From ce0329fd9c10b2d7d81267683579e8cfe45ccfd8 Mon Sep 17 00:00:00 2001 From: Ronie Salgado Date: Tue, 10 Jan 2017 15:29:45 -0300 Subject: [PATCH] Adding the generated Lowcode sources. --- nsspursrc/vm/cogit.h | 2 +- nsspursrc/vm/cogitARMv5.c | 4796 +- nsspursrc/vm/cogitIA32.c | 2350 +- nsspursrc/vm/cogitMIPSEL.c | 1272 +- nsspursrc/vm/cogmethod.h | 2 +- nsspursrc/vm/cointerp.c | 13227 ++- nsspursrc/vm/cointerp.h | 11 +- nsspursrc/vm/gcc3x-cointerp.c | 13227 ++- nsspursrc/vm/interp.h | 4 +- nsspursrc/vm/nssendcache.h | 2 +- nsspursrc/vm/vmCallback.h | 2 +- nsspurstacksrc/vm/gcc3x-interp.c | 13152 ++- nsspurstacksrc/vm/interp.c | 13152 ++- nsspurstacksrc/vm/interp.h | 2 +- nsspurstacksrc/vm/vmCallback.h | 2 +- platforms/unix/vm/sqConfig.h | 2 +- specs/lowcode.xml | 2 +- spurlowcodesrc/examplePlugins.ext | 2 + spurlowcodesrc/examplePlugins.int | 2 + spurlowcodesrc/vm/cogit.c | 20 + spurlowcodesrc/vm/cogit.h | 163 + spurlowcodesrc/vm/cogitARMv5.c | 43929 ++++++++ spurlowcodesrc/vm/cogitIA32.c | 41105 +++++++ spurlowcodesrc/vm/cogitMIPSEL.c | 40291 +++++++ spurlowcodesrc/vm/cogmethod.h | 36 + spurlowcodesrc/vm/cointerp.c | 97499 ++++++++++++++++ spurlowcodesrc/vm/cointerp.h | 411 + spurlowcodesrc/vm/exampleSqNamedPrims.h | 12 + spurlowcodesrc/vm/gcc3x-cointerp.c | 97508 +++++++++++++++++ spurlowcodesrc/vm/interp.h | 46 + spurlowcodesrc/vm/vmCallback.h | 31 + spurlowcodestacksrc/examplePlugins.ext | 2 + spurlowcodestacksrc/examplePlugins.int | 2 + spurlowcodestacksrc/vm/exampleSqNamedPrims.h | 12 + spurlowcodestacksrc/vm/gcc3x-interp.c | 83136 ++++++++++++++ spurlowcodestacksrc/vm/interp.c | 83127 ++++++++++++++ spurlowcodestacksrc/vm/interp.h | 40 + spurlowcodestacksrc/vm/vmCallback.h | 31 + spursrc/vm/cogit.h | 2 +- spursrc/vm/cogitARMv5.c | 4501 +- spursrc/vm/cogitIA32.c | 1870 +- spursrc/vm/cogitMIPSEL.c | 1113 +- spursrc/vm/cogmethod.h | 2 +- spursrc/vm/cointerp.c | 12138 +- spursrc/vm/cointerp.h | 11 +- spursrc/vm/gcc3x-cointerp.c | 12138 +- spursrc/vm/interp.h | 4 +- spursrc/vm/vmCallback.h | 2 +- 48 files changed, 531032 insertions(+), 49361 deletions(-) create mode 100644 spurlowcodesrc/examplePlugins.ext create mode 100644 spurlowcodesrc/examplePlugins.int create mode 100644 spurlowcodesrc/vm/cogit.c create mode 100644 spurlowcodesrc/vm/cogit.h create mode 100644 spurlowcodesrc/vm/cogitARMv5.c create mode 100644 spurlowcodesrc/vm/cogitIA32.c create mode 100644 spurlowcodesrc/vm/cogitMIPSEL.c create mode 100644 spurlowcodesrc/vm/cogmethod.h create mode 100644 spurlowcodesrc/vm/cointerp.c create mode 100644 spurlowcodesrc/vm/cointerp.h create mode 100644 spurlowcodesrc/vm/exampleSqNamedPrims.h create mode 100644 spurlowcodesrc/vm/gcc3x-cointerp.c create mode 100644 spurlowcodesrc/vm/interp.h create mode 100644 spurlowcodesrc/vm/vmCallback.h create mode 100644 spurlowcodestacksrc/examplePlugins.ext create mode 100644 spurlowcodestacksrc/examplePlugins.int create mode 100644 spurlowcodestacksrc/vm/exampleSqNamedPrims.h create mode 100644 spurlowcodestacksrc/vm/gcc3x-interp.c create mode 100644 spurlowcodestacksrc/vm/interp.c create mode 100644 spurlowcodestacksrc/vm/interp.h create mode 100644 spurlowcodestacksrc/vm/vmCallback.h diff --git a/nsspursrc/vm/cogit.h b/nsspursrc/vm/cogit.h index c10a3fd037..6631d9938c 100644 --- a/nsspursrc/vm/cogit.h +++ b/nsspursrc/vm/cogit.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ diff --git a/nsspursrc/vm/cogitARMv5.c b/nsspursrc/vm/cogitARMv5.c index ff739883ff..841d7fc8f6 100644 --- a/nsspursrc/vm/cogitARMv5.c +++ b/nsspursrc/vm/cogitARMv5.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -253,7 +253,7 @@ char *__cogitBuildInfo = __buildInfo; #define NumSendTrampolines 4 #define NumSpecialSelectors 32 #define NumStoreTrampolines 5 -#define NumTrampolines 79 +#define NumTrampolines (IMMUTABILITY ? 80 : 75) #define OrCqR 108 #define OrCwR 116 #define OrOpcode 12 @@ -356,8 +356,8 @@ typedef struct { typedef struct _BytecodeDescriptor { sqInt (*generator )(void); - sqInt (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); - sqInt (*needsFrameFunction )(sqInt); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); signed char stackDelta; unsigned char opcode; unsigned char numBytes; @@ -727,7 +727,7 @@ static AbstractInstruction * NoDbgRegParms gMoveCwR(sqInt wordConstant, sqInt re static AbstractInstruction * NoDbgRegParms gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg); static AbstractInstruction * NoDbgRegParms gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg); static AbstractInstruction * NoDbgRegParms gMoveRR(sqInt reg1, sqInt reg2); -static usqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); +static sqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); static sqInt NoDbgRegParms mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg); static sqInt NoDbgRegParms mapObjectReferencesInClosedPIC(CogMethod *cPIC); static void mapObjectReferencesInGeneratedRuntime(void); @@ -847,7 +847,7 @@ static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop); static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg); static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg); static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)); -static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison); +static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison); static sqInt NoDbgRegParms genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg); static sqInt NoDbgRegParms genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg); static sqInt genPrimitiveAdd(void); @@ -884,7 +884,7 @@ 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 genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*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); @@ -1027,7 +1027,6 @@ static sqInt NoDbgRegParms dumpLiterals(sqInt generateBranchAround); static sqInt endSizeOffset(void); static sqInt NoDbgRegParms literalInstructionInRange(AbstractInstruction *litInst); static AbstractInstruction * NoDbgRegParms locateLiteral(sqInt aLiteral); -static sqInt NoDbgRegParms mustDumpLiterals(sqInt currentOpcodeIndex); static sqInt resetForBlockCompile(void); static sqInt saveForBlockCompile(void); static sqInt compileBlockDispatch(void); @@ -1929,6 +1928,7 @@ static sqInt needsFrame; static sqInt nextLiteralIndex; static AbstractInstruction * noCheckEntry; static sqInt numAbstractOpcodes; +static sqInt numExtB; static sqInt numIRCs; static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; static sqInt opcodeIndex; @@ -3014,6 +3014,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord11; sqInt aWord110; sqInt aWord111; + sqInt aWord1110; + sqInt aWord1111; + sqInt aWord1112; + sqInt aWord1113; sqInt aWord112; sqInt aWord113; sqInt aWord114; @@ -3025,6 +3029,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord12; sqInt aWord120; sqInt aWord121; + sqInt aWord1210; + sqInt aWord1211; sqInt aWord122; sqInt aWord123; sqInt aWord124; @@ -3039,8 +3045,6 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord132; sqInt aWord133; sqInt aWord134; - sqInt aWord135; - sqInt aWord136; sqInt aWord14; sqInt aWord15; sqInt aWord16; @@ -3052,6 +3056,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord21; sqInt aWord210; sqInt aWord211; + sqInt aWord2110; + sqInt aWord2111; sqInt aWord212; sqInt aWord213; sqInt aWord214; @@ -3062,6 +3068,12 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord219; sqInt aWord22; sqInt aWord220; + sqInt aWord221; + sqInt aWord222; + sqInt aWord223; + sqInt aWord224; + sqInt aWord225; + sqInt aWord226; sqInt aWord23; sqInt aWord24; sqInt aWord25; @@ -3075,6 +3087,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord310; sqInt aWord311; sqInt aWord312; + sqInt aWord313; + sqInt aWord314; + sqInt aWord315; + sqInt aWord316; sqInt aWord32; sqInt aWord33; sqInt aWord34; @@ -3086,6 +3102,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt aWord4; sqInt aWord40; sqInt aWord41; + sqInt aWord410; + sqInt aWord411; sqInt aWord42; sqInt aWord43; sqInt aWord44; @@ -3115,26 +3133,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) 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 aWord81; - sqInt aWord82; - sqInt aWord83; - sqInt aWord84; - sqInt aWord85; - sqInt aWord86; sqInt aWord9; usqIntptr_t base; usqIntptr_t base1; @@ -3143,10 +3143,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t baseReg; usqIntptr_t baseReg1; usqIntptr_t baseReg2; - sqInt constant; + usqIntptr_t constant; usqIntptr_t constant1; usqIntptr_t constant10; - usqIntptr_t constant11; + sqInt constant11; usqIntptr_t constant12; usqIntptr_t constant13; usqIntptr_t constant14; @@ -3186,21 +3186,21 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t dstReg1; sqInt flagsOrOpcode; sqInt flagsOrOpcode1; + sqInt flagsOrOpcode11; + sqInt flagsOrOpcode12; sqInt flagsOrOpcode2; sqInt flagsOrOpcode3; sqInt flagsOrOpcode4; sqInt flagsOrOpcode5; - sqInt flagsOrOpcode6; - sqInt flagsOrOpcode7; usqIntptr_t fpReg; sqInt hb; sqInt hb1; + sqInt hb11; + sqInt hb12; sqInt hb2; sqInt hb3; sqInt hb4; sqInt hb5; - sqInt hb6; - sqInt hb7; sqInt i; sqInt i1; sqInt i10; @@ -3251,23 +3251,23 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqInt instrOffset14; usqInt instrOffset15; usqInt instrOffset16; - usqInt instrOffset17; - usqInt instrOffset18; - usqInt instrOffset19; + sqInt instrOffset17; + sqInt instrOffset18; + sqInt instrOffset19; usqInt instrOffset2; usqInt instrOffset20; usqInt instrOffset21; usqInt instrOffset22; - usqInt instrOffset23; - usqInt instrOffset24; + sqInt instrOffset23; + sqInt instrOffset24; usqInt instrOffset25; - sqInt instrOffset26; - sqInt instrOffset27; - sqInt instrOffset28; + usqInt instrOffset26; + usqInt instrOffset27; + usqInt instrOffset28; usqInt instrOffset29; usqInt instrOffset3; - sqInt instrOffset4; - sqInt instrOffset5; + usqInt instrOffset4; + usqInt instrOffset5; usqInt instrOffset6; usqInt instrOffset7; usqInt instrOffset8; @@ -3330,8 +3330,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) AbstractInstruction *jumpTarget9; sqInt negate; sqInt negate1; - sqInt offset; - sqInt offset1; + sqIntptr_t offset; + sqIntptr_t offset1; sqInt offset10; sqInt offset11; sqInt offset12; @@ -3342,7 +3342,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt offset17; sqInt offset18; sqInt offset19; - usqIntptr_t offset2; + sqInt offset2; sqInt offset20; sqInt offset21; sqInt offset22; @@ -3350,7 +3350,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt offset24; sqInt offset25; sqInt offset26; - sqInt offset27; + usqIntptr_t offset27; sqInt offset28; sqInt offset29; sqInt offset3; @@ -3360,8 +3360,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt offset33; sqInt offset4; sqInt offset5; - sqIntptr_t offset6; - sqIntptr_t offset7; + sqInt offset6; + sqInt offset7; sqInt offset8; sqInt offset9; sqInt p; @@ -3369,6 +3369,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t rd1; usqIntptr_t rd10; usqIntptr_t rd11; + usqIntptr_t rd110; + usqIntptr_t rd111; usqIntptr_t rd12; usqIntptr_t rd13; usqIntptr_t rd14; @@ -3381,8 +3383,6 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t rd20; usqIntptr_t rd21; usqIntptr_t rd22; - usqIntptr_t rd23; - usqIntptr_t rd24; usqIntptr_t rd3; usqIntptr_t rd4; usqIntptr_t rd5; @@ -3413,6 +3413,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t rn1; usqIntptr_t rn10; usqIntptr_t rn11; + usqIntptr_t rn110; + usqIntptr_t rn111; usqIntptr_t rn12; usqIntptr_t rn13; usqIntptr_t rn14; @@ -3427,8 +3429,6 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t rn22; usqIntptr_t rn23; usqIntptr_t rn24; - usqIntptr_t rn25; - usqIntptr_t rn26; usqIntptr_t rn3; usqIntptr_t rn4; usqIntptr_t rn5; @@ -3474,32 +3474,32 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t srcReg7; usqIntptr_t srcReg8; usqIntptr_t srcReg9; - sqInt u; - sqInt u1; + int u; + int u1; sqInt u2; - int u3; - int u4; + sqInt u3; + sqInt u4; sqInt u5; sqInt u6; sqInt u7; sqIntptr_t val; sqIntptr_t val1; - usqIntptr_t val2; - sqIntptr_t val3; + sqIntptr_t val11; + sqIntptr_t val12; + sqIntptr_t val2; + usqIntptr_t val3; sqIntptr_t val4; sqIntptr_t val5; - sqIntptr_t val6; - sqIntptr_t val7; sqInt value; - unsigned int value1; + sqInt value1; unsigned int value2; - sqInt value3; + unsigned int value3; unsigned int value4; unsigned int value5; unsigned int value6; sqInt word; - usqIntptr_t word1; - sqInt word2; + sqInt word1; + usqIntptr_t word2; usqIntptr_t word3; if (!(((self_in_dispatchConcretize->conditionOrNil)) == null)) { @@ -3547,109 +3547,73 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) assert(((((self_in_dispatchConcretize->operands))[0]) % 4) == 0); /* normal pc offset */ - offset = (((int) (((self_in_dispatchConcretize->operands))[0]))) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset)); + offset2 = (((int) (((self_in_dispatchConcretize->operands))[0]))) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset2)); /* begin machineCodeAt:put: */ - aWord = bl(self_in_dispatchConcretize, offset); + aWord = bl(self_in_dispatchConcretize, offset2); ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case CallFull: /* begin concretizeCallFull */ - jumpTarget123 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); - if ((addressIsInInstructions(jumpTarget123)) - || (jumpTarget123 == (methodLabel()))) { - jumpTarget123 = ((AbstractInstruction *) ((jumpTarget123->address))); + jumpTarget1 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); } - assert(jumpTarget123 != 0); - jumpTarget33 = jumpTarget123; + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord63 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord1 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord63; - instrOffset6 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1; + instrOffset = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[instrOffset6 / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((1 & 1)) << 5)))) | ConcreteIPReg)); - assert(instrOffset6 == (literalLoadInstructionBytes(self_in_dispatchConcretize))); - (self_in_dispatchConcretize->machineCodeSize) = instrOffset6 + 4; + ((self_in_dispatchConcretize->machineCode))[instrOffset / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((1 & 1)) << 5)))) | ConcreteIPReg)); + assert(instrOffset == (literalLoadInstructionBytes(self_in_dispatchConcretize))); + (self_in_dispatchConcretize->machineCodeSize) = instrOffset + 4; return; case JumpR: /* begin concretizeJumpR */ /* bx reg */ - reg2 = ((self_in_dispatchConcretize->operands))[0]; - aWord39 = (((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | reg2); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord39; + reg = ((self_in_dispatchConcretize->operands))[0]; + aWord2 = (((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | reg); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord2; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case JumpFull: /* begin concretizeJumpFull */ - jumpTarget124 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); - if ((addressIsInInstructions(jumpTarget124)) - || (jumpTarget124 == (methodLabel()))) { - jumpTarget124 = ((AbstractInstruction *) ((jumpTarget124->address))); + jumpTarget11 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + if ((addressIsInInstructions(jumpTarget11)) + || (jumpTarget11 == (methodLabel()))) { + jumpTarget11 = ((AbstractInstruction *) ((jumpTarget11->address))); } - assert(jumpTarget124 != 0); - jumpTarget34 = jumpTarget124; + assert(jumpTarget11 != 0); + jumpTarget2 = jumpTarget11; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord64 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord3 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord64; - instrOffset7 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord3; + instrOffset1 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[instrOffset7 / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | ConcreteIPReg)); - (self_in_dispatchConcretize->machineCodeSize) = instrOffset7 + 4; + ((self_in_dispatchConcretize->machineCode))[instrOffset1 / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | ConcreteIPReg)); + (self_in_dispatchConcretize->machineCodeSize) = instrOffset1 + 4; return; case JumpLong: case Jump: - /* begin concretizeConditionalJump: */ - jumpTarget1 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); - assertSaneJumpTarget(jumpTarget1); - if ((addressIsInInstructions(jumpTarget1)) - || (jumpTarget1 == (methodLabel()))) { - jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); - } - assert(jumpTarget1 != 0); - jumpTarget = jumpTarget1; - offset8 = (((int) jumpTarget)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset8)); - /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(AL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset8) >> 2) & 0xFFFFFF))); - (self_in_dispatchConcretize->machineCodeSize) = 4; - return; - - case JumpLongZero: - case JumpZero: - /* begin concretizeConditionalJump: */ - jumpTarget11 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); - assertSaneJumpTarget(jumpTarget11); - if ((addressIsInInstructions(jumpTarget11)) - || (jumpTarget11 == (methodLabel()))) { - jumpTarget11 = ((AbstractInstruction *) ((jumpTarget11->address))); - } - assert(jumpTarget11 != 0); - jumpTarget2 = jumpTarget11; - offset9 = (((int) jumpTarget2)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset9)); - /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset9) >> 2) & 0xFFFFFF))); - (self_in_dispatchConcretize->machineCodeSize) = 4; - return; - - case JumpLongNonZero: - case JumpNonZero: /* begin concretizeConditionalJump: */ jumpTarget12 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget12); @@ -3659,14 +3623,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget12 != 0); jumpTarget3 = jumpTarget12; - offset10 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset10)); + offset3 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset3)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset10) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(AL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset3) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpNegative: + case JumpLongZero: + case JumpZero: /* begin concretizeConditionalJump: */ jumpTarget13 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget13); @@ -3676,14 +3641,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget13 != 0); jumpTarget4 = jumpTarget13; - offset11 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset11)); + offset4 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset4)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(MI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset11) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset4) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpNonNegative: + case JumpLongNonZero: + case JumpNonZero: /* begin concretizeConditionalJump: */ jumpTarget14 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget14); @@ -3693,14 +3659,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget14 != 0); jumpTarget5 = jumpTarget14; - offset12 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset12)); + offset5 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset5)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(PL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset12) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset5) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpOverflow: + case JumpNegative: /* begin concretizeConditionalJump: */ jumpTarget15 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget15); @@ -3710,14 +3676,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget15 != 0); jumpTarget6 = jumpTarget15; - offset13 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset13)); + offset6 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset6)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset13) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(MI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset6) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpNoOverflow: + case JumpNonNegative: /* begin concretizeConditionalJump: */ jumpTarget16 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget16); @@ -3727,15 +3693,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget16 != 0); jumpTarget7 = jumpTarget16; - offset14 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset14)); + offset7 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset7)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset14) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(PL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset7) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpCarry: - case JumpAboveOrEqual: + case JumpOverflow: /* begin concretizeConditionalJump: */ jumpTarget17 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget17); @@ -3745,15 +3710,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget17 != 0); jumpTarget8 = jumpTarget17; - offset15 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset15)); + offset8 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset8)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset15) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset8) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpNoCarry: - case JumpBelow: + case JumpNoOverflow: /* begin concretizeConditionalJump: */ jumpTarget18 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget18); @@ -3763,14 +3727,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget18 != 0); jumpTarget9 = jumpTarget18; - offset16 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset16)); + offset9 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset9)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset16) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset9) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpLess: + case JumpCarry: + case JumpAboveOrEqual: /* begin concretizeConditionalJump: */ jumpTarget19 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget19); @@ -3780,14 +3745,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget19 != 0); jumpTarget10 = jumpTarget19; - offset17 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset17)); + offset10 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset10)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset17) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset10) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpGreaterOrEqual: + case JumpNoCarry: + case JumpBelow: /* begin concretizeConditionalJump: */ jumpTarget110 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget110); @@ -3797,14 +3763,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget110 != 0); jumpTarget20 = jumpTarget110; - offset18 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset18)); + offset11 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset11)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset18) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset11) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpGreater: + case JumpLess: /* begin concretizeConditionalJump: */ jumpTarget111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget111); @@ -3814,14 +3780,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget111 != 0); jumpTarget21 = jumpTarget111; - offset19 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset19)); + offset12 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset12)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset19) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset12) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpLessOrEqual: + case JumpGreaterOrEqual: /* begin concretizeConditionalJump: */ jumpTarget112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget112); @@ -3831,14 +3797,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget112 != 0); jumpTarget22 = jumpTarget112; - offset20 = (((int) jumpTarget22)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset20)); + offset13 = (((int) jumpTarget22)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset13)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset20) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset13) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpAbove: + case JumpGreater: /* begin concretizeConditionalJump: */ jumpTarget113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget113); @@ -3848,14 +3814,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget113 != 0); jumpTarget23 = jumpTarget113; - offset21 = (((int) jumpTarget23)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset21)); + offset14 = (((int) jumpTarget23)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset14)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(HI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset21) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset14) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpBelowOrEqual: + case JumpLessOrEqual: /* begin concretizeConditionalJump: */ jumpTarget114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget114); @@ -3865,15 +3831,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget114 != 0); jumpTarget24 = jumpTarget114; - offset22 = (((int) jumpTarget24)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset22)); + offset15 = (((int) jumpTarget24)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset15)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset22) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset15) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpFPEqual: - /* begin concretizeFPConditionalJump: */ + case JumpAbove: + /* begin concretizeConditionalJump: */ jumpTarget115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget115); if ((addressIsInInstructions(jumpTarget115)) @@ -3882,17 +3848,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget115 != 0); jumpTarget25 = jumpTarget115; - offset23 = (((int) jumpTarget25)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset23)); - /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + offset16 = (((int) jumpTarget25)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset16)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset23) >> 2) & 0xFFFFFF))); - (self_in_dispatchConcretize->machineCodeSize) = 8; + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(HI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset16) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpFPNotEqual: - /* begin concretizeFPConditionalJump: */ + case JumpBelowOrEqual: + /* begin concretizeConditionalJump: */ jumpTarget116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget116); if ((addressIsInInstructions(jumpTarget116)) @@ -3901,16 +3865,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget116 != 0); jumpTarget26 = jumpTarget116; - offset24 = (((int) jumpTarget26)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset24)); - /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + offset17 = (((int) jumpTarget26)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset17)); /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset24) >> 2) & 0xFFFFFF))); - (self_in_dispatchConcretize->machineCodeSize) = 8; + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset17) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; return; - case JumpFPLess: + case JumpFPEqual: /* begin concretizeFPConditionalJump: */ jumpTarget117 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget117); @@ -3920,16 +3882,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget117 != 0); jumpTarget27 = jumpTarget117; - offset25 = (((int) jumpTarget27)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset25)); + offset18 = (((int) jumpTarget27)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset18)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset25) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset18) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; - case JumpFPGreaterOrEqual: + case JumpFPNotEqual: /* begin concretizeFPConditionalJump: */ jumpTarget118 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget118); @@ -3939,16 +3901,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget118 != 0); jumpTarget28 = jumpTarget118; - offset26 = (((int) jumpTarget28)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset26)); + offset19 = (((int) jumpTarget28)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset19)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset26) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset19) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; - case JumpFPGreater: + case JumpFPLess: /* begin concretizeFPConditionalJump: */ jumpTarget119 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget119); @@ -3958,16 +3920,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget119 != 0); jumpTarget29 = jumpTarget119; - offset27 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset27)); + offset20 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset20)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset27) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset20) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; - case JumpFPLessOrEqual: + case JumpFPGreaterOrEqual: /* begin concretizeFPConditionalJump: */ jumpTarget120 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget120); @@ -3977,16 +3939,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget120 != 0); jumpTarget30 = jumpTarget120; - offset28 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset28)); + offset21 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset21)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset28) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset21) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; - case JumpFPOrdered: + case JumpFPGreater: /* begin concretizeFPConditionalJump: */ jumpTarget121 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget121); @@ -3996,16 +3958,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget121 != 0); jumpTarget31 = jumpTarget121; - offset29 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset29)); + offset22 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset22)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset29) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset22) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; - case JumpFPUnordered: + case JumpFPLessOrEqual: /* begin concretizeFPConditionalJump: */ jumpTarget122 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); assertSaneJumpTarget(jumpTarget122); @@ -4015,34 +3977,72 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget122 != 0); jumpTarget32 = jumpTarget122; - offset30 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); - assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset30)); + offset23 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset23)); /* begin machineCodeAt:put: */ ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; /* begin machineCodeAt:put: */ - ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset30) >> 2) & 0xFFFFFF))); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset23) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPOrdered: + /* begin concretizeFPConditionalJump: */ + jumpTarget123 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget123); + if ((addressIsInInstructions(jumpTarget123)) + || (jumpTarget123 == (methodLabel()))) { + jumpTarget123 = ((AbstractInstruction *) ((jumpTarget123->address))); + } + assert(jumpTarget123 != 0); + jumpTarget33 = jumpTarget123; + offset24 = (((int) jumpTarget33)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset24)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset24) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPUnordered: + /* begin concretizeFPConditionalJump: */ + jumpTarget124 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget124); + if ((addressIsInInstructions(jumpTarget124)) + || (jumpTarget124 == (methodLabel()))) { + jumpTarget124 = ((AbstractInstruction *) ((jumpTarget124->address))); + } + assert(jumpTarget124 != 0); + jumpTarget34 = jumpTarget124; + offset25 = (((int) jumpTarget34)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset25)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset25) >> 2) & 0xFFFFFF))); (self_in_dispatchConcretize->machineCodeSize) = 8; return; case RetN: /* begin concretizeRetN */ - offset1 = ((self_in_dispatchConcretize->operands))[0]; - if (offset1 == 0) { + offset26 = ((self_in_dispatchConcretize->operands))[0]; + if (offset26 == 0) { /* begin machineCodeAt:put: */ - aWord1 = movrn(self_in_dispatchConcretize, PC, LR); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1; + aWord4 = movrn(self_in_dispatchConcretize, PC, LR); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord4; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l5; + goto l132; } - assert(offset1 < 0xFF); + assert(offset26 < 0xFF); /* begin machineCodeAt:put: */ - aWord2 = addrnimmror(self_in_dispatchConcretize, SP, SP, offset1, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord2; + aWord11 = addrnimmror(self_in_dispatchConcretize, SP, SP, offset26, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord11; /* begin machineCodeAt:put: */ - aWord3 = movrn(self_in_dispatchConcretize, PC, LR); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord3; + aWord21 = movrn(self_in_dispatchConcretize, PC, LR); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord21; (self_in_dispatchConcretize->machineCodeSize) = 8; - l5: /* end concretizeRetN */; + l132: /* end concretizeRetN */; return; case Stop: @@ -4070,12 +4070,12 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) flagsOrOpcode = (negate ? inverseOpcodeFor(self_in_dispatchConcretize, AddOpcode) : AddOpcode); - aWord4 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord4; + aWord5 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord5; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l6; + goto l142; - goto l36; + goto l135; } for (i = 2; i <= 30; i += 2) { if ((value & (((0xFFU << i) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i)))) == value) { @@ -4086,12 +4086,12 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) flagsOrOpcode1 = (negate ? inverseOpcodeFor(self_in_dispatchConcretize, AddOpcode) : AddOpcode); - aWord4 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode1) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord4; + aWord5 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode1) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord5; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l6; + goto l142; - goto l36; + goto l135; } } if (!((value == val) @@ -4106,411 +4106,410 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord5 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord5; + aWord12 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord12; /* begin machineCodeAt:put: */ - aWord6 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AddOpcode, rd, rn, ConcreteIPReg, 32 - hb); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord6; + aWord22 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AddOpcode, rd, rn, ConcreteIPReg, 32 - hb); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord22; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l6; + goto l142; } } /* begin concretizeDataOperationCwR: */ - constant1 = ((self_in_dispatchConcretize->operands))[0]; - rn13 = ((self_in_dispatchConcretize->operands))[1]; - rd11 = rn13; + constant = ((self_in_dispatchConcretize->operands))[0]; + rn1 = ((self_in_dispatchConcretize->operands))[1]; + rd1 = rn1; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord115 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord31 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord115; - instrOffset8 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord31; + instrOffset2 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord65 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn13 << 16) | (rd11 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset8 / 4] = aWord65; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset8 + 4; - goto l6; + aWord111 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn1 << 16) | (rd1 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset2 / 4] = aWord111; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset2 + 4))); + goto l142; - l36: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; - l6: /* end concretizeNegateableDataOperationCqR: */; + l135: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; + l142: /* end concretizeNegateableDataOperationCqR: */; return; case AndCqR: /* begin concretizeInvertibleDataOperationCqR: */ - val1 = ((self_in_dispatchConcretize->operands))[0]; - rn1 = ((self_in_dispatchConcretize->operands))[1]; + val2 = ((self_in_dispatchConcretize->operands))[0]; + rn18 = ((self_in_dispatchConcretize->operands))[1]; assert(!((((self_in_dispatchConcretize->opcode)) == CmpOpcode))); /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ - value1 = val1; + value4 = val2; while (1) { - if ((value1 & 0xFF) == value1) { - invert = val1 != value1; + if ((value4 & 0xFF) == value4) { + invert2 = val2 != value4; /* begin machineCodeAt:put: */ - flagsOrOpcode2 = (invert + flagsOrOpcode2 = (invert2 ? inverseOpcodeFor(self_in_dispatchConcretize, AndOpcode) : AndOpcode); - aWord7 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode2) << 21))) | (1U << 20)))) | ((rn1 << 16) | (rn1 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value1) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; + aWord65 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode2) << 21))) | (1U << 20)))) | ((rn18 << 16) | (rn18 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value4) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord65; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l7; + goto l330; - goto l40; + goto l318; } - for (i1 = 2; i1 <= 30; i1 += 2) { - if ((value1 & (((0xFFU << i1) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i1)))) == value1) { - rot1 = 32 - i1; - immediate1 = (((usqInt) value1) >> i1) | ((value1 << (32 - i1)) & 0xFFFFFFFFU); - invert = val1 != value1; + for (i8 = 2; i8 <= 30; i8 += 2) { + if ((value4 & (((0xFFU << i8) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i8)))) == value4) { + rot8 = 32 - i8; + immediate15 = (((usqInt) value4) >> i8) | ((value4 << (32 - i8)) & 0xFFFFFFFFU); + invert2 = val2 != value4; /* begin machineCodeAt:put: */ - flagsOrOpcode3 = (invert + flagsOrOpcode11 = (invert2 ? inverseOpcodeFor(self_in_dispatchConcretize, AndOpcode) : AndOpcode); - aWord7 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode3) << 21))) | (1U << 20)))) | ((rn1 << 16) | (rn1 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot1) >> 1)) << 8))) | immediate1) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; + aWord65 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode11) << 21))) | (1U << 20)))) | ((rn18 << 16) | (rn18 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot8) >> 1)) << 8))) | immediate15) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord65; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l7; + goto l330; - goto l40; + goto l318; } } - if (!(value1 == val1)) break; - value1 = (val1 < 0 - ? -1 - val1 - : (unsigned int)~val1); + if (!(value4 == val2)) break; + value4 = (val2 < 0 + ? -1 - val2 + : (unsigned int)~val2); } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val1 > 0) { - hb1 = highBit(val1); - if ((1U << hb1) == (val1 + 1)) { + if (val2 > 0) { + hb2 = highBit(val2); + if ((1U << hb2) == (val2 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord8 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord8; + aWord131 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord131; /* begin machineCodeAt:put: */ - aWord9 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rn1, rn1, ConcreteIPReg, 32 - hb1); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord9; + aWord223 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rn18, rn18, ConcreteIPReg, 32 - hb2); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord223; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l7; + goto l330; } } /* begin concretizeDataOperationCqR: */ - val5 = ((self_in_dispatchConcretize->operands))[0]; - rn4 = ((self_in_dispatchConcretize->operands))[1]; + val11 = ((self_in_dispatchConcretize->operands))[0]; + rn21 = ((self_in_dispatchConcretize->operands))[1]; /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ - rd2 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + rd18 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode ? 0 - : rn4); + : rn21); /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ - if ((val5 & 0xFF) == val5) { + if ((val11 & 0xFF) == val11) { /* begin machineCodeAt:put: */ - aWord40 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn4 << 16) | (rd2 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val5) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord40; + aWord410 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn21 << 16) | (rd18 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val11) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord410; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l374; + goto l330; - goto l375; + goto l364; } - for (i10 = 2; i10 <= 30; i10 += 2) { - if ((val5 & (((0xFFU << i10) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i10)))) == val5) { - rot9 = 32 - i10; - immediate12 = (((usqInt) val5) >> i10) | ((((sqIntptr_t)((usqInt)(val5) << (32 - i10)))) & 0xFFFFFFFFU); + for (i13 = 2; i13 <= 30; i13 += 2) { + if ((val11 & (((0xFFU << i13) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i13)))) == val11) { + rot11 = 32 - i13; + immediate14 = (((usqInt) val11) >> i13) | ((((sqIntptr_t)((usqInt)(val11) << (32 - i13)))) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord40 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn4 << 16) | (rd2 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot9) >> 1)) << 8))) | immediate12) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord40; + aWord410 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn21 << 16) | (rd18 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot11) >> 1)) << 8))) | immediate14) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord410; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l374; + goto l330; - goto l375; + goto l364; } } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val5 > 0) { - hb5 = highBit(val5); - if ((1U << hb5) == (val5 + 1)) { + if (val11 > 0) { + hb11 = highBit(val11); + if ((1U << hb11) == (val11 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord110 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord110; + aWord1210 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1210; /* begin machineCodeAt:put: */ - aWord210 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rd2, rn4, ConcreteIPReg, 32 - hb5); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord210; + aWord2110 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rd18, rn21, ConcreteIPReg, 32 - hb11); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord2110; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l374; + goto l330; } } /* begin concretizeDataOperationCwR: */ - constant2 = ((self_in_dispatchConcretize->operands))[0]; - rn14 = ((self_in_dispatchConcretize->operands))[1]; - rd12 = rn14; + constant10 = ((self_in_dispatchConcretize->operands))[0]; + rn19 = ((self_in_dispatchConcretize->operands))[1]; + rd19 = rn19; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord116 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord313 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord116; - instrOffset9 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord313; + instrOffset26 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord66 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn14 << 16) | (rd12 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset9 / 4] = aWord66; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset9 + 4; - goto l374; + aWord1110 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn19 << 16) | (rd19 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset26 / 4] = aWord1110; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset26 + 4))); + goto l330; - l375: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l374: /* end concretizeDataOperationCqR: */; - goto l7; + l364: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + goto l330; - l40: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; - l7: /* end concretizeInvertibleDataOperationCqR: */; + l318: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l330: /* end concretizeInvertibleDataOperationCqR: */; return; case AndCqRR: /* begin concretizeAndCqRR */ - val2 = ((self_in_dispatchConcretize->operands))[0]; - srcReg = ((self_in_dispatchConcretize->operands))[1]; - dstReg = ((self_in_dispatchConcretize->operands))[2]; + val3 = ((self_in_dispatchConcretize->operands))[0]; + srcReg19 = ((self_in_dispatchConcretize->operands))[1]; + dstReg1 = ((self_in_dispatchConcretize->operands))[2]; /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ - value2 = val2; + value5 = val3; while (1) { - if ((value2 & 0xFF) == value2) { - invert1 = val2 != value2; + if ((value5 & 0xFF) == value5) { + invert3 = val3 != value5; /* begin machineCodeAt:put: */ - aWord10 = (invert1 - ? bicsrnimmror(self_in_dispatchConcretize, dstReg, srcReg, value2, 0) - : andsrnimmror(self_in_dispatchConcretize, dstReg, srcReg, value2, 0)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord10; + aWord66 = (invert3 + ? bicsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, value5, 0) + : andsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, value5, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord66; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l8; + goto l338; - goto l44; + goto l336; } - for (i2 = 2; i2 <= 30; i2 += 2) { - if ((value2 & (((0xFFU << i2) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i2)))) == value2) { - rot2 = 32 - i2; - immediate2 = (((usqInt) value2) >> i2) | ((value2 << (32 - i2)) & 0xFFFFFFFFU); - invert1 = val2 != value2; + for (i9 = 2; i9 <= 30; i9 += 2) { + if ((value5 & (((0xFFU << i9) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i9)))) == value5) { + rot9 = 32 - i9; + immediate16 = (((usqInt) value5) >> i9) | ((value5 << (32 - i9)) & 0xFFFFFFFFU); + invert3 = val3 != value5; /* begin machineCodeAt:put: */ - aWord10 = (invert1 - ? bicsrnimmror(self_in_dispatchConcretize, dstReg, srcReg, immediate2, rot2) - : andsrnimmror(self_in_dispatchConcretize, dstReg, srcReg, immediate2, rot2)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord10; + aWord66 = (invert3 + ? bicsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, immediate16, rot9) + : andsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, immediate16, rot9)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord66; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l8; + goto l338; - goto l44; + goto l336; } } - if (!(value2 == val2)) break; - value2 = (val2 < 0 - ? -1 - val2 - : (unsigned int)~val2); + if (!(value5 == val3)) break; + value5 = (val3 < 0 + ? -1 - val3 + : (unsigned int)~val3); } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - hb2 = highBit(((self_in_dispatchConcretize->operands))[0]); - if ((1U << hb2) == (val2 + 1)) { + hb3 = highBit(((self_in_dispatchConcretize->operands))[0]); + if ((1U << hb3) == (val3 + 1)) { /* MVN temp reg, 0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord11 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord11; + aWord132 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord132; /* begin machineCodeAt:put: */ - aWord12 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, dstReg, srcReg, ConcreteIPReg, 32 - hb2); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord12; + aWord224 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, dstReg1, srcReg19, ConcreteIPReg, 32 - hb3); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord224; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l8; + goto l338; } else { /* begin concretizeDataOperationCwR: */ - constant3 = ((self_in_dispatchConcretize->operands))[0]; - rn15 = ((self_in_dispatchConcretize->operands))[1]; - rd13 = rn15; + constant12 = ((self_in_dispatchConcretize->operands))[0]; + rn20 = ((self_in_dispatchConcretize->operands))[1]; + rd20 = rn20; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord117 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord314 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord117; - instrOffset10 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord314; + instrOffset27 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord67 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn15 << 16) | (rd13 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset10 / 4] = aWord67; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset10 + 4; - goto l8; + aWord1111 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn20 << 16) | (rd20 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset27 / 4] = aWord1111; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset27 + 4))); + goto l338; } - l44: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; - l8: /* end concretizeAndCqRR */; + l336: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l338: /* end concretizeAndCqRR */; return; case CmpCqR: /* begin concretizeNegateableDataOperationCqR: */ - val3 = ((self_in_dispatchConcretize->operands))[0]; + val1 = ((self_in_dispatchConcretize->operands))[0]; /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen. */ rn2 = ((self_in_dispatchConcretize->operands))[1]; - rd1 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + rd2 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode ? 0 : rn2); /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ - value3 = val3; + value1 = val1; while (1) { - if ((value3 & 0xFF) == value3) { - negate1 = val3 != value3; + if ((value1 & 0xFF) == value1) { + negate1 = val1 != value1; /* begin machineCodeAt:put: */ - flagsOrOpcode4 = (negate1 + flagsOrOpcode3 = (negate1 ? inverseOpcodeFor(self_in_dispatchConcretize, CmpOpcode) : CmpOpcode); - aWord13 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode4) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd1 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value3) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord13; + aWord6 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode3) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd2 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value1) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord6; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l9; + goto l150; - goto l48; + goto l143; } - for (i3 = 2; i3 <= 30; i3 += 2) { - if ((value3 & (((0xFFU << i3) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i3)))) == value3) { - rot3 = 32 - i3; - immediate3 = (((usqInt) value3) >> i3) | ((((sqInt)((usqInt)(value3) << (32 - i3)))) & 0xFFFFFFFFU); - negate1 = val3 != value3; + for (i1 = 2; i1 <= 30; i1 += 2) { + if ((value1 & (((0xFFU << i1) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i1)))) == value1) { + rot1 = 32 - i1; + immediate1 = (((usqInt) value1) >> i1) | ((((sqInt)((usqInt)(value1) << (32 - i1)))) & 0xFFFFFFFFU); + negate1 = val1 != value1; /* begin machineCodeAt:put: */ - flagsOrOpcode5 = (negate1 + flagsOrOpcode4 = (negate1 ? inverseOpcodeFor(self_in_dispatchConcretize, CmpOpcode) : CmpOpcode); - aWord13 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode5) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd1 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot3) >> 1)) << 8))) | immediate3) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord13; + aWord6 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode4) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd2 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot1) >> 1)) << 8))) | immediate1) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord6; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l9; + goto l150; - goto l48; + goto l143; } } - if (!((value3 == val3) - && (val3 != 0))) break; - value3 = -val3; + if (!((value1 == val1) + && (val1 != 0))) break; + value1 = -val1; } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val3 > 0) { - hb3 = highBit(val3); - if ((1U << hb3) == (val3 + 1)) { + if (val1 > 0) { + hb1 = highBit(val1); + if ((1U << hb1) == (val1 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord14 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord14; + aWord13 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord13; /* begin machineCodeAt:put: */ - aWord15 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, CmpOpcode, rd1, rn2, ConcreteIPReg, 32 - hb3); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord15; + aWord23 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, CmpOpcode, rd2, rn2, ConcreteIPReg, 32 - hb1); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord23; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l9; + goto l150; } } /* begin concretizeDataOperationCwR: */ - constant4 = ((self_in_dispatchConcretize->operands))[0]; - rn16 = ((self_in_dispatchConcretize->operands))[1]; - rd14 = 0; + constant1 = ((self_in_dispatchConcretize->operands))[0]; + rn11 = ((self_in_dispatchConcretize->operands))[1]; + rd11 = 0; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord118 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord32 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord118; - instrOffset11 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord32; + instrOffset3 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord68 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn16 << 16) | (rd14 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset11 / 4] = aWord68; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset11 + 4; - goto l9; + aWord112 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn11 << 16) | (rd11 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset3 / 4] = aWord112; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset3 + 4))); + goto l150; - l48: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; - l9: /* end concretizeNegateableDataOperationCqR: */; + l143: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; + l150: /* end concretizeNegateableDataOperationCqR: */; return; case OrCqR: /* begin concretizeDataOperationCqR: */ - val6 = ((self_in_dispatchConcretize->operands))[0]; - rn5 = ((self_in_dispatchConcretize->operands))[1]; + val4 = ((self_in_dispatchConcretize->operands))[0]; + rn22 = ((self_in_dispatchConcretize->operands))[1]; /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ - rd3 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + rd21 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode ? 0 - : rn5); + : rn22); /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ - if ((val6 & 0xFF) == val6) { + if ((val4 & 0xFF) == val4) { /* begin machineCodeAt:put: */ - aWord41 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn5 << 16) | (rd3 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val6) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord41; + aWord67 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn22 << 16) | (rd21 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val4) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord67; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l208; + goto l348; - goto l206; + goto l346; } - for (i11 = 2; i11 <= 30; i11 += 2) { - if ((val6 & (((0xFFU << i11) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i11)))) == val6) { - rot10 = 32 - i11; - immediate13 = (((usqInt) val6) >> i11) | ((((sqIntptr_t)((usqInt)(val6) << (32 - i11)))) & 0xFFFFFFFFU); + for (i10 = 2; i10 <= 30; i10 += 2) { + if ((val4 & (((0xFFU << i10) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i10)))) == val4) { + rot10 = 32 - i10; + immediate17 = (((usqInt) val4) >> i10) | ((((sqIntptr_t)((usqInt)(val4) << (32 - i10)))) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord41 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn5 << 16) | (rd3 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot10) >> 1)) << 8))) | immediate13) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord41; + aWord67 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn22 << 16) | (rd21 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot10) >> 1)) << 8))) | immediate17) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord67; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l208; + goto l348; - goto l206; + goto l346; } } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val6 > 0) { - hb6 = highBit(val6); - if ((1U << hb6) == (val6 + 1)) { + if (val4 > 0) { + hb4 = highBit(val4); + if ((1U << hb4) == (val4 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord111 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord111; + aWord133 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord133; /* begin machineCodeAt:put: */ - aWord211 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, OrOpcode, rd3, rn5, ConcreteIPReg, 32 - hb6); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord211; + aWord225 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, OrOpcode, rd21, rn22, ConcreteIPReg, 32 - hb4); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord225; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l208; + goto l348; } } /* begin concretizeDataOperationCwR: */ - constant5 = ((self_in_dispatchConcretize->operands))[0]; - rn17 = ((self_in_dispatchConcretize->operands))[1]; - rd15 = rn17; + constant13 = ((self_in_dispatchConcretize->operands))[0]; + rn110 = ((self_in_dispatchConcretize->operands))[1]; + rd110 = rn110; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord119 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord315 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord119; - instrOffset12 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord315; + instrOffset28 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord69 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn17 << 16) | (rd15 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset12 / 4] = aWord69; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset12 + 4; - goto l208; + aWord1112 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn110 << 16) | (rd110 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset28 / 4] = aWord1112; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset28 + 4))); + goto l348; - l206: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l208: /* end concretizeDataOperationCqR: */; + l346: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l348: /* end concretizeDataOperationCqR: */; return; case SubCqR: @@ -4518,450 +4517,449 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) word = ((self_in_dispatchConcretize->operands))[0]; /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ if ((word & 0xFF) == word) { - reg = ((self_in_dispatchConcretize->operands))[1]; + reg1 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord16 = subsrnimmror(self_in_dispatchConcretize, reg, reg, word, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord16; + aWord7 = subsrnimmror(self_in_dispatchConcretize, reg1, reg1, word, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l10; + goto l158; - goto l52; + goto l151; } - for (i5 = 2; i5 <= 30; i5 += 2) { - if ((word & (((0xFFU << i5) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i5)))) == word) { - rot4 = 32 - i5; - immediate4 = (((usqInt) word) >> i5) | ((((sqInt)((usqInt)(word) << (32 - i5)))) & 0xFFFFFFFFU); - reg = ((self_in_dispatchConcretize->operands))[1]; + for (i11 = 2; i11 <= 30; i11 += 2) { + if ((word & (((0xFFU << i11) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i11)))) == word) { + rot2 = 32 - i11; + immediate2 = (((usqInt) word) >> i11) | ((((sqInt)((usqInt)(word) << (32 - i11)))) & 0xFFFFFFFFU); + reg1 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord16 = subsrnimmror(self_in_dispatchConcretize, reg, reg, immediate4, rot4); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord16; + aWord7 = subsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, rot2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l10; + goto l158; - goto l52; + goto l151; } } /* before building a full load of a big constant, see if we can do an add of the constant negated */ /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ if (((-word) & 0xFF) == (-word)) { - immediate4 = -word; - reg = ((self_in_dispatchConcretize->operands))[1]; + immediate2 = -word; + reg1 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord17 = addsrnimmror(self_in_dispatchConcretize, reg, reg, immediate4, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord17; + aWord14 = addsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord14; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l10; + goto l158; - goto l376; + goto l365; } - for (i4 = 2; i4 <= 30; i4 += 2) { - if (((-word) & (((0xFFU << i4) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i4)))) == (-word)) { - rot4 = 32 - i4; - immediate4 = (((usqInt) (-word)) >> i4) | ((((sqInt)((usqInt)((-word)) << (32 - i4)))) & 0xFFFFFFFFU); - reg = ((self_in_dispatchConcretize->operands))[1]; + for (i2 = 2; i2 <= 30; i2 += 2) { + if (((-word) & (((0xFFU << i2) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i2)))) == (-word)) { + rot2 = 32 - i2; + immediate2 = (((usqInt) (-word)) >> i2) | ((((sqInt)((usqInt)((-word)) << (32 - i2)))) & 0xFFFFFFFFU); + reg1 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord17 = addsrnimmror(self_in_dispatchConcretize, reg, reg, immediate4, rot4); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord17; + aWord14 = addsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, rot2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord14; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l10; + goto l158; - goto l376; + goto l365; } } /* begin concretizeDataOperationCwR: */ - constant6 = ((self_in_dispatchConcretize->operands))[0]; - rn18 = ((self_in_dispatchConcretize->operands))[1]; - rd16 = rn18; + constant2 = ((self_in_dispatchConcretize->operands))[0]; + rn3 = ((self_in_dispatchConcretize->operands))[1]; + rd3 = rn3; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord120 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord24 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord120; - instrOffset13 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord24; + instrOffset4 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord70 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn18 << 16) | (rd16 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset13 / 4] = aWord70; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset13 + 4; - goto l10; + aWord113 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn3 << 16) | (rd3 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset4 / 4] = aWord113; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset4 + 4))); + goto l158; - l376: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l365: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l52: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l10: /* end concretizeSubCqR */; + l151: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l158: /* end concretizeSubCqR */; return; case TstCqR: /* begin concretizeTstCqR */ - constant = ((self_in_dispatchConcretize->operands))[0]; - if ((constant & 0xFF) == constant) { - reg1 = ((self_in_dispatchConcretize->operands))[1]; + constant11 = ((self_in_dispatchConcretize->operands))[0]; + if ((constant11 & 0xFF) == constant11) { + reg2 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord18 = tstrnimmror(self_in_dispatchConcretize, reg1, reg1, constant, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord18; + aWord8 = tstrnimmror(self_in_dispatchConcretize, reg2, reg2, constant11, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord8; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l11; + goto l164; - goto l54; + goto l159; } - for (i6 = 2; i6 <= 30; i6 += 2) { - if ((constant & (((0xFFU << i6) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i6)))) == constant) { - rot5 = 32 - i6; - immediate5 = (((usqInt) constant) >> i6) | ((((sqInt)((usqInt)(constant) << (32 - i6)))) & 0xFFFFFFFFU); - reg1 = ((self_in_dispatchConcretize->operands))[1]; + for (i3 = 2; i3 <= 30; i3 += 2) { + if ((constant11 & (((0xFFU << i3) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i3)))) == constant11) { + rot3 = 32 - i3; + immediate3 = (((usqInt) constant11) >> i3) | ((((sqInt)((usqInt)(constant11) << (32 - i3)))) & 0xFFFFFFFFU); + reg2 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord18 = tstrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate5, rot5); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord18; + aWord8 = tstrnimmror(self_in_dispatchConcretize, reg2, reg2, immediate3, rot3); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord8; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l11; + goto l164; - goto l54; + goto l159; } } /* begin concretizeDataOperationCwR: */ - constant7 = ((self_in_dispatchConcretize->operands))[0]; - rn19 = ((self_in_dispatchConcretize->operands))[1]; - rd17 = rn19; + constant3 = ((self_in_dispatchConcretize->operands))[0]; + rn4 = ((self_in_dispatchConcretize->operands))[1]; + rd4 = rn4; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord121 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord25 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord121; - instrOffset14 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord25; + instrOffset5 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord71 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(TstOpcode) << 21))) | (1U << 20)))) | ((rn19 << 16) | (rd17 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset14 / 4] = aWord71; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset14 + 4; - goto l11; + aWord15 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(TstOpcode) << 21))) | (1U << 20)))) | ((rn4 << 16) | (rd4 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset5 / 4] = aWord15; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset5 + 4))); + goto l164; - l54: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l11: /* end concretizeTstCqR */; + l159: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l164: /* end concretizeTstCqR */; return; case XorCqR: /* begin concretizeInvertibleDataOperationCqR: */ - val4 = ((self_in_dispatchConcretize->operands))[0]; - rn3 = ((self_in_dispatchConcretize->operands))[1]; + val5 = ((self_in_dispatchConcretize->operands))[0]; + rn23 = ((self_in_dispatchConcretize->operands))[1]; assert(!((((self_in_dispatchConcretize->opcode)) == CmpOpcode))); /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ - value4 = val4; + value6 = val5; while (1) { - if ((value4 & 0xFF) == value4) { - invert2 = val4 != value4; + if ((value6 & 0xFF) == value6) { + invert4 = val5 != value6; /* begin machineCodeAt:put: */ - flagsOrOpcode6 = (invert2 + flagsOrOpcode5 = (invert4 ? inverseOpcodeFor(self_in_dispatchConcretize, XorOpcode) : XorOpcode); - aWord19 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode6) << 21))) | (1U << 20)))) | ((rn3 << 16) | (rn3 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value4) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord19; + aWord68 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode5) << 21))) | (1U << 20)))) | ((rn23 << 16) | (rn23 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value6) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord68; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l12; + goto l362; - goto l58; + goto l350; } - for (i7 = 2; i7 <= 30; i7 += 2) { - if ((value4 & (((0xFFU << i7) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i7)))) == value4) { - rot6 = 32 - i7; - immediate6 = (((usqInt) value4) >> i7) | ((value4 << (32 - i7)) & 0xFFFFFFFFU); - invert2 = val4 != value4; + for (i15 = 2; i15 <= 30; i15 += 2) { + if ((value6 & (((0xFFU << i15) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i15)))) == value6) { + rot12 = 32 - i15; + immediate19 = (((usqInt) value6) >> i15) | ((value6 << (32 - i15)) & 0xFFFFFFFFU); + invert4 = val5 != value6; /* begin machineCodeAt:put: */ - flagsOrOpcode7 = (invert2 + flagsOrOpcode12 = (invert4 ? inverseOpcodeFor(self_in_dispatchConcretize, XorOpcode) : XorOpcode); - aWord19 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode7) << 21))) | (1U << 20)))) | ((rn3 << 16) | (rn3 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot6) >> 1)) << 8))) | immediate6) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord19; + aWord68 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode12) << 21))) | (1U << 20)))) | ((rn23 << 16) | (rn23 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot12) >> 1)) << 8))) | immediate19) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord68; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l12; + goto l362; - goto l58; + goto l350; } } - if (!(value4 == val4)) break; - value4 = (val4 < 0 - ? -1 - val4 - : (unsigned int)~val4); + if (!(value6 == val5)) break; + value6 = (val5 < 0 + ? -1 - val5 + : (unsigned int)~val5); } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val4 > 0) { - hb4 = highBit(val4); - if ((1U << hb4) == (val4 + 1)) { + if (val5 > 0) { + hb5 = highBit(val5); + if ((1U << hb5) == (val5 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord20 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord20; + aWord134 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord134; /* begin machineCodeAt:put: */ - aWord21 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rn3, rn3, ConcreteIPReg, 32 - hb4); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord21; + aWord226 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rn23, rn23, ConcreteIPReg, 32 - hb5); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord226; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l12; + goto l362; } } /* begin concretizeDataOperationCqR: */ - val7 = ((self_in_dispatchConcretize->operands))[0]; - rn6 = ((self_in_dispatchConcretize->operands))[1]; + val12 = ((self_in_dispatchConcretize->operands))[0]; + rn24 = ((self_in_dispatchConcretize->operands))[1]; /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ - rd4 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + rd22 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode ? 0 - : rn6); + : rn24); /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ - if ((val7 & 0xFF) == val7) { + if ((val12 & 0xFF) == val12) { /* begin machineCodeAt:put: */ - aWord42 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn6 << 16) | (rd4 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val7) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord42; + aWord411 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn24 << 16) | (rd22 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val12) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord411; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l377; + goto l362; - goto l378; + goto l366; } - for (i12 = 2; i12 <= 30; i12 += 2) { - if ((val7 & (((0xFFU << i12) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i12)))) == val7) { - rot11 = 32 - i12; - immediate14 = (((usqInt) val7) >> i12) | ((((sqIntptr_t)((usqInt)(val7) << (32 - i12)))) & 0xFFFFFFFFU); + for (i14 = 2; i14 <= 30; i14 += 2) { + if ((val12 & (((0xFFU << i14) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i14)))) == val12) { + rot13 = 32 - i14; + immediate18 = (((usqInt) val12) >> i14) | ((((sqIntptr_t)((usqInt)(val12) << (32 - i14)))) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord42 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn6 << 16) | (rd4 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot11) >> 1)) << 8))) | immediate14) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord42; + aWord411 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn24 << 16) | (rd22 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot13) >> 1)) << 8))) | immediate18) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord411; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l377; + goto l362; - goto l378; + goto l366; } } /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ - if (val7 > 0) { - hb7 = highBit(val7); - if ((1U << hb7) == (val7 + 1)) { + if (val12 > 0) { + hb12 = highBit(val12); + if ((1U << hb12) == (val12 + 1)) { /* MVN temp, #0, making 0xffffffff */ /* begin machineCodeAt:put: */ - aWord112 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord112; + aWord1211 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1211; /* begin machineCodeAt:put: */ - aWord212 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rd4, rn6, ConcreteIPReg, 32 - hb7); - ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord212; + aWord2111 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rd22, rn24, ConcreteIPReg, 32 - hb12); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord2111; (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l377; + goto l362; } } /* begin concretizeDataOperationCwR: */ - constant8 = ((self_in_dispatchConcretize->operands))[0]; - rn20 = ((self_in_dispatchConcretize->operands))[1]; - rd18 = rn20; + constant14 = ((self_in_dispatchConcretize->operands))[0]; + rn111 = ((self_in_dispatchConcretize->operands))[1]; + rd111 = rn111; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord122 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord316 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord122; - instrOffset15 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord316; + instrOffset29 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord72 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn20 << 16) | (rd18 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset15 / 4] = aWord72; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset15 + 4; - goto l377; + aWord1113 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn111 << 16) | (rd111 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset29 / 4] = aWord1113; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset29 + 4))); + goto l362; - l378: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l377: /* end concretizeDataOperationCqR: */; - goto l12; + l366: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + goto l362; - l58: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; - l12: /* end concretizeInvertibleDataOperationCqR: */; + l350: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l362: /* end concretizeInvertibleDataOperationCqR: */; return; case AddCwR: /* begin concretizeDataOperationCwR: */ - constant9 = ((self_in_dispatchConcretize->operands))[0]; - rn21 = ((self_in_dispatchConcretize->operands))[1]; - rd19 = rn21; + constant4 = ((self_in_dispatchConcretize->operands))[0]; + rn5 = ((self_in_dispatchConcretize->operands))[1]; + rd5 = rn5; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord123 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord9 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord123; - instrOffset16 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord9; + instrOffset6 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord73 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn21 << 16) | (rd19 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset16 / 4] = aWord73; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset16 + 4; + aWord16 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn5 << 16) | (rd5 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset6 / 4] = aWord16; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset6 + 4; return; case AndCwR: /* begin concretizeDataOperationCwR: */ - constant10 = ((self_in_dispatchConcretize->operands))[0]; - rn22 = ((self_in_dispatchConcretize->operands))[1]; - rd20 = rn22; + constant5 = ((self_in_dispatchConcretize->operands))[0]; + rn6 = ((self_in_dispatchConcretize->operands))[1]; + rd6 = rn6; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord124 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord10 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord124; - instrOffset17 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord10; + instrOffset7 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord74 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn22 << 16) | (rd20 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset17 / 4] = aWord74; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset17 + 4; + aWord17 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn6 << 16) | (rd6 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset7 / 4] = aWord17; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset7 + 4; return; case CmpCwR: /* begin concretizeDataOperationCwR: */ - constant11 = ((self_in_dispatchConcretize->operands))[0]; - rn23 = ((self_in_dispatchConcretize->operands))[1]; - rd21 = 0; + constant6 = ((self_in_dispatchConcretize->operands))[0]; + rn7 = ((self_in_dispatchConcretize->operands))[1]; + rd7 = 0; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord125 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord18 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord125; - instrOffset18 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord18; + instrOffset8 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord75 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn23 << 16) | (rd21 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset18 / 4] = aWord75; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset18 + 4; + aWord19 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn7 << 16) | (rd7 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset8 / 4] = aWord19; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset8 + 4; return; case OrCwR: /* begin concretizeDataOperationCwR: */ - constant12 = ((self_in_dispatchConcretize->operands))[0]; - rn24 = ((self_in_dispatchConcretize->operands))[1]; - rd22 = rn24; + constant7 = ((self_in_dispatchConcretize->operands))[0]; + rn8 = ((self_in_dispatchConcretize->operands))[1]; + rd8 = rn8; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord126 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord20 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord126; - instrOffset19 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord20; + instrOffset9 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord76 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn24 << 16) | (rd22 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset19 / 4] = aWord76; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset19 + 4; + aWord110 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn8 << 16) | (rd8 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset9 / 4] = aWord110; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset9 + 4; return; case SubCwR: /* begin concretizeDataOperationCwR: */ - constant13 = ((self_in_dispatchConcretize->operands))[0]; - rn25 = ((self_in_dispatchConcretize->operands))[1]; - rd23 = rn25; + constant8 = ((self_in_dispatchConcretize->operands))[0]; + rn9 = ((self_in_dispatchConcretize->operands))[1]; + rd9 = rn9; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord127 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord26 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord127; - instrOffset20 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord26; + instrOffset10 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord77 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn25 << 16) | (rd23 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset20 / 4] = aWord77; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset20 + 4; + aWord114 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn9 << 16) | (rd9 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset10 / 4] = aWord114; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset10 + 4; return; case XorCwR: /* begin concretizeDataOperationCwR: */ - constant14 = ((self_in_dispatchConcretize->operands))[0]; - rn26 = ((self_in_dispatchConcretize->operands))[1]; - rd24 = rn26; + constant9 = ((self_in_dispatchConcretize->operands))[0]; + rn10 = ((self_in_dispatchConcretize->operands))[1]; + rd10 = rn10; /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord128 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord27 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord128; - instrOffset21 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord27; + instrOffset11 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord78 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn26 << 16) | (rd24 << 12))) | (ConcreteIPReg & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[instrOffset21 / 4] = aWord78; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset21 + 4; + aWord115 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn10 << 16) | (rd10 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset11 / 4] = aWord115; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset11 + 4; return; case AddRR: /* begin concretizeDataOperationRR: */ - srcReg9 = ((self_in_dispatchConcretize->operands))[0]; - rn7 = ((self_in_dispatchConcretize->operands))[1]; - rd5 = rn7; + srcReg1 = ((self_in_dispatchConcretize->operands))[0]; + rn12 = ((self_in_dispatchConcretize->operands))[1]; + rd12 = rn12; /* begin machineCodeAt:put: */ - aWord43 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn7 << 16) | (rd5 << 12))) | (srcReg9 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord43; + aWord28 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn12 << 16) | (rd12 << 12))) | (srcReg1 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord28; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case AndRR: /* begin concretizeDataOperationRR: */ - srcReg10 = ((self_in_dispatchConcretize->operands))[0]; - rn8 = ((self_in_dispatchConcretize->operands))[1]; - rd6 = rn8; + srcReg2 = ((self_in_dispatchConcretize->operands))[0]; + rn13 = ((self_in_dispatchConcretize->operands))[1]; + rd13 = rn13; /* begin machineCodeAt:put: */ - aWord44 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn8 << 16) | (rd6 << 12))) | (srcReg10 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord44; + aWord29 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn13 << 16) | (rd13 << 12))) | (srcReg2 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord29; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case CmpRR: /* begin concretizeDataOperationRR: */ - srcReg11 = ((self_in_dispatchConcretize->operands))[0]; - rn9 = ((self_in_dispatchConcretize->operands))[1]; - rd7 = 0; + srcReg3 = ((self_in_dispatchConcretize->operands))[0]; + rn14 = ((self_in_dispatchConcretize->operands))[1]; + rd14 = 0; /* begin machineCodeAt:put: */ - aWord45 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn9 << 16) | (rd7 << 12))) | (srcReg11 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord45; + aWord30 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn14 << 16) | (rd14 << 12))) | (srcReg3 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord30; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case OrRR: /* begin concretizeDataOperationRR: */ - srcReg12 = ((self_in_dispatchConcretize->operands))[0]; - rn10 = ((self_in_dispatchConcretize->operands))[1]; - rd8 = rn10; + srcReg4 = ((self_in_dispatchConcretize->operands))[0]; + rn15 = ((self_in_dispatchConcretize->operands))[1]; + rd15 = rn15; /* begin machineCodeAt:put: */ - aWord46 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn10 << 16) | (rd8 << 12))) | (srcReg12 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord46; + aWord33 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn15 << 16) | (rd15 << 12))) | (srcReg4 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord33; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case SubRR: /* begin concretizeDataOperationRR: */ - srcReg13 = ((self_in_dispatchConcretize->operands))[0]; - rn11 = ((self_in_dispatchConcretize->operands))[1]; - rd9 = rn11; + srcReg5 = ((self_in_dispatchConcretize->operands))[0]; + rn16 = ((self_in_dispatchConcretize->operands))[1]; + rd16 = rn16; /* begin machineCodeAt:put: */ - aWord47 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn11 << 16) | (rd9 << 12))) | (srcReg13 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord47; + aWord34 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn16 << 16) | (rd16 << 12))) | (srcReg5 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord34; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case XorRR: /* begin concretizeDataOperationRR: */ - srcReg14 = ((self_in_dispatchConcretize->operands))[0]; - rn12 = ((self_in_dispatchConcretize->operands))[1]; - rd10 = rn12; + srcReg6 = ((self_in_dispatchConcretize->operands))[0]; + rn17 = ((self_in_dispatchConcretize->operands))[1]; + rd17 = rn17; /* begin machineCodeAt:put: */ - aWord48 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn12 << 16) | (rd10 << 12))) | (srcReg14 & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord48; + aWord35 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn17 << 16) | (rd17 << 12))) | (srcReg6 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord35; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5017,52 +5015,52 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* RSB destReg, srcReg, #0 */ reg3 = ((self_in_dispatchConcretize->operands))[0]; - aWord49 = ((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(RsbOpcode) << 21))) | (0U << 20)))) | ((reg3 << 16) | (reg3 << 12)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord49; + aWord36 = ((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(RsbOpcode) << 21))) | (0U << 20)))) | ((reg3 << 16) | (reg3 << 12)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord36; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case LoadEffectiveAddressMwrR: /* begin concretizeLoadEffectiveAddressMwrR */ - offset2 = ((self_in_dispatchConcretize->operands))[0]; - srcReg1 = ((self_in_dispatchConcretize->operands))[1]; - destReg = ((self_in_dispatchConcretize->operands))[2]; + offset27 = ((self_in_dispatchConcretize->operands))[0]; + srcReg7 = ((self_in_dispatchConcretize->operands))[1]; + destReg1 = ((self_in_dispatchConcretize->operands))[2]; /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ - if ((offset2 & 0xFF) == offset2) { + if ((offset27 & 0xFF) == offset27) { /* begin machineCodeAt:put: */ - aWord22 = addrnimmror(self_in_dispatchConcretize, destReg, srcReg1, offset2, 0U << 1); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord22; + aWord37 = addrnimmror(self_in_dispatchConcretize, destReg1, srcReg7, offset27, 0U << 1); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l67; + goto l203; } - for (i8 = 2; i8 <= 30; i8 += 2) { - if ((offset2 & (((0xFFU << i8) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i8)))) == offset2) { - rot7 = 32 - i8; - immediate7 = (((usqInt) offset2) >> i8) | ((offset2 << (32 - i8)) & 0xFFFFFFFFU); + for (i4 = 2; i4 <= 30; i4 += 2) { + if ((offset27 & (((0xFFU << i4) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i4)))) == offset27) { + rot4 = 32 - i4; + immediate4 = (((usqInt) offset27) >> i4) | ((offset27 << (32 - i4)) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord22 = addrnimmror(self_in_dispatchConcretize, destReg, srcReg1, immediate7, ((sqInt)((usqInt)(rot7) << 1))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord22; + aWord37 = addrnimmror(self_in_dispatchConcretize, destReg1, srcReg7, immediate4, ((sqInt)((usqInt)(rot4) << 1))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l67; + goto l203; } } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord50 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord116 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord50; - instrOffset = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord116; + instrOffset12 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord23 = addrnrm(self_in_dispatchConcretize, destReg, srcReg1, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[16 / 4] = aWord23; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset + 4; + aWord210 = addrnrm(self_in_dispatchConcretize, destReg1, srcReg7, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[16 / 4] = aWord210; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset12 + 4; - l67: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l203: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; (self_in_dispatchConcretize->machineCodeSize); return; @@ -5073,8 +5071,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 000 1101 0 0000 dest dist -100 srcR */ reg4 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord51 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg4 << 12))) | (((((sqInt)((usqInt)(distance) << 7))) | (64 | reg4)) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord51; + aWord38 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg4 << 12))) | (((((sqInt)((usqInt)(distance) << 7))) | (64 | reg4)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord38; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5085,8 +5083,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 000 1101 0 0000 dest dist -010 srcR */ reg5 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord52 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg5 << 12))) | (((((sqInt)((usqInt)(distance1) << 7))) | (32 | reg5)) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord52; + aWord39 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg5 << 12))) | (((((sqInt)((usqInt)(distance1) << 7))) | (32 | reg5)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord39; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5097,8 +5095,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 000 1101 0 0000 dest dista 000 srcR */ reg6 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord53 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg6 << 12))) | (((((sqInt)((usqInt)(distance2) << 7))) | reg6) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord53; + aWord40 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg6 << 12))) | (((((sqInt)((usqInt)(distance2) << 7))) | reg6) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord40; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5107,10 +5105,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) distReg = ((self_in_dispatchConcretize->operands))[0]; /* cond 000 1101 0 0000 destR distR 0101 srcR */ - destReg7 = ((self_in_dispatchConcretize->operands))[1]; + destReg2 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord54 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg7 << 12))) | (((distReg << 8) | (80 | destReg7)) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord54; + aWord41 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg2 << 12))) | (((distReg << 8) | (80 | destReg2)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord41; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5119,10 +5117,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) distReg1 = ((self_in_dispatchConcretize->operands))[0]; /* cond 000 1101 0 0000 dest dist 0001 srcR */ - destReg8 = ((self_in_dispatchConcretize->operands))[1]; + destReg3 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord55 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg8 << 12))) | (((distReg1 << 8) | (16 | destReg8)) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord55; + aWord42 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg3 << 12))) | (((distReg1 << 8) | (16 | destReg3)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord42; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5131,10 +5129,10 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) distReg2 = ((self_in_dispatchConcretize->operands))[0]; /* cond 000 1101 0 0000 dest dist 0011 srcR */ - destReg9 = ((self_in_dispatchConcretize->operands))[1]; + destReg4 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord56 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg9 << 12))) | (((distReg2 << 8) | (48 | destReg9)) & 0xFFF); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord56; + aWord43 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg4 << 12))) | (((distReg2 << 8) | (48 | destReg4)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord43; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5160,67 +5158,67 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) case MoveCqR: /* begin concretizeMoveCqR */ - word2 = ((self_in_dispatchConcretize->operands))[0]; + word1 = ((self_in_dispatchConcretize->operands))[0]; reg7 = ((self_in_dispatchConcretize->operands))[1]; /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ - if ((word2 & 0xFF) == word2) { + if ((word1 & 0xFF) == word1) { /* begin machineCodeAt:put: */ - aWord57 = movimmror(self_in_dispatchConcretize, reg7, word2, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord57; + aWord44 = movimmror(self_in_dispatchConcretize, reg7, word1, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord44; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l248; + goto l225; - goto l246; + goto l223; } - for (i14 = 2; i14 <= 30; i14 += 2) { - if ((word2 & (((0xFFU << i14) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i14)))) == word2) { - rot12 = 32 - i14; - immediate15 = (((usqInt) word2) >> i14) | ((((sqInt)((usqInt)(word2) << (32 - i14)))) & 0xFFFFFFFFU); + for (i12 = 2; i12 <= 30; i12 += 2) { + if ((word1 & (((0xFFU << i12) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i12)))) == word1) { + rot5 = 32 - i12; + immediate5 = (((usqInt) word1) >> i12) | ((((sqInt)((usqInt)(word1) << (32 - i12)))) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord57 = movimmror(self_in_dispatchConcretize, reg7, immediate15, rot12); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord57; + aWord44 = movimmror(self_in_dispatchConcretize, reg7, immediate5, rot5); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord44; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l248; + goto l225; - goto l246; + goto l223; } } - if (word2 < 0) { - invVal = -1 - word2; + if (word1 < 0) { + invVal = -1 - word1; } else { - invVal = (unsigned int)~word2; + invVal = (unsigned int)~word1; } /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ if ((invVal & 0xFF) == invVal) { /* begin machineCodeAt:put: */ - aWord113 = mvnimmror(self_in_dispatchConcretize, reg7, invVal, 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord113; + aWord117 = mvnimmror(self_in_dispatchConcretize, reg7, invVal, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord117; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l248; + goto l225; - goto l379; + goto l367; } - for (i13 = 2; i13 <= 30; i13 += 2) { - if ((invVal & (((0xFFU << i13) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i13)))) == invVal) { - rot12 = 32 - i13; - immediate15 = (((usqInt) invVal) >> i13) | ((invVal << (32 - i13)) & 0xFFFFFFFFU); + for (i5 = 2; i5 <= 30; i5 += 2) { + if ((invVal & (((0xFFU << i5) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i5)))) == invVal) { + rot5 = 32 - i5; + immediate5 = (((usqInt) invVal) >> i5) | ((invVal << (32 - i5)) & 0xFFFFFFFFU); /* begin machineCodeAt:put: */ - aWord113 = mvnimmror(self_in_dispatchConcretize, reg7, immediate15, rot12); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord113; + aWord117 = mvnimmror(self_in_dispatchConcretize, reg7, immediate5, rot5); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord117; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l248; + goto l225; - goto l379; + goto l367; } } (self_in_dispatchConcretize->machineCodeSize) = loadCwInto(self_in_dispatchConcretize, ((self_in_dispatchConcretize->operands))[1]); - goto l248; + goto l225; - l379: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l367: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l246: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; - l248: /* end concretizeMoveCqR */; + l223: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l225: /* end concretizeMoveCqR */; return; case MoveCwR: @@ -5230,339 +5228,339 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) case MoveRR: /* begin concretizeMoveRR */ - srcReg2 = ((self_in_dispatchConcretize->operands))[0]; + srcReg8 = ((self_in_dispatchConcretize->operands))[0]; /* cond 000 1101 0 0000 dest 0000 0000 srcR */ - destReg1 = ((self_in_dispatchConcretize->operands))[1]; + destReg5 = ((self_in_dispatchConcretize->operands))[1]; /* begin machineCodeAt:put: */ - aWord24 = movrn(self_in_dispatchConcretize, destReg1, srcReg2); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord24; + aWord45 = movrn(self_in_dispatchConcretize, destReg5, srcReg8); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord45; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case MoveAwR: /* begin concretizeMoveAwR */ srcAddr = ((self_in_dispatchConcretize->operands))[0]; - destReg10 = ((self_in_dispatchConcretize->operands))[1]; + destReg6 = ((self_in_dispatchConcretize->operands))[1]; if ((srcAddr != null) && ((srcAddr >= (varBaseAddress())) && ((srcAddr - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord79 = ldrrnplusImm(self_in_dispatchConcretize, destReg10, ConcreteVarBaseReg, srcAddr - (varBaseAddress())); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord79; + aWord46 = ldrrnplusImm(self_in_dispatchConcretize, destReg6, ConcreteVarBaseReg, srcAddr - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord46; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l331; + goto l232; } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord213 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord118 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord213; - instrOffset22 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord118; + instrOffset13 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord129 = ldrrnplusImm(self_in_dispatchConcretize, destReg10, ConcreteIPReg, 0); - ((self_in_dispatchConcretize->machineCode))[instrOffset22 / 4] = aWord129; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset22 + 4; - l331: /* end concretizeMoveAwR */; + aWord211 = ldrrnplusImm(self_in_dispatchConcretize, destReg6, ConcreteIPReg, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset13 / 4] = aWord211; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset13 + 4; + l232: /* end concretizeMoveAwR */; return; case MoveRAw: /* begin concretizeMoveRAw */ - srcReg15 = ((self_in_dispatchConcretize->operands))[0]; + srcReg9 = ((self_in_dispatchConcretize->operands))[0]; destAddr = ((self_in_dispatchConcretize->operands))[1]; if ((destAddr != null) && ((destAddr >= (varBaseAddress())) && ((destAddr - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord80 = strrnplusImm(self_in_dispatchConcretize, srcReg15, ConcreteVarBaseReg, destAddr - (varBaseAddress())); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord80; + aWord47 = strrnplusImm(self_in_dispatchConcretize, srcReg9, ConcreteVarBaseReg, destAddr - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord47; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l336; + goto l237; } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord214 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord119 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord214; - instrOffset23 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord119; + instrOffset14 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord130 = strrnplusImm(self_in_dispatchConcretize, srcReg15, ConcreteIPReg, 0); - ((self_in_dispatchConcretize->machineCode))[instrOffset23 / 4] = aWord130; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset23 + 4; - l336: /* end concretizeMoveRAw */; + aWord212 = strrnplusImm(self_in_dispatchConcretize, srcReg9, ConcreteIPReg, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset14 / 4] = aWord212; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset14 + 4; + l237: /* end concretizeMoveRAw */; return; case MoveAbR: /* begin concretizeMoveAbR */ srcAddr1 = ((self_in_dispatchConcretize->operands))[0]; - destReg11 = ((self_in_dispatchConcretize->operands))[1]; + destReg7 = ((self_in_dispatchConcretize->operands))[1]; if ((srcAddr1 != null) && ((srcAddr1 >= (varBaseAddress())) && ((srcAddr1 - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord81 = ldrbrnplusimm(self_in_dispatchConcretize, destReg11, ConcreteVarBaseReg, 1, srcAddr1 - (varBaseAddress())); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord81; + aWord48 = ldrbrnplusimm(self_in_dispatchConcretize, destReg7, ConcreteVarBaseReg, 1, srcAddr1 - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord48; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l341; + goto l242; } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord215 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord120 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord215; - instrOffset24 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord120; + instrOffset15 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord131 = ldrbrnplusimm(self_in_dispatchConcretize, destReg11, ConcreteIPReg, 1, 0); - ((self_in_dispatchConcretize->machineCode))[instrOffset24 / 4] = aWord131; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset24 + 4; - l341: /* end concretizeMoveAbR */; + aWord213 = ldrbrnplusimm(self_in_dispatchConcretize, destReg7, ConcreteIPReg, 1, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset15 / 4] = aWord213; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset15 + 4; + l242: /* end concretizeMoveAbR */; return; case MoveRAb: /* begin concretizeMoveRAb */ - srcReg16 = ((self_in_dispatchConcretize->operands))[0]; + srcReg10 = ((self_in_dispatchConcretize->operands))[0]; destAddr1 = ((self_in_dispatchConcretize->operands))[1]; if ((destAddr1 != null) && ((destAddr1 >= (varBaseAddress())) && ((destAddr1 - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord82 = strbrnplusimm(self_in_dispatchConcretize, srcReg16, ConcreteVarBaseReg, 1, destAddr1 - (varBaseAddress())); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord82; + aWord49 = strbrnplusimm(self_in_dispatchConcretize, srcReg10, ConcreteVarBaseReg, 1, destAddr1 - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord49; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l346; + goto l247; } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord216 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord121 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord216; - instrOffset25 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord121; + instrOffset16 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord132 = strbrnplusimm(self_in_dispatchConcretize, srcReg16, ConcreteIPReg, 1, 0); - ((self_in_dispatchConcretize->machineCode))[instrOffset25 / 4] = aWord132; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset25 + 4; - l346: /* end concretizeMoveRAb */; + aWord214 = strbrnplusimm(self_in_dispatchConcretize, srcReg10, ConcreteIPReg, 1, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset16 / 4] = aWord214; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset16 + 4; + l247: /* end concretizeMoveRAb */; return; case MoveMbrR: /* begin concretizeMoveMbrR */ - offset31 = ((self_in_dispatchConcretize->operands))[0]; - srcReg17 = ((self_in_dispatchConcretize->operands))[1]; - destReg12 = ((self_in_dispatchConcretize->operands))[2]; + offset28 = ((self_in_dispatchConcretize->operands))[0]; + srcReg11 = ((self_in_dispatchConcretize->operands))[1]; + destReg8 = ((self_in_dispatchConcretize->operands))[2]; /* begin is12BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset31)) <= 0xFFF) { + if ((SQABS(offset28)) <= 0xFFF) { /* (2 raisedTo: 12)-1 */ - if (offset31 >= 0) { + if (offset28 >= 0) { /* begin machineCodeAt:put: */ - aWord83 = ldrbrnplusimm(self_in_dispatchConcretize, destReg12, srcReg17, 1, offset31); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord83; + aWord50 = ldrbrnplusimm(self_in_dispatchConcretize, destReg8, srcReg11, 1, offset28); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord50; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l353; + goto l254; - goto l351; + goto l251; } else { - immediate17 = SQABS(offset31); + immediate6 = SQABS(offset28); /* begin machineCodeAt:put: */ - aWord83 = ldrbrnplusimm(self_in_dispatchConcretize, destReg12, srcReg17, 0, immediate17); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord83; + aWord50 = ldrbrnplusimm(self_in_dispatchConcretize, destReg8, srcReg11, 0, immediate6); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord50; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l353; + goto l254; - goto l351; + goto l251; } } else { - if ((offset31 != null) - && ((offset31 >= (varBaseAddress())) - && ((offset31 - (varBaseAddress())) < (1U << 12)))) { + if ((offset28 != null) + && ((offset28 >= (varBaseAddress())) + && ((offset28 - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord133 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset31 - (varBaseAddress()), 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord133; - instrOffset26 = 4; + aWord122 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset28 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord122; + instrOffset17 = 4; } else { /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord310 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord215 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord310; - instrOffset26 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord215; + instrOffset17 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); } /* begin machineCodeAt:put: */ - aWord217 = ldrbrnrm(self_in_dispatchConcretize, destReg12, srcReg17, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset26 / 4] = aWord217; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset26 + 4; - goto l353; + aWord310 = ldrbrnrm(self_in_dispatchConcretize, destReg8, srcReg11, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset17 / 4] = aWord310; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset17 + 4; + goto l254; - goto l351; + goto l251; } - l351: /* end is12BitValue:ifTrue:ifFalse: */; - l353: /* end concretizeMoveMbrR */; + l251: /* end is12BitValue:ifTrue:ifFalse: */; + l254: /* end concretizeMoveMbrR */; return; case MoveRMbr: /* begin concretizeMoveRMbr */ - srcReg18 = ((self_in_dispatchConcretize->operands))[0]; - offset32 = ((self_in_dispatchConcretize->operands))[1]; - baseReg1 = ((self_in_dispatchConcretize->operands))[2]; + srcReg12 = ((self_in_dispatchConcretize->operands))[0]; + offset29 = ((self_in_dispatchConcretize->operands))[1]; + baseReg = ((self_in_dispatchConcretize->operands))[2]; /* begin is12BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset32)) <= 0xFFF) { + if ((SQABS(offset29)) <= 0xFFF) { /* (2 raisedTo: 12)-1 */ - if (offset32 >= 0) { + if (offset29 >= 0) { /* begin machineCodeAt:put: */ - aWord84 = strbrnplusimm(self_in_dispatchConcretize, srcReg18, baseReg1, 1, offset32); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord84; + aWord51 = strbrnplusimm(self_in_dispatchConcretize, srcReg12, baseReg, 1, offset29); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord51; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l360; + goto l261; - goto l358; + goto l258; } else { - immediate18 = SQABS(offset32); + immediate7 = SQABS(offset29); /* begin machineCodeAt:put: */ - aWord84 = strbrnplusimm(self_in_dispatchConcretize, srcReg18, baseReg1, 0, immediate18); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord84; + aWord51 = strbrnplusimm(self_in_dispatchConcretize, srcReg12, baseReg, 0, immediate7); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord51; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l360; + goto l261; - goto l358; + goto l258; } } else { - if ((offset32 != null) - && ((offset32 >= (varBaseAddress())) - && ((offset32 - (varBaseAddress())) < (1U << 12)))) { + if ((offset29 != null) + && ((offset29 >= (varBaseAddress())) + && ((offset29 - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord134 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset32 - (varBaseAddress()), 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord134; - instrOffset27 = 4; + aWord123 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset29 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord123; + instrOffset18 = 4; } else { /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord311 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord216 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord311; - instrOffset27 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord216; + instrOffset18 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); } /* begin machineCodeAt:put: */ - aWord218 = strbrnrm(self_in_dispatchConcretize, srcReg18, baseReg1, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset27 / 4] = aWord218; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset27 + 4; - goto l360; + aWord311 = strbrnrm(self_in_dispatchConcretize, srcReg12, baseReg, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset18 / 4] = aWord311; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset18 + 4; + goto l261; - goto l358; + goto l258; } - l358: /* end is12BitValue:ifTrue:ifFalse: */; - l360: /* end concretizeMoveRMbr */; + l258: /* end is12BitValue:ifTrue:ifFalse: */; + l261: /* end concretizeMoveRMbr */; return; case MoveRM16r: /* begin concretizeMoveRM16r */ - srcReg19 = ((self_in_dispatchConcretize->operands))[0]; - offset33 = ((self_in_dispatchConcretize->operands))[1]; - baseReg2 = ((self_in_dispatchConcretize->operands))[2]; + srcReg13 = ((self_in_dispatchConcretize->operands))[0]; + offset30 = ((self_in_dispatchConcretize->operands))[1]; + baseReg1 = ((self_in_dispatchConcretize->operands))[2]; /* begin is12BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset33)) <= 0xFFF) { + if ((SQABS(offset30)) <= 0xFFF) { /* (2 raisedTo: 12)-1 */ - if (offset33 >= 0) { + if (offset30 >= 0) { /* begin machineCodeAt:put: */ - aWord85 = strhrnplusimm(self_in_dispatchConcretize, srcReg19, baseReg2, 1, offset33); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord85; + aWord52 = strhrnplusimm(self_in_dispatchConcretize, srcReg13, baseReg1, 1, offset30); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord52; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l367; + goto l268; - goto l365; + goto l265; } else { - immediate19 = SQABS(offset33); + immediate8 = SQABS(offset30); /* begin machineCodeAt:put: */ - aWord85 = strhrnplusimm(self_in_dispatchConcretize, srcReg19, baseReg2, 0, immediate19); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord85; + aWord52 = strhrnplusimm(self_in_dispatchConcretize, srcReg13, baseReg1, 0, immediate8); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord52; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l367; + goto l268; - goto l365; + goto l265; } } else { - if ((offset33 != null) - && ((offset33 >= (varBaseAddress())) - && ((offset33 - (varBaseAddress())) < (1U << 12)))) { + if ((offset30 != null) + && ((offset30 >= (varBaseAddress())) + && ((offset30 - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ - aWord135 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset33 - (varBaseAddress()), 0); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord135; - instrOffset28 = 4; + aWord124 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset30 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord124; + instrOffset19 = 4; } else { /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord312 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord217 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord312; - instrOffset28 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord217; + instrOffset19 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); } /* begin machineCodeAt:put: */ - aWord219 = strhrnrm(self_in_dispatchConcretize, srcReg19, baseReg2, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset28 / 4] = aWord219; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset28 + 4; - goto l367; + aWord312 = strhrnrm(self_in_dispatchConcretize, srcReg13, baseReg1, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset19 / 4] = aWord312; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset19 + 4; + goto l268; - goto l365; + goto l265; } - l365: /* end is12BitValue:ifTrue:ifFalse: */; - l367: /* end concretizeMoveRM16r */; + l265: /* end is12BitValue:ifTrue:ifFalse: */; + l268: /* end concretizeMoveRM16r */; return; case MoveM16rR: /* begin concretizeMoveM16rR */ - offset3 = ((self_in_dispatchConcretize->operands))[0]; - srcReg3 = ((self_in_dispatchConcretize->operands))[1]; - destReg2 = ((self_in_dispatchConcretize->operands))[2]; + offset31 = ((self_in_dispatchConcretize->operands))[0]; + srcReg14 = ((self_in_dispatchConcretize->operands))[1]; + destReg9 = ((self_in_dispatchConcretize->operands))[2]; /* begin is8BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset3)) <= 0xFF) { + if ((SQABS(offset31)) <= 0xFF) { /* (2 raisedTo: 8)-1 */ - if (offset3 >= 0) { + if (offset31 >= 0) { /* begin machineCodeAt:put: */ - aWord25 = ldrhrnplusimm(self_in_dispatchConcretize, destReg2, srcReg3, 1, offset3); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord25; + aWord53 = ldrhrnplusimm(self_in_dispatchConcretize, destReg9, srcReg14, 1, offset31); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord53; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l16; + goto l274; } else { - immediate8 = SQABS(offset3); + immediate9 = SQABS(offset31); /* begin machineCodeAt:put: */ - aWord25 = ldrhrnplusimm(self_in_dispatchConcretize, destReg2, srcReg3, 0, immediate8); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord25; + aWord53 = ldrhrnplusimm(self_in_dispatchConcretize, destReg9, srcReg14, 0, immediate9); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord53; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l16; + goto l274; } } @@ -5571,59 +5569,59 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord58 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord125 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord58; - instrOffset1 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord125; + instrOffset20 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord26 = ldrhrnrm(self_in_dispatchConcretize, destReg2, srcReg3, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset1 / 4] = aWord26; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset1 + 4; - goto l16; + aWord218 = ldrhrnrm(self_in_dispatchConcretize, destReg9, srcReg14, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset20 / 4] = aWord218; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset20 + 4; + goto l274; } - l16: /* end concretizeMoveM16rR */; + l274: /* end concretizeMoveM16rR */; return; case MoveM64rRd: /* begin concretizeMoveM64rRd */ - offset6 = ((self_in_dispatchConcretize->operands))[0]; - u3 = (offset6 > 0 + offset = ((self_in_dispatchConcretize->operands))[0]; + u = (offset > 0 ? 1 : 0); - srcReg8 = ((self_in_dispatchConcretize->operands))[1]; - destReg6 = ((self_in_dispatchConcretize->operands))[2]; - ((self_in_dispatchConcretize->machineCode))[0] = ((((3977251584U | (srcReg8 << 16)) | (destReg6 << 12)) | (((int)((usqInt)(u3) << 23)))) | (((usqInt) offset6) >> 2)); + srcReg = ((self_in_dispatchConcretize->operands))[1]; + destReg = ((self_in_dispatchConcretize->operands))[2]; + ((self_in_dispatchConcretize->machineCode))[0] = ((((3977251584U | (srcReg << 16)) | (destReg << 12)) | (((int)((usqInt)(u) << 23)))) | (((usqInt) offset) >> 2)); (self_in_dispatchConcretize->machineCodeSize) = 4; return; case MoveMwrR: /* begin concretizeMoveMwrR */ - offset4 = ((self_in_dispatchConcretize->operands))[0]; - srcReg4 = ((self_in_dispatchConcretize->operands))[1]; - destReg3 = ((self_in_dispatchConcretize->operands))[2]; + offset32 = ((self_in_dispatchConcretize->operands))[0]; + srcReg15 = ((self_in_dispatchConcretize->operands))[1]; + destReg10 = ((self_in_dispatchConcretize->operands))[2]; /* begin is12BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset4)) <= 0xFFF) { + if ((SQABS(offset32)) <= 0xFFF) { /* (2 raisedTo: 12)-1 */ - if (offset4 >= 0) { + if (offset32 >= 0) { /* begin machineCodeAt:put: */ - aWord27 = ldrrnplusimm(self_in_dispatchConcretize, destReg3, srcReg4, 1, offset4); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord27; + aWord54 = ldrrnplusimm(self_in_dispatchConcretize, destReg10, srcReg15, 1, offset32); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord54; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l17; + goto l280; - goto l75; + goto l275; } else { - immediate9 = SQABS(offset4); + immediate10 = SQABS(offset32); /* begin machineCodeAt:put: */ - aWord27 = ldrrnplusimm(self_in_dispatchConcretize, destReg3, srcReg4, 0, immediate9); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord27; + aWord54 = ldrrnplusimm(self_in_dispatchConcretize, destReg10, srcReg15, 0, immediate10); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord54; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l17; + goto l280; - goto l75; + goto l275; } } else { @@ -5631,21 +5629,21 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord59 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord126 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord59; - instrOffset2 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord126; + instrOffset21 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord28 = ldrrnrm(self_in_dispatchConcretize, destReg3, srcReg4, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset2 / 4] = aWord28; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset2 + 4; - goto l17; + aWord219 = ldrrnrm(self_in_dispatchConcretize, destReg10, srcReg15, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset21 / 4] = aWord219; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset21 + 4; + goto l280; - goto l75; + goto l275; } - l75: /* end is12BitValue:ifTrue:ifFalse: */; - l17: /* end concretizeMoveMwrR */; + l275: /* end is12BitValue:ifTrue:ifFalse: */; + l280: /* end concretizeMoveMwrR */; return; case MoveXbrRR: @@ -5659,8 +5657,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 011 1100 1 base dest 00000 00 0 inde */ dest = ((self_in_dispatchConcretize->operands))[2]; /* begin machineCodeAt:put: */ - aWord29 = ldrbrnrm(self_in_dispatchConcretize, dest, base, index); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord29; + aWord55 = ldrbrnrm(self_in_dispatchConcretize, dest, base, index); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord55; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5673,8 +5671,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 011 1100 0 base srcR 00000 00 0 index */ base1 = ((self_in_dispatchConcretize->operands))[2]; /* begin machineCodeAt:put: */ - aWord30 = strbrnrm(self_in_dispatchConcretize, src, base1, index1); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord30; + aWord56 = strbrnrm(self_in_dispatchConcretize, src, base1, index1); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord56; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5687,8 +5685,8 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 011 1100 1 base dest 00010 00 0 inde bulit by lowest level generator so we can do the lsl #2 on the index register */ dest1 = ((self_in_dispatchConcretize->operands))[2]; /* begin machineCodeAt:put: */ - aWord31 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, dest1, base2, 1, 1, 0, 0, 1, index2); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord31; + aWord57 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, dest1, base2, 1, 1, 0, 0, 1, index2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord57; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5703,38 +5701,38 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond 011 1100 0 base srcR 00010 00 0 inde */ base3 = ((self_in_dispatchConcretize->operands))[2]; /* begin machineCodeAt:put: */ - aWord32 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, src1, base3, 1, 1, 0, 0, 0, index3); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord32; + aWord58 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, src1, base3, 1, 1, 0, 0, 0, index3); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord58; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case MoveRMwr: /* begin concretizeMoveRMwr */ - srcReg5 = ((self_in_dispatchConcretize->operands))[0]; - offset5 = ((self_in_dispatchConcretize->operands))[1]; - baseReg = ((self_in_dispatchConcretize->operands))[2]; + srcReg16 = ((self_in_dispatchConcretize->operands))[0]; + offset33 = ((self_in_dispatchConcretize->operands))[1]; + baseReg2 = ((self_in_dispatchConcretize->operands))[2]; /* begin is12BitValue:ifTrue:ifFalse: */ - if ((SQABS(offset5)) <= 0xFFF) { + if ((SQABS(offset33)) <= 0xFFF) { /* (2 raisedTo: 12)-1 */ - if (offset5 >= 0) { + if (offset33 >= 0) { /* begin machineCodeAt:put: */ - aWord33 = strrnplusimm(self_in_dispatchConcretize, srcReg5, baseReg, 1, offset5); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord33; + aWord59 = strrnplusimm(self_in_dispatchConcretize, srcReg16, baseReg2, 1, offset33); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord59; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l22; + goto l294; - goto l82; + goto l289; } else { - immediate10 = SQABS(offset5); + immediate11 = SQABS(offset33); /* begin machineCodeAt:put: */ - aWord33 = strrnplusimm(self_in_dispatchConcretize, srcReg5, baseReg, 0, immediate10); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord33; + aWord59 = strrnplusimm(self_in_dispatchConcretize, srcReg16, baseReg2, 0, immediate11); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord59; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l22; + goto l294; - goto l82; + goto l289; } } else { @@ -5742,32 +5740,32 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord60 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord127 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord60; - instrOffset3 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord127; + instrOffset22 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord34 = strrnrm(self_in_dispatchConcretize, srcReg5, baseReg, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset3 / 4] = aWord34; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset3 + 4; - goto l22; + aWord220 = strrnrm(self_in_dispatchConcretize, srcReg16, baseReg2, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset22 / 4] = aWord220; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset22 + 4; + goto l294; - goto l82; + goto l289; } - l82: /* end is12BitValue:ifTrue:ifFalse: */; - l22: /* end concretizeMoveRMwr */; + l289: /* end is12BitValue:ifTrue:ifFalse: */; + l294: /* end concretizeMoveRMwr */; return; case MoveRdM64r: /* begin concretizeMoveRdM64r */ - offset7 = ((self_in_dispatchConcretize->operands))[1]; - u4 = (offset7 > 0 + offset1 = ((self_in_dispatchConcretize->operands))[1]; + u1 = (offset1 > 0 ? 1 : 0); - dstReg1 = ((self_in_dispatchConcretize->operands))[2]; + dstReg = ((self_in_dispatchConcretize->operands))[2]; fpReg = ((self_in_dispatchConcretize->operands))[0]; - ((self_in_dispatchConcretize->machineCode))[0] = ((((3976203008U | (dstReg1 << 16)) | (fpReg << 12)) | (((int)((usqInt)(u4) << 23)))) | (((usqInt) offset7) >> 2)); + ((self_in_dispatchConcretize->machineCode))[0] = ((((3976203008U | (dstReg << 16)) | (fpReg << 12)) | (((int)((usqInt)(u1) << 23)))) | (((usqInt) offset1) >> 2)); (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5775,9 +5773,9 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* begin concretizePopR */ /* LDR destReg, [SP], #4 */ - destReg4 = ((self_in_dispatchConcretize->operands))[0]; - aWord35 = popR(self_in_dispatchConcretize, destReg4); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord35; + destReg11 = ((self_in_dispatchConcretize->operands))[0]; + aWord60 = popR(self_in_dispatchConcretize, destReg11); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord60; (self_in_dispatchConcretize->machineCodeSize) = 4; return; @@ -5786,64 +5784,64 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) /* cond | 010 | 1001 | 0 | -Rn- | -Rd- | 0000 0000 0100 */ /* STR srcReg, [sp, #-4] */ - srcReg6 = ((self_in_dispatchConcretize->operands))[0]; - aWord36 = pushR(self_in_dispatchConcretize, srcReg6); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord36; + srcReg17 = ((self_in_dispatchConcretize->operands))[0]; + aWord61 = pushR(self_in_dispatchConcretize, srcReg17); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord61; (self_in_dispatchConcretize->machineCodeSize) = 4; return; case PushCq: /* begin concretizePushCq */ - word1 = ((self_in_dispatchConcretize->operands))[0]; + word2 = ((self_in_dispatchConcretize->operands))[0]; /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ - value5 = word1; + value2 = word2; while (1) { - if ((value5 & 0xFF) == value5) { - invert3 = word1 != value5; + if ((value2 & 0xFF) == value2) { + invert = word2 != value2; /* begin machineCodeAt:put: */ - aWord37 = (invert3 - ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value5, 0) - : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value5, 0)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; - instrOffset4 = 4; - - goto l87; - } - for (i9 = 2; i9 <= 30; i9 += 2) { - if ((value5 & (((0xFFU << i9) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i9)))) == value5) { - rot8 = 32 - i9; - immediate11 = (((usqInt) value5) >> i9) | ((value5 << (32 - i9)) & 0xFFFFFFFFU); - invert3 = word1 != value5; + aWord62 = (invert + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value2, 0) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value2, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; + instrOffset23 = 4; + + goto l302; + } + for (i6 = 2; i6 <= 30; i6 += 2) { + if ((value2 & (((0xFFU << i6) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i6)))) == value2) { + rot6 = 32 - i6; + immediate12 = (((usqInt) value2) >> i6) | ((value2 << (32 - i6)) & 0xFFFFFFFFU); + invert = word2 != value2; /* begin machineCodeAt:put: */ - aWord37 = (invert3 - ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate11, rot8) - : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate11, rot8)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; - instrOffset4 = 4; + aWord62 = (invert + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate12, rot6) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate12, rot6)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; + instrOffset23 = 4; - goto l87; + goto l302; } } - if (!(value5 == word1)) break; - value5 = (word1 < 0 - ? -1 - word1 - : (unsigned int)~word1); + if (!(value2 == word2)) break; + value2 = (word2 < 0 + ? -1 - word2 + : (unsigned int)~word2); } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord61 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord128 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord61; - instrOffset4 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord128; + instrOffset23 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); - l87: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l302: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; /* begin machineCodeAt:put: */ - aWord38 = pushR(self_in_dispatchConcretize, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset4 / 4] = aWord38; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset4 + 4; + aWord221 = pushR(self_in_dispatchConcretize, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset23 / 4] = aWord221; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset23 + 4; return; case PushCw: @@ -5853,51 +5851,51 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) || ((((AbstractInstruction *) word3)) == (methodLabel()))) || (((((usqInt)word3)) >= ((methodLabel->address))) && ((((usqInt)word3)) < (youngReferrers())))) { - instrOffset5 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); + instrOffset24 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); } else { /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ - value6 = word3; + value3 = word3; while (1) { - if ((value6 & 0xFF) == value6) { - invert4 = word3 != value6; + if ((value3 & 0xFF) == value3) { + invert1 = word3 != value3; /* begin machineCodeAt:put: */ - aWord62 = (invert4 - ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value6, 0) - : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value6, 0)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; - instrOffset5 = 4; + aWord63 = (invert1 + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value3, 0) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value3, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord63; + instrOffset24 = 4; - goto l259; + goto l307; } - for (i15 = 2; i15 <= 30; i15 += 2) { - if ((value6 & (((0xFFU << i15) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i15)))) == value6) { - rot13 = 32 - i15; - immediate16 = (((usqInt) value6) >> i15) | ((value6 << (32 - i15)) & 0xFFFFFFFFU); - invert4 = word3 != value6; + for (i7 = 2; i7 <= 30; i7 += 2) { + if ((value3 & (((0xFFU << i7) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i7)))) == value3) { + rot7 = 32 - i7; + immediate13 = (((usqInt) value3) >> i7) | ((value3 << (32 - i7)) & 0xFFFFFFFFU); + invert1 = word3 != value3; /* begin machineCodeAt:put: */ - aWord62 = (invert4 - ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate16, rot13) - : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate16, rot13)); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; - instrOffset5 = 4; + aWord63 = (invert1 + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate13, rot7) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate13, rot7)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord63; + instrOffset24 = 4; - goto l259; + goto l307; } } - if (!(value6 == word3)) break; - value6 = (word3 < 0 + if (!(value3 == word3)) break; + value3 = (word3 < 0 ? -1 - word3 : (unsigned int)~word3); } - instrOffset5 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); + instrOffset24 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); - l259: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l307: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; } /* begin machineCodeAt:put: */ - aWord114 = pushR(self_in_dispatchConcretize, ConcreteIPReg); - ((self_in_dispatchConcretize->machineCode))[instrOffset5 / 4] = aWord114; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset5 + 4; + aWord129 = pushR(self_in_dispatchConcretize, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset24 / 4] = aWord129; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset24 + 4; return; case PrefetchAw: @@ -5908,33 +5906,33 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) && ((addressOperand - (varBaseAddress())) < (1U << 12)))) { /* begin machineCodeAt:put: */ immediate20 = addressOperand - (varBaseAddress()); - aWord86 = ((usqInt) (4115722240U | ((((int)((usqInt)(ConcreteVarBaseReg) << 16))) | ((1U << 23) | immediate20)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord86; + aWord64 = ((usqInt) (4115722240U | ((((int)((usqInt)(ConcreteVarBaseReg) << 16))) | ((1U << 23) | immediate20)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord64; (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l373; + goto l313; } /* begin moveCw:intoR: */ assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); /* begin machineCodeAt:put: */ - aWord220 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + aWord130 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) ? 1 : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); - ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord220; - instrOffset29 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord130; + instrOffset25 = ((self_in_dispatchConcretize->machineCodeSize) = 4); /* begin machineCodeAt:put: */ - aWord136 = 4115722240U | ((((int)((usqInt)(ConcreteIPReg) << 16))) | ((1U << 23) | 0)); - ((self_in_dispatchConcretize->machineCode))[instrOffset29 / 4] = aWord136; - (self_in_dispatchConcretize->machineCodeSize) = instrOffset29 + 4; - l373: /* end concretizePrefetchAw */; + aWord222 = 4115722240U | ((((int)((usqInt)(ConcreteIPReg) << 16))) | ((1U << 23) | 0)); + ((self_in_dispatchConcretize->machineCode))[instrOffset25 / 4] = aWord222; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset25 + 4; + l313: /* end concretizePrefetchAw */; return; case ConvertRRd: /* begin concretizeConvertRRd */ - srcReg7 = ((self_in_dispatchConcretize->operands))[0]; - destReg5 = ((self_in_dispatchConcretize->operands))[1]; - ((self_in_dispatchConcretize->machineCode))[0] = (fmsrFromto(self_in_dispatchConcretize, srcReg7, 9)); - ((self_in_dispatchConcretize->machineCode))[1] = (fsitodFromto(self_in_dispatchConcretize, 9, destReg5)); + srcReg18 = ((self_in_dispatchConcretize->operands))[0]; + destReg12 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (fmsrFromto(self_in_dispatchConcretize, srcReg18, 9)); + ((self_in_dispatchConcretize->machineCode))[1] = (fsitodFromto(self_in_dispatchConcretize, 9, destReg12)); (self_in_dispatchConcretize->machineCodeSize) = 8; return; @@ -6462,6 +6460,7 @@ isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, s { sqInt call; + /* begin instructionBeforeAddress: */ call = longAt(mcpc - 4); return (instructionIsBL(self_in_isCallPrecedingReturnPC, call)) || (instructionIsBLX(self_in_isCallPrecedingReturnPC, call)); @@ -6989,6 +6988,7 @@ relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeRet assert((delta % 4) == 0); if (delta != 0) { + /* begin instructionBeforeAddress: */ instr = longAt(retpc - 4); assert((instructionIsB(self_in_relocateCallBeforeReturnPCby, instr)) || (instructionIsBL(self_in_relocateCallBeforeReturnPCby, instr))); @@ -7083,6 +7083,7 @@ rewriteTransferAttarget(AbstractInstruction * self_in_rewriteTransferAttarget, u /* return offset */ callDistance = ((usqInt) (callTargetAddress - ((callSiteReturnAddress + 8) - 4))); assert(isInImmediateJumpRange(self_in_rewriteTransferAttarget, callDistance)); + /* begin instructionBeforeAddress: */ instr = longAt(callSiteReturnAddress - 4); assert((instructionIsB(self_in_rewriteTransferAttarget, instr)) || (instructionIsBL(self_in_rewriteTransferAttarget, instr))); @@ -7649,7 +7650,7 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -8917,7 +8918,7 @@ cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt callForCogCompiledCodeCompaction(); return 0; } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -9039,7 +9040,7 @@ cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt nu if (startAddress == 0) { return ((CogMethod *) InsufficientCodeSpace); } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -9366,7 +9367,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if ((numRegsPushed == 0) && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { - goto l1; + goto l4; } wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); if (wordsPushedModAlignment != 0) { @@ -9377,7 +9378,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr (anInstruction->dependent = locateLiteral(delta * BytesPerWord)); } } - l1: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + l4: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; } /* begin genSaveRegs: */ if (regsToSave == 0) { @@ -9390,13 +9391,13 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr /* begin genMarshallNArgs:arg:arg:arg:arg: */ if (numArgs == 0) { ((AbstractInstruction *) backEnd); - goto l7; + goto l13; } if (regOrConst0 < NoReg) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst0, CArg0Reg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(-2 - regOrConst0)); + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, CArg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(-2 - regOrConst0)); } } else { @@ -9405,13 +9406,13 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 1) { ((AbstractInstruction *) backEnd); - goto l7; + goto l13; } if (regOrConst1 < NoReg) { /* begin MoveCq:R: */ - anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst1, CArg1Reg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(-2 - regOrConst1)); + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, CArg1Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(-2 - regOrConst1)); } } else { @@ -9420,13 +9421,13 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 2) { ((AbstractInstruction *) backEnd); - goto l7; + goto l13; } if (regOrConst2 < NoReg) { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst2, CArg2Reg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(-2 - regOrConst2)); + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, CArg2Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(-2 - regOrConst2)); } } else { @@ -9435,13 +9436,13 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 3) { ((AbstractInstruction *) backEnd); - goto l7; + goto l13; } if (regOrConst3 < NoReg) { /* begin MoveCq:R: */ - anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst3, CArg3Reg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(-2 - regOrConst3)); + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, CArg3Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(-2 - regOrConst3)); } } else { @@ -9449,7 +9450,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr genoperandoperand(MoveRR, regOrConst3, CArg3Reg); } ((AbstractInstruction *) backEnd); -l7: /* end genMarshallNArgs:arg:arg:arg:arg: */; +l13: /* end genMarshallNArgs:arg:arg:arg:arg: */; /* begin CallFullRT: */ callTarget = ((usqInt)aRoutine); /* begin CallFull: */ @@ -10166,10 +10167,11 @@ extABytecode(void) static sqInt extBBytecode(void) { - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte1 > 0x7F) ? byte1 - 256 : (((usqInt) extB << 8)) + byte1); + numExtB += 1; return 0; } @@ -10421,7 +10423,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10431,7 +10433,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#followForwardedMethods */ @@ -10744,11 +10746,11 @@ generateCaptureCStackPointers(sqInt captureFramePointer) /* begin PushR: */ genoperand(PushR, VarBaseReg); /* begin MoveCq:R: */ - quickConstant1 = varBaseAddress(); + quickConstant = varBaseAddress(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, VarBaseReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); } if (captureFramePointer) { @@ -10760,12 +10762,12 @@ generateCaptureCStackPointers(sqInt captureFramePointer) /* begin MoveR:R: */ genoperandoperand(MoveRR, SPReg, TempReg); /* begin AddCq:R: */ - quickConstant = 0 + BytesPerWord; + quickConstant1 = 0 + BytesPerWord; /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AddCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AddCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); } /* begin MoveR:Aw: */ address1 = cStackPointerAddress(); @@ -10931,7 +10933,7 @@ generateCogMethod(sqInt selector) assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); result = outputInstructionsAt(startAddress + headerSize); assert(((startAddress + headerSize) + codeSize) == result); - padIfPossibleWithStopsFromto(backEnd, result, (startAddress + totalSize) - mapSize); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); fillInBlockHeadersAt(startAddress); method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); @@ -11003,12 +11005,12 @@ static sqInt NoDbgRegParms generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - sqInt delta; + usqIntptr_t delta; sqInt i; AbstractInstruction *instruction; sqInt length; - sqInt location; - sqInt mapEntry; + usqIntptr_t location; + usqIntptr_t mapEntry; sqInt maxDelta; usqIntptr_t mcpc; @@ -11289,14 +11291,11 @@ genInnerPICAbortTrampoline(char *name) { AbstractInstruction *anInstruction; AbstractInstruction *jumpMNUCase; - sqInt quickConstant; /* begin CmpCq:R: */ - quickConstant = 0; - /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, ClassReg); + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + (anInstruction->dependent = locateLiteral(0)); } /* begin JumpZero: */ jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -11441,14 +11440,14 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu jumpMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); if (eoCheckFlag) { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(NSCEnclosingObjectIndex * BytesPerWord)); + anInstruction3 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(NSCEnclosingObjectIndex * BytesPerWord)); } /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction4 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(0)); } /* begin JumpZero: */ jumpItsTheReceiverStupid = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -11459,9 +11458,9 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* arbitrary argument count */ /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(NSCNumArgsIndex * BytesPerWord)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(NSCNumArgsIndex * BytesPerWord)); } /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, ReceiverResultReg, TempReg, SPReg); @@ -11472,9 +11471,9 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* begin MoveR:Mw:r: */ offset = ((0) + numArgs) * BytesPerWord; /* begin gen:operand:quickConstant:operand: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(offset)); + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset)); } } } @@ -12301,7 +12300,7 @@ gMoveRR(sqInt reg1, sqInt reg2) /* Answer the address of the null byte at the end of the method map. */ /* Cogit>>#mapEndFor: */ -static usqInt NoDbgRegParms +static sqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod) { usqInt end; @@ -12327,6 +12326,7 @@ mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annota usqInt mcpc; sqInt result; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -12499,7 +12499,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12509,7 +12509,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { ensureInYoungReferrers(cogMethod); hasYoungObj = 0; @@ -12581,7 +12581,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12591,7 +12591,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); @@ -12672,7 +12672,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12682,7 +12682,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { hasYoungObj = 0; } @@ -12790,7 +12790,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12800,7 +12800,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } if ((((cogMethod->cmType)) == CMOpenPIC) && ((isImmediate((cogMethod->selector))) @@ -12834,7 +12834,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); if (result1 != 0) { - goto l2; + goto l4; } } else { @@ -12844,7 +12844,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map1 -= 1; } - l2: /* end mapFor:performUntil:arg: */; + l4: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -12938,7 +12938,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12948,7 +12948,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } return 0; } @@ -13263,7 +13263,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -13273,7 +13273,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#maxCogMethodAddress */ @@ -13361,7 +13361,7 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -13822,6 +13822,7 @@ printPCMapPairsFor(CogMethod *cogMethod) usqInt mcpc; sqInt value; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -14016,7 +14017,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14026,7 +14027,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#relocateCallsInClosedPIC: */ @@ -14591,7 +14592,7 @@ unlinkAllSends(void) } result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14601,7 +14602,7 @@ unlinkAllSends(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) != CMFree) { @@ -15033,7 +15034,7 @@ unlinkSendsLinkedForInvalidClasses(void) } result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -15043,7 +15044,7 @@ unlinkSendsLinkedForInvalidClasses(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -15146,7 +15147,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); if (result != 0) { - goto l1; + goto l2; } } else { @@ -15156,7 +15157,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -15205,7 +15206,7 @@ unlinkSendsToFree(void) } result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -15215,7 +15216,7 @@ unlinkSendsToFree(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) == CMClosedPIC) { @@ -15278,7 +15279,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -15288,7 +15289,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -16264,7 +16265,7 @@ genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*p /* CogObjectRepresentation>>#genDoubleComparison:invert: */ static sqInt NoDbgRegParms -genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison) +genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison) { AbstractInstruction *anInstruction; AbstractInstruction *compare; @@ -16551,19 +16552,19 @@ genPrimitiveBitShift(void) genConvertSmallIntegerToIntegerInReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } } /* begin JumpNegative: */ jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant = numSmallIntegerBits(); + quickConstant1 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, ClassReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant1)); } /* begin JumpGreaterOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); @@ -16587,20 +16588,20 @@ genPrimitiveBitShift(void) genoperand(RetN, 0); jmpTarget(jumpNegative, gNegateR(ClassReg)); /* begin CmpCq:R: */ - quickConstant1 = numSmallIntegerBits(); + quickConstant2 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant2)); } /* begin JumpLessOrEqual: */ jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - quickConstant2 = numSmallIntegerBits(); + quickConstant = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(MoveCqR, quickConstant2, ClassReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant2)); + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); } jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); @@ -16693,9 +16694,9 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } } /* begin JumpZero: */ @@ -16705,9 +16706,9 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(TempReg); gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, ClassReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(0)); + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); } /* begin JumpZero: */ jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -16715,17 +16716,17 @@ genPrimitiveDiv(void) genoperandoperand(XorRR, ClassReg, Arg1Reg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } } /* begin JumpGreaterOrEqual: */ jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(1)); + anInstruction = genoperandoperand(SubCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); } jmpTarget(jumpSameSign, (convert = gLabel())); genConvertIntegerToSmallIntegerInReg(TempReg); @@ -17184,7 +17185,7 @@ genSmallIntegerComparison(sqInt jumpOpcode) /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ static sqInt NoDbgRegParms -genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) { AbstractInstruction *anInstruction; sqInt constant; @@ -17365,15 +17366,15 @@ genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg) { AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; - sqInt operandOne; + sqInt quickConstant; assert(indexReg != destReg); /* begin AddCq:R: */ - operandOne = (BaseHeaderSize / BytesPerWord) - 1; - /* begin checkQuickConstant:forInstruction: */ - anInstruction = genoperandoperand(AddCqR, operandOne, indexReg); + quickConstant = (BaseHeaderSize / BytesPerWord) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, indexReg); if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(operandOne)); + (anInstruction->dependent = locateLiteral(quickConstant)); } /* begin genMoveConstant:R: */ if (shouldAnnotateObjectReference(tableObj)) { @@ -17406,16 +17407,16 @@ genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(4)); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(4)); } /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } genConvertIntegerToSmallIntegerInReg(destReg); return 0; @@ -17433,16 +17434,16 @@ genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(4)); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(4)); } /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } return 0; } @@ -17508,9 +17509,9 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin Label */ immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, 1, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(1)); + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(1)); } /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); @@ -17523,16 +17524,16 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } jmpTarget(jumpCompare, gLabel()); } @@ -17543,9 +17544,9 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin JumpZero: */ jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, 1, destReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(1)); + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(1)); } /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); @@ -17698,9 +17699,6 @@ genPrimitiveAt(void) AbstractInstruction *jumpWordTooBig; AbstractInstruction *methodInBounds; sqInt nSlotsOrBytesReg; - sqInt operandOne; - sqInt operandOne1; - sqInt operandOne2; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; @@ -17708,6 +17706,9 @@ genPrimitiveAt(void) sqInt quickConstant4; sqInt quickConstant5; sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + sqInt quickConstant9; nSlotsOrBytesReg = ClassReg; /* begin genLoadArgAtDepth:into: */ @@ -17719,27 +17720,27 @@ genPrimitiveAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction13 = genoperandoperand(SubCqR, 1, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(1)); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); } genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); } /* begin JumpZero: */ jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -17748,27 +17749,27 @@ genPrimitiveAt(void) /* begin CmpCq:R: */ quickConstant2 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); } /* begin JumpBelowOrEqual: */ jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant3 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant3)); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant3)); } /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant4 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, formatReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(quickConstant4)); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant4)); } /* begin JumpAboveOrEqual: */ jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -17779,11 +17780,11 @@ genPrimitiveAt(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction5 = genoperandoperand(AddCqR, operandOne, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(operandOne)); + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(AddCqR, quickConstant5, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant5)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); @@ -17800,20 +17801,20 @@ genPrimitiveAt(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstCompiledMethodFormat(); + quickConstant6 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant5, formatReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(quickConstant5)); + anInstruction8 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant6)); } /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(BaseHeaderSize)); + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(BaseHeaderSize)); } - methodInBounds = anInstruction7; + methodInBounds = anInstruction9; /* begin MoveXbr:R:R: */ genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); @@ -17826,9 +17827,9 @@ genPrimitiveAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, formatReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(1)); + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(1)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); @@ -17841,9 +17842,9 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(BaseHeaderSize)); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); } /* begin Jump: */ genoperand(Jump, ((sqInt)convertToIntAndReturn)); @@ -17851,11 +17852,11 @@ genPrimitiveAt(void) /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - operandOne1 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction9 = genoperandoperand(AddCqR, operandOne1, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(operandOne1)); + quickConstant7 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(AddCqR, quickConstant7, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant7)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); @@ -17868,9 +17869,9 @@ genPrimitiveAt(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, formatReg); /* begin CmpCq:R: */ - anInstruction10 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(ClassMethodContextCompactIndex)); + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(ClassMethodContextCompactIndex)); } /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -17882,11 +17883,11 @@ genPrimitiveAt(void) genoperand(PopR, nSlotsOrBytesReg); genConvertSmallIntegerToIntegerInReg(formatReg); /* begin AndCq:R: */ - quickConstant6 = fixedFieldsOfClassFormatMask(); + quickConstant8 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(AndCqR, quickConstant6, formatReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(quickConstant6)); + anInstruction13 = genoperandoperand(AndCqR, quickConstant8, formatReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant8)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); @@ -17897,11 +17898,11 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, formatReg, Arg1Reg); /* begin AddCq:R: */ - operandOne2 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction12 = genoperandoperand(AddCqR, operandOne2, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(operandOne2)); + quickConstant9 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(AddCqR, quickConstant9, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant9)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); @@ -17971,18 +17972,18 @@ genPrimitiveAtPut(void) AbstractInstruction *jumpWordsOutOfRange; AbstractInstruction *methodInBounds; sqInt nSlotsOrBytesReg; - sqInt operandOne; - sqInt operandOne1; - sqInt operandOne2; - sqInt operandOne3; sqInt quickConstant; sqInt quickConstant1; + sqInt quickConstant10; + sqInt quickConstant11; sqInt quickConstant2; sqInt quickConstant3; sqInt quickConstant4; sqInt quickConstant5; sqInt quickConstant6; sqInt quickConstant7; + sqInt quickConstant8; + sqInt quickConstant9; nSlotsOrBytesReg = ClassReg; /* begin genLoadArgAtDepth:into: */ @@ -17994,19 +17995,19 @@ genPrimitiveAtPut(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction15 = genoperandoperand(SubCqR, 1, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(1)); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); } # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant7 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction17 = genoperandoperand(TstCqR, quickConstant7, TempReg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(quickConstant7)); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -18018,21 +18019,21 @@ genPrimitiveAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ - quickConstant = weakArrayFormat(); + quickConstant1 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); } /* begin JumpAbove: */ jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); /* begin CmpCq:R: */ - quickConstant1 = arrayFormat(); + quickConstant2 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant2)); } /* begin JumpBelow: */ jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); @@ -18043,11 +18044,11 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction3 = genoperandoperand(AddCqR, operandOne, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(operandOne)); + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(AddCqR, quickConstant3, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant3)); } /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); @@ -18060,9 +18061,9 @@ genPrimitiveAtPut(void) jmpTarget(jumpHasFixedFields, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(ClassMethodContextCompactIndex)); + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(ClassMethodContextCompactIndex)); } /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -18074,20 +18075,20 @@ genPrimitiveAtPut(void) genoperand(PopR, nSlotsOrBytesReg); genConvertSmallIntegerToIntegerInReg(formatReg); /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant4 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(AndCqR, quickConstant2, formatReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(quickConstant2)); + anInstruction8 = genoperandoperand(AndCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant4)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin AddCq:R: */ - operandOne1 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction6 = genoperandoperand(AddCqR, operandOne1, formatReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(operandOne1)); + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AddCqR, quickConstant5, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant5)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); @@ -18107,29 +18108,29 @@ genPrimitiveAtPut(void) /* begin genJumpNotSmallInteger:scratchReg: */ jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); /* begin CmpCq:R: */ - quickConstant3 = firstByteFormat(); + quickConstant6 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant3, formatReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(quickConstant3)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant6)); } /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstShortFormat(); + quickConstant7 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(CmpCqR, quickConstant4, formatReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(quickConstant4)); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant7, formatReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant7)); } /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant8 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant5, formatReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(quickConstant5)); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant8, formatReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant8)); } /* begin JumpBelow: */ jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); @@ -18142,19 +18143,19 @@ genPrimitiveAtPut(void) genConvertSmallIntegerToIntegerInReg(TempReg); if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(0)); + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); } } /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin AddCq:R: */ - operandOne2 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction10 = genoperandoperand(AddCqR, operandOne2, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(operandOne2)); + quickConstant9 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant9, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant9)); } /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); @@ -18177,11 +18178,11 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstCompiledMethodFormat(); + quickConstant10 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(CmpCqR, quickConstant6, formatReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(quickConstant6)); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant10, formatReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant10)); } /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -18189,9 +18190,9 @@ genPrimitiveAtPut(void) methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin AddCq:R: */ - anInstruction12 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(BaseHeaderSize)); + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); @@ -18207,11 +18208,11 @@ genPrimitiveAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); /* begin AndCq:R: */ - operandOne3 = (BytesPerWord / 2) - 1; - /* begin checkQuickConstant:forInstruction: */ - anInstruction13 = genoperandoperand(AndCqR, operandOne3, formatReg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(operandOne3)); + quickConstant11 = (BytesPerWord / 2) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(AndCqR, quickConstant11, formatReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(quickConstant11)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); @@ -18227,9 +18228,9 @@ genPrimitiveAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction16 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(BaseHeaderSize)); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); @@ -18251,9 +18252,9 @@ genPrimitiveAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction14 = genoperandoperand(AddCqR, 1, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(1)); + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(1)); } genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); @@ -18364,7 +18365,6 @@ genPrimitiveMirrorNew(void) AbstractInstruction *jumpTooSmall; AbstractInstruction *jumpUnhashed; AbstractInstruction *jumpVariableOrEphemeron; - sqInt operandOne; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; @@ -18374,6 +18374,7 @@ genPrimitiveMirrorNew(void) sqInt quickConstant6; sqInt quickConstant7; sqInt quickConstant8; + sqInt quickConstant9; AbstractInstruction *skip; assert((methodNumArgs()) == 1); @@ -18394,19 +18395,19 @@ genPrimitiveMirrorNew(void) jumpImmediate = genJumpImmediate(Arg0Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction7 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant3)); } /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(InstanceSpecificationIndex + 1)); + anInstruction8 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(InstanceSpecificationIndex + 1)); } /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); @@ -18420,80 +18421,80 @@ genPrimitiveMirrorNew(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = fixedFieldsFieldWidth(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, TempReg); + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction9 = genoperandoperand(AndCqR, quickConstant4, TempReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant4)); } /* begin AndCq:R: */ - quickConstant3 = fixedFieldsOfClassFormatMask(); + quickConstant5 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant3)); + anInstruction10 = genoperandoperand(AndCqR, quickConstant5, instSpecReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant5)); } /* begin CmpCq:R: */ - quickConstant4 = nonIndexablePointerFormat(); + quickConstant6 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(quickConstant4)); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant6, TempReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant6)); } /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = numSlotsMask(); + quickConstant7 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(quickConstant5)); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant7)); } /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant6 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant6, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction11 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction6 = genoperandoperand(CmpCqR, 0, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(0)); + anInstruction13 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction12 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(BaseHeaderSize * 2)); + anInstruction1 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize * 2)); } /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(1)); + anInstruction14 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(1)); } /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - operandOne = BaseHeaderSize / BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction8 = genoperandoperand(AddCqR, operandOne, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(operandOne)); + quickConstant8 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction15 = genoperandoperand(AddCqR, quickConstant8, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(quickConstant8)); } /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); @@ -18501,11 +18502,11 @@ genPrimitiveMirrorNew(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant7 = getScavengeThreshold(); + quickConstant9 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(quickConstant7)); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(quickConstant9)); } /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -18516,37 +18517,37 @@ genPrimitiveMirrorNew(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction13 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(4)); + anInstruction2 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(4)); } /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction14 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(BaseHeaderSize)); + anInstruction3 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveCq:R: */ - quickConstant8 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction15 = genoperandoperand(MoveCqR, quickConstant8, fillReg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(quickConstant8)); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, fillReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); } /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(0)); + anInstruction5 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); } - fillLoop = anInstruction16; + fillLoop = anInstruction5; /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(4)); + anInstruction6 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(4)); } /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, 8, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(8)); + anInstruction17 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(8)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); @@ -18621,9 +18622,9 @@ genPrimitiveMirrorNewWithArg(void) AbstractInstruction *jumpTooSmall; AbstractInstruction *jumpUnhashed; sqInt maxSlots; - sqInt operandOne; sqInt quickConstant; sqInt quickConstant1; + sqInt quickConstant10; sqInt quickConstant2; sqInt quickConstant3; sqInt quickConstant4; @@ -18654,19 +18655,19 @@ genPrimitiveMirrorNewWithArg(void) jumpImmediate = genJumpImmediate(Arg0Reg); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(InstanceSpecificationIndex + 1)); + anInstruction9 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(InstanceSpecificationIndex + 1)); } /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant3)); } /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -18685,67 +18686,67 @@ genPrimitiveMirrorNewWithArg(void) checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, Arg1Reg)); genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = (fixedFieldsFieldWidth()) + 1; - genoperandoperand(LogicalShiftRightCqR, quickConstant1, instSpecReg); + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction11 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant4)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant3 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant3, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant4 = arrayFormat(); + quickConstant5 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant4)); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant5)); } /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstByteFormat(); + quickConstant6 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(quickConstant5)); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant6)); } /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstLongFormat(); + quickConstant7 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(quickConstant6)); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant7)); } /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant7 = (((usqInt)maxSlots << 1) | 1); + quickConstant8 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(quickConstant7)); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant8, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(quickConstant8)); } /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction14 = genoperand(PushCq, 0); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(0)); + anInstruction = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); @@ -18755,33 +18756,33 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction15 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(BytesPerWord)); + anInstruction1 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); } /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction16 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(BytesPerWord - 1)); } /* begin LogicalShiftLeftCq:R: */ - quickConstant8 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant8, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction17 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(BytesPerWord - 1)); } /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction16 = genoperand(PushCq, 0); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(0)); + anInstruction2 = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); @@ -18796,40 +18797,40 @@ genPrimitiveMirrorNewWithArg(void) checkLiteralforInstruction(wordConstant, genoperand(PushCw, wordConstant)); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(0)); + anInstruction3 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction9 = genoperandoperand(CmpCqR, 0, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(0)); + anInstruction18 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction18 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction18)) { - (anInstruction18->dependent = locateLiteral(BaseHeaderSize * 2)); + anInstruction4 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(BaseHeaderSize * 2)); } /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction10 = genoperandoperand(AndCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(1)); + anInstruction19 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(1)); } /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - operandOne = BaseHeaderSize / BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction11 = genoperandoperand(AddCqR, operandOne, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(operandOne)); + quickConstant9 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction20 = genoperandoperand(AddCqR, quickConstant9, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(quickConstant9)); } /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); @@ -18837,11 +18838,11 @@ genPrimitiveMirrorNewWithArg(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant9 = getScavengeThreshold(); + quickConstant10 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(quickConstant9)); + anInstruction21 = genoperandoperand(CmpCqR, quickConstant10, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction21)) { + (anInstruction21->dependent = locateLiteral(quickConstant10)); } /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -18852,34 +18853,34 @@ genPrimitiveMirrorNewWithArg(void) /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, byteSizeReg, address1)); /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction19)) { - (anInstruction19->dependent = locateLiteral(4)); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(4)); } /* begin PopR: */ genoperand(PopR, fillReg); /* begin PopR: */ genoperand(PopR, TempReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction20 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction20)) { - (anInstruction20->dependent = locateLiteral(BaseHeaderSize)); + anInstruction6 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:Mw:r: */ - anInstruction21 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction21)) { - (anInstruction21->dependent = locateLiteral(0)); + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); } - fillLoop = anInstruction21; + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction22)) { - (anInstruction22->dependent = locateLiteral(4)); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(4)); } /* begin AddCq:R: */ - anInstruction13 = genoperandoperand(AddCqR, 8, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(8)); + anInstruction22 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction22)) { + (anInstruction22->dependent = locateLiteral(8)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); @@ -18942,7 +18943,6 @@ genPrimitiveNew(void) AbstractInstruction *jumpTooBig; AbstractInstruction *jumpUnhashed; AbstractInstruction *jumpVariableOrEphemeron; - sqInt operandOne; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; @@ -18951,6 +18951,7 @@ genPrimitiveNew(void) sqInt quickConstant5; sqInt quickConstant6; sqInt quickConstant7; + sqInt quickConstant8; AbstractInstruction *skip; if (methodOrBlockNumArgs == 1) { @@ -18981,77 +18982,77 @@ genPrimitiveNew(void) quickConstant = fixedFieldsFieldWidth(); genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant1)); + anInstruction7 = genoperandoperand(AndCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant3)); } /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant4 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant2)); + anInstruction8 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant4)); } /* begin CmpCq:R: */ - quickConstant3 = nonIndexablePointerFormat(); + quickConstant5 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant3, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant3)); + anInstruction9 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant5)); } /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = numSlotsMask(); + quickConstant6 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant4)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant6)); } /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant5 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant5, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction9 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(0)); + anInstruction11 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction10 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(BaseHeaderSize * 2)); + anInstruction1 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize * 2)); } /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(1)); + anInstruction12 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(1)); } /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - operandOne = BaseHeaderSize / BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction6 = genoperandoperand(AddCqR, operandOne, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(operandOne)); + quickConstant7 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant7, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant7)); } /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); @@ -19059,11 +19060,11 @@ genPrimitiveNew(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant6 = getScavengeThreshold(); + quickConstant8 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant6, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(quickConstant6)); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant8)); } /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -19074,37 +19075,37 @@ genPrimitiveNew(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction11 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(4)); + anInstruction2 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(4)); } /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction12 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(BaseHeaderSize)); + anInstruction3 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveCq:R: */ - quickConstant7 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction13 = genoperandoperand(MoveCqR, quickConstant7, fillReg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(quickConstant7)); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, fillReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); } /* begin MoveR:Mw:r: */ - anInstruction14 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(0)); + anInstruction5 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); } - fillLoop = anInstruction14; + fillLoop = anInstruction5; /* begin MoveR:Mw:r: */ - anInstruction15 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(4)); + anInstruction6 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(4)); } /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, 8, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(8)); + anInstruction15 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(8)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); @@ -19174,7 +19175,6 @@ genPrimitiveNewWithArg(void) AbstractInstruction *jumpNoSpace; AbstractInstruction *jumpUnhashed; sqInt maxSlots; - sqInt operandOne; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; @@ -19184,6 +19184,7 @@ genPrimitiveNewWithArg(void) sqInt quickConstant6; sqInt quickConstant7; sqInt quickConstant8; + sqInt quickConstant9; AbstractInstruction *skip; sqInt wordConstant; @@ -19220,64 +19221,64 @@ genPrimitiveNewWithArg(void) quickConstant = (fixedFieldsFieldWidth()) + 1; genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, instSpecReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant1)); + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant3)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant2 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant3 = arrayFormat(); + quickConstant4 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant3, instSpecReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant3)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant4)); } /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstByteFormat(); + quickConstant5 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant4)); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant5)); } /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant6 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant5)); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant6)); } /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = (((usqInt)maxSlots << 1) | 1); + quickConstant7 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant6, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(quickConstant6)); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant7)); } /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction12 = genoperand(PushCq, 0); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(0)); + anInstruction = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); @@ -19287,33 +19288,33 @@ genPrimitiveNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction13 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(BytesPerWord)); + anInstruction1 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); } /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction14 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(BytesPerWord - 1)); } /* begin LogicalShiftLeftCq:R: */ - quickConstant7 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant7, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BytesPerWord - 1)); } /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction14 = genoperand(PushCq, 0); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(0)); + anInstruction2 = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); @@ -19328,40 +19329,40 @@ genPrimitiveNewWithArg(void) checkLiteralforInstruction(wordConstant, genoperand(PushCw, wordConstant)); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction15 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(0)); + anInstruction3 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction7 = genoperandoperand(CmpCqR, 0, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(0)); + anInstruction16 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction16 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(BaseHeaderSize * 2)); + anInstruction4 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(BaseHeaderSize * 2)); } /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(1)); + anInstruction17 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(1)); } /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - operandOne = BaseHeaderSize / BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction9 = genoperandoperand(AddCqR, operandOne, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(operandOne)); + quickConstant8 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction18 = genoperandoperand(AddCqR, quickConstant8, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(quickConstant8)); } /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); @@ -19369,11 +19370,11 @@ genPrimitiveNewWithArg(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant8 = getScavengeThreshold(); + quickConstant9 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction10 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(quickConstant8)); + anInstruction19 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(quickConstant9)); } /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -19384,32 +19385,32 @@ genPrimitiveNewWithArg(void) /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, byteSizeReg, address1)); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(4)); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(4)); } /* begin PopR: */ genoperand(PopR, fillReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction18 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction18)) { - (anInstruction18->dependent = locateLiteral(BaseHeaderSize)); + anInstruction6 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction19)) { - (anInstruction19->dependent = locateLiteral(0)); + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); } - fillLoop = anInstruction19; + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction20)) { - (anInstruction20->dependent = locateLiteral(4)); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(4)); } /* begin AddCq:R: */ - anInstruction11 = genoperandoperand(AddCqR, 8, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(8)); + anInstruction20 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(8)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); @@ -19466,7 +19467,6 @@ genPrimitiveShallowCopy(void) AbstractInstruction *jumpNoSpace; AbstractInstruction *jumpTooBig; AbstractInstruction *jumpVariable; - sqInt operandOne; sqInt ptrReg; sqInt quickConstant; sqInt quickConstant1; @@ -19474,6 +19474,7 @@ genPrimitiveShallowCopy(void) sqInt quickConstant3; sqInt quickConstant4; sqInt quickConstant5; + sqInt quickConstant6; sqInt resultReg; sqInt slotsReg; @@ -19490,18 +19491,18 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction9 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant)); } /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = indexablePointersFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant1)); } /* begin JumpZero: */ jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -19511,45 +19512,45 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant2 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant2)); } /* begin JumpZero: */ jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction3 = genoperandoperand(CmpCqR, 0, slotsReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(0)); + anInstruction12 = genoperandoperand(CmpCqR, 0, slotsReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(0)); } /* begin JumpZero: */ jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, slotsReg, TempReg); /* begin AndCq:R: */ - anInstruction4 = genoperandoperand(AndCqR, 1, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(1)); + anInstruction13 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(1)); } /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, slotsReg); /* begin AddCq:R: */ - operandOne = BaseHeaderSize / BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction5 = genoperandoperand(AddCqR, operandOne, slotsReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(operandOne)); + quickConstant3 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(AddCqR, quickConstant3, slotsReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant3)); } /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); /* begin AddR:R: */ genoperandoperand(AddRR, resultReg, slotsReg); /* begin CmpCq:R: */ - quickConstant3 = getScavengeThreshold(); + quickConstant4 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(quickConstant3)); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant4, slotsReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(quickConstant4)); } /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -19560,75 +19561,75 @@ genPrimitiveShallowCopy(void) /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, slotsReg, address1)); /* begin SubCq:R: */ - anInstruction12 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(BytesPerWord * 2)); + anInstruction = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BytesPerWord * 2)); } /* begin MoveMw:r:R: */ - anInstruction13 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction13)) { - (anInstruction13->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin AndCq:R: */ - quickConstant4 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); + quickConstant5 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(AndCqR, quickConstant4, TempReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(quickConstant4)); + anInstruction16 = genoperandoperand(AndCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(quickConstant5)); } /* begin MoveR:Mw:r: */ - anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(0)); + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(BytesPerWord)); + anInstruction3 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BytesPerWord)); } /* begin AndCq:R: */ - quickConstant5 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); + quickConstant6 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(AndCqR, quickConstant5, TempReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(quickConstant5)); + anInstruction17 = genoperandoperand(AndCqR, quickConstant6, TempReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(quickConstant6)); } /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(BytesPerWord)); + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(BytesPerWord)); } /* begin Label */ copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(BytesPerWord * 2)); + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(BytesPerWord * 2)); } /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(BytesPerWord * 2)); + anInstruction19 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(BytesPerWord * 2)); } /* begin MoveMw:r:R: */ - anInstruction17 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(0)); + anInstruction5 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); } /* begin MoveR:Mw:r: */ - anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); - if (usesOutOfLineLiteral(anInstruction18)) { - (anInstruction18->dependent = locateLiteral(0)); + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(0)); } /* begin MoveMw:r:R: */ - anInstruction19 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction19)) { - (anInstruction19->dependent = locateLiteral(BytesPerWord)); + anInstruction7 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(BytesPerWord)); } /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); - if (usesOutOfLineLiteral(anInstruction20)) { - (anInstruction20->dependent = locateLiteral(BytesPerWord)); + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(BytesPerWord)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, ptrReg, slotsReg); @@ -19643,9 +19644,9 @@ genPrimitiveShallowCopy(void) jmpTarget(jumpVariable, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - anInstruction11 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(ClassMethodContextCompactIndex)); + anInstruction20 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(ClassMethodContextCompactIndex)); } /* begin JumpNonZero: */ genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); @@ -19662,8 +19663,8 @@ genPrimitiveShallowCopy(void) static sqInt genPrimitiveStringAt(void) { + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; AbstractInstruction *anInstruction5; @@ -19682,11 +19683,11 @@ genPrimitiveStringAt(void) AbstractInstruction *jumpWordsDone; AbstractInstruction *jumpWordsOutOfBounds; AbstractInstruction *jumpWordTooBig; - sqInt operandOne; - sqInt operandOne1; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; /* begin genLoadArgAtDepth:into: */ assert(0 < (numRegArgs())); @@ -19696,36 +19697,36 @@ genPrimitiveStringAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 1, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(1)); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); } genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant)); } /* begin JumpGreaterOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); } /* begin JumpGreaterOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant2 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, formatReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant2)); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant2)); } /* begin JumpLess: */ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); @@ -19734,11 +19735,11 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction4 = genoperandoperand(AddCqR, operandOne, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(operandOne)); + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant3)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); @@ -19749,9 +19750,9 @@ genPrimitiveStringAt(void) jumpWordsDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(BytesPerWord - 1)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); @@ -19760,9 +19761,9 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(BaseHeaderSize)); + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveXbr:R:R: */ genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); @@ -19774,11 +19775,11 @@ genPrimitiveStringAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); /* begin AndCq:R: */ - operandOne1 = (BytesPerWord / 1) - 1; - /* begin checkQuickConstant:forInstruction: */ - anInstruction7 = genoperandoperand(AndCqR, operandOne1, formatReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(operandOne1)); + quickConstant4 = (BytesPerWord / 1) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant4)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); @@ -19789,9 +19790,9 @@ genPrimitiveStringAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(BaseHeaderSize)); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); } /* begin Jump: */ genoperand(Jump, ((sqInt)done)); @@ -19835,13 +19836,13 @@ genPrimitiveStringAtPut(void) AbstractInstruction *jumpShortsOutOfRange; AbstractInstruction *jumpWordsOutOfBounds; AbstractInstruction *jumpWordsOutOfRange; - sqInt operandOne; - sqInt operandOne1; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; sqInt quickConstant3; sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; /* begin genLoadArgAtDepth:into: */ assert(1 < (numRegArgs())); @@ -19853,19 +19854,19 @@ genPrimitiveStringAtPut(void) jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction10 = genoperandoperand(SubCqR, 1, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(1)); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); } # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant4 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(TstCqR, quickConstant4, TempReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(quickConstant4)); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -19877,45 +19878,45 @@ genPrimitiveStringAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - quickConstant = firstLongFormat(); + quickConstant1 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); } /* begin JumpBelow: */ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant1 = firstCompiledMethodFormat(); + quickConstant2 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); } /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant2 = firstByteFormat(); + quickConstant3 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant3)); } /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant3 = firstShortFormat(); + quickConstant4 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant3)); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant4)); } /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(0)); + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); } /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); @@ -19927,11 +19928,11 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction5 = genoperandoperand(AddCqR, operandOne, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(operandOne)); + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AddCqR, quickConstant5, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant5)); } /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); @@ -19947,11 +19948,11 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); /* begin AndCq:R: */ - operandOne1 = (BytesPerWord / 2) - 1; - /* begin checkQuickConstant:forInstruction: */ - anInstruction6 = genoperandoperand(AndCqR, operandOne1, formatReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(operandOne1)); + quickConstant6 = (BytesPerWord / 2) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant6)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); @@ -19965,9 +19966,9 @@ genPrimitiveStringAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction11 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(BaseHeaderSize)); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); @@ -19981,9 +19982,9 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(BytesPerWord - 1)); + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(BytesPerWord - 1)); } /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); @@ -19995,9 +19996,9 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(BaseHeaderSize)); + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(BaseHeaderSize)); } /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); @@ -20015,9 +20016,9 @@ genPrimitiveStringAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(1)); + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(1)); } genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); @@ -20241,7 +20242,6 @@ genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt s usqLong newFloatHeader; sqInt quickConstant; sqInt quickConstant1; - sqInt quickConstant2; allocSize = BaseHeaderSize + (sizeof(double)); newFloatHeader = headerForSlotsformatclassIndex((sizeof(double)) / BytesPerWord, firstLongFormat(), ClassFloatCompactIndex); @@ -20250,16 +20250,16 @@ genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt s /* begin gen:literal:operand: */ checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, resultReg)); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction1 = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(allocSize)); + anInstruction = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(allocSize)); } /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant1 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, scratch1); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant1, scratch1); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant1)); } /* begin JumpAboveOrEqual: */ jumpFail = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -20268,33 +20268,31 @@ genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt s /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, scratch1, address1)); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) newFloatHeader); + quickConstant = ((usqInt) newFloatHeader); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(MoveCqR, quickConstant1, scratch1); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, scratch1); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant)); } /* begin MoveR:Mw:r: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (newFloatHeader >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, scratch1); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(quickConstant2)); + anInstruction2 = genoperandoperand(MoveCqR, newFloatHeader >> 32, scratch1); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(newFloatHeader >> 32)); } /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(4)); + anInstruction3 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); } /* begin MoveRd:M64:r: */ - anInstruction6 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(BaseHeaderSize)); + anInstruction5 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(BaseHeaderSize)); } return jumpFail; } @@ -20414,16 +20412,16 @@ genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) /* begin Label */ loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -20461,16 +20459,16 @@ genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, Abst but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -20514,24 +20512,24 @@ genEnsureOopInRegNotForwardedscratchRegupdatingMwr(sqInt reg, sqInt scratch, sqI but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); @@ -20576,16 +20574,16 @@ genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -20593,9 +20591,9 @@ genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, /* begin MoveR:Mw:r: */ offset = (index * BytesPerWord) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, offset, objReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, offset, objReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } assert((reg == Arg0Reg) && ((scratch == TempReg) @@ -20670,6 +20668,7 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; AbstractInstruction *anInstruction15; AbstractInstruction *anInstruction16; @@ -20696,7 +20695,6 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction35; AbstractInstruction *anInstruction36; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; @@ -20716,8 +20714,6 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) sqInt offset4; sqInt offset5; sqInt offset6; - sqInt operandOne; - sqInt operandOne1; sqInt quickConstant; sqInt quickConstant1; sqInt quickConstant2; @@ -20726,65 +20722,66 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) sqInt quickConstant5; sqInt quickConstant6; sqInt quickConstant7; + sqInt quickConstant8; AbstractInstruction * self_in_saveAndRestoreLinkRegAround; sqInt slotSize; /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ /* begin MoveMw:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); - if (usesOutOfLineLiteral(anInstruction14)) { - (anInstruction14->dependent = locateLiteral(FoxMethod)); + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(FoxMethod)); } gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); /* begin JumpZero: */ jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction15)) { - (anInstruction15->dependent = locateLiteral(FoxThisContext)); + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(FoxThisContext)); } /* begin RetN: */ genoperand(RetN, 0); jmpTarget(jumpSingle, gLabel()); /* begin OrCq:R: */ - anInstruction16 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); - if (usesOutOfLineLiteral(anInstruction16)) { - (anInstruction16->dependent = locateLiteral(MFMethodFlagHasContextFlag)); + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(MFMethodFlagHasContextFlag)); } /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); - if (usesOutOfLineLiteral(anInstruction17)) { - (anInstruction17->dependent = locateLiteral(FoxMethod)); + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(FoxMethod)); } switch (isInBlock) { case InFullBlock: /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 3, ClassReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(3)); + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); } break; case InVanillaBlock: /* begin SubCq:R: */ - anInstruction9 = genoperandoperand(SubCqR, 3, ClassReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(3)); + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(3)); } /* begin MoveM16:r:R: */ - anInstruction10 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(0)); + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } /* begin SubR:R: */ genoperandoperand(SubRR, TempReg, ClassReg); break; case 0: /* begin SubCq:R: */ - anInstruction11 = genoperandoperand(SubCqR, 1, ClassReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(1)); + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(1)); } break; default: @@ -20800,48 +20797,46 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin gen:literal:operand: */ checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant4 = ((usqInt) header); + quickConstant2 = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction18 = genoperandoperand(MoveCqR, quickConstant4, TempReg); - if (usesOutOfLineLiteral(anInstruction18)) { - (anInstruction18->dependent = locateLiteral(quickConstant4)); + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant2)); } /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction19)) { - (anInstruction19->dependent = locateLiteral(0)); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(0)); } /* begin MoveCq:R: */ - quickConstant5 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction20 = genoperandoperand(MoveCqR, quickConstant5, TempReg); - if (usesOutOfLineLiteral(anInstruction20)) { - (anInstruction20->dependent = locateLiteral(quickConstant5)); + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction21)) { + (anInstruction21->dependent = locateLiteral(header >> 32)); } /* begin MoveR:Mw:r: */ - anInstruction21 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction21)) { - (anInstruction21->dependent = locateLiteral(4)); + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction31)) { + (anInstruction31->dependent = locateLiteral(4)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, ReceiverResultReg, TempReg); /* begin AddCq:R: */ - quickConstant = smallObjectBytesForSlots(slotSize); + quickConstant5 = smallObjectBytesForSlots(slotSize); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AddCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant)); + anInstruction29 = genoperandoperand(AddCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction29)) { + (anInstruction29->dependent = locateLiteral(quickConstant5)); } /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); /* begin CmpCq:R: */ - quickConstant1 = getScavengeThreshold(); + quickConstant6 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction30 = genoperandoperand(CmpCqR, quickConstant6, TempReg); + if (usesOutOfLineLiteral(anInstruction30)) { + (anInstruction30->dependent = locateLiteral(quickConstant6)); } /* begin JumpAboveOrEqual: */ jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -20851,55 +20846,55 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveR:Mw:r: */ offset = BaseHeaderSize + (SenderIndex * BytesPerOop); /* begin gen:operand:quickConstant:operand: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction22)) { - (anInstruction22->dependent = locateLiteral(offset)); + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(offset)); } /* begin MoveMw:r:R: */ - anInstruction23 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); - if (usesOutOfLineLiteral(anInstruction23)) { - (anInstruction23->dependent = locateLiteral(FoxSavedFP)); + anInstruction13 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(FoxSavedFP)); } genSetSmallIntegerTagsIn(TempReg); /* begin MoveR:Mw:r: */ offset1 = BaseHeaderSize + (InstructionPointerIndex * BytesPerOop); /* begin gen:operand:quickConstant:operand: */ - anInstruction24 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction24)) { - (anInstruction24->dependent = locateLiteral(offset1)); + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(offset1)); } /* begin MoveMw:r:R: */ offset2 = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction25 = genoperandoperandoperand(MoveMwrR, offset2, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction25)) { - (anInstruction25->dependent = locateLiteral(offset2)); + anInstruction15 = genoperandoperandoperand(MoveMwrR, offset2, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(offset2)); } /* begin MoveR:Mw:r: */ offset3 = BaseHeaderSize + (MethodIndex * BytesPerWord); /* begin gen:operand:quickConstant:operand: */ - anInstruction26 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction26)) { - (anInstruction26->dependent = locateLiteral(offset3)); + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(offset3)); } /* begin MoveR:Mw:r: */ - anInstruction27 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); - if (usesOutOfLineLiteral(anInstruction27)) { - (anInstruction27->dependent = locateLiteral(FoxThisContext)); + anInstruction17 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(FoxThisContext)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, SPReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant2 = 2; - genoperandoperand(LogicalShiftRightCqR, quickConstant2, TempReg); + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin SubCq:R: */ - quickConstant6 = 3; + quickConstant3 = 3; /* begin gen:quickConstant:operand: */ - anInstruction28 = genoperandoperand(SubCqR, quickConstant6, TempReg); - if (usesOutOfLineLiteral(anInstruction28)) { - (anInstruction28->dependent = locateLiteral(quickConstant6)); + anInstruction18 = genoperandoperand(SubCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(quickConstant3)); } /* begin AddR:R: */ genoperandoperand(AddRR, SendNumArgsReg, TempReg); @@ -20907,17 +20902,17 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveR:Mw:r: */ offset4 = BaseHeaderSize + (StackPointerIndex * BytesPerOop); /* begin gen:operand:quickConstant:operand: */ - anInstruction29 = genoperandoperandoperand(MoveRMwr, TempReg, offset4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction29)) { - (anInstruction29->dependent = locateLiteral(offset4)); + anInstruction19 = genoperandoperandoperand(MoveRMwr, TempReg, offset4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(offset4)); } if (isInBlock > 0) { /* begin MoveR:R: */ genoperandoperand(MoveRR, SendNumArgsReg, TempReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 2, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(2)); + anInstruction27 = genoperandoperand(AddCqR, 2, TempReg); + if (usesOutOfLineLiteral(anInstruction27)) { + (anInstruction27->dependent = locateLiteral(2)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); @@ -20930,35 +20925,35 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) } else { /* begin MoveCq:R: */ - anInstruction36 = genoperandoperand(MoveCqR, constant, TempReg); - if (usesOutOfLineLiteral(anInstruction36)) { - (anInstruction36->dependent = locateLiteral(constant)); + anInstruction28 = genoperandoperand(MoveCqR, constant, TempReg); + if (usesOutOfLineLiteral(anInstruction28)) { + (anInstruction28->dependent = locateLiteral(constant)); } } } /* begin MoveR:Mw:r: */ offset5 = BaseHeaderSize + (ClosureIndex * BytesPerOop); /* begin gen:operand:quickConstant:operand: */ - anInstruction30 = genoperandoperandoperand(MoveRMwr, TempReg, offset5, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction30)) { - (anInstruction30->dependent = locateLiteral(offset5)); + anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, offset5, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(offset5)); } /* begin MoveMw:r:R: */ - anInstruction31 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); - if (usesOutOfLineLiteral(anInstruction31)) { - (anInstruction31->dependent = locateLiteral(FoxMFReceiver)); + anInstruction22 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction22)) { + (anInstruction22->dependent = locateLiteral(FoxMFReceiver)); } /* begin MoveR:Mw:r: */ offset6 = BaseHeaderSize + (ReceiverIndex * BytesPerOop); /* begin gen:operand:quickConstant:operand: */ - anInstruction32 = genoperandoperandoperand(MoveRMwr, TempReg, offset6, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction32)) { - (anInstruction32->dependent = locateLiteral(offset6)); + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, offset6, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction23)) { + (anInstruction23->dependent = locateLiteral(offset6)); } /* begin MoveCq:R: */ - anInstruction33 = genoperandoperand(MoveCqR, 1, ClassReg); - if (usesOutOfLineLiteral(anInstruction33)) { - (anInstruction33->dependent = locateLiteral(1)); + anInstruction24 = genoperandoperand(MoveCqR, 1, ClassReg); + if (usesOutOfLineLiteral(anInstruction24)) { + (anInstruction24->dependent = locateLiteral(1)); } /* begin CmpR:R: */ loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); @@ -20969,59 +20964,59 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin SubR:R: */ genoperandoperand(SubRR, ClassReg, TempReg); /* begin AddCq:R: */ - anInstruction3 = genoperandoperand(AddCqR, 2, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(2)); + anInstruction32 = genoperandoperand(AddCqR, 2, TempReg); + if (usesOutOfLineLiteral(anInstruction32)) { + (anInstruction32->dependent = locateLiteral(2)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); /* begin AddCq:R: */ - operandOne = ReceiverIndex + (BaseHeaderSize / BytesPerWord); - /* begin checkQuickConstant:forInstruction: */ - anInstruction4 = genoperandoperand(AddCqR, operandOne, ClassReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(operandOne)); + quickConstant7 = ReceiverIndex + (BaseHeaderSize / BytesPerWord); + /* begin gen:quickConstant:operand: */ + anInstruction33 = genoperandoperand(AddCqR, quickConstant7, ClassReg); + if (usesOutOfLineLiteral(anInstruction33)) { + (anInstruction33->dependent = locateLiteral(quickConstant7)); } /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); /* begin SubCq:R: */ - quickConstant7 = (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1; + quickConstant4 = (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1; /* begin gen:quickConstant:operand: */ - anInstruction34 = genoperandoperand(SubCqR, quickConstant7, ClassReg); - if (usesOutOfLineLiteral(anInstruction34)) { - (anInstruction34->dependent = locateLiteral(quickConstant7)); + anInstruction25 = genoperandoperand(SubCqR, quickConstant4, ClassReg); + if (usesOutOfLineLiteral(anInstruction25)) { + (anInstruction25->dependent = locateLiteral(quickConstant4)); } /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); jmpTarget(exit, gLabel()); /* begin MoveCq:R: */ - quickConstant3 = nilObject(); + quickConstant1 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(MoveCqR, quickConstant3, TempReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(quickConstant3)); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, ClassReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(FoxMFReceiver)); + anInstruction34 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + if (usesOutOfLineLiteral(anInstruction34)) { + (anInstruction34->dependent = locateLiteral(FoxMFReceiver)); } /* begin AddCq:R: */ - operandOne1 = (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord); - /* begin checkQuickConstant:forInstruction: */ - anInstruction6 = genoperandoperand(AddCqR, operandOne1, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(operandOne1)); + quickConstant8 = (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord); + /* begin gen:quickConstant:operand: */ + anInstruction35 = genoperandoperand(AddCqR, quickConstant8, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction35)) { + (anInstruction35->dependent = locateLiteral(quickConstant8)); } /* begin SubCq:R: */ - anInstruction35 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); - if (usesOutOfLineLiteral(anInstruction35)) { - (anInstruction35->dependent = locateLiteral(BytesPerWord)); + anInstruction26 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + if (usesOutOfLineLiteral(anInstruction26)) { + (anInstruction26->dependent = locateLiteral(BytesPerWord)); } - loopHead = anInstruction35; + loopHead = anInstruction26; /* begin CmpR:R: */ genoperandoperand(CmpRR, SPReg, ClassReg); /* begin JumpBelow: */ @@ -21030,9 +21025,9 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, 1, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(1)); + anInstruction36 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction36)) { + (anInstruction36->dependent = locateLiteral(1)); } /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); @@ -21126,14 +21121,14 @@ genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(3)); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, mask, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(mask)); + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(mask)); } return 0; } @@ -21150,16 +21145,16 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } return 0; } @@ -21173,13 +21168,13 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) { - AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; sqInt offset; - sqInt operandOne; - sqInt quickConstant1; + sqInt quickConstant; sqInt quickConstant2; + sqInt quickConstant3; assert(instReg != destReg); assert(instReg != scratchReg); @@ -21187,17 +21182,17 @@ genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt /* begin MoveR:R: */ genoperandoperand(MoveRR, instReg, scratchReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = classTableMajorIndexShift(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, scratchReg); + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); assert(!(shouldAnnotateObjectReference(classTableRootObj()))); /* begin MoveMw:r:R: */ offset = (classTableRootObj()) + BaseHeaderSize; /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(offset)); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); } /* begin MoveR:R: */ @@ -21205,16 +21200,16 @@ genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt /* begin AndCq:R: */ quickConstant2 = classTableMinorIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, scratchReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant2)); + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant2)); } /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction2 = genoperandoperand(AddCqR, operandOne, scratchReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(operandOne)); + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(AddCqR, quickConstant3, scratchReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant3)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); @@ -21251,24 +21246,24 @@ genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, /* begin AndCq:R: */ quickConstant1 = tagMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant1, scratchReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); } /* begin JumpNonZero: */ jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant2 = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, scratchReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant2)); + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); } if (!instRegIsReceiver) { @@ -21276,16 +21271,16 @@ genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, /* begin CmpCq:R: */ quickConstant = isForwardedObjectClassIndexPun(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, scratchReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(BaseHeaderSize)); + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BaseHeaderSize)); } /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); @@ -21370,16 +21365,16 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s if (scratchRegOrNone == NoReg) { flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(3)); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); } } else { /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin MoveR:R: */ genoperandoperand(MoveRR, destReg, scratchRegOrNone); @@ -21390,9 +21385,9 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s /* begin AndCq:R: */ quickConstant1 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant1)); + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant1)); } return 0; } @@ -21568,7 +21563,6 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) sqInt offset1; sqInt quickConstant; sqInt quickConstant1; - sqInt quickConstant2; AbstractInstruction *skip; assert(size < (numSlotsMask())); @@ -21578,28 +21572,26 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) /* begin gen:literal:operand: */ checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(MoveCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant1)); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant)); } /* begin MoveR:Mw:r: */ - anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(MoveCqR, quickConstant2, TempReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(quickConstant2)); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(header >> 32)); } /* begin MoveR:Mw:r: */ - anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(4)); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); } if (initialized && (size > 0)) { @@ -21610,38 +21602,38 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) } else { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, constant, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(constant)); + anInstruction6 = genoperandoperand(MoveCqR, constant, TempReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(constant)); } } for (i = 0; i < size; i += 1) { /* begin MoveR:Mw:r: */ offset = (i * BytesPerWord) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); } } } /* begin LoadEffectiveAddressMw:r:R: */ offset1 = smallObjectBytesForSlots(size); /* begin gen:quickConstant:operand:operand: */ - anInstruction7 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset1, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(offset1)); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset1, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset1)); } /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant1 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction7 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant1)); } /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); @@ -21685,7 +21677,6 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq sqInt quickConstant1; sqInt quickConstant2; sqInt quickConstant3; - sqInt quickConstant4; AbstractInstruction *skip; @@ -21701,44 +21692,42 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq /* begin gen:literal:operand: */ checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction = genoperandoperand(MoveCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); } /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(MoveCqR, quickConstant2, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant2)); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(header >> 32)); } /* begin MoveR:Mw:r: */ - anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(4)); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); } /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(byteSize)); + anInstruction4 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(byteSize)); } /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant3 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant3)); } /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); @@ -21749,37 +21738,37 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq /* begin MoveR:Mw:r: */ offset = (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction6 = genoperandoperandoperand(MoveRMwr, ClassReg, offset, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(offset)); + anInstruction5 = genoperandoperandoperand(MoveRMwr, ClassReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset)); } /* begin MoveCq:R: */ - quickConstant3 = (((usqInt)bcpc << 1) | 1); + quickConstant1 = (((usqInt)bcpc << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(MoveCqR, quickConstant3, TempReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(quickConstant3)); + anInstruction6 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant1)); } /* begin MoveR:Mw:r: */ offset1 = (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(offset1)); + anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(offset1)); } /* begin MoveCq:R: */ - quickConstant4 = (((usqInt)numArgs << 1) | 1); + quickConstant2 = (((usqInt)numArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(MoveCqR, quickConstant4, TempReg); - if (usesOutOfLineLiteral(anInstruction9)) { - (anInstruction9->dependent = locateLiteral(quickConstant4)); + anInstruction8 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant2)); } /* begin MoveR:Mw:r: */ offset2 = (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction10)) { - (anInstruction10->dependent = locateLiteral(offset2)); + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(offset2)); } return 0; } @@ -21899,9 +21888,9 @@ genPrimitiveObjectAt(void) AbstractInstruction *jumpBadIndex; AbstractInstruction *jumpBounds; AbstractInstruction *jumpNotHeaderIndex; - sqInt operandOne; sqInt quickConstant; sqInt quickConstant1; + sqInt quickConstant2; /* begin genLoadArgAtDepth:into: */ assert(0 < (numRegArgs())); @@ -21909,11 +21898,11 @@ genPrimitiveObjectAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); /* begin CmpCq:R: */ - quickConstant = (((usqInt)1 << 1) | 1); + quickConstant1 = (((usqInt)1 << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); } /* begin JumpNonZero: */ jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -21925,11 +21914,11 @@ genPrimitiveObjectAt(void) genoperand(RetN, 0); jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); /* begin SubCq:R: */ - quickConstant1 = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(SubCqR, quickConstant1, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant1)); + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); } /* begin CmpR:R: */ genoperandoperand(CmpRR, headerReg, Arg0Reg); @@ -21937,11 +21926,11 @@ genPrimitiveObjectAt(void) jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin AddCq:R: */ - operandOne = ((usqInt) BaseHeaderSize) >> (shiftForWord()); - /* begin checkQuickConstant:forInstruction: */ - anInstruction1 = genoperandoperand(AddCqR, operandOne, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(operandOne)); + quickConstant2 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant2)); } /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); @@ -22323,8 +22312,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ offset = (index * BytesPerWord) + BaseHeaderSize; @@ -22369,8 +22358,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -22408,9 +22397,9 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin genStoreTrampolineCall: */ if (index >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, index, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(index)); + anInstruction = genoperandoperand(MoveCqR, index, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(index)); } /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); @@ -22422,8 +22411,8 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -22436,15 +22425,15 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ offset = (index * BytesPerWord) + BaseHeaderSize; /* begin gen:operand:quickConstant:operand: */ - anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } jmpTarget(immutabilityFailure, gLabel()); return 0; @@ -23279,11 +23268,11 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse } else { /* begin PushCq: */ - anInstruction = genoperand(PushCq, constant); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant)); + anInstruction1 = genoperand(PushCq, constant); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); } - inst = anInstruction; + inst = anInstruction1; } } else { @@ -23292,9 +23281,9 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse offset = (self_in_ensureSpilledAtfrom->offset); baseReg = (self_in_ensureSpilledAtfrom->registerr); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(offset)); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); } /* begin PushR: */ inst = genoperand(PushR, TempReg); @@ -23684,14 +23673,6 @@ locateLiteral(sqInt aLiteral) return litInst; } - /* OutOfLineLiteralsManager>>#mustDumpLiterals: */ -static sqInt NoDbgRegParms -mustDumpLiterals(sqInt currentOpcodeIndex) -{ - return (currentOpcodeIndex >= firstOpcodeIndex) - && ((currentOpcodeIndex - firstOpcodeIndex) >= (outOfLineLiteralOpcodeLimit(backEnd()))); -} - /* OutOfLineLiteralsManager>>#resetForBlockCompile */ static sqInt resetForBlockCompile(void) @@ -23768,9 +23749,9 @@ compileGetErrorCode(void) checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin JumpZero: */ jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -23790,9 +23771,9 @@ compileGetErrorCode(void) genoperandoperand(MoveRR, TempReg, ClassReg); jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin MoveR:Aw: */ address1 = primFailCodeAddress(); @@ -23822,12 +23803,12 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) sqInt address6; sqInt address8; sqInt address9; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; AbstractInstruction *anInstruction5; - AbstractInstruction *anInstruction6; - AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; sqInt callTarget; sqInt callTarget1; @@ -23874,9 +23855,9 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); } /* begin MoveCq:R: */ - anInstruction8 = genoperandoperand(MoveCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction8)) { - (anInstruction8->dependent = locateLiteral(0)); + anInstruction5 = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); } /* begin MoveR:Aw: */ address11 = primFailCodeAddress(); @@ -23884,9 +23865,9 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) checkLiteralforInstruction(address11, genoperandoperand(MoveRAw, TempReg, address11)); if (methodOrBlockNumArgs != 0) { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(methodOrBlockNumArgs)); + anInstruction = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(methodOrBlockNumArgs)); } } /* begin MoveR:Aw: */ @@ -23911,9 +23892,9 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } /* begin MoveR:Aw: */ address4 = newMethodAddress(); @@ -23981,18 +23962,18 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) checkLiteralforInstruction(address9, genoperandoperand(MoveAwR, address9, TempReg)); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(0)); + anInstruction8 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ offset1 = 0; /* begin gen:quickConstant:operand:operand: */ - anInstruction5 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(offset1)); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); } /* begin RetN: */ genoperand(RetN, BytesPerWord); @@ -24015,9 +23996,9 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) } jmpTarget(jmpSampleNonPrim, gLabel()); /* begin MoveCq:R: */ - anInstruction6 = genoperandoperand(MoveCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(0)); + anInstruction3 = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); } /* begin MoveR:Aw: */ address10 = newMethodAddress(); @@ -24038,9 +24019,9 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset2 = BytesPerWord * (methodOrBlockNumArgs + (0)); /* begin gen:quickConstant:operand:operand: */ - anInstruction7 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(offset2)); + anInstruction4 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(offset2)); } } return 0; @@ -24076,26 +24057,26 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); } if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(offset)); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); } } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); } } annotateobjRef(gCmpCwR(selector, TempReg), selector); @@ -24105,16 +24086,16 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(offset1)); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); } } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); } } /* begin CmpR:R: */ @@ -24131,7 +24112,7 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh static void NoDbgRegParms compileOpenPICnumArgs(sqInt selector, sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -24154,18 +24135,18 @@ compileOpenPICnumArgs(sqInt selector, sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } - itsAHit = anInstruction2; + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); jumpBCMethod = genJumpImmediate(ClassReg); jmpTarget(jumpBCMethod, picInterpretAbort); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(cmNoCheckEntryOffset)); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(cmNoCheckEntryOffset)); } /* begin JumpR: */ genoperand(JumpR, ClassReg); @@ -24213,26 +24194,26 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); } if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(offset)); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); } } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); } } /* begin CmpR:R: */ @@ -24243,16 +24224,16 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(offset1)); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); } } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); } } /* begin CmpR:R: */ @@ -24476,6 +24457,7 @@ genExtJumpIfFalse(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(falseObject(), target); } @@ -24499,6 +24481,7 @@ genExtJumpIfTrue(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(trueObject(), target); } @@ -24511,7 +24494,7 @@ genExtJumpIfTrue(void) static sqInt genExtNopBytecode(void) { - extA = (extB = 0); + extA = (numExtB = (extB = 0)); return 0; } @@ -24530,6 +24513,7 @@ genExtPushIntegerBytecode(void) value = byte1 + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; return genPushLiteral((((usqInt)value << 1) | 1)); } @@ -24576,6 +24560,7 @@ genExtPushPseudoVariableOrOuterBytecode(void) ext = extB; extB = 0; + numExtB = 0; switch (ext) { case 0: @@ -24655,6 +24640,7 @@ genExtSendAbsentDynamicSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentDynamicSupernumArgs(litIndex, nArgs); } @@ -24674,6 +24660,7 @@ genExtSendAbsentImplicitBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentImplicitnumArgs(litIndex, nArgs); } @@ -24695,6 +24682,7 @@ genExtSendAbsentOuterBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byte2; return genSendAbsentOuternumArgsdepth(litIndex, nArgs, depth); } @@ -24715,6 +24703,7 @@ genExtSendAbsentSelfBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentSelfnumArgs(litIndex, nArgs); } @@ -24734,6 +24723,7 @@ genExtSendBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendnumArgs(litIndex, nArgs); } @@ -24757,6 +24747,7 @@ genExtSendSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return (isDirected ? genSendDirectedSupernumArgs(litIndex, nArgs) : genSendSupernumArgs(litIndex, nArgs)); @@ -24862,6 +24853,7 @@ genExtUnconditionalJump(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; if (distance < 0) { return genJumpBackTo(target); @@ -24892,7 +24884,7 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) { sqInt address; sqInt address1; - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt offset; sqInt wordConstant; @@ -24904,9 +24896,9 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) /* begin MoveR:R: */ genoperandoperand(MoveRR, r2, r1); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 1, r1); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(1)); + anInstruction2 = genoperandoperand(AddCqR, 1, r1); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(1)); } /* begin MoveR:Ab: */ address1 = primTraceLogIndexAddress(); @@ -24916,9 +24908,9 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, selector); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } /* begin MoveCw:R: */ wordConstant = ((sqInt)(primTraceLogAddress())); @@ -25018,7 +25010,7 @@ genLongUnconditionalForwardJump(void) static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -25041,19 +25033,19 @@ genLookupForPerformNumArgs(sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } - itsAHit = anInstruction2; + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); /* Adjust arguments and jump to the method's unchecked entry-point. */ jumpInterpret = genJumpImmediate(ClassReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(cmNoCheckEntryOffset)); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(cmNoCheckEntryOffset)); } adjustArgumentsForPerform(numArgs); /* begin JumpR: */ @@ -25120,9 +25112,9 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) sqInt address6; sqInt address7; sqInt address8; - AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; - AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction7; sqInt callTarget; AbstractInstruction *continuePostSample; AbstractInstruction * inst; @@ -25135,9 +25127,9 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveCq:R: */ quickConstant = varBaseAddress(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant)); + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); } if (profiling) { @@ -25167,9 +25159,9 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) checkLiteralforInstruction(address6, genoperandoperand(MoveAwR, address6, TempReg)); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction7 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -25195,9 +25187,9 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) checkLiteralforInstruction(address8, genoperandoperand(MoveAwR, address8, reg)); genLoadStackPointers(backEnd); /* begin MoveMw:r:R: */ - anInstruction6 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(0)); + anInstruction4 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(0)); } /* begin RetN: */ @@ -25642,7 +25634,7 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) CogBlockMethod *cogMethod1; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; sqInt errCode; CogMethod *homeMethod; sqInt isBackwardBranch; @@ -26518,14 +26510,14 @@ static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs) { AbstractInstruction *anInstruction; - AbstractInstruction *anInstruction11; - AbstractInstruction *anInstruction12; - AbstractInstruction *anInstruction2; - AbstractInstruction *anInstruction3; - AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; sqInt index; sqInt offset; - sqInt operandOne; + sqInt quickConstant; assert((numRegArgs()) <= 2); assert(numArgs >= 1); @@ -26538,44 +26530,44 @@ adjustArgumentsForPerform(sqInt numArgs) } if ((2 + 1) == numArgs) { /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(BytesPerWord)); + anInstruction1 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); } /* begin AddCq:R: */ - operandOne = (numArgs + 1) * BytesPerWord; - /* begin checkQuickConstant:forInstruction: */ - anInstruction = genoperandoperand(AddCqR, operandOne, SPReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(operandOne)); + quickConstant = (numArgs + 1) * BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant, SPReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant)); } return; } for (index = (numArgs - 2); index >= 0; index += -1) { /* begin MoveMw:r:R: */ - anInstruction11 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(index * BytesPerWord)); + anInstruction8 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(index * BytesPerWord)); } /* begin MoveR:Mw:r: */ offset = (index + 1) * BytesPerWord; /* begin gen:operand:quickConstant:operand: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(offset)); + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(offset)); } } /* begin AddCq:R: */ - anInstruction2 = genoperandoperand(AddCqR, BytesPerWord, SPReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(BytesPerWord)); + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BytesPerWord)); } } @@ -26698,7 +26690,8 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) /* begin assertExtsAreConsumed: */ if (!((descriptor->isExtension))) { assert((extA == 0) - && (extB == 0)); + && ((extB == 0) + && (numExtB == 0))); } traceDescriptor(descriptor); traceSimStack(); @@ -26714,12 +26707,14 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) (fixup->targetInstruction = abstractInstructionAt(nextOpcodeIndex)); } /* begin maybeDumpLiterals: */ - if ((mustDumpLiterals(opcodeIndex)) + if (((opcodeIndex >= firstOpcodeIndex) + && ((opcodeIndex - firstOpcodeIndex) >= (outOfLineLiteralOpcodeLimit(backEnd())))) || ((isUnconditionalBranch(descriptor)) || ((descriptor->isReturn)))) { dumpLiterals(!((isUnconditionalBranch(descriptor)) || ((descriptor->isReturn)))); } + /* begin nextBytecodePCFor:exts: */ bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) : 0)); @@ -26888,15 +26883,15 @@ compileBlockFrameBuild(BlockStart *blockStart) if (((blockStart->numInitialNils)) > 0) { if (((blockStart->numInitialNils)) > 1) { /* begin genMoveNilR: */ - constant1 = nilObject(); - if (shouldAnnotateObjectReference(constant1)) { - annotateobjRef(gMoveCwR(constant1, TempReg), constant1); + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant1, TempReg); + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant1)); + (anInstruction->dependent = locateLiteral(constant)); } } for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { @@ -26906,15 +26901,15 @@ compileBlockFrameBuild(BlockStart *blockStart) } else { /* begin genPushConstant: */ - constant = nilObject(); - if (shouldAnnotateObjectReference(constant)) { - annotateobjRef(gPushCw(constant), constant); + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); } else { /* begin PushCq: */ - anInstruction1 = genoperand(PushCq, constant); + anInstruction1 = genoperand(PushCq, constant1); if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(constant)); + (anInstruction1->dependent = locateLiteral(constant1)); } } } @@ -27134,9 +27129,9 @@ compileFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant)); + anInstruction1 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); } } /* begin PushR: */ @@ -27167,9 +27162,9 @@ compileFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); @@ -27254,10 +27249,10 @@ compileTwoPathFrameBuild(void) initSimStackForFramelessMethod(initialPC); /* begin compileMethodBody */ if (endPC < initialPC) { - goto l7; + goto l8; } compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); -l7: /* end compileMethodBody */; +l8: /* end compileMethodBody */; /* reset because it impacts inst var store compilation */ useTwoPaths = 0; @@ -27282,9 +27277,9 @@ compileTwoPathFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant)); + anInstruction1 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); } } /* begin PushR: */ @@ -27315,9 +27310,9 @@ compileTwoPathFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); @@ -27423,13 +27418,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction1 = gen(Nop); + abstractInstruction = gen(Nop); } else { /* begin Label */ - abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction1->annotation = HasBytecodePC); + (abstractInstruction->annotation = HasBytecodePC); return 0; } break; @@ -27438,13 +27433,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction2 = gen(Nop); + abstractInstruction1 = gen(Nop); } else { /* begin Label */ - abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction2->annotation = HasBytecodePC); + (abstractInstruction1->annotation = HasBytecodePC); return 0; case 4: @@ -27489,8 +27484,8 @@ doubleExtendedDoAnythingBytecode(void) assert(needsFrame); assert(!(prevInstIsPCAnnotated())); /* begin annotateBytecode: */ - abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction->annotation = HasBytecodePC); + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); return 0; } @@ -27781,7 +27776,7 @@ genExtPushClosureBytecode(void) assert(needsFrame); startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); - extA = (extB = 0); + extA = (numExtB = (extB = 0)); /* begin genInlineClosure:numArgs:numCopied: */ assert(getActiveContextAllocatesInMachineCode()); voidReceiverResultRegContainsSelf(); @@ -28047,9 +28042,9 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) popToReg(ssTop(), argReg1); if (((ssValue(1))->spilled)) { /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, BytesPerWord, SPReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(BytesPerWord)); + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BytesPerWord)); } } } @@ -28085,9 +28080,9 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant, rcvrReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant)); + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(constant)); } } } @@ -28100,9 +28095,9 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant1, argReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(constant1)); + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(constant1)); } } } @@ -28173,16 +28168,16 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm = genJumpImmediate(argReg); /* begin MoveMw:r:R: */ - anInstruction11 = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); - if (usesOutOfLineLiteral(anInstruction11)) { - (anInstruction11->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -28209,16 +28204,16 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm1 = genJumpImmediate(rcvrReg); /* begin MoveMw:r:R: */ - anInstruction12 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); - if (usesOutOfLineLiteral(anInstruction12)) { - (anInstruction12->dependent = locateLiteral(0)); + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); } /* begin AndCq:R: */ quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(quickConstant1)); + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant1)); } /* begin JumpNonZero: */ ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -28248,16 +28243,16 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC { AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; sqInt constant; sqInt constant1; + sqInt constant11; sqInt constant2; sqInt constant3; sqInt constant4; - sqInt constant5; AbstractInstruction *jumpEqual; AbstractInstruction *jumpNotEqual; AbstractInstruction *label; @@ -28276,24 +28271,24 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(constant4)); + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(constant4)); } } } else { if (rcvrIsConstant) { /* begin genCmpConstant:R: */ - constant5 = ((ssValue(1))->constant); - if (shouldAnnotateObjectReference(constant5)) { - annotateobjRef(gCmpCwR(constant5, argReg), constant5); + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant5, argReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(constant5)); + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(constant11)); } } } @@ -28322,9 +28317,9 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction2 = genoperandoperand(MoveCqR, constant, resultReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(constant)); + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); } } } @@ -28336,9 +28331,9 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, constant1, resultReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(constant1)); + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant1)); } } } @@ -28350,21 +28345,21 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC (shouldAnnotateObjectReference(constant2) ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) : (/* begin MoveCq:R: */ - (anInstruction4 = genoperandoperand(MoveCqR, constant2, resultReg)), - (usesOutOfLineLiteral(anInstruction4) - ? (anInstruction4->dependent = locateLiteral(constant2)) + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + (usesOutOfLineLiteral(anInstruction2) + ? (anInstruction2->dependent = locateLiteral(constant2)) : 0), - anInstruction4))) + anInstruction2))) : (/* begin genMoveTrueR: */ (constant3 = trueObject()), (shouldAnnotateObjectReference(constant3) ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) : (/* begin MoveCq:R: */ - (anInstruction5 = genoperandoperand(MoveCqR, constant3, resultReg)), - (usesOutOfLineLiteral(anInstruction5) - ? (anInstruction5->dependent = locateLiteral(constant3)) + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + (usesOutOfLineLiteral(anInstruction3) + ? (anInstruction3->dependent = locateLiteral(constant3)) : 0), - anInstruction5))))); + anInstruction3))))); jmpTarget(jumpNotEqual, gLabel()); ssPushRegister(resultReg); return 0; @@ -28486,9 +28481,9 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) } else { /* begin SubCq:R: */ - anInstruction1 = genoperandoperand(SubCqR, boolean, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(boolean)); + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(boolean)); } } /* begin JumpZero: */ @@ -28507,9 +28502,9 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) ? (trueObject()) - (falseObject()) : (falseObject()) - (trueObject())); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); } /* begin JumpZero: */ ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -28551,19 +28546,19 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen } if (sendTable == selfSendTrampolines) { annotation = IsNSSelfSend; - goto l2; + goto l1; } if (sendTable == dynamicSuperSendTrampolines) { annotation = IsNSDynamicSuperSend; - goto l2; + goto l1; } if (sendTable == superSendTrampolines) { annotation = IsSuperSend; - goto l2; + goto l1; } assert(sendTable == ordinarySendTrampolines); annotation = IsSendCall; -l2: /* end annotationForSendTable: */; +l1: /* end annotationForSendTable: */; if ((annotation == IsSuperSend) || (0)) { genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); @@ -28603,16 +28598,16 @@ genMethodAbortTrampolineFor(sqInt numArgs) zeroOpcodeIndex(); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(0)); + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); } /* begin JumpNonZero: */ jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveR:Mw:r: */ - anInstruction1 = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(0)); + anInstruction = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); } compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); @@ -28744,9 +28739,9 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(quickConstant)); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); } /* begin JumpNonZero: */ jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -28762,9 +28757,9 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant1 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(quickConstant1)); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); } /* begin JumpLess: */ jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); @@ -28773,9 +28768,9 @@ genPrimitiveClosureValue(void) /* begin MoveM16:r:R: */ offset = offsetof(CogMethod, blockEntryOffset); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(offset)); + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); } /* begin AddR:R: */ genoperandoperand(AddRR, ClassReg, TempReg); @@ -28785,9 +28780,9 @@ genPrimitiveClosureValue(void) return NotFullyInitialized; } /* begin SubCq:R: */ - anInstruction2 = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(blockNoContextSwitchOffset)); + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(blockNoContextSwitchOffset)); } } /* begin JumpR: */ @@ -29281,16 +29276,16 @@ genSpecialSelectorArithmetic(void) case AddRR: if (argIsInt) { /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(argInt - ConstZero)); + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(argInt - ConstZero)); } /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction3)) { - (anInstruction3->dependent = locateLiteral(argInt - ConstZero)); + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(argInt - ConstZero)); } } else { @@ -29301,9 +29296,9 @@ genSpecialSelectorArithmetic(void) jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); if (rcvrIsInt) { /* begin MoveCq:R: */ - anInstruction4 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction4)) { - (anInstruction4->dependent = locateLiteral(rcvrInt)); + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(rcvrInt)); } } else { @@ -29316,16 +29311,16 @@ genSpecialSelectorArithmetic(void) case SubRR: if (argIsInt) { /* begin SubCq:R: */ - anInstruction5 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction5)) { - (anInstruction5->dependent = locateLiteral(argInt - ConstZero)); + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(argInt - ConstZero)); } /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(argInt - ConstZero)); + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(argInt - ConstZero)); } } else { @@ -29342,9 +29337,9 @@ genSpecialSelectorArithmetic(void) case AndRR: if (argIsInt) { /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction2)) { - (anInstruction2->dependent = locateLiteral(argInt)); + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(argInt)); } } else { @@ -29357,9 +29352,9 @@ genSpecialSelectorArithmetic(void) case OrRR: if (argIsInt) { /* begin OrCq:R: */ - anInstruction6 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction6)) { - (anInstruction6->dependent = locateLiteral(argInt)); + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(argInt)); } } else { @@ -29375,9 +29370,9 @@ genSpecialSelectorArithmetic(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction7 = genoperandoperand(MoveCqR, argInt, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction7)) { - (anInstruction7->dependent = locateLiteral(argInt)); + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(argInt)); } } index = byte0 - ((bytecodeSetOffset == 256 @@ -29506,9 +29501,9 @@ genSpecialSelectorComparison(void) } if (argIsInt) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(argInt)); + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(argInt)); } } else { @@ -29524,9 +29519,9 @@ genSpecialSelectorComparison(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, argInt, Arg0Reg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(argInt)); + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(argInt)); } } index = byte0 - ((bytecodeSetOffset == 256 @@ -29660,9 +29655,9 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI /* begin genStoreTrampolineCall: */ if (slotIndex >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, slotIndex, TempReg); - if (usesOutOfLineLiteral(anInstruction1)) { - (anInstruction1->dependent = locateLiteral(slotIndex)); + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(slotIndex)); } /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); @@ -29674,8 +29669,8 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -29693,13 +29688,13 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI ssStoreAndReplacePoptoReg(popBoolean, ClassReg); ssFlushTo(simStackPtr); /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); - if (usesOutOfLineLiteral(anInstruction)) { - (anInstruction->dependent = locateLiteral(slotIndex)); + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(slotIndex)); } /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceStoreContextInstVarTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); # if IMMUTABILITY if (needsImmCheck) { @@ -30445,7 +30440,7 @@ scanBlock(BlockStart *blockStart) inBlock = InVanillaBlock; pc = (blockStart->startpc); end = ((blockStart->startpc)) + ((blockStart->span)); - framelessStackDelta = (nExts = (extA = (extB = 0))); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); pushingNils = 1; while (pc < end) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; @@ -30491,6 +30486,7 @@ scanBlock(BlockStart *blockStart) pushingNils = 0; } } + /* begin nextBytecodePCFor:at:exts:in: */ pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) : 0)); @@ -30498,7 +30494,7 @@ scanBlock(BlockStart *blockStart) nExts += 1; } else { - nExts = (extA = (extB = 0)); + nExts = (extA = (numExtB = (extB = 0))); } prevBCDescriptor = descriptor; } @@ -30542,7 +30538,7 @@ scanMethod(void) return 0; } pc = (latestContinuation = initialPC); - numBlocks = (framelessStackDelta = (nExts = (extA = (extB = 0)))); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); while (pc <= endPC) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; descriptor = generatorAt(byte0); @@ -30628,7 +30624,7 @@ scanMethod(void) pc += (descriptor->numBytes); nExts = ((descriptor->isExtension) ? nExts + 1 - : (extA = (extB = 0))); + : (extA = (numExtB = (extB = 0)))); prevBCDescriptor = descriptor; } return numBlocks; diff --git a/nsspursrc/vm/cogitIA32.c b/nsspursrc/vm/cogitIA32.c index f6d3a1b978..d81ad1b1ad 100644 --- a/nsspursrc/vm/cogitIA32.c +++ b/nsspursrc/vm/cogitIA32.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -270,7 +270,7 @@ char *__cogitBuildInfo = __buildInfo; #define NumSendTrampolines 4 #define NumSpecialSelectors 32 #define NumStoreTrampolines 5 -#define NumTrampolines 79 +#define NumTrampolines (IMMUTABILITY ? 80 : 75) #define OrCqR 108 #define OrCwR 116 #define OrRR 102 @@ -372,8 +372,8 @@ typedef struct { typedef struct _BytecodeDescriptor { sqInt (*generator )(void); - sqInt (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); - sqInt (*needsFrameFunction )(sqInt); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); signed char stackDelta; unsigned char opcode; unsigned char numBytes; @@ -839,7 +839,7 @@ static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop); static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg); static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg); static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)); -static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison); +static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison); static sqInt NoDbgRegParms genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg); static sqInt NoDbgRegParms genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg); static sqInt genPrimitiveAdd(void); @@ -876,7 +876,7 @@ 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 genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*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); @@ -1889,6 +1889,7 @@ static usqInt mzFreeStart; static sqInt needsFrame; static AbstractInstruction * noCheckEntry; static sqInt numAbstractOpcodes; +static sqInt numExtB; static sqInt numIRCs; static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; static sqInt opcodeIndex; @@ -2891,7 +2892,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t destReg13; usqIntptr_t destReg14; usqIntptr_t destReg15; + usqIntptr_t destReg16; + usqIntptr_t destReg17; + usqIntptr_t destReg18; + usqIntptr_t destReg19; usqIntptr_t destReg2; + usqIntptr_t destReg20; + usqIntptr_t destReg21; + usqIntptr_t destReg22; + usqIntptr_t destReg23; + usqIntptr_t destReg24; usqIntptr_t destReg3; usqIntptr_t destReg4; usqIntptr_t destReg5; @@ -2977,7 +2987,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t mask2; sqInt mcIdx; sqInt offset; - usqIntptr_t offset1; + sqInt offset1; usqIntptr_t offset10; usqIntptr_t offset11; sqInt offset110; @@ -2995,14 +3005,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt offset121; sqInt offset122; sqInt offset123; - sqInt offset13; - sqInt offset14; - sqInt offset15; + usqIntptr_t offset13; + usqIntptr_t offset14; + usqIntptr_t offset15; sqInt offset16; sqInt offset17; sqInt offset18; sqInt offset19; - usqIntptr_t offset2; + sqInt offset2; sqInt offset20; sqInt offset21; sqInt offset22; @@ -3017,6 +3027,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) sqInt offset30; sqInt offset31; sqInt offset32; + sqInt offset33; usqIntptr_t offset4; usqIntptr_t offset5; usqIntptr_t offset6; @@ -3091,7 +3102,16 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) usqIntptr_t srcReg11; usqIntptr_t srcReg12; usqIntptr_t srcReg13; + usqIntptr_t srcReg14; + usqIntptr_t srcReg15; + usqIntptr_t srcReg16; + usqIntptr_t srcReg17; + usqIntptr_t srcReg18; + usqIntptr_t srcReg19; usqIntptr_t srcReg2; + usqIntptr_t srcReg20; + usqIntptr_t srcReg21; + usqIntptr_t srcReg22; usqIntptr_t srcReg3; usqIntptr_t srcReg4; usqIntptr_t srcReg5; @@ -3193,12 +3213,12 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); } assert(jumpTarget != 0); - offset13 = (((int) jumpTarget)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); + offset1 = (((int) jumpTarget)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); ((self_in_dispatchConcretize->machineCode))[0] = 233; - ((self_in_dispatchConcretize->machineCode))[1] = (offset13 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset13) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset13) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset13) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; return; @@ -3214,14 +3234,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget12 != 0); jumpTarget3 = jumpTarget12; - offset15 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset16 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset15) + ? isQuick(self_in_dispatchConcretize, offset16) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 4); - ((self_in_dispatchConcretize->machineCode))[1] = (offset15 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset16 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l82; + goto l89; } /* begin concretizeConditionalJumpLong: */ jumpTarget11 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3232,15 +3252,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget11 != 0); jumpTarget2 = jumpTarget11; - offset16 = (((int) jumpTarget2)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + offset17 = (((int) jumpTarget2)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = (128 + 4); - ((self_in_dispatchConcretize->machineCode))[2] = (offset16 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset16) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset16) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset16) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset17 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset17) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset17) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset17) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l82: /* end concretizeConditionalJump: */; + l89: /* end concretizeConditionalJump: */; return; case JumpLongNonZero: @@ -3255,14 +3275,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget13 != 0); jumpTarget4 = jumpTarget13; - offset17 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset18 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset17) + ? isQuick(self_in_dispatchConcretize, offset18) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 5); - ((self_in_dispatchConcretize->machineCode))[1] = (offset17 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset18 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l87; + goto l94; } /* begin concretizeConditionalJumpLong: */ jumpTarget111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3273,15 +3293,15 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget111 != 0); jumpTarget21 = jumpTarget111; - offset18 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + offset19 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = (128 + 5); - ((self_in_dispatchConcretize->machineCode))[2] = (offset18 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset18) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset18) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset18) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset19 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset19) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset19) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset19) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l87: /* end concretizeConditionalJump: */; + l94: /* end concretizeConditionalJump: */; return; case Jump: @@ -3293,23 +3313,23 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); } assert(jumpTarget1 != 0); - offset14 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset14) + ? isQuick(self_in_dispatchConcretize, offset2) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = 235; - ((self_in_dispatchConcretize->machineCode))[1] = (offset14 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset2 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l72; + goto l9; } - offset14 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); + offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); ((self_in_dispatchConcretize->machineCode))[0] = 233; - ((self_in_dispatchConcretize->machineCode))[1] = (offset14 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset14) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset14) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset14) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - l72: /* end concretizeJump */; + l9: /* end concretizeJump */; return; case JumpNegative: @@ -3322,14 +3342,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget14 != 0); jumpTarget5 = jumpTarget14; - offset19 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset20 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset19) + ? isQuick(self_in_dispatchConcretize, offset20) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 8); - ((self_in_dispatchConcretize->machineCode))[1] = (offset19 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset20 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l92; + goto l99; } /* begin concretizeConditionalJumpLong: */ jumpTarget112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3348,7 +3368,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset110) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset110) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l92: /* end concretizeConditionalJump: */; + l99: /* end concretizeConditionalJump: */; return; case JumpNonNegative: @@ -3361,14 +3381,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget15 != 0); jumpTarget6 = jumpTarget15; - offset20 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset21 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset20) + ? isQuick(self_in_dispatchConcretize, offset21) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 9); - ((self_in_dispatchConcretize->machineCode))[1] = (offset20 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset21 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l97; + goto l104; } /* begin concretizeConditionalJumpLong: */ jumpTarget113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3387,7 +3407,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset111) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset111) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l97: /* end concretizeConditionalJump: */; + l104: /* end concretizeConditionalJump: */; return; case JumpOverflow: @@ -3400,14 +3420,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget16 != 0); jumpTarget7 = jumpTarget16; - offset21 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset22 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset21) + ? isQuick(self_in_dispatchConcretize, offset22) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112); - ((self_in_dispatchConcretize->machineCode))[1] = (offset21 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset22 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l102; + goto l109; } /* begin concretizeConditionalJumpLong: */ jumpTarget114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3426,7 +3446,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset112) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset112) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l102: /* end concretizeConditionalJump: */; + l109: /* end concretizeConditionalJump: */; return; case JumpNoOverflow: @@ -3439,14 +3459,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget17 != 0); jumpTarget8 = jumpTarget17; - offset22 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset23 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset22) + ? isQuick(self_in_dispatchConcretize, offset23) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 1); - ((self_in_dispatchConcretize->machineCode))[1] = (offset22 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset23 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l107; + goto l114; } /* begin concretizeConditionalJumpLong: */ jumpTarget115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3465,7 +3485,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset113) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset113) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l107: /* end concretizeConditionalJump: */; + l114: /* end concretizeConditionalJump: */; return; case JumpCarry: @@ -3480,14 +3500,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget18 != 0); jumpTarget9 = jumpTarget18; - offset23 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset24 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset23) + ? isQuick(self_in_dispatchConcretize, offset24) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 2); - ((self_in_dispatchConcretize->machineCode))[1] = (offset23 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset24 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l112; + goto l119; } /* begin concretizeConditionalJumpLong: */ jumpTarget116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3506,7 +3526,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset114) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset114) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l112: /* end concretizeConditionalJump: */; + l119: /* end concretizeConditionalJump: */; return; case JumpNoCarry: @@ -3521,14 +3541,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget19 != 0); jumpTarget10 = jumpTarget19; - offset24 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset25 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset24) + ? isQuick(self_in_dispatchConcretize, offset25) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 3); - ((self_in_dispatchConcretize->machineCode))[1] = (offset24 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset25 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l117; + goto l124; } /* begin concretizeConditionalJumpLong: */ jumpTarget117 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3547,7 +3567,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset115) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset115) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l117: /* end concretizeConditionalJump: */; + l124: /* end concretizeConditionalJump: */; return; case JumpLess: @@ -3560,14 +3580,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget110 != 0); jumpTarget20 = jumpTarget110; - offset25 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset26 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset25) + ? isQuick(self_in_dispatchConcretize, offset26) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 12); - ((self_in_dispatchConcretize->machineCode))[1] = (offset25 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset26 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l122; + goto l129; } /* begin concretizeConditionalJumpLong: */ jumpTarget118 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3586,7 +3606,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset116) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset116) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l122: /* end concretizeConditionalJump: */; + l129: /* end concretizeConditionalJump: */; return; case JumpGreaterOrEqual: @@ -3599,14 +3619,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget119 != 0); jumpTarget29 = jumpTarget119; - offset26 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset27 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset26) + ? isQuick(self_in_dispatchConcretize, offset27) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 13); - ((self_in_dispatchConcretize->machineCode))[1] = (offset26 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset27 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l127; + goto l134; } /* begin concretizeConditionalJumpLong: */ jumpTarget1110 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3625,7 +3645,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset117) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset117) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l127: /* end concretizeConditionalJump: */; + l134: /* end concretizeConditionalJump: */; return; case JumpGreater: @@ -3638,14 +3658,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget120 != 0); jumpTarget30 = jumpTarget120; - offset27 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset28 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset27) + ? isQuick(self_in_dispatchConcretize, offset28) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 15); - ((self_in_dispatchConcretize->machineCode))[1] = (offset27 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset28 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l132; + goto l139; } /* begin concretizeConditionalJumpLong: */ jumpTarget1111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3664,7 +3684,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset118) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset118) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l132: /* end concretizeConditionalJump: */; + l139: /* end concretizeConditionalJump: */; return; case JumpLessOrEqual: @@ -3677,14 +3697,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget121 != 0); jumpTarget31 = jumpTarget121; - offset28 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset29 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset28) + ? isQuick(self_in_dispatchConcretize, offset29) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 14); - ((self_in_dispatchConcretize->machineCode))[1] = (offset28 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset29 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l137; + goto l144; } /* begin concretizeConditionalJumpLong: */ jumpTarget1112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3703,7 +3723,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset119) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset119) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l137: /* end concretizeConditionalJump: */; + l144: /* end concretizeConditionalJump: */; return; case JumpAbove: @@ -3717,14 +3737,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget122 != 0); jumpTarget32 = jumpTarget122; - offset29 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset30 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset29) + ? isQuick(self_in_dispatchConcretize, offset30) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 7); - ((self_in_dispatchConcretize->machineCode))[1] = (offset29 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset30 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l142; + goto l149; } /* begin concretizeConditionalJumpLong: */ jumpTarget1113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3743,7 +3763,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset120) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset120) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l142: /* end concretizeConditionalJump: */; + l149: /* end concretizeConditionalJump: */; return; case JumpBelowOrEqual: @@ -3757,14 +3777,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget123 != 0); jumpTarget33 = jumpTarget123; - offset30 = (((int) jumpTarget33)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset31 = (((int) jumpTarget33)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset30) + ? isQuick(self_in_dispatchConcretize, offset31) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 6); - ((self_in_dispatchConcretize->machineCode))[1] = (offset30 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset31 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l147; + goto l154; } /* begin concretizeConditionalJumpLong: */ jumpTarget1114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3783,7 +3803,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset121) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset121) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l147: /* end concretizeConditionalJump: */; + l154: /* end concretizeConditionalJump: */; return; case JumpFPOrdered: @@ -3796,14 +3816,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget124 != 0); jumpTarget34 = jumpTarget124; - offset31 = (((int) jumpTarget34)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset32 = (((int) jumpTarget34)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset31) + ? isQuick(self_in_dispatchConcretize, offset32) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 11); - ((self_in_dispatchConcretize->machineCode))[1] = (offset31 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset32 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l152; + goto l159; } /* begin concretizeConditionalJumpLong: */ jumpTarget1115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3822,7 +3842,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset122) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset122) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l152: /* end concretizeConditionalJump: */; + l159: /* end concretizeConditionalJump: */; return; case JumpFPUnordered: @@ -3835,14 +3855,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) } assert(jumpTarget125 != 0); jumpTarget35 = jumpTarget125; - offset32 = (((int) jumpTarget35)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + offset33 = (((int) jumpTarget35)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 - ? isQuick(self_in_dispatchConcretize, offset32) + ? isQuick(self_in_dispatchConcretize, offset33) : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { ((self_in_dispatchConcretize->machineCode))[0] = (112 + 10); - ((self_in_dispatchConcretize->machineCode))[1] = (offset32 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (offset33 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l157; + goto l164; } /* begin concretizeConditionalJumpLong: */ jumpTarget1116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); @@ -3861,22 +3881,22 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset123) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset123) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l157: /* end concretizeConditionalJump: */; + l164: /* end concretizeConditionalJump: */; return; case RetN: /* begin concretizeRetN */ - offset1 = ((self_in_dispatchConcretize->operands))[0]; - if (offset1 == 0) { + offset3 = ((self_in_dispatchConcretize->operands))[0]; + if (offset3 == 0) { ((self_in_dispatchConcretize->machineCode))[0] = 195; (self_in_dispatchConcretize->machineCodeSize) = 1; - goto l8; + goto l10; } ((self_in_dispatchConcretize->machineCode))[0] = 194; - ((self_in_dispatchConcretize->machineCode))[1] = (offset1 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[2] = (((usqInt) offset1) >> 8); + ((self_in_dispatchConcretize->machineCode))[1] = (offset3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (((usqInt) offset3) >> 8); (self_in_dispatchConcretize->machineCodeSize) = 3; - l8: /* end concretizeRetN */; + l10: /* end concretizeRetN */; return; case Stop: @@ -3894,7 +3914,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg2, 0)); ((self_in_dispatchConcretize->machineCode))[2] = (value & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l10; + goto l12; } if (reg2 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 5; @@ -3903,7 +3923,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l10; + goto l12; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg2, 0)); @@ -3912,7 +3932,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l10: /* end concretizeAddCqR */; + l12: /* end concretizeAddCqR */; return; case AddCwR: @@ -3926,7 +3946,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l11; + goto l13; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg3, 0)); @@ -3935,7 +3955,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l11: /* end concretizeAddCwR */; + l13: /* end concretizeAddCwR */; return; case AddRR: @@ -3960,7 +3980,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg4, 2)); ((self_in_dispatchConcretize->machineCode))[2] = (value2 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l13; + goto l15; } if (reg4 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 21; @@ -3969,7 +3989,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value2) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l13; + goto l15; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg4, 2)); @@ -3978,7 +3998,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value2) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l13: /* end concretizeAddcCqR */; + l15: /* end concretizeAddcCqR */; return; case AddRdRd: @@ -4012,7 +4032,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg5, 4)); ((self_in_dispatchConcretize->machineCode))[2] = (mask & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l16; + goto l18; } if (reg5 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 37; @@ -4021,7 +4041,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l16; + goto l18; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg5, 4)); @@ -4030,7 +4050,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l16: /* end concretizeAndCqR */; + l18: /* end concretizeAndCqR */; return; case AndCwR: @@ -4044,7 +4064,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value3) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value3) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l17; + goto l19; } ((self_in_dispatchConcretize->machineCode))[0] = 131; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg6, 4)); @@ -4053,7 +4073,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value3) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value3) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l17: /* end concretizeAndCwR */; + l19: /* end concretizeAndCwR */; return; case AndRR: @@ -4070,7 +4090,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg7, 0)); ((self_in_dispatchConcretize->machineCode))[2] = (mask1 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l18; + goto l20; } if (reg7 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 169; @@ -4079,7 +4099,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l18; + goto l20; } ((self_in_dispatchConcretize->machineCode))[0] = 247; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg7, 0)); @@ -4088,7 +4108,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l18: /* end concretizeTstCqR */; + l20: /* end concretizeTstCqR */; return; case CmpCqR: @@ -4100,7 +4120,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg8, 7)); ((self_in_dispatchConcretize->machineCode))[2] = (value4 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l19; + goto l21; } if (reg8 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 61; @@ -4109,7 +4129,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value4) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value4) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l19; + goto l21; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg8, 7)); @@ -4118,7 +4138,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value4) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value4) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l19: /* end concretizeCmpCqR */; + l21: /* end concretizeCmpCqR */; return; case CmpCwR: @@ -4132,7 +4152,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value5) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value5) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l20; + goto l22; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg9, 7)); @@ -4141,7 +4161,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value5) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value5) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l20: /* end concretizeCmpCwR */; + l22: /* end concretizeCmpCwR */; return; case CmpRR: @@ -4222,7 +4242,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg10, 1)); ((self_in_dispatchConcretize->machineCode))[2] = (mask2 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l27; + goto l29; } if (reg10 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 13; @@ -4231,7 +4251,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask2) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l27; + goto l29; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg10, 1)); @@ -4240,7 +4260,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask2) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l27: /* end concretizeOrCqR */; + l29: /* end concretizeOrCqR */; return; case OrCwR: @@ -4254,7 +4274,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value6) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value6) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l28; + goto l30; } ((self_in_dispatchConcretize->machineCode))[0] = 131; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg11, 1)); @@ -4263,7 +4283,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value6) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value6) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l28: /* end concretizeOrCwR */; + l30: /* end concretizeOrCwR */; return; case OrRR: @@ -4279,7 +4299,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg12, 5)); ((self_in_dispatchConcretize->machineCode))[2] = (value7 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l29; + goto l31; } if (reg12 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 45; @@ -4288,7 +4308,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value7) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value7) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l29; + goto l31; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg12, 5)); @@ -4297,7 +4317,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value7) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value7) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l29: /* end concretizeSubCqR */; + l31: /* end concretizeSubCqR */; return; case SubCwR: @@ -4311,7 +4331,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value8) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value8) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l30; + goto l32; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg13, 5)); @@ -4320,7 +4340,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value8) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value8) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l30: /* end concretizeSubCwR */; + l32: /* end concretizeSubCwR */; return; case SubRR: @@ -4389,7 +4409,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value9) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value9) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l36; + goto l38; } ((self_in_dispatchConcretize->machineCode))[0] = 129; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg16, 6)); @@ -4398,7 +4418,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value9) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value9) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l36: /* end concretizeXorCwR */; + l38: /* end concretizeXorCwR */; return; case XorRR: @@ -4444,43 +4464,43 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) case LoadEffectiveAddressMwrR: /* begin concretizeLoadEffectiveAddressMwrR */ - offset2 = ((self_in_dispatchConcretize->operands))[0]; + offset4 = ((self_in_dispatchConcretize->operands))[0]; srcReg = ((self_in_dispatchConcretize->operands))[1]; destReg = ((self_in_dispatchConcretize->operands))[2]; if (srcReg != ESP) { - if (isQuick(self_in_dispatchConcretize, offset2)) { + if (isQuick(self_in_dispatchConcretize, offset4)) { ((self_in_dispatchConcretize->machineCode))[0] = 141; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg, destReg)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l41; + goto l43; } ((self_in_dispatchConcretize->machineCode))[0] = 141; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg, destReg)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset2 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset2) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset2) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset2) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l41; + goto l43; } - if (isQuick(self_in_dispatchConcretize, offset2)) { + if (isQuick(self_in_dispatchConcretize, offset4)) { ((self_in_dispatchConcretize->machineCode))[0] = 141; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg, destReg)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset4 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l41; + goto l43; } ((self_in_dispatchConcretize->machineCode))[0] = 141; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg, destReg)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset2 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset2) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset2) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset2) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset4) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - l41: /* end concretizeLoadEffectiveAddressMwrR */; + l43: /* end concretizeLoadEffectiveAddressMwrR */; return; case ArithmeticShiftRightCqR: @@ -4491,13 +4511,13 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 209; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg19, 7)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l42; + goto l44; } ((self_in_dispatchConcretize->machineCode))[0] = 193; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg19, 7)); ((self_in_dispatchConcretize->machineCode))[2] = shiftCount; (self_in_dispatchConcretize->machineCodeSize) = 3; - l42: /* end concretizeArithmeticShiftRightCqR */; + l44: /* end concretizeArithmeticShiftRightCqR */; return; case LogicalShiftRightCqR: @@ -4508,13 +4528,13 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 209; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg20, 5)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l43; + goto l45; } ((self_in_dispatchConcretize->machineCode))[0] = 193; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg20, 5)); ((self_in_dispatchConcretize->machineCode))[2] = distance; (self_in_dispatchConcretize->machineCodeSize) = 3; - l43: /* end concretizeLogicalShiftRightCqR */; + l45: /* end concretizeLogicalShiftRightCqR */; return; case LogicalShiftLeftCqR: @@ -4525,13 +4545,13 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 209; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg21, 4)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l44; + goto l46; } ((self_in_dispatchConcretize->machineCode))[0] = 193; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg21, 4)); ((self_in_dispatchConcretize->machineCode))[2] = distance1; (self_in_dispatchConcretize->machineCodeSize) = 3; - l44: /* end concretizeLogicalShiftLeftCqR */; + l46: /* end concretizeLogicalShiftLeftCqR */; return; case ArithmeticShiftRightRR: @@ -4542,7 +4562,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 211; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg1, 7)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l45; + goto l47; } regToShift = (destReg1 == shiftCountReg ? ECX @@ -4555,7 +4575,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift, 7)); ((self_in_dispatchConcretize->machineCode))[3] = (144 + ECX); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l45; + goto l47; } ((self_in_dispatchConcretize->machineCode))[0] = 135; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg)); @@ -4564,7 +4584,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = 135; ((self_in_dispatchConcretize->machineCode))[5] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg)); (self_in_dispatchConcretize->machineCodeSize) = 6; - l45: /* end concretizeArithmeticShiftRightRR */; + l47: /* end concretizeArithmeticShiftRightRR */; return; case LogicalShiftLeftRR: @@ -4575,7 +4595,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 211; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg2, 4)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l46; + goto l48; } regToShift1 = (destReg2 == shiftCountReg1 ? ECX @@ -4588,7 +4608,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift1, 4)); ((self_in_dispatchConcretize->machineCode))[3] = (144 + ECX); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l46; + goto l48; } ((self_in_dispatchConcretize->machineCode))[0] = 135; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg1)); @@ -4597,7 +4617,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[4] = 135; ((self_in_dispatchConcretize->machineCode))[5] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg1)); (self_in_dispatchConcretize->machineCodeSize) = 6; - l46: /* end concretizeLogicalShiftLeftRR */; + l48: /* end concretizeLogicalShiftLeftRR */; return; case MoveCqR: @@ -4611,13 +4631,13 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value13) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value13) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l47; + goto l165; } - reg22 = ((self_in_dispatchConcretize->operands))[1]; + reg26 = ((self_in_dispatchConcretize->operands))[1]; ((self_in_dispatchConcretize->machineCode))[0] = 49; - ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg22, reg22)); + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg26, reg26)); (self_in_dispatchConcretize->machineCodeSize) = 2; - l47: /* end concretizeMoveCqR */; + l165: /* end concretizeMoveCqR */; return; case MoveCwR: @@ -4659,519 +4679,570 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) case MoveAwR: /* begin concretizeMoveAwR */ - addressOperand1 = ((self_in_dispatchConcretize->operands))[0]; + addressOperand = ((self_in_dispatchConcretize->operands))[0]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand))) + || ((((AbstractInstruction *) addressOperand)) == (methodLabel()))) { + addressOperand = ((((AbstractInstruction *) addressOperand))->address); + } + reg22 = ((self_in_dispatchConcretize->operands))[1]; + if (reg22 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 161; + ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l52; + } + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg22)); + ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l52: /* end concretizeMoveAwR */; + return; + + case MoveRAw: + /* begin concretizeMoveRAw */ + reg23 = ((self_in_dispatchConcretize->operands))[0]; + addressOperand1 = ((self_in_dispatchConcretize->operands))[1]; if ((addressIsInInstructions(((AbstractInstruction *) addressOperand1))) || ((((AbstractInstruction *) addressOperand1)) == (methodLabel()))) { addressOperand1 = ((((AbstractInstruction *) addressOperand1))->address); } - reg23 = ((self_in_dispatchConcretize->operands))[1]; if (reg23 == EAX) { - ((self_in_dispatchConcretize->machineCode))[0] = 161; + ((self_in_dispatchConcretize->machineCode))[0] = 163; ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand1 & 0xFF); ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand1) >> 8) & 0xFF); ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l74; + goto l53; } - ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg23)); ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand1 & 0xFF); ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand1) >> 8) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand1) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand1) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l74: /* end concretizeMoveAwR */; + l53: /* end concretizeMoveRAw */; return; - case MoveRAw: - /* begin concretizeMoveRAw */ - reg24 = ((self_in_dispatchConcretize->operands))[0]; - addressOperand2 = ((self_in_dispatchConcretize->operands))[1]; + case MoveAbR: + /* begin concretizeMoveAbR */ + addressOperand2 = ((self_in_dispatchConcretize->operands))[0]; if ((addressIsInInstructions(((AbstractInstruction *) addressOperand2))) || ((((AbstractInstruction *) addressOperand2)) == (methodLabel()))) { addressOperand2 = ((((AbstractInstruction *) addressOperand2))->address); } - if (reg24 == EAX) { - ((self_in_dispatchConcretize->machineCode))[0] = 163; - ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand2 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand2) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand2) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand2) >> 24) & 0xFF); - (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l75; - } - ((self_in_dispatchConcretize->machineCode))[0] = 137; - ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg24)); - ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand2 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand2) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand2) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand2) >> 24) & 0xFF); - (self_in_dispatchConcretize->machineCodeSize) = 6; - l75: /* end concretizeMoveRAw */; - return; - - case MoveAbR: - /* begin concretizeMoveAbR */ - addressOperand3 = ((self_in_dispatchConcretize->operands))[0]; - if ((addressIsInInstructions(((AbstractInstruction *) addressOperand3))) - || ((((AbstractInstruction *) addressOperand3)) == (methodLabel()))) { - addressOperand3 = ((((AbstractInstruction *) addressOperand3))->address); - } - reg25 = ((self_in_dispatchConcretize->operands))[1]; + reg24 = ((self_in_dispatchConcretize->operands))[1]; ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; - ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg25)); - ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand3 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand3) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand3) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand3) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg24)); + ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand2) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; return; case MoveRAb: /* begin concretizeMoveRAb */ - reg26 = ((self_in_dispatchConcretize->operands))[0]; - addressOperand4 = ((self_in_dispatchConcretize->operands))[1]; - if ((addressIsInInstructions(((AbstractInstruction *) addressOperand4))) - || ((((AbstractInstruction *) addressOperand4)) == (methodLabel()))) { - addressOperand4 = ((((AbstractInstruction *) addressOperand4))->address); + reg25 = ((self_in_dispatchConcretize->operands))[0]; + addressOperand3 = ((self_in_dispatchConcretize->operands))[1]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand3))) + || ((((AbstractInstruction *) addressOperand3)) == (methodLabel()))) { + addressOperand3 = ((((AbstractInstruction *) addressOperand3))->address); } - if (reg26 == EAX) { + if (reg25 == EAX) { ((self_in_dispatchConcretize->machineCode))[0] = 162; - ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand4 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand4) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand4) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand4) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand3) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l77; + goto l55; } ((self_in_dispatchConcretize->machineCode))[0] = 136; - ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg26)); - ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand4 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand4) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand4) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand4) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg25)); + ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand3) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - l77: /* end concretizeMoveRAb */; + l55: /* end concretizeMoveRAb */; return; case MoveMbrR: /* begin concretizeMoveMbrR */ - offset3 = ((self_in_dispatchConcretize->operands))[0]; + offset5 = ((self_in_dispatchConcretize->operands))[0]; srcReg3 = ((self_in_dispatchConcretize->operands))[1]; destReg5 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg3 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset3)) { + if (isQuick(self_in_dispatchConcretize, offset5)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg3, destReg5)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l51; + goto l56; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg3, destReg5)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset3 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset3) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset3) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset3) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - goto l51; + goto l56; } - if (isQuick(self_in_dispatchConcretize, offset3)) { + if (isQuick(self_in_dispatchConcretize, offset5)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg3, destReg5)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg3)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l51; + goto l56; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg3, destReg5)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg3)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset3 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset3) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset3) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset3) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset5) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - l51: /* end concretizeMoveMbrR */; + l56: /* end concretizeMoveMbrR */; return; case MoveRMbr: case MoveRM8r: /* begin concretizeMoveRMbr */ - offset4 = ((self_in_dispatchConcretize->operands))[1]; + offset6 = ((self_in_dispatchConcretize->operands))[1]; srcReg4 = ((self_in_dispatchConcretize->operands))[0]; destReg6 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg4 >= 4) { error("invalid register"); } if (destReg6 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset4)) { + if (isQuick(self_in_dispatchConcretize, offset6)) { ((self_in_dispatchConcretize->machineCode))[0] = 136; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg6, srcReg4)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset6 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l52; + goto l57; } ((self_in_dispatchConcretize->machineCode))[0] = 136; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg6, srcReg4)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset4) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l52; + goto l57; } ((self_in_dispatchConcretize->machineCode))[0] = 136; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg6, srcReg4)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg6)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset4 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset4) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset6) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - l52: /* end concretizeMoveRMbr */; + l57: /* end concretizeMoveRMbr */; return; case MoveM8rR: /* begin concretizeMoveM8rR */ - offset5 = ((self_in_dispatchConcretize->operands))[0]; + offset7 = ((self_in_dispatchConcretize->operands))[0]; srcReg5 = ((self_in_dispatchConcretize->operands))[1]; destReg7 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg5 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset5)) { + if (isQuick(self_in_dispatchConcretize, offset7)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg5, destReg7)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l53; + goto l58; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg5, destReg7)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset5) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - goto l53; + goto l58; } - if (isQuick(self_in_dispatchConcretize, offset5)) { + if (isQuick(self_in_dispatchConcretize, offset7)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg5, destReg7)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg5)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset7 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l53; + goto l58; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg5, destReg7)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg5)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset5) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset7) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - l53: /* end concretizeMoveM8rR */; + l58: /* end concretizeMoveM8rR */; return; case MoveM16rR: /* begin concretizeMoveM16rR */ - offset6 = ((self_in_dispatchConcretize->operands))[0]; + offset8 = ((self_in_dispatchConcretize->operands))[0]; srcReg6 = ((self_in_dispatchConcretize->operands))[1]; destReg8 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg6 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset6)) { + if (isQuick(self_in_dispatchConcretize, offset8)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 183; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg6, destReg8)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l54; + goto l59; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 183; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg6, destReg8)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset6 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset6) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset6) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset8) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - goto l54; + goto l59; } - if (isQuick(self_in_dispatchConcretize, offset6)) { + if (isQuick(self_in_dispatchConcretize, offset8)) { ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 183; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg6, destReg8)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg6)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset8 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l54; + goto l59; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 183; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg6, destReg8)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg6)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset6 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset6) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset6) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset8) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - l54: /* end concretizeMoveM16rR */; + l59: /* end concretizeMoveM16rR */; return; case MoveRM16r: /* begin concretizeMoveRM16r */ - offset7 = ((self_in_dispatchConcretize->operands))[1]; + offset9 = ((self_in_dispatchConcretize->operands))[1]; srcReg7 = ((self_in_dispatchConcretize->operands))[0]; destReg9 = ((self_in_dispatchConcretize->operands))[2]; if (destReg9 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset7)) { + if (isQuick(self_in_dispatchConcretize, offset9)) { ((self_in_dispatchConcretize->machineCode))[0] = 102; ((self_in_dispatchConcretize->machineCode))[1] = 137; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg9, srcReg7)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l55; + goto l60; } ((self_in_dispatchConcretize->machineCode))[0] = 102; ((self_in_dispatchConcretize->machineCode))[1] = 137; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg9, srcReg7)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset7) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset9) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - goto l55; + goto l60; } ((self_in_dispatchConcretize->machineCode))[0] = 102; ((self_in_dispatchConcretize->machineCode))[1] = 137; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg9, srcReg7)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg9)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset7 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset7) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset9) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - l55: /* end concretizeMoveRM16r */; + l60: /* end concretizeMoveRM16r */; return; case MoveM32rR: case MoveMwrR: /* begin concretizeMoveMwrR */ - offset8 = ((self_in_dispatchConcretize->operands))[0]; + offset10 = ((self_in_dispatchConcretize->operands))[0]; srcReg8 = ((self_in_dispatchConcretize->operands))[1]; destReg10 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg8 != ESP) { - if ((offset8 == 0) + if ((offset10 == 0) && (srcReg8 != EBP)) { ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, srcReg8, destReg10)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l56; + goto l61; } - if (isQuick(self_in_dispatchConcretize, offset8)) { + if (isQuick(self_in_dispatchConcretize, offset10)) { ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg8, destReg10)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset10 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l56; + goto l61; } ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg8, destReg10)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset8 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset8) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset8) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset10) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset10) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset10) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l56; + goto l61; } - if (offset8 == 0) { + if (offset10 == 0) { ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, srcReg8, destReg10)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l56; + goto l61; } - if (isQuick(self_in_dispatchConcretize, offset8)) { + if (isQuick(self_in_dispatchConcretize, offset10)) { ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg8, destReg10)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset10 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l56; + goto l61; } ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg8, destReg10)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset8) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset8) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset10) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset10) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset10) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - l56: /* end concretizeMoveMwrR */; + l61: /* end concretizeMoveMwrR */; return; case MoveRM32r: case MoveRMwr: /* begin concretizeMoveRMwr */ srcReg9 = ((self_in_dispatchConcretize->operands))[0]; - offset9 = ((self_in_dispatchConcretize->operands))[1]; + offset11 = ((self_in_dispatchConcretize->operands))[1]; destReg11 = ((self_in_dispatchConcretize->operands))[2]; if (destReg11 != ESP) { - if ((offset9 == 0) + if ((offset11 == 0) && (destReg11 != EBP)) { ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, destReg11, srcReg9)); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l57; + goto l62; } - if (isQuick(self_in_dispatchConcretize, offset9)) { + if (isQuick(self_in_dispatchConcretize, offset11)) { ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg11, srcReg9)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset11 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l57; + goto l62; } ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg11, srcReg9)); - ((self_in_dispatchConcretize->machineCode))[2] = (offset9 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset9) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset9) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset11) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset11) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset11) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l57; + goto l62; } - if (offset9 == 0) { + if (offset11 == 0) { ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, destReg11, srcReg9)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l57; + goto l62; } - if (isQuick(self_in_dispatchConcretize, offset9)) { + if (isQuick(self_in_dispatchConcretize, offset11)) { ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg11, srcReg9)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset11 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l57; + goto l62; } ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg11, srcReg9)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); - ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset9) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset9) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset11) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset11) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset11) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 7; - l57: /* end concretizeMoveRMwr */; + l62: /* end concretizeMoveRMwr */; return; case MoveM32rRs: /* begin concretizeMoveM32rRs */ - offset10 = ((self_in_dispatchConcretize->operands))[0]; + offset12 = ((self_in_dispatchConcretize->operands))[0]; srcReg10 = ((self_in_dispatchConcretize->operands))[1]; destReg12 = ((self_in_dispatchConcretize->operands))[2]; if (srcReg10 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset10)) { + if (isQuick(self_in_dispatchConcretize, offset12)) { ((self_in_dispatchConcretize->machineCode))[0] = 243; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg10, destReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l58; + goto l63; } ((self_in_dispatchConcretize->machineCode))[0] = 243; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg10, destReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset10 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset10) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset10) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset10) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset12) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l58; + goto l63; } - if (isQuick(self_in_dispatchConcretize, offset10)) { + if (isQuick(self_in_dispatchConcretize, offset12)) { ((self_in_dispatchConcretize->machineCode))[0] = 243; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg10, destReg12)); ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg10)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l58; + goto l63; } ((self_in_dispatchConcretize->machineCode))[0] = 243; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg10, destReg12)); ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg10)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset10 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset10) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset10) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset10) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset12) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 9; - l58: /* end concretizeMoveM32rRs */; + l63: /* end concretizeMoveM32rRs */; + return; + + case MoveRsM32r: + /* begin concretizeMoveRsM32r */ + srcReg11 = ((self_in_dispatchConcretize->operands))[0]; + offset13 = ((self_in_dispatchConcretize->operands))[1]; + destReg13 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg13 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset13)) { + + /* MOVSD destReg, srcReg */ + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset13 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l64; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset13 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset13) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset13) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset13) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l64; + } + if (isQuick(self_in_dispatchConcretize, offset13)) { + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg13)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset13 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l64; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg13)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset13 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset13) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset13) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset13) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 9; + l64: /* end concretizeMoveRsM32r */; return; case MoveM64rRd: /* begin concretizeMoveM64rRd */ - offset11 = ((self_in_dispatchConcretize->operands))[0]; - srcReg11 = ((self_in_dispatchConcretize->operands))[1]; - destReg13 = ((self_in_dispatchConcretize->operands))[2]; - if (srcReg11 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset11)) { + offset14 = ((self_in_dispatchConcretize->operands))[0]; + srcReg12 = ((self_in_dispatchConcretize->operands))[1]; + destReg14 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg12 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset14)) { ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg11, destReg13)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset14 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l59; + goto l65; } ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg11, destReg13)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset11 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset11) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset11) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset11) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset14 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset14) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset14) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset14) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l59; + goto l65; } - if (isQuick(self_in_dispatchConcretize, offset11)) { + if (isQuick(self_in_dispatchConcretize, offset14)) { ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg11, destReg13)); - ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg11)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg12)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset14 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l59; + goto l65; } ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 16; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg11, destReg13)); - ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg11)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset11 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset11) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset11) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset11) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg12)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset14 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset14) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset14) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset14) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 9; - l59: /* end concretizeMoveM64rRd */; + l65: /* end concretizeMoveM64rRd */; return; case MoveXbrRR: @@ -5185,7 +5256,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, dest)); ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, index, base)); (self_in_dispatchConcretize->machineCodeSize) = 4; - goto l60; + goto l66; } ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 182; @@ -5193,7 +5264,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, index, base)); ((self_in_dispatchConcretize->machineCode))[4] = 0; (self_in_dispatchConcretize->machineCodeSize) = 5; - l60: /* end concretizeMoveXbrRR */; + l66: /* end concretizeMoveXbrRR */; return; case MoveRXbrR: @@ -5225,7 +5296,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[mcIdx + 3] = (144 + swapreg); } (self_in_dispatchConcretize->machineCodeSize) = 3 + (2 * mcIdx); - goto l61; + goto l67; } ((self_in_dispatchConcretize->machineCode))[mcIdx] = 136; ((self_in_dispatchConcretize->machineCode))[mcIdx + 1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, src)); @@ -5235,7 +5306,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[mcIdx + 4] = (144 + swapreg); } (self_in_dispatchConcretize->machineCodeSize) = 4 + (2 * mcIdx); - l61: /* end concretizeMoveRXbrR */; + l67: /* end concretizeMoveRXbrR */; return; case MoveXwrRR: @@ -5248,14 +5319,14 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, dest1)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index2, base2)); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l62; + goto l68; } ((self_in_dispatchConcretize->machineCode))[0] = 139; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, dest1)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index2, base2)); ((self_in_dispatchConcretize->machineCode))[3] = 0; (self_in_dispatchConcretize->machineCodeSize) = 4; - l62: /* end concretizeMoveXwrRR */; + l68: /* end concretizeMoveXwrRR */; return; case MoveRXwrR: @@ -5268,63 +5339,63 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, src1)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index3, base3)); (self_in_dispatchConcretize->machineCodeSize) = 3; - goto l63; + goto l69; } ((self_in_dispatchConcretize->machineCode))[0] = 137; ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, src1)); ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index3, base3)); ((self_in_dispatchConcretize->machineCode))[3] = 0; (self_in_dispatchConcretize->machineCodeSize) = 4; - l63: /* end concretizeMoveRXwrR */; + l69: /* end concretizeMoveRXwrR */; return; case MoveRdM64r: /* begin concretizeMoveRdM64r */ - srcReg12 = ((self_in_dispatchConcretize->operands))[0]; - offset12 = ((self_in_dispatchConcretize->operands))[1]; - destReg14 = ((self_in_dispatchConcretize->operands))[2]; - if (destReg14 != ESP) { - if (isQuick(self_in_dispatchConcretize, offset12)) { + srcReg13 = ((self_in_dispatchConcretize->operands))[0]; + offset15 = ((self_in_dispatchConcretize->operands))[1]; + destReg15 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg15 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset15)) { ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 17; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg14, srcReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset15 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - goto l64; + goto l70; } ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 17; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg14, srcReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset12) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset15 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset15) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset15) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset15) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 8; - goto l64; + goto l70; } - if (isQuick(self_in_dispatchConcretize, offset12)) { + if (isQuick(self_in_dispatchConcretize, offset15)) { ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 17; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg14, srcReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg14)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg15)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset15 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 6; - goto l64; + goto l70; } ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; - ((self_in_dispatchConcretize->machineCode))[2] = 17; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg14, srcReg12)); - ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg14)); - ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset12) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg15)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset15 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset15) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset15) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset15) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 9; - l64: /* end concretizeMoveRdM64r */; + l70: /* end concretizeMoveRdM64r */; return; case PopR: @@ -5346,7 +5417,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[0] = 106; ((self_in_dispatchConcretize->machineCode))[1] = (value11 & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 2; - goto l67; + goto l73; } ((self_in_dispatchConcretize->machineCode))[0] = 104; ((self_in_dispatchConcretize->machineCode))[1] = (value11 & 0xFF); @@ -5354,7 +5425,7 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value11) >> 16) & 0xFF); ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value11) >> 24) & 0xFF); (self_in_dispatchConcretize->machineCodeSize) = 5; - l67: /* end concretizePushCq */; + l73: /* end concretizePushCq */; return; case PushCw: @@ -5371,29 +5442,118 @@ dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) case PrefetchAw: /* begin concretizePrefetchAw */ if (((self_in_dispatchConcretize->maxSize)) > 0) { - addressOperand = ((self_in_dispatchConcretize->operands))[0]; + addressOperand4 = ((self_in_dispatchConcretize->operands))[0]; ((self_in_dispatchConcretize->machineCode))[0] = 15; ((self_in_dispatchConcretize->machineCode))[1] = 24; ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, 0, 5, 1)); - ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand & 0xFF); - ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand) >> 8) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand) >> 16) & 0xFF); - ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand) >> 24) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand4) >> 24) & 0xFF); } (self_in_dispatchConcretize->machineCodeSize) = (self_in_dispatchConcretize->maxSize); return; case ConvertRRd: /* begin concretizeConvertRRd */ - srcReg13 = ((self_in_dispatchConcretize->operands))[0]; - destReg15 = ((self_in_dispatchConcretize->operands))[1]; + srcReg14 = ((self_in_dispatchConcretize->operands))[0]; + destReg16 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 42; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg14, destReg16)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRdR: + /* begin concretizeConvertRdR */ + srcReg15 = ((self_in_dispatchConcretize->operands))[0]; + destReg17 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 45; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg15, destReg17)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRsRd: + /* begin concretizeConvertRsRd */ + srcReg16 = ((self_in_dispatchConcretize->operands))[0]; + destReg18 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 90; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg16, destReg18)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRdRs: + /* begin concretizeConvertRdRs */ + srcReg17 = ((self_in_dispatchConcretize->operands))[0]; + destReg19 = ((self_in_dispatchConcretize->operands))[1]; ((self_in_dispatchConcretize->machineCode))[0] = 242; ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 90; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg17, destReg19)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRsR: + /* begin concretizeConvertRsR */ + srcReg18 = ((self_in_dispatchConcretize->operands))[0]; + destReg20 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 45; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg18, destReg20)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRRs: + /* begin concretizeConvertRRs */ + srcReg19 = ((self_in_dispatchConcretize->operands))[0]; + destReg21 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; ((self_in_dispatchConcretize->machineCode))[2] = 42; - ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg13, destReg15)); + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg19, destReg21)); (self_in_dispatchConcretize->machineCodeSize) = 4; return; + case SignExtend8RR: + /* begin concretizeSignExtend8RR */ + srcReg20 = ((self_in_dispatchConcretize->operands))[0]; + destReg22 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 190; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg20, destReg22)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case SignExtend16RR: + /* begin concretizeSignExtend16RR */ + srcReg21 = ((self_in_dispatchConcretize->operands))[0]; + destReg23 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 191; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg21, destReg23)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case ZeroExtend8RR: + /* begin concretizeZeroExtend8RR */ + srcReg22 = ((self_in_dispatchConcretize->operands))[0]; + destReg24 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg22, destReg24)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case ZeroExtend16RR: + concretizeZeroExtend16RR(self_in_dispatchConcretize); + return; + default: error("Case not found and no otherwise clause"); } @@ -7455,7 +7615,7 @@ static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) { sqInt blockEntry; - usqInt end; + sqInt end; sqInt pc; sqInt result; usqInt targetpc; @@ -7499,7 +7659,7 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -8744,7 +8904,7 @@ cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt callForCogCompiledCodeCompaction(); return 0; } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -8866,7 +9026,7 @@ cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt nu if (startAddress == 0) { return ((CogMethod *) InsufficientCodeSpace); } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -9181,7 +9341,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if ((numRegsPushed == 0) && (0 >= numArgs)) { - goto l1; + goto l2; } wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); if (wordsPushedModAlignment != 0) { @@ -9189,20 +9349,20 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr /* begin SubCq:R: */ anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); } - l1: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; } genSaveRegs(backEnd, regsToSave); /* begin genMarshallNArgs:arg:arg:arg:arg: */ if (numArgs == 0) { ((AbstractInstruction *) backEnd); - goto l6; + goto l11; } if (numArgs > 1) { if (numArgs > 2) { if (numArgs > 3) { if (regOrConst3 < NoReg) { /* begin PushCq: */ - anInstruction1 = genoperand(PushCq, -2 - regOrConst3); + anInstruction4 = genoperand(PushCq, -2 - regOrConst3); } else { /* begin PushR: */ @@ -9211,7 +9371,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (regOrConst2 < NoReg) { /* begin PushCq: */ - anInstruction2 = genoperand(PushCq, -2 - regOrConst2); + anInstruction1 = genoperand(PushCq, -2 - regOrConst2); } else { /* begin PushR: */ @@ -9220,7 +9380,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (regOrConst1 < NoReg) { /* begin PushCq: */ - anInstruction3 = genoperand(PushCq, -2 - regOrConst1); + anInstruction2 = genoperand(PushCq, -2 - regOrConst1); } else { /* begin PushR: */ @@ -9229,14 +9389,14 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (regOrConst0 < NoReg) { /* begin PushCq: */ - anInstruction4 = genoperand(PushCq, -2 - regOrConst0); + anInstruction3 = genoperand(PushCq, -2 - regOrConst0); } else { /* begin PushR: */ genoperand(PushR, regOrConst0); } ((AbstractInstruction *) backEnd); -l6: /* end genMarshallNArgs:arg:arg:arg:arg: */; +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; /* begin CallFullRT: */ callTarget = ((usqInt)aRoutine); /* begin annotateCall: */ @@ -9930,10 +10090,11 @@ extABytecode(void) static sqInt extBBytecode(void) { - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte1 > 0x7F) ? byte1 - 256 : (((usqInt) extB << 8)) + byte1); + numExtB += 1; return 0; } @@ -10185,7 +10346,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10195,7 +10356,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#followForwardedMethods */ @@ -10467,12 +10628,12 @@ generateCaptureCStackPointers(sqInt captureFramePointer) { sqInt address; sqInt address1; - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; usqIntptr_t fixupSize; usqIntptr_t opcodeSize; - sqInt quickConstant; + sqInt quickConstant1; sqInt startAddress; /* begin allocateOpcodes:bytecodes: */ @@ -10491,14 +10652,14 @@ generateCaptureCStackPointers(sqInt captureFramePointer) /* begin MoveR:Aw: */ address = cFramePointerAddress(); /* begin gen:operand:literal: */ - anInstruction2 = genoperandoperand(MoveRAw, FPReg, address); + anInstruction1 = genoperandoperand(MoveRAw, FPReg, address); } /* begin MoveR:R: */ genoperandoperand(MoveRR, SPReg, TempReg); /* begin AddCq:R: */ - quickConstant = leafCallStackPointerDelta(backEnd); + quickConstant1 = leafCallStackPointerDelta(backEnd); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AddCqR, quickConstant, TempReg); + anInstruction2 = genoperandoperand(AddCqR, quickConstant1, TempReg); /* begin MoveR:Aw: */ address1 = cStackPointerAddress(); /* begin gen:operand:literal: */ @@ -10578,15 +10739,15 @@ generateClosedPICPrototype(void) jmpTarget(jumpNext, gLabel()); } /* begin MoveUniqueCw:R: */ - wordConstant1 = (subsequentPrototypeMethodOop()) + h; + wordConstant = (subsequentPrototypeMethodOop()) + h; /* begin gen:uniqueLiteral:operand: */ - anInstruction1 = genoperandoperand(MoveCwR, wordConstant1, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg); /* begin CmpC32:R: */ - wordConstant = 3133021973U + h; + wordConstant1 = 3133021973U + h; /* begin gen:literal:operand: */ opcode = CmpCwR; /* begin checkLiteral:forInstruction: */ - anInstruction = genoperandoperand(opcode, wordConstant, TempReg); + anInstruction1 = genoperandoperand(opcode, wordConstant1, TempReg); /* begin JumpLongZero: */ jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16); genConditionalBranchoperand(JumpLongZero, ((sqInt)jumpTarget)); @@ -10658,7 +10819,7 @@ generateCogMethod(sqInt selector) assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); result = outputInstructionsAt(startAddress + headerSize); assert(((startAddress + headerSize) + codeSize) == result); - padIfPossibleWithStopsFromto(backEnd, result, (startAddress + totalSize) - mapSize); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); fillInBlockHeadersAt(startAddress); method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); @@ -10730,12 +10891,12 @@ static sqInt NoDbgRegParms generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - usqIntptr_t delta; + sqInt delta; sqInt i; AbstractInstruction *instruction; sqInt length; - usqIntptr_t location; - usqIntptr_t mapEntry; + sqInt location; + sqInt mapEntry; sqInt maxDelta; usqIntptr_t mcpc; @@ -10964,7 +11125,6 @@ genGetLeafCallStackPointer(void) usqIntptr_t fixupSize; usqIntptr_t opcodeSize; sqInt quickConstant; - sqInt reg; sqInt startAddress; /* begin allocateOpcodes:bytecodes: */ @@ -10990,9 +11150,8 @@ genGetLeafCallStackPointer(void) genoperandoperand(MoveRR, SPReg, EAX); /* begin AddCq:R: */ quickConstant = leafCallStackPointerDelta(backEnd); - reg = EAX; /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AddCqR, quickConstant, reg); + anInstruction = genoperandoperand(AddCqR, quickConstant, EAX); /* begin RetN: */ genoperand(RetN, 0); @@ -11021,12 +11180,9 @@ genInnerPICAbortTrampoline(char *name) { AbstractInstruction *anInstruction; AbstractInstruction *jumpMNUCase; - sqInt quickConstant; /* begin CmpCq:R: */ - quickConstant = 0; - /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, ClassReg); + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); /* begin JumpZero: */ jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceInterpretMethodFromPICreceiver, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg); @@ -11169,9 +11325,9 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu jumpMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); if (eoCheckFlag) { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction4 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jumpItsTheReceiverStupid = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveR:R: */ @@ -11181,7 +11337,7 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* arbitrary argument count */ /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); /* begin AddCq:R: */ anInstruction = genoperandoperand(AddCqR, 1, TempReg); @@ -11194,7 +11350,7 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* begin MoveR:Mw:r: */ offset = ((1) + numArgs) * BytesPerWord; /* begin gen:operand:quickConstant:operand: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); } } jmpTarget(jumpItsTheReceiverStupid, gLabel()); @@ -12020,6 +12176,7 @@ mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annota usqInt mcpc; sqInt result; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -12192,7 +12349,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12202,7 +12359,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { ensureInYoungReferrers(cogMethod); hasYoungObj = 0; @@ -12274,7 +12431,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12284,7 +12441,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); @@ -12365,7 +12522,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12375,7 +12532,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { hasYoungObj = 0; } @@ -12483,7 +12640,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12493,7 +12650,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } if ((((cogMethod->cmType)) == CMOpenPIC) && ((isImmediate((cogMethod->selector))) @@ -12527,7 +12684,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); if (result1 != 0) { - goto l2; + goto l4; } } else { @@ -12537,7 +12694,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map1 -= 1; } - l2: /* end mapFor:performUntil:arg: */; + l4: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -12631,7 +12788,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12641,7 +12798,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } return 0; } @@ -12956,7 +13113,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -12966,7 +13123,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#maxCogMethodAddress */ @@ -13054,7 +13211,7 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -13518,6 +13675,7 @@ printPCMapPairsFor(CogMethod *cogMethod) usqInt mcpc; sqInt value; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -13725,7 +13883,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); if (result != 0) { - goto l1; + goto l2; } } else { @@ -13735,7 +13893,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#relocateCallsInClosedPIC: */ @@ -14305,7 +14463,7 @@ unlinkAllSends(void) } result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14315,7 +14473,7 @@ unlinkAllSends(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) != CMFree) { @@ -14747,7 +14905,7 @@ unlinkSendsLinkedForInvalidClasses(void) } result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14757,7 +14915,7 @@ unlinkSendsLinkedForInvalidClasses(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -14860,7 +15018,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14870,7 +15028,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -14919,7 +15077,7 @@ unlinkSendsToFree(void) } result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -14929,7 +15087,7 @@ unlinkSendsToFree(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) == CMClosedPIC) { @@ -14992,7 +15150,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -15002,7 +15160,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -15969,7 +16127,7 @@ genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*p /* CogObjectRepresentation>>#genDoubleComparison:invert: */ static sqInt NoDbgRegParms -genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison) +genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison) { AbstractInstruction *anInstruction; AbstractInstruction *compare; @@ -16239,14 +16397,14 @@ genPrimitiveBitShift(void) genConvertSmallIntegerToIntegerInReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); } /* begin JumpNegative: */ jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant = numSmallIntegerBits(); + quickConstant1 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, ClassReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); /* begin JumpGreaterOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -16269,15 +16427,15 @@ genPrimitiveBitShift(void) genoperand(RetN, 0); jmpTarget(jumpNegative, gNegateR(ClassReg)); /* begin CmpCq:R: */ - quickConstant1 = numSmallIntegerBits(); + quickConstant2 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); /* begin JumpLessOrEqual: */ jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - quickConstant2 = numSmallIntegerBits(); + quickConstant = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(MoveCqR, quickConstant2, ClassReg); + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); /* begin genPrimReturn */ @@ -16369,7 +16527,7 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); } /* begin JumpZero: */ jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -16378,19 +16536,19 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(TempReg); gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); /* begin JumpZero: */ jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin XorR:R: */ genoperandoperand(XorRR, ClassReg, Arg1Reg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, Arg1Reg); + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); } /* begin JumpGreaterOrEqual: */ jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, 1, TempReg); + anInstruction = genoperandoperand(SubCqR, 1, TempReg); jmpTarget(jumpSameSign, (convert = gLabel())); genConvertIntegerToSmallIntegerInReg(TempReg); /* begin MoveR:R: */ @@ -16829,7 +16987,7 @@ genSmallIntegerComparison(sqInt jumpOpcode) /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ static sqInt NoDbgRegParms -genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) { AbstractInstruction *anInstruction; sqInt constant; @@ -17033,11 +17191,11 @@ genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); genConvertIntegerToSmallIntegerInReg(destReg); return 0; } @@ -17054,11 +17212,11 @@ genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); return 0; } @@ -17123,7 +17281,7 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin Label */ immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, 1, destReg); + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); /* begin AlignmentNops: */ @@ -17135,11 +17293,11 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); jmpTarget(jumpCompare, gLabel()); } else { @@ -17149,7 +17307,7 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin JumpZero: */ jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, 1, destReg); + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); flag("endianness"); @@ -17307,19 +17465,19 @@ genPrimitiveAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction13 = genoperandoperand(SubCqR, 1, Arg1Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpZero: */ jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin JumpBelow: */ @@ -17327,19 +17485,19 @@ genPrimitiveAt(void) /* begin CmpCq:R: */ quickConstant2 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpBelowOrEqual: */ jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant3 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant4 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); jmpTarget(jumpNotIndexable, gLabel()); @@ -17349,7 +17507,7 @@ genPrimitiveAt(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction7 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -17367,12 +17525,12 @@ genPrimitiveAt(void) /* begin CmpCq:R: */ quickConstant5 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + anInstruction8 = genoperandoperand(CmpCqR, quickConstant5, formatReg); /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); - methodInBounds = anInstruction7; + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + methodInBounds = anInstruction9; /* begin MoveXbr:R:R: */ genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); @@ -17385,7 +17543,7 @@ genPrimitiveAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, formatReg); + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -17397,14 +17555,14 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); /* begin Jump: */ genoperand(Jump, ((sqInt)convertToIntAndReturn)); jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction11 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); jumpWordTooBig = jumpNotSmallIntegerUnsignedValueInRegister(TempReg); @@ -17416,7 +17574,7 @@ genPrimitiveAt(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, formatReg); /* begin CmpCq:R: */ - anInstruction10 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin PushR: */ @@ -17429,7 +17587,7 @@ genPrimitiveAt(void) /* begin AndCq:R: */ quickConstant6 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(AndCqR, quickConstant6, formatReg); + anInstruction13 = genoperandoperand(AndCqR, quickConstant6, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -17439,7 +17597,7 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, formatReg, Arg1Reg); /* begin AddCq:R: */ - anInstruction12 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction14 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -17527,14 +17685,14 @@ genPrimitiveAtPut(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction15 = genoperandoperand(SubCqR, 1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant7 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction17 = genoperandoperand(TstCqR, quickConstant7, TempReg); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -17545,16 +17703,16 @@ genPrimitiveAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ - quickConstant = weakArrayFormat(); + quickConstant1 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpAbove: */ jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); /* begin CmpCq:R: */ - quickConstant1 = arrayFormat(); + quickConstant2 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpBelow: */ jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin JumpNonZero: */ @@ -17564,7 +17722,7 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction3 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17576,7 +17734,7 @@ genPrimitiveAtPut(void) jmpTarget(jumpHasFixedFields, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin PushR: */ @@ -17587,13 +17745,13 @@ genPrimitiveAtPut(void) genoperand(PopR, nSlotsOrBytesReg); genConvertSmallIntegerToIntegerInReg(formatReg); /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant3 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(AndCqR, quickConstant2, formatReg); + anInstruction8 = genoperandoperand(AndCqR, quickConstant3, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); + anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); /* begin JumpBelowOrEqual: */ @@ -17612,21 +17770,21 @@ genPrimitiveAtPut(void) /* begin genJumpNotSmallInteger:scratchReg: */ jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); /* begin CmpCq:R: */ - quickConstant3 = firstByteFormat(); + quickConstant4 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstShortFormat(); + quickConstant5 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant6 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, formatReg); /* begin JumpBelow: */ jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CmpR:R: */ @@ -17638,12 +17796,12 @@ genPrimitiveAtPut(void) genConvertSmallIntegerToIntegerInReg(TempReg); if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); } /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction13 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17665,16 +17823,16 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstCompiledMethodFormat(); + quickConstant7 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, formatReg); /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin AddCq:R: */ - anInstruction12 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17689,7 +17847,7 @@ genPrimitiveAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); /* begin AndCq:R: */ - anInstruction13 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + anInstruction16 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -17704,7 +17862,7 @@ genPrimitiveAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction16 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin genPrimReturn */ @@ -17725,7 +17883,7 @@ genPrimitiveAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction14 = genoperandoperand(AddCqR, 1, Arg0Reg); + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); return 0; @@ -17857,20 +18015,20 @@ genPrimitiveMirrorNew(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction11 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); /* Is the class arg pointers with at least 3 fields? */ jumpImmediate = genJumpImmediate(Arg0Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction9 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + anInstruction10 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genGetHashFieldNonImmOfinto(Arg0Reg, halfHeaderReg); @@ -17883,84 +18041,84 @@ genPrimitiveMirrorNew(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = fixedFieldsFieldWidth(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, TempReg); + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, TempReg); + anInstruction11 = genoperandoperand(AndCqR, quickConstant4, TempReg); /* begin AndCq:R: */ - quickConstant3 = fixedFieldsOfClassFormatMask(); + quickConstant5 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + anInstruction12 = genoperandoperand(AndCqR, quickConstant5, instSpecReg); /* begin CmpCq:R: */ - quickConstant4 = nonIndexablePointerFormat(); + quickConstant6 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, TempReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant6, TempReg); /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = numSlotsMask(); + quickConstant7 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant6 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant6, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction6 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction15 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction13 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction16 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction17 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant7 = getScavengeThreshold(); + quickConstant8 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); + anInstruction18 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction14 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction15 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction16 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveCq:R: */ - quickConstant8 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction17 = genoperandoperand(MoveCqR, quickConstant8, fillReg); + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); /* begin MoveR:Mw:r: */ - anInstruction18 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction18; + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction19 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -18069,14 +18227,14 @@ genPrimitiveMirrorNewWithArg(void) jumpImmediate = genJumpImmediate(Arg0Reg); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genGetHashFieldNonImmOfinto(Arg0Reg, halfHeaderReg); @@ -18091,53 +18249,53 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = (fixedFieldsFieldWidth()) + 1; - genoperandoperand(LogicalShiftRightCqR, quickConstant1, instSpecReg); + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); + anInstruction14 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant3 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant3, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant4 = arrayFormat(); + quickConstant5 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstByteFormat(); + quickConstant6 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstLongFormat(); + quickConstant7 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + anInstruction17 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant7 = (((usqInt)maxSlots << 1) | 1); + quickConstant8 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + anInstruction18 = genoperandoperand(CmpCqR, quickConstant8, Arg0Reg); /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction15 = genoperand(PushCq, 0); + anInstruction1 = genoperand(PushCq, 0); /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); @@ -18146,22 +18304,22 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction16 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + anInstruction19 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant8 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant8, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction17 = genoperand(PushCq, 0); + anInstruction3 = genoperand(PushCq, 0); /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); @@ -18172,27 +18330,27 @@ genPrimitiveMirrorNewWithArg(void) /* begin PushCw: */ wordConstant = nilObject(); /* begin gen:literal: */ - anInstruction18 = genoperand(PushCw, wordConstant); + anInstruction4 = genoperand(PushCw, wordConstant); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction9 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction21 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction20 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction10 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction22 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction23 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); @@ -18201,7 +18359,7 @@ genPrimitiveMirrorNewWithArg(void) /* begin CmpCq:R: */ quickConstant9 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); + anInstruction24 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -18209,22 +18367,22 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction21 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); /* begin PopR: */ genoperand(PopR, fillReg); /* begin PopR: */ genoperand(PopR, TempReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction23 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveR:Mw:r: */ - anInstruction24 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction24; + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; /* begin MoveR:Mw:r: */ - anInstruction25 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction13 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction25 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -18314,7 +18472,7 @@ genPrimitiveNew(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction9 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); /* begin JumpZero: */ jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -18326,81 +18484,81 @@ genPrimitiveNew(void) quickConstant = fixedFieldsFieldWidth(); genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, TempReg); + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, TempReg); /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant4 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); + anInstruction10 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); /* begin CmpCq:R: */ - quickConstant3 = nonIndexablePointerFormat(); + quickConstant5 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, TempReg); /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = numSlotsMask(); + quickConstant6 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant5 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant5, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction13 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction11 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction14 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant6 = getScavengeThreshold(); + quickConstant7 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant6, byteSizeReg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction12 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction13 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction14 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveCq:R: */ - quickConstant7 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction15 = genoperandoperand(MoveCqR, quickConstant7, fillReg); + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction16; + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction17 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -18505,7 +18663,7 @@ genPrimitiveNewWithArg(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction12 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); /* begin JumpZero: */ jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -18517,47 +18675,47 @@ genPrimitiveNewWithArg(void) quickConstant = (fixedFieldsFieldWidth()) + 1; genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, instSpecReg); + anInstruction12 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant2 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant3 = arrayFormat(); + quickConstant4 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant3, instSpecReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstByteFormat(); + quickConstant5 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant6 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = (((usqInt)maxSlots << 1) | 1); + quickConstant7 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant6, Arg0Reg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction13 = genoperand(PushCq, 0); + anInstruction1 = genoperand(PushCq, 0); /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); @@ -18566,22 +18724,22 @@ genPrimitiveNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction14 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + anInstruction17 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant7 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant7, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction15 = genoperand(PushCq, 0); + anInstruction3 = genoperand(PushCq, 0); /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); @@ -18592,27 +18750,27 @@ genPrimitiveNewWithArg(void) /* begin PushCw: */ wordConstant = nilObject(); /* begin gen:literal: */ - anInstruction16 = genoperand(PushCw, wordConstant); + anInstruction4 = genoperand(PushCw, wordConstant); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction7 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction19 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction18 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction20 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction21 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); @@ -18621,7 +18779,7 @@ genPrimitiveNewWithArg(void) /* begin CmpCq:R: */ quickConstant8 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction10 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + anInstruction22 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -18629,20 +18787,20 @@ genPrimitiveNewWithArg(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction19 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); /* begin PopR: */ genoperand(PopR, fillReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction21 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction22; + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; /* begin MoveR:Mw:r: */ - anInstruction23 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction11 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction23 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -18718,18 +18876,18 @@ genPrimitiveShallowCopy(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction12 = genoperandoperand(MoveAwR, address, resultReg); + anInstruction = genoperandoperand(MoveAwR, address, resultReg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (ptrReg = (formatReg = SendNumArgsReg)), NoReg); /* begin CmpCq:R: */ quickConstant = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = indexablePointersFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpZero: */ jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin Label */ @@ -18738,21 +18896,21 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant2 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); /* begin JumpZero: */ jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction3 = genoperandoperand(CmpCqR, 0, slotsReg); + anInstruction14 = genoperandoperand(CmpCqR, 0, slotsReg); /* begin JumpZero: */ jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, slotsReg, TempReg); /* begin AndCq:R: */ - anInstruction4 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction15 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, slotsReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); + anInstruction16 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); /* begin AddR:R: */ @@ -18760,7 +18918,7 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant3 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); + anInstruction17 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -18768,39 +18926,39 @@ genPrimitiveShallowCopy(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction13 = genoperandoperand(MoveRAw, slotsReg, address1); + anInstruction1 = genoperandoperand(MoveRAw, slotsReg, address1); /* begin SubCq:R: */ - anInstruction14 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + anInstruction2 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); /* begin AndCq:R: */ quickConstant4 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(AndCqR, quickConstant4, TempReg); + anInstruction18 = genoperandoperand(AndCqR, quickConstant4, TempReg); /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); /* begin MoveMw:r:R: */ - anInstruction17 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); /* begin AndCq:R: */ quickConstant5 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(AndCqR, quickConstant5, TempReg); + anInstruction19 = genoperandoperand(AndCqR, quickConstant5, TempReg); /* begin MoveR:Mw:r: */ - anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); /* begin Label */ copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + anInstruction21 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); /* begin MoveMw:r:R: */ - anInstruction19 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + anInstruction7 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); /* begin MoveMw:r:R: */ - anInstruction21 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + anInstruction9 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, ptrReg, slotsReg); /* begin JumpAbove: */ @@ -18814,7 +18972,7 @@ genPrimitiveShallowCopy(void) jmpTarget(jumpVariable, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - anInstruction11 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + anInstruction22 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); /* begin JumpNonZero: */ genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); jmpTarget(jumpImmediate, jmpTarget(jumpNoSpace, jmpTarget(jumpIsMethod, jmpTarget(jumpTooBig, jmpTarget(jumpEmpty, gLabel()))))); @@ -18830,8 +18988,8 @@ genPrimitiveShallowCopy(void) static sqInt genPrimitiveStringAt(void) { + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; AbstractInstruction *anInstruction5; @@ -18862,25 +19020,25 @@ genPrimitiveStringAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 1, Arg1Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpGreaterOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpGreaterOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant2 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpLess: */ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin CmpR:R: */ @@ -18888,7 +19046,7 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg); @@ -18898,7 +19056,7 @@ genPrimitiveStringAt(void) jumpWordsDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18906,7 +19064,7 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); /* begin MoveXbr:R:R: */ genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); jmpTarget(jumpWordsDone, (done = gLabel())); @@ -18917,7 +19075,7 @@ genPrimitiveStringAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18927,7 +19085,7 @@ genPrimitiveStringAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); /* begin Jump: */ genoperand(Jump, ((sqInt)done)); jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel())))))); @@ -18986,14 +19144,14 @@ genPrimitiveStringAtPut(void) jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction10 = genoperandoperand(SubCqR, 1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant4 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(TstCqR, quickConstant4, TempReg); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -19004,31 +19162,31 @@ genPrimitiveStringAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - quickConstant = firstLongFormat(); + quickConstant1 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpBelow: */ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant1 = firstCompiledMethodFormat(); + quickConstant2 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant2 = firstByteFormat(); + quickConstant3 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant3 = firstShortFormat(); + quickConstant4 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg); + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin CmpR:R: */ @@ -19039,7 +19197,7 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction8 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -19054,7 +19212,7 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); /* begin AndCq:R: */ - anInstruction6 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -19067,7 +19225,7 @@ genPrimitiveStringAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction11 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin genPrimReturn */ @@ -19080,7 +19238,7 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -19091,7 +19249,7 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -19108,7 +19266,7 @@ genPrimitiveStringAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg); + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); return CompletePrimitive; @@ -19304,51 +19462,48 @@ genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt s usqIntptr_t allocSize; AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction21; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; - AbstractInstruction *anInstruction7; - AbstractInstruction *anInstruction8; AbstractInstruction *jumpFail; usqLong newFloatHeader; sqInt quickConstant; sqInt quickConstant1; - sqInt quickConstant2; allocSize = BaseHeaderSize + (sizeof(double)); newFloatHeader = headerForSlotsformatclassIndex((sizeof(double)) / BytesPerWord, firstLongFormat(), ClassFloatCompactIndex); /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction1 = genoperandoperand(MoveAwR, address, resultReg); + anInstruction = genoperandoperand(MoveAwR, address, resultReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction2 = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); + anInstruction1 = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant1 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, scratch1); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant1, scratch1); /* begin JumpAboveOrEqual: */ jumpFail = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction3 = genoperandoperand(MoveRAw, scratch1, address1); + anInstruction2 = genoperandoperand(MoveRAw, scratch1, address1); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) newFloatHeader); + quickConstant = ((usqInt) newFloatHeader); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, scratch1); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, scratch1); /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (newFloatHeader >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, scratch1); + anInstruction21 = genoperandoperand(MoveCqR, newFloatHeader >> 32, scratch1); /* begin MoveR:Mw:r: */ - anInstruction7 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); + anInstruction3 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); /* begin MoveRd:M64:r: */ - anInstruction8 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); + anInstruction5 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); return jumpFail; } @@ -19452,11 +19607,11 @@ genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) /* begin Label */ loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); @@ -19493,11 +19648,11 @@ genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, Abst but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); @@ -19540,16 +19695,16 @@ genEnsureOopInRegNotForwardedscratchRegupdatingMwr(sqInt reg, sqInt scratch, sqI but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); jmpTarget(ok, jmpTarget(imm, gLabel())); @@ -19592,16 +19747,16 @@ genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); assert((reg == Arg0Reg) && ((scratch == TempReg) && (objReg == ReceiverResultReg))); @@ -19675,6 +19830,7 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; AbstractInstruction *anInstruction15; AbstractInstruction *anInstruction16; @@ -19703,7 +19859,6 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction37; AbstractInstruction *anInstruction38; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; @@ -19722,43 +19877,42 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) sqInt quickConstant3; sqInt quickConstant4; sqInt quickConstant5; - sqInt quickConstant6; AbstractInstruction * self_in_saveAndRestoreLinkRegAround; sqInt slotSize; /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ /* begin MoveMw:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); /* begin JumpZero: */ jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, 0); jmpTarget(jumpSingle, gLabel()); /* begin OrCq:R: */ - anInstruction16 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); switch (isInBlock) { case InFullBlock: /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 3, ClassReg); + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); break; case InVanillaBlock: /* begin SubCq:R: */ - anInstruction9 = genoperandoperand(SubCqR, 3, ClassReg); + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); /* begin MoveM16:r:R: */ - anInstruction10 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, TempReg, ClassReg); break; case 0: /* begin SubCq:R: */ - anInstruction11 = genoperandoperand(SubCqR, 1, ClassReg); + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); break; default: error("Case not found and no otherwise clause"); @@ -19771,74 +19925,72 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction18 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction10 = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant4 = ((usqInt) header); + quickConstant2 = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction19 = genoperandoperand(MoveCqR, quickConstant4, TempReg); + anInstruction11 = genoperandoperand(MoveCqR, quickConstant2, TempReg); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant5 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction21 = genoperandoperand(MoveCqR, quickConstant5, TempReg); + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, ReceiverResultReg, TempReg); /* begin AddCq:R: */ - quickConstant = smallObjectBytesForSlots(slotSize); + quickConstant4 = smallObjectBytesForSlots(slotSize); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AddCqR, quickConstant, TempReg); + anInstruction32 = genoperandoperand(AddCqR, quickConstant4, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction23 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction13 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant1 = getScavengeThreshold(); + quickConstant5 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + anInstruction33 = genoperandoperand(CmpCqR, quickConstant5, TempReg); /* begin JumpAboveOrEqual: */ jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ continuation = genoperandoperand(MoveRR, FPReg, TempReg); genSetSmallIntegerTagsIn(TempReg); /* begin MoveR:Mw:r: */ - anInstruction24 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ - anInstruction25 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); genSetSmallIntegerTagsIn(TempReg); /* begin MoveR:Mw:r: */ - anInstruction26 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction27 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction28 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); + anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction29 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + anInstruction19 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, SPReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant2 = 2; - genoperandoperand(LogicalShiftRightCqR, quickConstant2, TempReg); + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin SubCq:R: */ - quickConstant6 = 4; + quickConstant3 = 4; /* begin gen:quickConstant:operand: */ - anInstruction30 = genoperandoperand(SubCqR, quickConstant6, TempReg); + anInstruction20 = genoperandoperand(SubCqR, quickConstant3, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, SendNumArgsReg, TempReg); genConvertIntegerToSmallIntegerInReg(TempReg); /* begin MoveR:Mw:r: */ - anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); + anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); if (isInBlock > 0) { /* begin MoveR:R: */ genoperandoperand(MoveRR, SendNumArgsReg, TempReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 2, TempReg); + anInstruction29 = genoperandoperand(AddCqR, 2, TempReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); } @@ -19850,17 +20002,17 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) } else { /* begin MoveCq:R: */ - anInstruction38 = genoperandoperand(MoveCqR, constant, TempReg); + anInstruction30 = genoperandoperand(MoveCqR, constant, TempReg); } } /* begin MoveR:Mw:r: */ - anInstruction32 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ - anInstruction33 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + anInstruction24 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction34 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); + anInstruction25 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); /* begin MoveCq:R: */ - anInstruction35 = genoperandoperand(MoveCqR, 1, ClassReg); + anInstruction26 = genoperandoperand(MoveCqR, 1, ClassReg); /* begin CmpR:R: */ loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); /* begin JumpGreater: */ @@ -19870,32 +20022,32 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin SubR:R: */ genoperandoperand(SubRR, ClassReg, TempReg); /* begin AddCq:R: */ - anInstruction3 = genoperandoperand(AddCqR, 2, TempReg); + anInstruction34 = genoperandoperand(AddCqR, 2, TempReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); + anInstruction35 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); /* begin SubCq:R: */ - anInstruction36 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); + anInstruction27 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); jmpTarget(exit, gLabel()); /* begin MoveCq:R: */ - quickConstant3 = nilObject(); + quickConstant1 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(MoveCqR, quickConstant3, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, ClassReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + anInstruction36 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); + anInstruction37 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); /* begin SubCq:R: */ - anInstruction37 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); - loopHead = anInstruction37; + anInstruction28 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + loopHead = anInstruction28; /* begin CmpR:R: */ genoperandoperand(CmpRR, SPReg, ClassReg); /* begin JumpBelowOrEqual: */ @@ -19904,7 +20056,7 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + anInstruction38 = genoperandoperand(AddCqR, 1, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); jmpTarget(exit, gLabel()); @@ -19990,9 +20142,9 @@ genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, mask, destReg); + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); return 0; } @@ -20008,11 +20160,11 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); return 0; } @@ -20025,11 +20177,11 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) { - AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; sqInt offset; - sqInt quickConstant1; + sqInt quickConstant; sqInt quickConstant2; assert(instReg != destReg); @@ -20038,24 +20190,24 @@ genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt /* begin MoveR:R: */ genoperandoperand(MoveRR, instReg, scratchReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = classTableMajorIndexShift(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, scratchReg); + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); assert(!(shouldAnnotateObjectReference(classTableRootObj()))); /* begin MoveMw:r:R: */ offset = (classTableRootObj()) + BaseHeaderSize; /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instReg, scratchReg); /* begin AndCq:R: */ quickConstant2 = classTableMinorIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); /* begin AddCq:R: */ - anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); + anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); return 0; @@ -20091,27 +20243,27 @@ genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, /* begin AndCq:R: */ quickConstant1 = tagMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); /* begin JumpNonZero: */ jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); /* begin AndCq:R: */ quickConstant2 = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); if (!instRegIsReceiver) { /* if it is forwarded... */ /* begin CmpCq:R: */ quickConstant = isForwardedObjectClassIndexPun(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, scratchReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); /* begin JumpNonZero: */ jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); jmpTarget(jumpNotForwarded, gLabel()); @@ -20192,11 +20344,11 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s if (scratchRegOrNone == NoReg) { flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); } else { /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, destReg, scratchRegOrNone); /* begin LogicalShiftRightCq:R: */ @@ -20206,7 +20358,7 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s /* begin AndCq:R: */ quickConstant1 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, destReg); + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); return 0; } @@ -20341,6 +20493,7 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) sqInt address1; AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; @@ -20348,14 +20501,12 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; - AbstractInstruction *anInstruction9; sqInt constant; usqLong header; sqInt i; sqInt offset; sqInt quickConstant; sqInt quickConstant1; - sqInt quickConstant2; AbstractInstruction *skip; assert(size < (numSlotsMask())); @@ -20363,19 +20514,17 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); if (initialized && (size > 0)) { /* begin genMoveConstant:R: */ @@ -20385,25 +20534,25 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) } else { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, constant, TempReg); + anInstruction7 = genoperandoperand(MoveCqR, constant, TempReg); } for (i = 0; i < size; i += 1) { /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); } } /* begin LoadEffectiveAddressMw:r:R: */ offset = smallObjectBytesForSlots(size); /* begin gen:quickConstant:operand:operand: */ - anInstruction8 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction9 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant1 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction8 = genoperandoperand(CmpCqR, quickConstant1, TempReg); /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CallRT: */ @@ -20445,7 +20594,6 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq sqInt quickConstant1; sqInt quickConstant2; sqInt quickConstant3; - sqInt quickConstant4; AbstractInstruction *skip; @@ -20459,29 +20607,27 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); /* begin MoveR:Mw:r: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction6 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction7 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant3 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CallRT: */ @@ -20489,19 +20635,19 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq (abstractInstruction->annotation = IsRelativeCall); jmpTarget(skip, gLabel()); /* begin MoveR:Mw:r: */ - anInstruction8 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant3 = (((usqInt)bcpc << 1) | 1); + quickConstant1 = (((usqInt)bcpc << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(MoveCqR, quickConstant3, TempReg); + anInstruction8 = genoperandoperand(MoveCqR, quickConstant1, TempReg); /* begin MoveR:Mw:r: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant4 = (((usqInt)numArgs << 1) | 1); + quickConstant2 = (((usqInt)numArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(MoveCqR, quickConstant4, TempReg); + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); /* begin MoveR:Mw:r: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); return 0; } @@ -20623,9 +20769,9 @@ genPrimitiveObjectAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); /* begin CmpCq:R: */ - quickConstant = (((usqInt)1 << 1) | 1); + quickConstant1 = (((usqInt)1 << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, Arg0Reg); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); /* begin JumpNonZero: */ jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveR:R: */ @@ -20636,16 +20782,16 @@ genPrimitiveObjectAt(void) genoperand(RetN, 0); jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); /* begin SubCq:R: */ - quickConstant1 = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(SubCqR, quickConstant1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, headerReg, Arg0Reg); /* begin JumpAbove: */ jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -20981,8 +21127,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); @@ -21019,8 +21165,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -21057,7 +21203,7 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin genStoreTrampolineCall: */ if (index >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, index, TempReg); + anInstruction = genoperandoperand(MoveCqR, index, TempReg); /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); (abstractInstruction1->annotation = IsRelativeCall); @@ -21068,8 +21214,8 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -21082,11 +21228,11 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ - anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); jmpTarget(immutabilityFailure, gLabel()); return 0; } @@ -21257,9 +21403,9 @@ maybeCompileRetryOnPrimitiveFail(sqInt primIndex) /* begin MoveAw:R: */ address = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); } @@ -21270,9 +21416,9 @@ maybeCompileRetryOnPrimitiveFail(sqInt primIndex) /* begin MoveAw:R: */ address1 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address1, TempReg); + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); /* begin JumpNonZero: */ jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); } @@ -21390,8 +21536,8 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse } else { /* begin PushCq: */ - anInstruction = genoperand(PushCq, constant); - inst = anInstruction; + anInstruction1 = genoperand(PushCq, constant); + inst = anInstruction1; } } else { @@ -21400,7 +21546,7 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse offset = (self_in_ensureSpilledAtfrom->offset); baseReg = (self_in_ensureSpilledAtfrom->registerr); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); /* begin PushR: */ inst = genoperand(PushR, TempReg); } @@ -21626,17 +21772,17 @@ compileGetErrorCode(void) /* begin MoveAw:R: */ address = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); primErrorTable = primErrTable(); primErrorTableSize = lengthOf(primErrorTable); flag("use CmpCqR if pc mapping means stable contexts never contain native pcs"); /* begin CmpCw:R: */ - anInstruction1 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); + anInstruction4 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); /* begin JumpAboveOrEqual: */ jmpIntError = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); genFetchIndexRegisterfrominto(TempReg, primErrorTable, ClassReg); @@ -21648,11 +21794,11 @@ compileGetErrorCode(void) genoperandoperand(MoveRR, TempReg, ClassReg); jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction1 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address1 = primFailCodeAddress(); /* begin gen:operand:literal: */ - anInstruction4 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address1); jmpTarget(jmpNoError, gLabel()); } @@ -21681,27 +21827,27 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) sqInt address6; sqInt address8; sqInt address9; - AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; AbstractInstruction *anInstruction17; AbstractInstruction *anInstruction18; AbstractInstruction *anInstruction19; - AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction20; - AbstractInstruction *anInstruction21; AbstractInstruction *anInstruction22; AbstractInstruction *anInstruction23; - AbstractInstruction *anInstruction24; AbstractInstruction *anInstruction25; AbstractInstruction *anInstruction26; AbstractInstruction *anInstruction27; AbstractInstruction *anInstruction28; - AbstractInstruction *anInstruction29; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; @@ -21714,7 +21860,6 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) AbstractInstruction *jmp; AbstractInstruction *jmpSampleNonPrim; AbstractInstruction *jmpSamplePrim; - sqInt literal; sqInt offset; sqInt offset1; sqInt offset2; @@ -21735,11 +21880,11 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveAw:R: */ address = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); /* begin MoveAw:R: */ address1 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address1, ClassReg); + anInstruction1 = genoperandoperand(MoveAwR, address1, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -21752,27 +21897,27 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); } /* begin MoveCq:R: */ - anInstruction23 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction17 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address11 = primFailCodeAddress(); /* begin gen:operand:literal: */ - anInstruction24 = genoperandoperand(MoveRAw, TempReg, address11); + anInstruction18 = genoperandoperand(MoveRAw, TempReg, address11); if (methodOrBlockNumArgs != 0) { /* begin MoveCq:R: */ - anInstruction6 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + anInstruction3 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); } /* begin MoveR:Aw: */ address12 = argumentCountAddress(); /* begin gen:operand:literal: */ - anInstruction25 = genoperandoperand(MoveRAw, TempReg, address12); + anInstruction19 = genoperandoperand(MoveRAw, TempReg, address12); if (flags & PrimCallNeedsPrimitiveFunction) { /* begin MoveCw:R: */ - anInstruction7 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); + anInstruction4 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); /* begin MoveR:Aw: */ address3 = primitiveFunctionPointerAddress(); /* begin gen:operand:literal: */ - anInstruction8 = genoperandoperand(MoveRAw, TempReg, address3); - primSetFunctionLabel = anInstruction8; + anInstruction5 = genoperandoperand(MoveRAw, TempReg, address3); + primSetFunctionLabel = anInstruction5; } if (flags & (PrimCallNeedsNewMethod + PrimCallMayCallBack)) { @@ -21784,16 +21929,16 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction9 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction6 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); /* begin MoveR:Aw: */ address4 = newMethodAddress(); /* begin gen:operand:literal: */ - anInstruction10 = genoperandoperand(MoveRAw, TempReg, address4); + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address4); } /* begin PrefetchAw: */ address13 = primFailCodeAddress(); /* begin gen:literal: */ - anInstruction26 = genoperand(PrefetchAw, address13); + anInstruction20 = genoperand(PrefetchAw, address13); if (flags & PrimCallMayCallBack) { /* Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode. */ @@ -21805,12 +21950,11 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) ? cePrimReturnEnterCogCodeProfiling : cePrimReturnEnterCogCode); /* begin PushCw: */ - anInstruction13 = genoperand(PushCw, retpc); + anInstruction22 = genoperand(PushCw, retpc); /* begin JumpFullRT: */ /* begin annotateCall: */ - literal = ((sqInt)(((sqInt)primitiveRoutine))); - anInstruction11 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); - abstractInstruction = anInstruction11; + anInstruction23 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); + abstractInstruction = anInstruction23; (abstractInstruction->annotation = IsRelativeCall); primInvokeInstruction = abstractInstruction; @@ -21821,8 +21965,8 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* Call the C primitive routine. */ /* begin CallFullRT: */ /* begin annotateCall: */ - anInstruction27 = genoperand(CallFull, ((sqInt)primitiveRoutine)); - abstractInstruction1 = anInstruction27; + anInstruction26 = genoperand(CallFull, ((sqInt)primitiveRoutine)); + abstractInstruction1 = anInstruction26; (abstractInstruction1->annotation = IsRelativeCall); primInvokeInstruction = abstractInstruction1; @@ -21831,11 +21975,11 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveAw:R: */ address5 = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address5, TempReg); + anInstruction8 = genoperandoperand(MoveAwR, address5, TempReg); /* begin MoveAw:R: */ address6 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction15 = genoperandoperand(MoveAwR, address6, ClassReg); + anInstruction9 = genoperandoperand(MoveAwR, address6, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -21850,24 +21994,24 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) address8 = instructionPointerAddress(); reg = ClassReg; /* begin gen:literal:operand: */ - anInstruction17 = genoperandoperand(MoveAwR, address8, reg); + anInstruction11 = genoperandoperand(MoveAwR, address8, reg); genLoadStackPointers(backEnd); /* begin MoveAw:R: */ address9 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction18 = genoperandoperand(MoveAwR, address9, TempReg); + anInstruction12 = genoperandoperand(MoveAwR, address9, TempReg); /* begin PushR: */ genoperand(PushR, ClassReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction25 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpNonZero: */ jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ offset1 = BytesPerWord; /* begin gen:quickConstant:operand:operand: */ - anInstruction19 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + anInstruction13 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, BytesPerWord); } @@ -21882,8 +22026,8 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin CallFullRT: */ callTarget = ((usqIntptr_t)ceCheckProfileTick); /* begin annotateCall: */ - anInstruction28 = genoperand(CallFull, callTarget); - abstractInstruction2 = anInstruction28; + anInstruction27 = genoperand(CallFull, callTarget); + abstractInstruction2 = anInstruction27; (abstractInstruction2->annotation = IsRelativeCall); /* begin Jump: */ @@ -21891,16 +22035,16 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) } jmpTarget(jmpSampleNonPrim, gLabel()); /* begin MoveCq:R: */ - anInstruction20 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction14 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address10 = newMethodAddress(); /* begin gen:operand:literal: */ - anInstruction21 = genoperandoperand(MoveRAw, TempReg, address10); + anInstruction15 = genoperandoperand(MoveRAw, TempReg, address10); /* begin CallFullRT: */ callTarget1 = ((usqIntptr_t)ceCheckProfileTick); /* begin annotateCall: */ - anInstruction29 = genoperand(CallFull, callTarget1); - abstractInstruction3 = anInstruction29; + anInstruction28 = genoperand(CallFull, callTarget1); + abstractInstruction3 = anInstruction28; (abstractInstruction3->annotation = IsRelativeCall); /* begin Jump: */ @@ -21913,7 +22057,7 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset2 = BytesPerWord * (methodOrBlockNumArgs + (1)); /* begin gen:quickConstant:operand:operand: */ - anInstruction22 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + anInstruction16 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); } return 0; } @@ -21948,18 +22092,18 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); } annotateobjRef(gCmpCwR(selector, TempReg), selector); /* begin JumpNonZero: */ @@ -21968,11 +22112,11 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, SendNumArgsReg, TempReg); @@ -21988,7 +22132,7 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh static void NoDbgRegParms compileOpenPICnumArgs(sqInt selector, sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -22011,13 +22155,13 @@ compileOpenPICnumArgs(sqInt selector, sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - itsAHit = anInstruction2; + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); jumpBCMethod = genJumpImmediate(ClassReg); jmpTarget(jumpBCMethod, picInterpretAbort); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); /* begin JumpR: */ genoperand(JumpR, ClassReg); jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); @@ -22064,18 +22208,18 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, selectorReg, TempReg); @@ -22085,11 +22229,11 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, SendNumArgsReg, TempReg); @@ -22309,6 +22453,7 @@ genExtJumpIfFalse(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(falseObject(), target); } @@ -22332,6 +22477,7 @@ genExtJumpIfTrue(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(trueObject(), target); } @@ -22344,7 +22490,7 @@ genExtJumpIfTrue(void) static sqInt genExtNopBytecode(void) { - extA = (extB = 0); + extA = (numExtB = (extB = 0)); return 0; } @@ -22363,6 +22509,7 @@ genExtPushIntegerBytecode(void) value = byte1 + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; return genPushLiteral((((usqInt)value << 1) | 1)); } @@ -22409,6 +22556,7 @@ genExtPushPseudoVariableOrOuterBytecode(void) ext = extB; extB = 0; + numExtB = 0; switch (ext) { case 0: @@ -22488,6 +22636,7 @@ genExtSendAbsentDynamicSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentDynamicSupernumArgs(litIndex, nArgs); } @@ -22507,6 +22656,7 @@ genExtSendAbsentImplicitBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentImplicitnumArgs(litIndex, nArgs); } @@ -22528,6 +22678,7 @@ genExtSendAbsentOuterBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byte2; return genSendAbsentOuternumArgsdepth(litIndex, nArgs, depth); } @@ -22548,6 +22699,7 @@ genExtSendAbsentSelfBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentSelfnumArgs(litIndex, nArgs); } @@ -22567,6 +22719,7 @@ genExtSendBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendnumArgs(litIndex, nArgs); } @@ -22590,6 +22743,7 @@ genExtSendSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return (isDirected ? genSendDirectedSupernumArgs(litIndex, nArgs) : genSendSupernumArgs(litIndex, nArgs)); @@ -22695,6 +22849,7 @@ genExtUnconditionalJump(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; if (distance < 0) { return genJumpBackTo(target); @@ -22725,7 +22880,7 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) { sqInt address; sqInt address1; - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; @@ -22736,24 +22891,24 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) /* begin MoveAb:R: */ address = primTraceLogIndexAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAbR, address, r2); + anInstruction1 = genoperandoperand(MoveAbR, address, r2); /* begin MoveR:R: */ genoperandoperand(MoveRR, r2, r1); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 1, r1); + anInstruction5 = genoperandoperand(AddCqR, 1, r1); /* begin MoveR:Ab: */ address1 = primTraceLogIndexAddress(); /* begin gen:operand:literal: */ - anInstruction3 = genoperandoperand(MoveRAb, r1, address1); + anInstruction2 = genoperandoperand(MoveRAb, r1, address1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), r1))); /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, selector); /* begin gen:quickConstant:operand:operand: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); /* begin MoveCw:R: */ wordConstant = ((sqInt)(primTraceLogAddress())); /* begin gen:literal:operand: */ - anInstruction5 = genoperandoperand(MoveCwR, wordConstant, r1); + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, r1); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, r2, r1); } @@ -22848,7 +23003,7 @@ genLongUnconditionalForwardJump(void) static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -22871,14 +23026,14 @@ genLookupForPerformNumArgs(sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - itsAHit = anInstruction2; + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); /* Adjust arguments and jump to the method's unchecked entry-point. */ jumpInterpret = genJumpImmediate(ClassReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); adjustArgumentsForPerform(numArgs); /* begin JumpR: */ genoperand(JumpR, ClassReg); @@ -22940,15 +23095,15 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) sqInt address7; sqInt address8; AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; - AbstractInstruction *anInstruction15; AbstractInstruction *anInstruction16; AbstractInstruction *anInstruction17; - AbstractInstruction *anInstruction3; - AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; AbstractInstruction *anInstruction9; sqInt callTarget; AbstractInstruction *continuePostSample; @@ -22964,11 +23119,11 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); /* begin MoveAw:R: */ address1 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address1, ClassReg); + anInstruction2 = genoperandoperand(MoveAwR, address1, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -22981,21 +23136,21 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address6 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address6, TempReg); + anInstruction12 = genoperandoperand(MoveAwR, address6, TempReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction16 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpNonZero: */ jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveAw:R: */ address5 = instructionPointerAddress(); /* begin gen:literal:operand: */ - anInstruction9 = genoperandoperand(MoveAwR, address5, ClassReg); + anInstruction7 = genoperandoperand(MoveAwR, address5, ClassReg); genLoadStackPointers(backEnd); /* begin MoveMw:r:R: */ - anInstruction10 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + anInstruction8 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction11 = genoperandoperandoperand(MoveRMwr, ClassReg, 0, SPReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, 0, SPReg); /* begin RetN: */ genoperand(RetN, 0); @@ -23003,16 +23158,16 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address7 = cStackPointerAddress(); /* begin gen:literal:operand: */ - anInstruction15 = genoperandoperand(MoveAwR, address7, SPReg); + anInstruction13 = genoperandoperand(MoveAwR, address7, SPReg); compileCallFornumArgsargargargargresultRegregsToSave(ceActivateFailingPrimitiveMethod, 1, SendNumArgsReg, null, null, null, NoReg, 0); /* begin MoveAw:R: */ address8 = instructionPointerAddress(); reg = ClassReg; /* begin gen:literal:operand: */ - anInstruction16 = genoperandoperand(MoveAwR, address8, reg); + anInstruction14 = genoperandoperand(MoveAwR, address8, reg); genLoadStackPointers(backEnd); /* begin MoveMw:r:R: */ - anInstruction13 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, ReceiverResultReg); + anInstruction11 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, ReceiverResultReg); /* begin PushR: */ genoperand(PushR, ClassReg); @@ -23445,7 +23600,7 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) CogBlockMethod *cogMethod1; BytecodeDescriptor *descriptor; sqInt distance; - sqInt endbcpc; + usqInt endbcpc; sqInt errCode; CogMethod *homeMethod; sqInt isBackwardBranch; @@ -24310,14 +24465,14 @@ addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCo static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs) { - AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction10; - AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; AbstractInstruction *anInstruction14; - AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; - AbstractInstruction *anInstruction9; sqInt index; assert((numRegArgs()) <= 2); @@ -24331,29 +24486,29 @@ adjustArgumentsForPerform(sqInt numArgs) } if ((2 + 1) == numArgs) { /* begin MoveMw:r:R: */ - anInstruction9 = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); + anInstruction6 = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); /* begin MoveMw:r:R: */ - anInstruction6 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg1Reg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg1Reg); /* begin MoveMw:r:R: */ - anInstruction7 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, Arg0Reg); + anInstruction4 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, Arg0Reg); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); + anInstruction14 = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); /* begin MoveR:Mw:r: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); + anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); return; } for (index = (numArgs - 1); index >= 1; index += -1) { /* begin MoveMw:r:R: */ - anInstruction13 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + anInstruction10 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); } /* begin PopR: */ genoperand(PopR, TempReg); /* begin MoveR:Mw:r: */ - anInstruction15 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); } @@ -24476,7 +24631,8 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) /* begin assertExtsAreConsumed: */ if (!((descriptor->isExtension))) { assert((extA == 0) - && (extB == 0)); + && ((extB == 0) + && (numExtB == 0))); } traceDescriptor(descriptor); traceSimStack(); @@ -24498,6 +24654,7 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) generateBranchAround = !((isUnconditionalBranch(descriptor)) || ((descriptor->isReturn))); } + /* begin nextBytecodePCFor:exts: */ bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) : 0)); @@ -24662,13 +24819,13 @@ compileBlockFrameBuild(BlockStart *blockStart) if (((blockStart->numInitialNils)) > 0) { if (((blockStart->numInitialNils)) > 1) { /* begin genMoveNilR: */ - constant1 = nilObject(); - if (shouldAnnotateObjectReference(constant1)) { - annotateobjRef(gMoveCwR(constant1, TempReg), constant1); + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant1, TempReg); + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); } for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { /* begin PushR: */ @@ -24677,13 +24834,13 @@ compileBlockFrameBuild(BlockStart *blockStart) } else { /* begin genPushConstant: */ - constant = nilObject(); - if (shouldAnnotateObjectReference(constant)) { - annotateobjRef(gPushCw(constant), constant); + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); } else { /* begin PushCq: */ - anInstruction1 = genoperand(PushCq, constant); + anInstruction1 = genoperand(PushCq, constant1); } } } @@ -24901,7 +25058,7 @@ compileFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); } /* begin PushR: */ genoperand(PushR, SendNumArgsReg); @@ -24931,7 +25088,7 @@ compileFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); @@ -24940,7 +25097,7 @@ compileFrameBuild(void) (stackCheckLabel->annotation = HasBytecodePC); if (numIRCs > 0) { /* begin PrefetchAw: */ - anInstruction2 = genoperand(PrefetchAw, theIRCs); + anInstruction1 = genoperand(PrefetchAw, theIRCs); } initSimStackForFramefulMethod(initialPC); @@ -25006,7 +25163,7 @@ compileTwoPathFrameBuild(void) /* begin CmpCq:R: */ quickConstant = storeCheckBoundary(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); /* begin JumpAboveOrEqual: */ jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -25039,7 +25196,7 @@ compileTwoPathFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); } /* begin PushR: */ genoperand(PushR, SendNumArgsReg); @@ -25056,7 +25213,7 @@ compileTwoPathFrameBuild(void) /* begin MoveAw:R: */ address = stackLimitAddress(); /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, TempReg, SPReg); if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { @@ -25069,7 +25226,7 @@ compileTwoPathFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); @@ -25078,7 +25235,7 @@ compileTwoPathFrameBuild(void) (stackCheckLabel->annotation = HasBytecodePC); if (numIRCs > 0) { /* begin PrefetchAw: */ - anInstruction2 = genoperand(PrefetchAw, theIRCs); + anInstruction1 = genoperand(PrefetchAw, theIRCs); } initSimStackForFramefulMethod(initialPC); @@ -25171,13 +25328,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction1 = gen(Nop); + abstractInstruction = gen(Nop); } else { /* begin Label */ - abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction1->annotation = HasBytecodePC); + (abstractInstruction->annotation = HasBytecodePC); return 0; } break; @@ -25186,13 +25343,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction2 = gen(Nop); + abstractInstruction1 = gen(Nop); } else { /* begin Label */ - abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction2->annotation = HasBytecodePC); + (abstractInstruction1->annotation = HasBytecodePC); return 0; case 4: @@ -25237,8 +25394,8 @@ doubleExtendedDoAnythingBytecode(void) assert(needsFrame); assert(!(prevInstIsPCAnnotated())); /* begin annotateBytecode: */ - abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction->annotation = HasBytecodePC); + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); return 0; } @@ -25522,7 +25679,7 @@ genExtPushClosureBytecode(void) assert(needsFrame); startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); - extA = (extB = 0); + extA = (numExtB = (extB = 0)); /* begin genInlineClosure:numArgs:numCopied: */ assert(getActiveContextAllocatesInMachineCode()); voidReceiverResultRegContainsSelf(); @@ -25788,7 +25945,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) popToReg(ssTop(), argReg1); if (((ssValue(1))->spilled)) { /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); } } } @@ -25823,7 +25980,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant, rcvrReg); + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); } } else { @@ -25835,7 +25992,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant1, argReg); + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); } } else { @@ -25905,11 +26062,11 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm = genJumpImmediate(argReg); /* begin MoveMw:r:R: */ - anInstruction11 = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant, TempReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, argReg, argReg); @@ -25935,11 +26092,11 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm1 = genJumpImmediate(rcvrReg); /* begin MoveMw:r:R: */ - anInstruction12 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); /* begin AndCq:R: */ quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant1, TempReg); + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); /* begin JumpNonZero: */ ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, rcvrReg, rcvrReg); @@ -25968,16 +26125,16 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC { AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; sqInt constant; sqInt constant1; + sqInt constant11; sqInt constant2; sqInt constant3; sqInt constant4; - sqInt constant5; AbstractInstruction *jumpEqual; AbstractInstruction *jumpNotEqual; AbstractInstruction *label; @@ -25996,19 +26153,19 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); } } else { if (rcvrIsConstant) { /* begin genCmpConstant:R: */ - constant5 = ((ssValue(1))->constant); - if (shouldAnnotateObjectReference(constant5)) { - annotateobjRef(gCmpCwR(constant5, argReg), constant5); + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant5, argReg); + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); } } else { @@ -26036,7 +26193,7 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction2 = genoperandoperand(MoveCqR, constant, resultReg); + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); } } else { @@ -26047,7 +26204,7 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, constant1, resultReg); + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); } } /* begin Jump: */ @@ -26058,15 +26215,15 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC (shouldAnnotateObjectReference(constant2) ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) : (/* begin MoveCq:R: */ - (anInstruction4 = genoperandoperand(MoveCqR, constant2, resultReg)), - anInstruction4))) + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + anInstruction2))) : (/* begin genMoveTrueR: */ (constant3 = trueObject()), (shouldAnnotateObjectReference(constant3) ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) : (/* begin MoveCq:R: */ - (anInstruction5 = genoperandoperand(MoveCqR, constant3, resultReg)), - anInstruction5))))); + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + anInstruction3))))); jmpTarget(jumpNotEqual, gLabel()); ssPushRegister(resultReg); return 0; @@ -26189,7 +26346,7 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) } else { /* begin SubCq:R: */ - anInstruction1 = genoperandoperand(SubCqR, boolean, TempReg); + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); } /* begin JumpZero: */ jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); @@ -26207,7 +26364,7 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) ? (trueObject()) - (falseObject()) : (falseObject()) - (trueObject())); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); /* begin JumpZero: */ ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); genCallMustBeBooleanFor(boolean); @@ -26248,19 +26405,19 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen } if (sendTable == selfSendTrampolines) { annotation = IsNSSelfSend; - goto l2; + goto l1; } if (sendTable == dynamicSuperSendTrampolines) { annotation = IsNSDynamicSuperSend; - goto l2; + goto l1; } if (sendTable == superSendTrampolines) { annotation = IsSuperSend; - goto l2; + goto l1; } assert(sendTable == ordinarySendTrampolines); annotation = IsSendCall; -l2: /* end annotationForSendTable: */; +l1: /* end annotationForSendTable: */; if ((annotation == IsSuperSend) || (0)) { genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); @@ -26291,12 +26448,12 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen static sqInt NoDbgRegParms genMethodAbortTrampolineFor(sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *jumpSICMiss; zeroOpcodeIndex(); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); /* begin JumpNonZero: */ jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); @@ -26423,7 +26580,7 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ClassReg); @@ -26438,7 +26595,7 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant1 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); /* begin JumpLess: */ jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); @@ -26446,7 +26603,7 @@ genPrimitiveClosureValue(void) /* begin MoveM16:r:R: */ offset = offsetof(CogMethod, blockEntryOffset); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, ClassReg, TempReg); primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); @@ -26455,7 +26612,7 @@ genPrimitiveClosureValue(void) return NotFullyInitialized; } /* begin SubCq:R: */ - anInstruction2 = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); } /* begin JumpR: */ genoperand(JumpR, TempReg); @@ -26930,11 +27087,11 @@ genSpecialSelectorArithmetic(void) case AddRR: if (argIsInt) { /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); } else { genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); @@ -26944,7 +27101,7 @@ genSpecialSelectorArithmetic(void) jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); if (rcvrIsInt) { /* begin MoveCq:R: */ - anInstruction4 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); } else { /* begin SubR:R: */ @@ -26956,11 +27113,11 @@ genSpecialSelectorArithmetic(void) case SubRR: if (argIsInt) { /* begin SubCq:R: */ - anInstruction5 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); } else { genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); @@ -26976,7 +27133,7 @@ genSpecialSelectorArithmetic(void) case AndRR: if (argIsInt) { /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); } else { /* begin AndR:R: */ @@ -26988,7 +27145,7 @@ genSpecialSelectorArithmetic(void) case OrRR: if (argIsInt) { /* begin OrCq:R: */ - anInstruction6 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); } else { /* begin OrR:R: */ @@ -27003,7 +27160,7 @@ genSpecialSelectorArithmetic(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction7 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); } index = byte0 - ((bytecodeSetOffset == 256 ? AltFirstSpecialSelector + 256 @@ -27131,7 +27288,7 @@ genSpecialSelectorComparison(void) } if (argIsInt) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); } else { /* begin CmpR:R: */ @@ -27146,7 +27303,7 @@ genSpecialSelectorComparison(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); } index = byte0 - ((bytecodeSetOffset == 256 ? AltFirstSpecialSelector + 256 @@ -27276,7 +27433,7 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI /* begin genStoreTrampolineCall: */ if (slotIndex >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, slotIndex, TempReg); + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); (abstractInstruction1->annotation = IsRelativeCall); @@ -27287,8 +27444,8 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -27306,10 +27463,10 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI ssStoreAndReplacePoptoReg(popBoolean, ClassReg); ssFlushTo(simStackPtr); /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceStoreContextInstVarTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); # if IMMUTABILITY if (needsImmCheck) { @@ -28031,7 +28188,7 @@ scanBlock(BlockStart *blockStart) inBlock = InVanillaBlock; pc = (blockStart->startpc); end = ((blockStart->startpc)) + ((blockStart->span)); - framelessStackDelta = (nExts = (extA = (extB = 0))); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); pushingNils = 1; while (pc < end) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; @@ -28077,6 +28234,7 @@ scanBlock(BlockStart *blockStart) pushingNils = 0; } } + /* begin nextBytecodePCFor:at:exts:in: */ pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) : 0)); @@ -28084,7 +28242,7 @@ scanBlock(BlockStart *blockStart) nExts += 1; } else { - nExts = (extA = (extB = 0)); + nExts = (extA = (numExtB = (extB = 0))); } prevBCDescriptor = descriptor; } @@ -28128,7 +28286,7 @@ scanMethod(void) return 0; } pc = (latestContinuation = initialPC); - numBlocks = (framelessStackDelta = (nExts = (extA = (extB = 0)))); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); while (pc <= endPC) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; descriptor = generatorAt(byte0); @@ -28214,7 +28372,7 @@ scanMethod(void) pc += (descriptor->numBytes); nExts = ((descriptor->isExtension) ? nExts + 1 - : (extA = (extB = 0))); + : (extA = (numExtB = (extB = 0)))); prevBCDescriptor = descriptor; } return numBlocks; diff --git a/nsspursrc/vm/cogitMIPSEL.c b/nsspursrc/vm/cogitMIPSEL.c index 18d8b68301..306a860a9c 100644 --- a/nsspursrc/vm/cogitMIPSEL.c +++ b/nsspursrc/vm/cogitMIPSEL.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 + StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2040 uuid: 5c1c9278-c66a-4508-8b7c-fb1b0c8b3e46 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -279,7 +279,7 @@ char *__cogitBuildInfo = __buildInfo; #define NumSendTrampolines 4 #define NumSpecialSelectors 32 #define NumStoreTrampolines 5 -#define NumTrampolines 79 +#define NumTrampolines (IMMUTABILITY ? 80 : 75) #define OneInstruction 4 #define OR 37 #define ORI 13 @@ -401,8 +401,8 @@ typedef struct { typedef struct _BytecodeDescriptor { sqInt (*generator )(void); - sqInt (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); - sqInt (*needsFrameFunction )(sqInt); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); signed char stackDelta; unsigned char opcode; unsigned char numBytes; @@ -659,7 +659,7 @@ static AbstractInstruction * NoDbgRegParms gMoveCwR(sqInt wordConstant, sqInt re static AbstractInstruction * NoDbgRegParms gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg); static AbstractInstruction * NoDbgRegParms gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg); static AbstractInstruction * NoDbgRegParms gMoveRR(sqInt reg1, sqInt reg2); -static usqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); +static sqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); static sqInt NoDbgRegParms mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg); static sqInt NoDbgRegParms mapObjectReferencesInClosedPIC(CogMethod *cPIC); static void mapObjectReferencesInGeneratedRuntime(void); @@ -1022,7 +1022,7 @@ 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 genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison); static sqInt NoDbgRegParms isUnannotatableConstant(CogSimStackEntry *simStackEntry); static sqInt NoDbgRegParms genAddSmallIntegerTagsTo(sqInt aRegister); static sqInt NoDbgRegParms genClearAndSetSmallIntegerTagsIn(sqInt scratchReg); @@ -2032,6 +2032,7 @@ static usqInt mzFreeStart; static sqInt needsFrame; static AbstractInstruction * noCheckEntry; static sqInt numAbstractOpcodes; +static sqInt numExtB; static sqInt numIRCs; static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; static sqInt opcodeIndex; @@ -2764,7 +2765,7 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - usqInt endbcpc; + sqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -3289,7 +3290,7 @@ checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMe usqInt cacheTag1; sqInt classTag; sqInt enclosingObject; - sqInt entryPoint; + usqInt entryPoint; usqInt entryPoint1; usqInt entryPoint2; sqInt literal; @@ -4009,7 +4010,7 @@ cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt callForCogCompiledCodeCompaction(); return 0; } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -4131,7 +4132,7 @@ cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt nu if (startAddress == 0) { return ((CogMethod *) InsufficientCodeSpace); } - memcpy(startAddress, cPICPrototype, closedPICSize); + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ pic = ((CogMethod *) startAddress); @@ -4453,7 +4454,7 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if ((numRegsPushed == 0) && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { - goto l1; + goto l2; } wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); if (wordsPushedModAlignment != 0) { @@ -4461,17 +4462,17 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr /* begin SubCq:R: */ anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); } - l1: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; } genSaveRegs(backEnd, regsToSave); /* begin genMarshallNArgs:arg:arg:arg:arg: */ if (numArgs == 0) { ((AbstractInstruction *) backEnd); - goto l6; + goto l11; } if (regOrConst0 < NoReg) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst0, A0); + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, A0); } else { /* begin MoveR:R: */ @@ -4479,11 +4480,11 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 1) { ((AbstractInstruction *) backEnd); - goto l6; + goto l11; } if (regOrConst1 < NoReg) { /* begin MoveCq:R: */ - anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst1, A1); + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, A1); } else { /* begin MoveR:R: */ @@ -4491,11 +4492,11 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 2) { ((AbstractInstruction *) backEnd); - goto l6; + goto l11; } if (regOrConst2 < NoReg) { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst2, A2); + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, A2); } else { /* begin MoveR:R: */ @@ -4503,18 +4504,18 @@ compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numAr } if (numArgs == 3) { ((AbstractInstruction *) backEnd); - goto l6; + goto l11; } if (regOrConst3 < NoReg) { /* begin MoveCq:R: */ - anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst3, A3); + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, A3); } else { /* begin MoveR:R: */ genoperandoperand(MoveRR, regOrConst3, A3); } ((AbstractInstruction *) backEnd); -l6: /* end genMarshallNArgs:arg:arg:arg:arg: */; +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; /* begin CallFullRT: */ callTarget = ((usqInt)aRoutine); /* begin CallFull: */ @@ -4944,7 +4945,7 @@ cPICHasForwardedClass(CogMethod *cPIC) static sqInt NoDbgRegParms cPICHasFreedTargets(CogMethod *cPIC) { - usqInt entryPoint; + sqInt entryPoint; sqInt i; sqInt pc; CogMethod *targetMethod; @@ -5207,10 +5208,11 @@ extABytecode(void) static sqInt extBBytecode(void) { - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte1 > 0x7F) ? byte1 - 256 : (((usqInt) extB << 8)) + byte1); + numExtB += 1; return 0; } @@ -5462,7 +5464,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -5472,7 +5474,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#followForwardedMethods */ @@ -5781,23 +5783,22 @@ generateCaptureCStackPointers(sqInt captureFramePointer) /* begin PushR: */ genoperand(PushR, VarBaseReg); /* begin MoveCq:R: */ - quickConstant1 = varBaseAddress(); + quickConstant = varBaseAddress(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, VarBaseReg); + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); if (captureFramePointer) { /* begin MoveR:Aw: */ address = cFramePointerAddress(); /* begin gen:operand:literal: */ - anInstruction2 = genoperandoperand(MoveRAw, FPReg, address); + anInstruction1 = genoperandoperand(MoveRAw, FPReg, address); } /* begin MoveR:R: */ genoperandoperand(MoveRR, SPReg, TempReg); /* begin AddCq:R: */ - quickConstant = 0 + BytesPerWord; - + quickConstant1 = 0 + BytesPerWord; /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AddCqR, quickConstant, TempReg); + anInstruction2 = genoperandoperand(AddCqR, quickConstant1, TempReg); /* begin MoveR:Aw: */ address1 = cStackPointerAddress(); /* begin gen:operand:literal: */ @@ -5880,15 +5881,15 @@ generateClosedPICPrototype(void) jmpTarget(jumpNext, gLabel()); } /* begin MoveUniqueCw:R: */ - wordConstant1 = (subsequentPrototypeMethodOop()) + h; + wordConstant = (subsequentPrototypeMethodOop()) + h; /* begin gen:uniqueLiteral:operand: */ - anInstruction1 = genoperandoperand(MoveCwR, wordConstant1, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg); /* begin CmpC32:R: */ - wordConstant = 3133021973U + h; + wordConstant1 = 3133021973U + h; /* begin gen:literal:operand: */ opcode = CmpCwR; /* begin checkLiteral:forInstruction: */ - anInstruction = genoperandoperand(opcode, wordConstant, TempReg); + anInstruction1 = genoperandoperand(opcode, wordConstant1, TempReg); /* begin JumpLongZero: */ jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16); genConditionalBranchoperand(JumpLongZero, ((sqInt)jumpTarget)); @@ -5960,7 +5961,7 @@ generateCogMethod(sqInt selector) assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); result = outputInstructionsAt(startAddress + headerSize); assert(((startAddress + headerSize) + codeSize) == result); - padIfPossibleWithStopsFromto(backEnd, result, (startAddress + totalSize) - mapSize); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); fillInBlockHeadersAt(startAddress); method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); @@ -6314,12 +6315,9 @@ genInnerPICAbortTrampoline(char *name) { AbstractInstruction *anInstruction; AbstractInstruction *jumpMNUCase; - sqInt quickConstant; /* begin CmpCq:R: */ - quickConstant = 0; - /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, ClassReg); + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); /* begin JumpZero: */ jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceInterpretMethodFromPICreceiver, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg); @@ -6459,9 +6457,9 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu jumpMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); if (eoCheckFlag) { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction4 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jumpItsTheReceiverStupid = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveR:R: */ @@ -6471,7 +6469,7 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* arbitrary argument count */ /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, ReceiverResultReg, TempReg, SPReg); } @@ -6481,7 +6479,7 @@ genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt nu /* begin MoveR:Mw:r: */ offset = ((0) + numArgs) * BytesPerWord; /* begin gen:operand:quickConstant:operand: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); } } jmpTarget(jumpItsTheReceiverStupid, gLabel()); @@ -7255,7 +7253,7 @@ gMoveRR(sqInt reg1, sqInt reg2) /* Answer the address of the null byte at the end of the method map. */ /* Cogit>>#mapEndFor: */ -static usqInt NoDbgRegParms +static sqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod) { usqInt end; @@ -7281,6 +7279,7 @@ mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annota usqInt mcpc; sqInt result; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -7452,7 +7451,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -7462,7 +7461,7 @@ mapObjectReferencesInMachineCodeForBecome(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { ensureInYoungReferrers(cogMethod); hasYoungObj = 0; @@ -7534,7 +7533,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -7544,7 +7543,7 @@ mapObjectReferencesInMachineCodeForFullGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); @@ -7625,7 +7624,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); if (result != 0) { - goto l1; + goto l2; } } else { @@ -7635,7 +7634,7 @@ mapObjectReferencesInMachineCodeForYoungGC(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; if (hasYoungObj) { hasYoungObj = 0; } @@ -7743,7 +7742,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -7753,7 +7752,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } if ((((cogMethod->cmType)) == CMOpenPIC) && ((isImmediate((cogMethod->selector))) @@ -7787,7 +7786,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); if (result1 != 0) { - goto l2; + goto l4; } } else { @@ -7797,7 +7796,7 @@ markAndTraceMachineCodeOfMarkedMethods(void) } map1 -= 1; } - l2: /* end mapFor:performUntil:arg: */; + l4: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -7891,7 +7890,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -7901,7 +7900,7 @@ markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } return 0; } @@ -8216,7 +8215,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -8226,7 +8225,7 @@ markMethodAndReferents(CogBlockMethod *aCogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#maxCogMethodAddress */ @@ -8314,7 +8313,7 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co sqInt byte; BytecodeDescriptor *descriptor; sqInt distance; - usqInt endbcpc; + sqInt endbcpc; CogMethod *homeMethod; sqInt isBackwardBranch; sqInt isInBlock; @@ -8778,6 +8777,7 @@ printPCMapPairsFor(CogMethod *cogMethod) usqInt mcpc; sqInt value; + /* begin firstMappedPCFor: */ mcpc = (0 ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); @@ -8977,7 +8977,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); if (result != 0) { - goto l1; + goto l2; } } else { @@ -8987,7 +8987,7 @@ relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) } map -= 1; } -l1: /* end mapFor:performUntil:arg: */; +l2: /* end mapFor:performUntil:arg: */; } /* Cogit>>#relocateCallsInClosedPIC: */ @@ -8995,7 +8995,7 @@ static void NoDbgRegParms relocateCallsInClosedPIC(CogMethod *cPIC) { sqLong callDelta; - usqInt entryPoint; + sqInt entryPoint; sqInt i; sqInt pc; sqLong refDelta; @@ -9553,7 +9553,7 @@ unlinkAllSends(void) } result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -9563,7 +9563,7 @@ unlinkAllSends(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) != CMFree) { @@ -9734,7 +9734,7 @@ static sqInt NoDbgRegParms unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity) { usqInt cacheAddress; - usqInt entryPoint; + sqInt entryPoint; usqInt entryPoint1; char *mcpc1; NSSendCache *nsSendCache; @@ -9884,7 +9884,7 @@ static sqInt NoDbgRegParms unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod) { usqInt cacheAddress; - usqInt entryPoint; + sqInt entryPoint; usqInt entryPoint1; char *mcpc1; NSSendCache *nsSendCache; @@ -9995,7 +9995,7 @@ unlinkSendsLinkedForInvalidClasses(void) } result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10005,7 +10005,7 @@ unlinkSendsLinkedForInvalidClasses(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -10108,7 +10108,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10118,7 +10118,7 @@ unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } @@ -10167,7 +10167,7 @@ unlinkSendsToFree(void) } result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10177,7 +10177,7 @@ unlinkSendsToFree(void) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if (((cogMethod->cmType)) == CMClosedPIC) { @@ -10240,7 +10240,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); if (result != 0) { - goto l1; + goto l2; } } else { @@ -10250,7 +10250,7 @@ unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) } map -= 1; } - l1: /* end mapFor:performUntil:arg: */; + l2: /* end mapFor:performUntil:arg: */; } else { if ((((cogMethod->cmType)) == CMClosedPIC) @@ -15015,7 +15015,7 @@ relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeRet static AbstractInstruction * NoDbgRegParms relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta) { - usqInt newTarget; + sqInt newTarget; usqInt oldTarget; assert((delta % 4) == 0); @@ -15068,7 +15068,7 @@ relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_i static AbstractInstruction * NoDbgRegParms relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta) { - usqInt newValue; + sqInt newValue; usqInt oldValue; if (((opcodeAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 8)) == ADDIU) @@ -15785,14 +15785,14 @@ genPrimitiveBitShift(void) genConvertSmallIntegerToIntegerInReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); } /* begin JumpNegative: */ jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant = numSmallIntegerBits(); + quickConstant1 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, ClassReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); /* begin JumpGreaterOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -15815,15 +15815,15 @@ genPrimitiveBitShift(void) genoperand(RetN, 0); jmpTarget(jumpNegative, gNegateR(ClassReg)); /* begin CmpCq:R: */ - quickConstant1 = numSmallIntegerBits(); + quickConstant2 = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); /* begin JumpLessOrEqual: */ jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - quickConstant2 = numSmallIntegerBits(); + quickConstant = numSmallIntegerBits(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(MoveCqR, quickConstant2, ClassReg); + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); /* begin genPrimReturn */ @@ -15915,7 +15915,7 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); } /* begin JumpZero: */ jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -15924,19 +15924,19 @@ genPrimitiveDiv(void) genShiftAwaySmallIntegerTagsInScratchReg(TempReg); gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, ClassReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); /* begin JumpZero: */ jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin XorR:R: */ genoperandoperand(XorRR, ClassReg, Arg1Reg); if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, Arg1Reg); + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); } /* begin JumpGreaterOrEqual: */ jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, 1, TempReg); + anInstruction = genoperandoperand(SubCqR, 1, TempReg); jmpTarget(jumpSameSign, (convert = gLabel())); genConvertIntegerToSmallIntegerInReg(TempReg); /* begin MoveR:R: */ @@ -16282,7 +16282,7 @@ genSmallIntegerComparison(sqInt jumpOpcode) /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ static sqInt NoDbgRegParms -genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) { AbstractInstruction *anInstruction; sqInt constant; @@ -16473,11 +16473,11 @@ genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); genConvertIntegerToSmallIntegerInReg(destReg); return 0; } @@ -16494,11 +16494,11 @@ genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); /* begin AndCq:R: */ quickConstant = identityHashHalfWordMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); return 0; } @@ -16563,7 +16563,7 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin Label */ immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, 1, destReg); + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); /* begin AlignmentNops: */ @@ -16575,11 +16575,11 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); jmpTarget(jumpCompare, gLabel()); } else { @@ -16589,7 +16589,7 @@ genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt /* begin JumpZero: */ jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, 1, destReg); + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); /* begin Jump: */ jumpCompare = genoperand(Jump, ((sqInt)0)); flag("endianness"); @@ -16747,19 +16747,19 @@ genPrimitiveAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction13 = genoperandoperand(SubCqR, 1, Arg1Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpZero: */ jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin JumpBelow: */ @@ -16767,19 +16767,19 @@ genPrimitiveAt(void) /* begin CmpCq:R: */ quickConstant2 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpBelowOrEqual: */ jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant3 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant4 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); jmpTarget(jumpNotIndexable, gLabel()); @@ -16789,7 +16789,7 @@ genPrimitiveAt(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction7 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -16807,12 +16807,12 @@ genPrimitiveAt(void) /* begin CmpCq:R: */ quickConstant5 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + anInstruction8 = genoperandoperand(CmpCqR, quickConstant5, formatReg); /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); - methodInBounds = anInstruction7; + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + methodInBounds = anInstruction9; /* formatReg already contains a value <= 16r1f, so no need to zero it */ /* begin MoveXbr:R:R: */ @@ -16829,7 +16829,7 @@ genPrimitiveAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, formatReg); + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -16841,14 +16841,14 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); /* begin Jump: */ genoperand(Jump, ((sqInt)convertToIntAndReturn)); jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction11 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); jumpWordTooBig = jumpNotSmallIntegerUnsignedValueInRegister(TempReg); @@ -16860,7 +16860,7 @@ genPrimitiveAt(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, formatReg); /* begin CmpCq:R: */ - anInstruction10 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin PushR: */ @@ -16873,7 +16873,7 @@ genPrimitiveAt(void) /* begin AndCq:R: */ quickConstant6 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(AndCqR, quickConstant6, formatReg); + anInstruction13 = genoperandoperand(AndCqR, quickConstant6, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -16883,7 +16883,7 @@ genPrimitiveAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, formatReg, Arg1Reg); /* begin AddCq:R: */ - anInstruction12 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction14 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -16971,14 +16971,14 @@ genPrimitiveAtPut(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction15 = genoperandoperand(SubCqR, 1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant7 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction17 = genoperandoperand(TstCqR, quickConstant7, TempReg); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -16989,16 +16989,16 @@ genPrimitiveAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); /* begin CmpCq:R: */ - quickConstant = weakArrayFormat(); + quickConstant1 = weakArrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpAbove: */ jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); /* begin CmpCq:R: */ - quickConstant1 = arrayFormat(); + quickConstant2 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpBelow: */ jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin JumpNonZero: */ @@ -17008,7 +17008,7 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction3 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17020,7 +17020,7 @@ genPrimitiveAtPut(void) jmpTarget(jumpHasFixedFields, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); /* begin JumpZero: */ jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin PushR: */ @@ -17031,13 +17031,13 @@ genPrimitiveAtPut(void) genoperand(PopR, nSlotsOrBytesReg); genConvertSmallIntegerToIntegerInReg(formatReg); /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant3 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(AndCqR, quickConstant2, formatReg); + anInstruction8 = genoperandoperand(AndCqR, quickConstant3, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); + anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); /* begin JumpBelowOrEqual: */ @@ -17056,21 +17056,21 @@ genPrimitiveAtPut(void) /* begin genJumpNotSmallInteger:scratchReg: */ jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); /* begin CmpCq:R: */ - quickConstant3 = firstByteFormat(); + quickConstant4 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstShortFormat(); + quickConstant5 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant6 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, formatReg); /* begin JumpBelow: */ jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CmpR:R: */ @@ -17082,12 +17082,12 @@ genPrimitiveAtPut(void) genConvertSmallIntegerToIntegerInReg(TempReg); if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); } /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction13 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17109,16 +17109,16 @@ genPrimitiveAtPut(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstCompiledMethodFormat(); + quickConstant7 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, formatReg); /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin AddCq:R: */ - anInstruction12 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -17133,7 +17133,7 @@ genPrimitiveAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); /* begin AndCq:R: */ - anInstruction13 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + anInstruction16 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); /* begin CmpR:R: */ @@ -17148,7 +17148,7 @@ genPrimitiveAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction16 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin genPrimReturn */ @@ -17169,7 +17169,7 @@ genPrimitiveAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction14 = genoperandoperand(AddCqR, 1, Arg0Reg); + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); return 0; @@ -17301,20 +17301,20 @@ genPrimitiveMirrorNew(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction11 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); /* Is the class arg pointers with at least 3 fields? */ jumpImmediate = genJumpImmediate(Arg0Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction9 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + anInstruction10 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genGetHashFieldNonImmOfinto(Arg0Reg, halfHeaderReg); @@ -17327,84 +17327,84 @@ genPrimitiveMirrorNew(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = fixedFieldsFieldWidth(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, TempReg); + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, TempReg); + anInstruction11 = genoperandoperand(AndCqR, quickConstant4, TempReg); /* begin AndCq:R: */ - quickConstant3 = fixedFieldsOfClassFormatMask(); + quickConstant5 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + anInstruction12 = genoperandoperand(AndCqR, quickConstant5, instSpecReg); /* begin CmpCq:R: */ - quickConstant4 = nonIndexablePointerFormat(); + quickConstant6 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, TempReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant6, TempReg); /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = numSlotsMask(); + quickConstant7 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant6 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant6, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction6 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction15 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction13 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction16 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction17 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant7 = getScavengeThreshold(); + quickConstant8 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); + anInstruction18 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction14 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction15 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction16 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveCq:R: */ - quickConstant8 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction17 = genoperandoperand(MoveCqR, quickConstant8, fillReg); + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); /* begin MoveR:Mw:r: */ - anInstruction18 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction18; + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction19 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -17513,14 +17513,14 @@ genPrimitiveMirrorNewWithArg(void) jumpImmediate = genJumpImmediate(Arg0Reg); genGetRawSlotSizeOfNonImminto(Arg0Reg, TempReg); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, InstanceSpecificationIndex + 1, TempReg); /* begin JumpLess: */ jumpTooSmall = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(Arg0Reg, TempReg, NoReg); /* begin CmpCq:R: */ - quickConstant = nonIndexablePointerFormat(); + quickConstant3 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpNonZero: */ jumpNotFixedPointers = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genGetHashFieldNonImmOfinto(Arg0Reg, halfHeaderReg); @@ -17535,53 +17535,53 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = (fixedFieldsFieldWidth()) + 1; - genoperandoperand(LogicalShiftRightCqR, quickConstant1, instSpecReg); + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant2 = formatMask(); + quickConstant4 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); + anInstruction14 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant3 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant3, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant4 = arrayFormat(); + quickConstant5 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstByteFormat(); + quickConstant6 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = firstLongFormat(); + quickConstant7 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction5 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + anInstruction17 = genoperandoperand(CmpCqR, quickConstant7, instSpecReg); /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant7 = (((usqInt)maxSlots << 1) | 1); + quickConstant8 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + anInstruction18 = genoperandoperand(CmpCqR, quickConstant8, Arg0Reg); /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction15 = genoperand(PushCq, 0); + anInstruction1 = genoperand(PushCq, 0); /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); @@ -17590,22 +17590,22 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction16 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + anInstruction19 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant8 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant8, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction17 = genoperand(PushCq, 0); + anInstruction3 = genoperand(PushCq, 0); /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); @@ -17616,27 +17616,27 @@ genPrimitiveMirrorNewWithArg(void) /* begin PushCw: */ wordConstant = nilObject(); /* begin gen:literal: */ - anInstruction18 = genoperand(PushCw, wordConstant); + anInstruction4 = genoperand(PushCw, wordConstant); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction19 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction9 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction21 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction20 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction10 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction22 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction23 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); @@ -17645,7 +17645,7 @@ genPrimitiveMirrorNewWithArg(void) /* begin CmpCq:R: */ quickConstant9 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); + anInstruction24 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -17653,22 +17653,22 @@ genPrimitiveMirrorNewWithArg(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction21 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); /* begin PopR: */ genoperand(PopR, fillReg); /* begin PopR: */ genoperand(PopR, TempReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction23 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveR:Mw:r: */ - anInstruction24 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction24; + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; /* begin MoveR:Mw:r: */ - anInstruction25 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction13 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction25 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -17758,7 +17758,7 @@ genPrimitiveNew(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction9 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); /* begin JumpZero: */ jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -17770,81 +17770,81 @@ genPrimitiveNew(void) quickConstant = fixedFieldsFieldWidth(); genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, TempReg); + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, TempReg); /* begin AndCq:R: */ - quickConstant2 = fixedFieldsOfClassFormatMask(); + quickConstant4 = fixedFieldsOfClassFormatMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, instSpecReg); + anInstruction10 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); /* begin CmpCq:R: */ - quickConstant3 = nonIndexablePointerFormat(); + quickConstant5 = nonIndexablePointerFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, TempReg); /* begin JumpAbove: */ jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = numSlotsMask(); + quickConstant6 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpAboveOrEqual: */ jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin LogicalShiftLeftCq:R: */ - quickConstant5 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant5, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:Mw:r: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction13 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction11 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction14 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, byteSizeReg); /* begin CmpCq:R: */ - quickConstant6 = getScavengeThreshold(); + quickConstant7 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(CmpCqR, quickConstant6, byteSizeReg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction12 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction13 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction14 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveCq:R: */ - quickConstant7 = nilObject(); + quickConstant2 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction15 = genoperandoperand(MoveCqR, quickConstant7, fillReg); + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction16; + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction17 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -17949,7 +17949,7 @@ genPrimitiveNewWithArg(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction12 = genoperandoperand(MoveAwR, address, Arg1Reg); + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); /* begin JumpZero: */ jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); @@ -17961,47 +17961,47 @@ genPrimitiveNewWithArg(void) quickConstant = (fixedFieldsFieldWidth()) + 1; genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); /* begin AndCq:R: */ - quickConstant1 = formatMask(); + quickConstant3 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, instSpecReg); + anInstruction12 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant2 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg0Reg, TempReg); genConvertSmallIntegerToIntegerInReg(TempReg); /* begin CmpCq:R: */ - quickConstant3 = arrayFormat(); + quickConstant4 = arrayFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant3, instSpecReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); /* begin JumpZero: */ jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant4 = firstByteFormat(); + quickConstant5 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + anInstruction14 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); /* begin JumpZero: */ jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant5 = firstLongFormat(); + quickConstant6 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + anInstruction15 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); /* begin JumpNonZero: */ jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant6 = (((usqInt)maxSlots << 1) | 1); + quickConstant7 = (((usqInt)maxSlots << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(CmpCqR, quickConstant6, Arg0Reg); + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); /* begin JumpAbove: */ jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin PushCq: */ - anInstruction13 = genoperand(PushCq, 0); + anInstruction1 = genoperand(PushCq, 0); /* begin Jump: */ jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); @@ -18010,22 +18010,22 @@ genPrimitiveNewWithArg(void) /* begin MoveR:R: */ genoperandoperand(MoveRR, TempReg, instSpecReg); /* begin MoveCq:R: */ - anInstruction14 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, instSpecReg, TempReg); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + anInstruction17 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); /* begin LogicalShiftLeftCq:R: */ - quickConstant7 = formatShift(); - genoperandoperand(LogicalShiftLeftCqR, quickConstant7, TempReg); + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, halfHeaderReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); /* begin LogicalShiftRightCq:R: */ genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); /* begin PushCq: */ - anInstruction15 = genoperand(PushCq, 0); + anInstruction3 = genoperand(PushCq, 0); /* begin Jump: */ jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); @@ -18036,27 +18036,27 @@ genPrimitiveNewWithArg(void) /* begin PushCw: */ wordConstant = nilObject(); /* begin gen:literal: */ - anInstruction16 = genoperand(PushCw, wordConstant); + anInstruction4 = genoperand(PushCw, wordConstant); jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); /* begin CmpCq:R: */ - anInstruction7 = genoperandoperand(CmpCqR, 0, byteSizeReg); + anInstruction19 = genoperandoperand(CmpCqR, 0, byteSizeReg); /* begin JumpNonZero: */ jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction18 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); /* begin Jump: */ skip = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); /* begin AndCq:R: */ - anInstruction8 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction20 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, byteSizeReg); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + anInstruction21 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); @@ -18065,7 +18065,7 @@ genPrimitiveNewWithArg(void) /* begin CmpCq:R: */ quickConstant8 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction10 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + anInstruction22 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -18073,20 +18073,20 @@ genPrimitiveNewWithArg(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction19 = genoperandoperand(MoveRAw, byteSizeReg, address1); + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); /* begin PopR: */ genoperand(PopR, fillReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction21 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); - fillLoop = anInstruction22; + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; /* begin MoveR:Mw:r: */ - anInstruction23 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); /* begin AddCq:R: */ - anInstruction11 = genoperandoperand(AddCqR, 8, Arg1Reg); + anInstruction23 = genoperandoperand(AddCqR, 8, Arg1Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); /* begin JumpAbove: */ @@ -18162,18 +18162,18 @@ genPrimitiveShallowCopy(void) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction12 = genoperandoperand(MoveAwR, address, resultReg); + anInstruction = genoperandoperand(MoveAwR, address, resultReg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (ptrReg = (formatReg = SendNumArgsReg)), NoReg); /* begin CmpCq:R: */ quickConstant = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction11 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpAboveOrEqual: */ jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = indexablePointersFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpZero: */ jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin Label */ @@ -18182,21 +18182,21 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant2 = numSlotsMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + anInstruction13 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); /* begin JumpZero: */ jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction3 = genoperandoperand(CmpCqR, 0, slotsReg); + anInstruction14 = genoperandoperand(CmpCqR, 0, slotsReg); /* begin JumpZero: */ jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveR:R: */ genoperandoperand(MoveRR, slotsReg, TempReg); /* begin AndCq:R: */ - anInstruction4 = genoperandoperand(AndCqR, 1, TempReg); + anInstruction15 = genoperandoperand(AndCqR, 1, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, TempReg, slotsReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); + anInstruction16 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); /* begin AddR:R: */ @@ -18204,7 +18204,7 @@ genPrimitiveShallowCopy(void) /* begin CmpCq:R: */ quickConstant3 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); + anInstruction17 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); /* begin JumpAboveOrEqual: */ jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ @@ -18212,39 +18212,39 @@ genPrimitiveShallowCopy(void) /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction13 = genoperandoperand(MoveRAw, slotsReg, address1); + anInstruction1 = genoperandoperand(MoveRAw, slotsReg, address1); /* begin SubCq:R: */ - anInstruction14 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + anInstruction2 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); /* begin AndCq:R: */ quickConstant4 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); /* begin gen:quickConstant:operand: */ - anInstruction7 = genoperandoperand(AndCqR, quickConstant4, TempReg); + anInstruction18 = genoperandoperand(AndCqR, quickConstant4, TempReg); /* begin MoveR:Mw:r: */ - anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); /* begin MoveMw:r:R: */ - anInstruction17 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); /* begin AndCq:R: */ quickConstant5 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); /* begin gen:quickConstant:operand: */ - anInstruction8 = genoperandoperand(AndCqR, quickConstant5, TempReg); + anInstruction19 = genoperandoperand(AndCqR, quickConstant5, TempReg); /* begin MoveR:Mw:r: */ - anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); /* begin Label */ copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); /* begin AddCq:R: */ - anInstruction10 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + anInstruction21 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); /* begin MoveMw:r:R: */ - anInstruction19 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + anInstruction7 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); /* begin MoveMw:r:R: */ - anInstruction21 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + anInstruction9 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, ptrReg, slotsReg); /* begin JumpAbove: */ @@ -18258,7 +18258,7 @@ genPrimitiveShallowCopy(void) jmpTarget(jumpVariable, gLabel()); genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - anInstruction11 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + anInstruction22 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); /* begin JumpNonZero: */ genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); jmpTarget(jumpImmediate, jmpTarget(jumpNoSpace, jmpTarget(jumpIsMethod, jmpTarget(jumpTooBig, jmpTarget(jumpEmpty, gLabel()))))); @@ -18307,25 +18307,25 @@ genPrimitiveStringAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genConvertSmallIntegerToIntegerInReg(Arg1Reg); /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 1, Arg1Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ quickConstant = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); /* begin JumpGreaterOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant1 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpGreaterOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ quickConstant2 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpLess: */ jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin CmpR:R: */ @@ -18333,7 +18333,7 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg); @@ -18343,7 +18343,7 @@ genPrimitiveStringAt(void) jumpWordsDone = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); /* begin AndCq:R: */ - anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18351,11 +18351,11 @@ genPrimitiveStringAt(void) /* begin JumpBelowOrEqual: */ jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); /* begin MoveXbr:R:R: */ genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, 0xFF, ReceiverResultReg); + anInstruction2 = genoperandoperand(AndCqR, 0xFF, ReceiverResultReg); jmpTarget(jumpWordsDone, (done = gLabel())); genConvertIntegerToCharacterInReg(ReceiverResultReg); @@ -18365,7 +18365,7 @@ genPrimitiveStringAt(void) genoperand(RetN, 0); jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18375,7 +18375,7 @@ genPrimitiveStringAt(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); /* begin MoveM16:r:R: */ - anInstruction9 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); /* begin Jump: */ genoperand(Jump, ((sqInt)done)); jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel())))))); @@ -18434,14 +18434,14 @@ genPrimitiveStringAtPut(void) jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin SubCq:R: */ - anInstruction10 = genoperandoperand(SubCqR, 1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); # if IMMUTABILITY genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); /* begin genJumpBaseHeaderImmutable: */ - quickConstant4 = immutableBitMask(); + quickConstant = immutableBitMask(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(TstCqR, quickConstant4, TempReg); + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); @@ -18452,31 +18452,31 @@ genPrimitiveStringAtPut(void) genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); /* begin CmpCq:R: */ - quickConstant = firstLongFormat(); + quickConstant1 = firstLongFormat(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, formatReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); /* begin JumpBelow: */ jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant1 = firstCompiledMethodFormat(); + quickConstant2 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); /* begin JumpAboveOrEqual: */ jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant2 = firstByteFormat(); + quickConstant3 = firstByteFormat(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); /* begin JumpAboveOrEqual: */ jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - quickConstant3 = firstShortFormat(); + quickConstant4 = firstShortFormat(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); /* begin JumpAboveOrEqual: */ jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin CmpCq:R: */ - anInstruction4 = genoperandoperand(CmpCqR, 0, Arg1Reg); + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); /* begin JumpLess: */ jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); /* begin CmpR:R: */ @@ -18487,7 +18487,7 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction8 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -18502,7 +18502,7 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); /* begin AndCq:R: */ - anInstruction6 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18515,7 +18515,7 @@ genPrimitiveStringAtPut(void) /* begin AddR:R: */ genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); /* begin MoveR:M16:r: */ - anInstruction11 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); /* begin genPrimReturn */ @@ -18528,7 +18528,7 @@ genPrimitiveStringAtPut(void) /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); /* begin AndCq:R: */ - anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); /* begin SubR:R: */ genoperandoperand(SubRR, formatReg, ClassReg); /* begin CmpR:R: */ @@ -18539,7 +18539,7 @@ genPrimitiveStringAtPut(void) genoperandoperand(MoveRR, Arg1Reg, TempReg); genConvertCharacterToCodeInReg(TempReg); /* begin AddCq:R: */ - anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); /* begin MoveR:Xbr:R: */ genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); /* begin MoveR:R: */ @@ -18556,7 +18556,7 @@ genPrimitiveStringAtPut(void) # endif /* IMMUTABILITY */ /* begin AddCq:R: */ - anInstruction9 = genoperandoperand(AddCqR, 1, Arg0Reg); + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); genConvertIntegerToSmallIntegerInReg(Arg0Reg); jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); return CompletePrimitive; @@ -18843,11 +18843,11 @@ genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) /* begin Label */ loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); @@ -18884,11 +18884,11 @@ genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, Abst but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); @@ -18931,16 +18931,16 @@ genEnsureOopInRegNotForwardedscratchRegupdatingMwr(sqInt reg, sqInt scratch, sqI but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, offset, baseReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); jmpTarget(ok, jmpTarget(imm, gLabel())); @@ -18983,16 +18983,16 @@ genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, but the following is an instruction shorter: */ imm = genJumpImmediate(reg); /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, scratch); + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, reg, reg); /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); assert((reg == Arg0Reg) && ((scratch == TempReg) && (objReg == ReceiverResultReg))); @@ -19066,6 +19066,7 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; AbstractInstruction *anInstruction15; AbstractInstruction *anInstruction16; @@ -19094,7 +19095,6 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) AbstractInstruction *anInstruction37; AbstractInstruction *anInstruction38; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; @@ -19114,43 +19114,42 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) sqInt quickConstant3; sqInt quickConstant4; sqInt quickConstant5; - sqInt quickConstant6; AbstractInstruction * self_in_saveAndRestoreLinkRegAround; sqInt slotSize; /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ /* begin MoveMw:r:R: */ - anInstruction14 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); /* begin JumpZero: */ jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, 0); jmpTarget(jumpSingle, gLabel()); /* begin OrCq:R: */ - anInstruction16 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); /* begin MoveR:Mw:r: */ - anInstruction17 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); switch (isInBlock) { case InFullBlock: /* begin SubCq:R: */ - anInstruction8 = genoperandoperand(SubCqR, 3, ClassReg); + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); break; case InVanillaBlock: /* begin SubCq:R: */ - anInstruction9 = genoperandoperand(SubCqR, 3, ClassReg); + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); /* begin MoveM16:r:R: */ - anInstruction10 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, TempReg, ClassReg); break; case 0: /* begin SubCq:R: */ - anInstruction11 = genoperandoperand(SubCqR, 1, ClassReg); + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); break; default: error("Case not found and no otherwise clause"); @@ -19163,74 +19162,72 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction18 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction10 = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant4 = ((usqInt) header); + quickConstant2 = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction19 = genoperandoperand(MoveCqR, quickConstant4, TempReg); + anInstruction11 = genoperandoperand(MoveCqR, quickConstant2, TempReg); /* begin MoveR:Mw:r: */ - anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant5 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction21 = genoperandoperand(MoveCqR, quickConstant5, TempReg); + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, ReceiverResultReg, TempReg); /* begin AddCq:R: */ - quickConstant = smallObjectBytesForSlots(slotSize); + quickConstant4 = smallObjectBytesForSlots(slotSize); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AddCqR, quickConstant, TempReg); + anInstruction32 = genoperandoperand(AddCqR, quickConstant4, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction23 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction13 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant1 = getScavengeThreshold(); + quickConstant5 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + anInstruction33 = genoperandoperand(CmpCqR, quickConstant5, TempReg); /* begin JumpAboveOrEqual: */ jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveR:R: */ continuation = genoperandoperand(MoveRR, FPReg, TempReg); genSetSmallIntegerTagsIn(TempReg); /* begin MoveR:Mw:r: */ - anInstruction24 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ - anInstruction25 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); genSetSmallIntegerTagsIn(TempReg); /* begin MoveR:Mw:r: */ - anInstruction26 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction27 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction28 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); + anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); /* begin MoveR:Mw:r: */ - anInstruction29 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + anInstruction19 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, TempReg); /* begin SubR:R: */ genoperandoperand(SubRR, SPReg, TempReg); /* begin LogicalShiftRightCq:R: */ - quickConstant2 = 2; - genoperandoperand(LogicalShiftRightCqR, quickConstant2, TempReg); + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); /* begin SubCq:R: */ - quickConstant6 = 3; + quickConstant3 = 3; /* begin gen:quickConstant:operand: */ - anInstruction30 = genoperandoperand(SubCqR, quickConstant6, TempReg); + anInstruction20 = genoperandoperand(SubCqR, quickConstant3, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, SendNumArgsReg, TempReg); genConvertIntegerToSmallIntegerInReg(TempReg); /* begin MoveR:Mw:r: */ - anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); + anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); if (isInBlock > 0) { /* begin MoveR:R: */ genoperandoperand(MoveRR, SendNumArgsReg, TempReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 2, TempReg); + anInstruction29 = genoperandoperand(AddCqR, 2, TempReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); } @@ -19242,17 +19239,17 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) } else { /* begin MoveCq:R: */ - anInstruction38 = genoperandoperand(MoveCqR, constant, TempReg); + anInstruction30 = genoperandoperand(MoveCqR, constant, TempReg); } } /* begin MoveR:Mw:r: */ - anInstruction32 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); /* begin MoveMw:r:R: */ - anInstruction33 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + anInstruction24 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction34 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); + anInstruction25 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); /* begin MoveCq:R: */ - anInstruction35 = genoperandoperand(MoveCqR, 1, ClassReg); + anInstruction26 = genoperandoperand(MoveCqR, 1, ClassReg); /* begin CmpR:R: */ loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); /* begin JumpGreater: */ @@ -19262,32 +19259,32 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin SubR:R: */ genoperandoperand(SubRR, ClassReg, TempReg); /* begin AddCq:R: */ - anInstruction3 = genoperandoperand(AddCqR, 2, TempReg); + anInstruction34 = genoperandoperand(AddCqR, 2, TempReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); + anInstruction35 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); /* begin SubCq:R: */ - anInstruction36 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); + anInstruction27 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); jmpTarget(exit, gLabel()); /* begin MoveCq:R: */ - quickConstant3 = nilObject(); + quickConstant1 = nilObject(); /* begin gen:quickConstant:operand: */ - anInstruction12 = genoperandoperand(MoveCqR, quickConstant3, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, FPReg, ClassReg); /* begin AddCq:R: */ - anInstruction5 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + anInstruction36 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); /* begin AddCq:R: */ - anInstruction6 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); + anInstruction37 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); /* begin SubCq:R: */ - anInstruction37 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); - loopHead = anInstruction37; + anInstruction28 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + loopHead = anInstruction28; /* begin CmpR:R: */ genoperandoperand(CmpRR, SPReg, ClassReg); /* begin JumpBelow: */ @@ -19296,7 +19293,7 @@ genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); /* begin AddCq:R: */ - anInstruction7 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + anInstruction38 = genoperandoperand(AddCqR, 1, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loopHead)); jmpTarget(exit, gLabel()); @@ -19386,9 +19383,9 @@ genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, mask, destReg); + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); return 0; } @@ -19404,11 +19401,11 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) sqInt quickConstant; /* begin MoveMw:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin AndCq:R: */ quickConstant = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant, destReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); return 0; } @@ -19421,11 +19418,11 @@ genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) { - AbstractInstruction *anInstruction1; - AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; sqInt offset; - sqInt quickConstant1; + sqInt quickConstant; sqInt quickConstant2; assert(instReg != destReg); @@ -19434,24 +19431,24 @@ genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt /* begin MoveR:R: */ genoperandoperand(MoveRR, instReg, scratchReg); /* begin LogicalShiftRightCq:R: */ - quickConstant1 = classTableMajorIndexShift(); - genoperandoperand(LogicalShiftRightCqR, quickConstant1, scratchReg); + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); /* begin LogicalShiftLeftCq:R: */ genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); assert(!(shouldAnnotateObjectReference(classTableRootObj()))); /* begin MoveMw:r:R: */ offset = (classTableRootObj()) + BaseHeaderSize; /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, instReg, scratchReg); /* begin AndCq:R: */ quickConstant2 = classTableMinorIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); /* begin AddCq:R: */ - anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); + anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); return 0; @@ -19487,27 +19484,27 @@ genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, /* begin AndCq:R: */ quickConstant1 = tagMask(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); /* begin JumpNonZero: */ jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); flag("endianness"); /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); /* begin AndCq:R: */ quickConstant2 = classIndexMask(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); if (!instRegIsReceiver) { /* if it is forwarded... */ /* begin CmpCq:R: */ quickConstant = isForwardedObjectClassIndexPun(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, scratchReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); /* begin JumpNonZero: */ jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); /* begin Jump: */ genoperand(Jump, ((sqInt)loop)); jmpTarget(jumpNotForwarded, gLabel()); @@ -19588,11 +19585,11 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s if (scratchRegOrNone == NoReg) { flag("endianness"); /* begin MoveMb:r:R: */ - anInstruction1 = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); } else { /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); /* begin MoveR:R: */ genoperandoperand(MoveRR, destReg, scratchRegOrNone); /* begin LogicalShiftRightCq:R: */ @@ -19602,7 +19599,7 @@ genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, s /* begin AndCq:R: */ quickConstant1 = formatMask(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(AndCqR, quickConstant1, destReg); + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); return 0; } @@ -19741,6 +19738,7 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) sqInt address1; AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; @@ -19748,14 +19746,12 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; - AbstractInstruction *anInstruction9; sqInt constant; usqLong header; sqInt i; sqInt offset; sqInt quickConstant; sqInt quickConstant1; - sqInt quickConstant2; AbstractInstruction *skip; assert(size < (numSlotsMask())); @@ -19763,19 +19759,17 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); if (initialized && (size > 0)) { /* begin genMoveConstant:R: */ @@ -19785,25 +19779,25 @@ genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) } else { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, constant, TempReg); + anInstruction7 = genoperandoperand(MoveCqR, constant, TempReg); } for (i = 0; i < size; i += 1) { /* begin MoveR:Mw:r: */ - anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); } } /* begin LoadEffectiveAddressMw:r:R: */ offset = smallObjectBytesForSlots(size); /* begin gen:quickConstant:operand:operand: */ - anInstruction8 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction9 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant1 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction8 = genoperandoperand(CmpCqR, quickConstant1, TempReg); /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CallRT: */ @@ -19845,7 +19839,6 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq sqInt quickConstant1; sqInt quickConstant2; sqInt quickConstant3; - sqInt quickConstant4; AbstractInstruction *skip; @@ -19859,29 +19852,27 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq /* begin MoveAw:R: */ address = freeStartAddress(); /* begin gen:literal:operand: */ - anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); /* begin genStoreHeader:intoNewInstance:using: */ - quickConstant1 = ((usqInt) header); + quickConstant = ((usqInt) header); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); /* begin MoveR:Mw:r: */ - anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant2 = ((sqInt) (header >> 32)); - /* begin gen:quickConstant:operand: */ - anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); /* begin MoveR:Mw:r: */ - anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); /* begin LoadEffectiveAddressMw:r:R: */ - anInstruction6 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); /* begin MoveR:Aw: */ address1 = freeStartAddress(); /* begin gen:operand:literal: */ - anInstruction7 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); /* begin CmpCq:R: */ - quickConstant = getScavengeThreshold(); + quickConstant3 = getScavengeThreshold(); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction12 = genoperandoperand(CmpCqR, quickConstant3, TempReg); /* begin JumpBelow: */ skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); /* begin CallRT: */ @@ -19889,19 +19880,19 @@ genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sq (abstractInstruction->annotation = IsRelativeCall); jmpTarget(skip, gLabel()); /* begin MoveR:Mw:r: */ - anInstruction8 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant3 = (((usqInt)bcpc << 1) | 1); + quickConstant1 = (((usqInt)bcpc << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction9 = genoperandoperand(MoveCqR, quickConstant3, TempReg); + anInstruction8 = genoperandoperand(MoveCqR, quickConstant1, TempReg); /* begin MoveR:Mw:r: */ - anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); /* begin MoveCq:R: */ - quickConstant4 = (((usqInt)numArgs << 1) | 1); + quickConstant2 = (((usqInt)numArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction11 = genoperandoperand(MoveCqR, quickConstant4, TempReg); + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); /* begin MoveR:Mw:r: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); return 0; } @@ -20023,9 +20014,9 @@ genPrimitiveObjectAt(void) jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); /* begin CmpCq:R: */ - quickConstant = (((usqInt)1 << 1) | 1); + quickConstant1 = (((usqInt)1 << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, Arg0Reg); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); /* begin JumpNonZero: */ jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveR:R: */ @@ -20036,16 +20027,16 @@ genPrimitiveObjectAt(void) genoperand(RetN, 0); jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); /* begin SubCq:R: */ - quickConstant1 = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(SubCqR, quickConstant1, Arg0Reg); + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); /* begin CmpR:R: */ genoperandoperand(CmpRR, headerReg, Arg0Reg); /* begin JumpAbove: */ jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); genConvertSmallIntegerToIntegerInReg(Arg0Reg); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); /* begin MoveXwr:R:R: */ genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); /* begin genPrimReturn */ @@ -20224,7 +20215,6 @@ static sqInt NoDbgRegParms genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, sqInt scratchReg, sqInt inFrame) { AbstractInstruction *abstractInstruction; - AbstractInstruction *abstractInstruction1; AbstractInstruction *anInstruction; AbstractInstruction * inst; AbstractInstruction *jmpAlreadyRemembered; @@ -20265,8 +20255,8 @@ genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, /* begin saveAndRestoreLinkRegAround: */ inst = genoperand(PushR, LinkReg); /* begin CallRT: */ - abstractInstruction1 = genoperand(Call, ceStoreCheckTrampoline); - (abstractInstruction1->annotation = IsRelativeCall); + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); /* begin PopR: */ @@ -20386,8 +20376,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); @@ -20424,8 +20414,8 @@ genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRest (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -20462,7 +20452,7 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin genStoreTrampolineCall: */ if (index >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, index, TempReg); + anInstruction = genoperandoperand(MoveCqR, index, TempReg); /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); (abstractInstruction1->annotation = IsRelativeCall); @@ -20473,8 +20463,8 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); if (needRestoreRcvr) { /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -20487,11 +20477,11 @@ genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRe /* begin MoveR:R: */ genoperandoperand(MoveRR, ClassReg, TempReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); } /* begin MoveR:Mw:r: */ - anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); jmpTarget(immutabilityFailure, gLabel()); return 0; } @@ -20662,9 +20652,9 @@ maybeCompileRetryOnPrimitiveFail(sqInt primIndex) /* begin MoveAw:R: */ address = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); } @@ -20675,9 +20665,9 @@ maybeCompileRetryOnPrimitiveFail(sqInt primIndex) /* begin MoveAw:R: */ address1 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address1, TempReg); + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); /* begin JumpNonZero: */ jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); } @@ -20795,8 +20785,8 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse } else { /* begin PushCq: */ - anInstruction = genoperand(PushCq, constant); - inst = anInstruction; + anInstruction1 = genoperand(PushCq, constant); + inst = anInstruction1; } } else { @@ -20805,7 +20795,7 @@ ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffse offset = (self_in_ensureSpilledAtfrom->offset); baseReg = (self_in_ensureSpilledAtfrom->registerr); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); /* begin PushR: */ inst = genoperand(PushR, TempReg); } @@ -21031,17 +21021,17 @@ compileGetErrorCode(void) /* begin MoveAw:R: */ address = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpZero: */ jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); primErrorTable = primErrTable(); primErrorTableSize = lengthOf(primErrorTable); flag("use CmpCqR if pc mapping means stable contexts never contain native pcs"); /* begin CmpCw:R: */ - anInstruction1 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); + anInstruction4 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); /* begin JumpAboveOrEqual: */ jmpIntError = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); genFetchIndexRegisterfrominto(TempReg, primErrorTable, ClassReg); @@ -21053,11 +21043,11 @@ compileGetErrorCode(void) genoperandoperand(MoveRR, TempReg, ClassReg); jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction1 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address1 = primFailCodeAddress(); /* begin gen:operand:literal: */ - anInstruction4 = genoperandoperand(MoveRAw, TempReg, address1); + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address1); jmpTarget(jmpNoError, gLabel()); } @@ -21082,27 +21072,27 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) sqInt address6; sqInt address8; sqInt address9; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction110; AbstractInstruction *anInstruction111; AbstractInstruction *anInstruction112; + AbstractInstruction *anInstruction113; AbstractInstruction *anInstruction12; AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; AbstractInstruction *anInstruction17; AbstractInstruction *anInstruction18; AbstractInstruction *anInstruction19; - AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction20; AbstractInstruction *anInstruction21; - AbstractInstruction *anInstruction22; - AbstractInstruction *anInstruction23; - AbstractInstruction *anInstruction24; AbstractInstruction *anInstruction25; - AbstractInstruction *anInstruction26; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; AbstractInstruction *anInstruction6; AbstractInstruction *anInstruction7; AbstractInstruction *anInstruction8; @@ -21115,7 +21105,6 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) AbstractInstruction *jmp; AbstractInstruction *jmpSampleNonPrim; AbstractInstruction *jmpSamplePrim; - sqInt literal1; sqInt offset; sqInt offset1; sqInt offset2; @@ -21136,11 +21125,11 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveAw:R: */ address = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction = genoperandoperand(MoveAwR, address, TempReg); /* begin MoveAw:R: */ address1 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address1, ClassReg); + anInstruction1 = genoperandoperand(MoveAwR, address1, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -21153,27 +21142,27 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); } /* begin MoveCq:R: */ - anInstruction23 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction18 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address11 = primFailCodeAddress(); /* begin gen:operand:literal: */ - anInstruction24 = genoperandoperand(MoveRAw, TempReg, address11); + anInstruction19 = genoperandoperand(MoveRAw, TempReg, address11); if (methodOrBlockNumArgs != 0) { /* begin MoveCq:R: */ - anInstruction6 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + anInstruction3 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); } /* begin MoveR:Aw: */ address12 = argumentCountAddress(); /* begin gen:operand:literal: */ - anInstruction25 = genoperandoperand(MoveRAw, TempReg, address12); + anInstruction20 = genoperandoperand(MoveRAw, TempReg, address12); if (flags & PrimCallNeedsPrimitiveFunction) { /* begin MoveCw:R: */ - anInstruction7 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); + anInstruction4 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); /* begin MoveR:Aw: */ address3 = primitiveFunctionPointerAddress(); /* begin gen:operand:literal: */ - anInstruction8 = genoperandoperand(MoveRAw, TempReg, address3); - primSetFunctionLabel = anInstruction8; + anInstruction5 = genoperandoperand(MoveRAw, TempReg, address3); + primSetFunctionLabel = anInstruction5; } if (flags & (PrimCallNeedsNewMethod + PrimCallMayCallBack)) { @@ -21185,16 +21174,16 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, methodObject); /* begin gen:quickConstant:operand:operand: */ - anInstruction9 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction6 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); /* begin MoveR:Aw: */ address4 = newMethodAddress(); /* begin gen:operand:literal: */ - anInstruction10 = genoperandoperand(MoveRAw, TempReg, address4); + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address4); } /* begin PrefetchAw: */ address13 = primFailCodeAddress(); /* begin gen:literal: */ - anInstruction26 = genoperand(PrefetchAw, address13); + anInstruction21 = genoperand(PrefetchAw, address13); if (flags & PrimCallMayCallBack) { /* Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode. */ @@ -21206,12 +21195,11 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) ? cePrimReturnEnterCogCodeProfiling : cePrimReturnEnterCogCode); /* begin MoveCw:R: */ - anInstruction13 = genoperandoperand(MoveCwR, retpc, RA); + anInstruction8 = genoperandoperand(MoveCwR, retpc, RA); /* begin JumpFullRT: */ /* begin JumpFull: */ - literal1 = ((sqInt)(((sqInt)primitiveRoutine))); - anInstruction12 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); - primInvokeInstruction = anInstruction12; + anInstruction110 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); + primInvokeInstruction = anInstruction110; jmp = (jmpSamplePrim = (continuePostSamplePrim = null)); } @@ -21220,19 +21208,19 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* Call the C primitive routine. */ /* begin CallFullRT: */ /* begin CallFull: */ - anInstruction110 = genoperand(CallFull, ((sqInt)primitiveRoutine)); - primInvokeInstruction = anInstruction110; + anInstruction111 = genoperand(CallFull, ((sqInt)primitiveRoutine)); + primInvokeInstruction = anInstruction111; if (flags & PrimCallCollectsProfileSamples) { assert(flags & PrimCallNeedsNewMethod); /* begin MoveAw:R: */ address5 = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address5, TempReg); + anInstruction9 = genoperandoperand(MoveAwR, address5, TempReg); /* begin MoveAw:R: */ address6 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction15 = genoperandoperand(MoveAwR, address6, ClassReg); + anInstruction10 = genoperandoperand(MoveAwR, address6, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -21247,21 +21235,21 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) address8 = instructionPointerAddress(); reg = LinkReg; /* begin gen:literal:operand: */ - anInstruction17 = genoperandoperand(MoveAwR, address8, reg); + anInstruction12 = genoperandoperand(MoveAwR, address8, reg); genLoadStackPointers(backEnd); /* begin MoveAw:R: */ address9 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction18 = genoperandoperand(MoveAwR, address9, TempReg); + anInstruction13 = genoperandoperand(MoveAwR, address9, TempReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction25 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpNonZero: */ jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveMw:r:R: */ offset1 = 0; /* begin gen:quickConstant:operand:operand: */ - anInstruction19 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + anInstruction14 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, BytesPerWord); } @@ -21276,22 +21264,22 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin CallFullRT: */ callTarget = ((usqIntptr_t)ceCheckProfileTick); /* begin CallFull: */ - anInstruction111 = genoperand(CallFull, callTarget); + anInstruction112 = genoperand(CallFull, callTarget); /* begin Jump: */ genoperand(Jump, ((sqInt)continuePostSamplePrim)); } jmpTarget(jmpSampleNonPrim, gLabel()); /* begin MoveCq:R: */ - anInstruction20 = genoperandoperand(MoveCqR, 0, TempReg); + anInstruction15 = genoperandoperand(MoveCqR, 0, TempReg); /* begin MoveR:Aw: */ address10 = newMethodAddress(); /* begin gen:operand:literal: */ - anInstruction21 = genoperandoperand(MoveRAw, TempReg, address10); + anInstruction16 = genoperandoperand(MoveRAw, TempReg, address10); /* begin CallFullRT: */ callTarget1 = ((usqIntptr_t)ceCheckProfileTick); /* begin CallFull: */ - anInstruction112 = genoperand(CallFull, callTarget1); + anInstruction113 = genoperand(CallFull, callTarget1); /* begin Jump: */ genoperand(Jump, ((sqInt)continuePostSampleNonPrim)); @@ -21303,7 +21291,7 @@ compileInterpreterPrimitive(void (*primitiveRoutine)(void)) /* begin MoveMw:r:R: */ offset2 = BytesPerWord * (methodOrBlockNumArgs + (0)); /* begin gen:quickConstant:operand:operand: */ - anInstruction22 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); } return 0; } @@ -21338,18 +21326,18 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); } annotateobjRef(gCmpCwR(selector, TempReg), selector); /* begin JumpNonZero: */ @@ -21358,11 +21346,11 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, SendNumArgsReg, TempReg); @@ -21378,7 +21366,7 @@ compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt sh static void NoDbgRegParms compileOpenPICnumArgs(sqInt selector, sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -21401,13 +21389,13 @@ compileOpenPICnumArgs(sqInt selector, sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - itsAHit = anInstruction2; + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); jumpBCMethod = genJumpImmediate(ClassReg); jmpTarget(jumpBCMethod, picInterpretAbort); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); /* begin JumpR: */ genoperand(JumpR, ClassReg); jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); @@ -21454,18 +21442,18 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); } /* begin AndCq:R: */ - anInstruction = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); if (baseRegOrNone == NoReg) { /* begin MoveMw:r:R: */ offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); } else { /* begin AddR:R: */ genoperandoperand(AddRR, baseRegOrNone, ClassReg); /* begin MoveMw:r:R: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, selectorReg, TempReg); @@ -21475,11 +21463,11 @@ compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt /* begin MoveMw:r:R: */ offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); } else { /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); } /* begin CmpR:R: */ genoperandoperand(CmpRR, SendNumArgsReg, TempReg); @@ -21684,6 +21672,7 @@ genExtJumpIfFalse(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(falseObject(), target); } @@ -21707,6 +21696,7 @@ genExtJumpIfTrue(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; return genJumpIfto(trueObject(), target); } @@ -21719,7 +21709,7 @@ genExtJumpIfTrue(void) static sqInt genExtNopBytecode(void) { - extA = (extB = 0); + extA = (numExtB = (extB = 0)); return 0; } @@ -21738,6 +21728,7 @@ genExtPushIntegerBytecode(void) value = byte1 + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; return genPushLiteral((((usqInt)value << 1) | 1)); } @@ -21784,6 +21775,7 @@ genExtPushPseudoVariableOrOuterBytecode(void) ext = extB; extB = 0; + numExtB = 0; switch (ext) { case 0: @@ -21863,6 +21855,7 @@ genExtSendAbsentDynamicSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentDynamicSupernumArgs(litIndex, nArgs); } @@ -21882,6 +21875,7 @@ genExtSendAbsentImplicitBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentImplicitnumArgs(litIndex, nArgs); } @@ -21903,6 +21897,7 @@ genExtSendAbsentOuterBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byte2; return genSendAbsentOuternumArgsdepth(litIndex, nArgs, depth); } @@ -21923,6 +21918,7 @@ genExtSendAbsentSelfBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendAbsentSelfnumArgs(litIndex, nArgs); } @@ -21942,6 +21938,7 @@ genExtSendBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return genSendnumArgs(litIndex, nArgs); } @@ -21965,6 +21962,7 @@ genExtSendSuperBytecode(void) extA = 0; nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; return (isDirected ? genSendDirectedSupernumArgs(litIndex, nArgs) : genSendSupernumArgs(litIndex, nArgs)); @@ -22070,6 +22068,7 @@ genExtUnconditionalJump(void) ? 1 : 0)), methodObj))); extB = 0; + numExtB = 0; target = (distance + 2) + bytecodePC; if (distance < 0) { return genJumpBackTo(target); @@ -22110,29 +22109,29 @@ genFastPrimTraceUsingand(sqInt r1, sqInt r2) sqInt wordConstant; /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, r2); + anInstruction = genoperandoperand(MoveCqR, 0, r2); /* begin MoveAb:R: */ address = primTraceLogIndexAddress(); /* begin gen:literal:operand: */ - anInstruction2 = genoperandoperand(MoveAbR, address, r2); + anInstruction1 = genoperandoperand(MoveAbR, address, r2); /* begin MoveR:R: */ genoperandoperand(MoveRR, r2, r1); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, 1, r1); + anInstruction5 = genoperandoperand(AddCqR, 1, r1); /* begin MoveR:Ab: */ address1 = primTraceLogIndexAddress(); /* begin gen:operand:literal: */ - anInstruction3 = genoperandoperand(MoveRAb, r1, address1); + anInstruction2 = genoperandoperand(MoveRAb, r1, address1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), r1))); /* begin MoveMw:r:R: */ offset = offsetof(CogMethod, selector); /* begin gen:quickConstant:operand:operand: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); /* begin MoveCw:R: */ wordConstant = ((sqInt)(primTraceLogAddress())); /* begin gen:literal:operand: */ - anInstruction5 = genoperandoperand(MoveCwR, wordConstant, r1); + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, r1); /* begin MoveR:Xwr:R: */ genoperandoperandoperand(MoveRXwrR, TempReg, r2, r1); } @@ -22227,7 +22226,7 @@ genLongUnconditionalForwardJump(void) static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs) { - AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; AbstractInstruction *anInstruction2; sqInt cacheBaseReg; AbstractInstruction *itsAHit; @@ -22250,14 +22249,14 @@ genLookupForPerformNumArgs(sqInt numArgs) ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); /* begin gen:quickConstant:operand:operand: */ - anInstruction2 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); - itsAHit = anInstruction2; + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); /* Adjust arguments and jump to the method's unchecked entry-point. */ jumpInterpret = genJumpImmediate(ClassReg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); adjustArgumentsForPerform(numArgs); /* begin JumpR: */ genoperand(JumpR, ClassReg); @@ -22317,17 +22316,17 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) sqInt address6; sqInt address7; sqInt address8; + AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; AbstractInstruction *anInstruction14; - AbstractInstruction *anInstruction15; AbstractInstruction *anInstruction16; AbstractInstruction *anInstruction18; AbstractInstruction *anInstruction2; - AbstractInstruction *anInstruction3; - AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction7; - AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; sqInt callTarget; AbstractInstruction *continuePostSample; AbstractInstruction * inst; @@ -22340,7 +22339,7 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveCq:R: */ quickConstant = varBaseAddress(); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); if (profiling) { @@ -22349,11 +22348,11 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address = nextProfileTickAddress(); /* begin gen:literal:operand: */ - anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); /* begin MoveAw:R: */ address1 = (nextProfileTickAddress()) + BytesPerWord; /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address1, ClassReg); + anInstruction2 = genoperandoperand(MoveAwR, address1, ClassReg); /* begin OrR:R: */ genoperandoperand(OrRR, TempReg, ClassReg); @@ -22366,19 +22365,19 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address6 = primFailCodeAddress(); /* begin gen:literal:operand: */ - anInstruction14 = genoperandoperand(MoveAwR, address6, TempReg); + anInstruction12 = genoperandoperand(MoveAwR, address6, TempReg); flag("ask concrete code gen if move sets condition codes?"); /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + anInstruction16 = genoperandoperand(CmpCqR, 0, TempReg); /* begin JumpNonZero: */ jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadStackPointers(backEnd); /* begin MoveMw:r:R: */ - anInstruction7 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + anInstruction5 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); /* begin MoveAw:R: */ address4 = instructionPointerAddress(); /* begin gen:literal:operand: */ - anInstruction8 = genoperandoperand(MoveAwR, address4, LinkReg); + anInstruction6 = genoperandoperand(MoveAwR, address4, LinkReg); /* begin RetN: */ genoperand(RetN, BytesPerWord); @@ -22387,16 +22386,16 @@ genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) /* begin MoveAw:R: */ address7 = cStackPointerAddress(); /* begin gen:literal:operand: */ - anInstruction15 = genoperandoperand(MoveAwR, address7, SPReg); + anInstruction13 = genoperandoperand(MoveAwR, address7, SPReg); compileCallFornumArgsargargargargresultRegregsToSave(ceActivateFailingPrimitiveMethod, 1, SendNumArgsReg, null, null, null, NoReg, 0); /* begin MoveAw:R: */ address8 = instructionPointerAddress(); reg = LinkReg; /* begin gen:literal:operand: */ - anInstruction16 = genoperandoperand(MoveAwR, address8, reg); + anInstruction14 = genoperandoperand(MoveAwR, address8, reg); genLoadStackPointers(backEnd); /* begin MoveMw:r:R: */ - anInstruction12 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + anInstruction10 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, BytesPerWord); @@ -22828,7 +22827,7 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) CogBlockMethod *cogMethod1; BytecodeDescriptor *descriptor; sqInt distance; - usqInt endbcpc; + sqInt endbcpc; sqInt errCode; CogMethod *homeMethod; sqInt isBackwardBranch; @@ -23694,11 +23693,11 @@ static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs) { AbstractInstruction *anInstruction; - AbstractInstruction *anInstruction11; - AbstractInstruction *anInstruction12; - AbstractInstruction *anInstruction2; - AbstractInstruction *anInstruction3; - AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; sqInt index; assert((numRegArgs()) <= 2); @@ -23712,23 +23711,23 @@ adjustArgumentsForPerform(sqInt numArgs) } if ((2 + 1) == numArgs) { /* begin MoveMw:r:R: */ - anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); /* begin MoveMw:r:R: */ - anInstruction4 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); + anInstruction1 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); + anInstruction13 = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); return; } for (index = (numArgs - 2); index >= 0; index += -1) { /* begin MoveMw:r:R: */ - anInstruction11 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + anInstruction8 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); /* begin MoveR:Mw:r: */ - anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); } /* begin AddCq:R: */ - anInstruction2 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord, SPReg); } @@ -23851,7 +23850,8 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) /* begin assertExtsAreConsumed: */ if (!((descriptor->isExtension))) { assert((extA == 0) - && (extB == 0)); + && ((extB == 0) + && (numExtB == 0))); } traceDescriptor(descriptor); traceSimStack(); @@ -23873,6 +23873,7 @@ compileAbstractInstructionsFromthrough(sqInt start, sqInt end) generateBranchAround = !((isUnconditionalBranch(descriptor)) || ((descriptor->isReturn))); } + /* begin nextBytecodePCFor:exts: */ bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) : 0)); @@ -24040,13 +24041,13 @@ compileBlockFrameBuild(BlockStart *blockStart) if (((blockStart->numInitialNils)) > 0) { if (((blockStart->numInitialNils)) > 1) { /* begin genMoveNilR: */ - constant1 = nilObject(); - if (shouldAnnotateObjectReference(constant1)) { - annotateobjRef(gMoveCwR(constant1, TempReg), constant1); + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant1, TempReg); + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); } for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { /* begin PushR: */ @@ -24055,13 +24056,13 @@ compileBlockFrameBuild(BlockStart *blockStart) } else { /* begin genPushConstant: */ - constant = nilObject(); - if (shouldAnnotateObjectReference(constant)) { - annotateobjRef(gPushCw(constant), constant); + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); } else { /* begin PushCq: */ - anInstruction1 = genoperand(PushCq, constant); + anInstruction1 = genoperand(PushCq, constant1); } } } @@ -24282,7 +24283,7 @@ compileFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); } /* begin PushR: */ genoperand(PushR, SendNumArgsReg); @@ -24312,7 +24313,7 @@ compileFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); @@ -24321,7 +24322,7 @@ compileFrameBuild(void) (stackCheckLabel->annotation = HasBytecodePC); if (numIRCs > 0) { /* begin PrefetchAw: */ - anInstruction2 = genoperand(PrefetchAw, theIRCs); + anInstruction1 = genoperand(PrefetchAw, theIRCs); } initSimStackForFramefulMethod(initialPC); @@ -24387,7 +24388,7 @@ compileTwoPathFrameBuild(void) /* begin CmpCq:R: */ quickConstant = storeCheckBoundary(); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + anInstruction4 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); /* begin JumpAboveOrEqual: */ jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); @@ -24423,7 +24424,7 @@ compileTwoPathFrameBuild(void) } else { /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); } /* begin PushR: */ genoperand(PushR, SendNumArgsReg); @@ -24440,7 +24441,7 @@ compileTwoPathFrameBuild(void) /* begin MoveAw:R: */ address = stackLimitAddress(); /* begin gen:literal:operand: */ - anInstruction4 = genoperandoperand(MoveAwR, address, TempReg); + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); /* begin CmpR:R: */ genoperandoperand(CmpRR, TempReg, SPReg); if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { @@ -24453,7 +24454,7 @@ compileTwoPathFrameBuild(void) /* begin JumpAboveOrEqual: */ jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); /* begin Jump: */ genoperand(Jump, ((sqInt)stackOverflowCall)); jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); @@ -24462,7 +24463,7 @@ compileTwoPathFrameBuild(void) (stackCheckLabel->annotation = HasBytecodePC); if (numIRCs > 0) { /* begin PrefetchAw: */ - anInstruction2 = genoperand(PrefetchAw, theIRCs); + anInstruction1 = genoperand(PrefetchAw, theIRCs); } initSimStackForFramefulMethod(initialPC); @@ -24555,13 +24556,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction1 = gen(Nop); + abstractInstruction = gen(Nop); } else { /* begin Label */ - abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction1->annotation = HasBytecodePC); + (abstractInstruction->annotation = HasBytecodePC); return 0; } break; @@ -24570,13 +24571,13 @@ doubleExtendedDoAnythingBytecode(void) /* begin annotateInstructionForBytecode */ if (prevInstIsPCAnnotated()) { /* begin Nop */ - abstractInstruction2 = gen(Nop); + abstractInstruction1 = gen(Nop); } else { /* begin Label */ - abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); } - (abstractInstruction2->annotation = HasBytecodePC); + (abstractInstruction1->annotation = HasBytecodePC); return 0; case 4: @@ -24621,8 +24622,8 @@ doubleExtendedDoAnythingBytecode(void) assert(needsFrame); assert(!(prevInstIsPCAnnotated())); /* begin annotateBytecode: */ - abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction->annotation = HasBytecodePC); + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); return 0; } @@ -24913,7 +24914,7 @@ genExtPushClosureBytecode(void) assert(needsFrame); startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); - extA = (extB = 0); + extA = (numExtB = (extB = 0)); /* begin genInlineClosure:numArgs:numCopied: */ assert(getActiveContextAllocatesInMachineCode()); voidReceiverResultRegContainsSelf(); @@ -25179,7 +25180,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) popToReg(ssTop(), argReg1); if (((ssValue(1))->spilled)) { /* begin AddCq:R: */ - anInstruction4 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); } } } @@ -25214,7 +25215,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant, rcvrReg); + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); } } else { @@ -25226,7 +25227,7 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant1, argReg); + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); } } else { @@ -25296,11 +25297,11 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm = genJumpImmediate(argReg); /* begin MoveMw:r:R: */ - anInstruction11 = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); /* begin AndCq:R: */ quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction2 = genoperandoperand(AndCqR, quickConstant, TempReg); + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); /* begin JumpNonZero: */ ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, argReg, argReg); @@ -25326,11 +25327,11 @@ genForwardersInlinedIdenticalOrNotIf(sqInt orNot) but the following is an instruction shorter: */ imm1 = genJumpImmediate(rcvrReg); /* begin MoveMw:r:R: */ - anInstruction12 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); /* begin AndCq:R: */ quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); /* begin gen:quickConstant:operand: */ - anInstruction3 = genoperandoperand(AndCqR, quickConstant1, TempReg); + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); /* begin JumpNonZero: */ ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(0, rcvrReg, rcvrReg); @@ -25359,16 +25360,16 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC { AbstractInstruction *anInstruction; AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; AbstractInstruction *anInstruction2; AbstractInstruction *anInstruction3; AbstractInstruction *anInstruction4; - AbstractInstruction *anInstruction5; sqInt constant; sqInt constant1; + sqInt constant11; sqInt constant2; sqInt constant3; sqInt constant4; - sqInt constant5; AbstractInstruction *jumpEqual; AbstractInstruction *jumpNotEqual; AbstractInstruction *label; @@ -25387,19 +25388,19 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); } } else { if (rcvrIsConstant) { /* begin genCmpConstant:R: */ - constant5 = ((ssValue(1))->constant); - if (shouldAnnotateObjectReference(constant5)) { - annotateobjRef(gCmpCwR(constant5, argReg), constant5); + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); } else { /* begin CmpCq:R: */ - anInstruction1 = genoperandoperand(CmpCqR, constant5, argReg); + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); } } else { @@ -25427,7 +25428,7 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction2 = genoperandoperand(MoveCqR, constant, resultReg); + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); } } else { @@ -25438,7 +25439,7 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC } else { /* begin MoveCq:R: */ - anInstruction3 = genoperandoperand(MoveCqR, constant1, resultReg); + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); } } /* begin Jump: */ @@ -25449,15 +25450,15 @@ genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsC (shouldAnnotateObjectReference(constant2) ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) : (/* begin MoveCq:R: */ - (anInstruction4 = genoperandoperand(MoveCqR, constant2, resultReg)), - anInstruction4))) + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + anInstruction2))) : (/* begin genMoveTrueR: */ (constant3 = trueObject()), (shouldAnnotateObjectReference(constant3) ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) : (/* begin MoveCq:R: */ - (anInstruction5 = genoperandoperand(MoveCqR, constant3, resultReg)), - anInstruction5))))); + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + anInstruction3))))); jmpTarget(jumpNotEqual, gLabel()); ssPushRegister(resultReg); return 0; @@ -25580,7 +25581,7 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) } else { /* begin SubCq:R: */ - anInstruction1 = genoperandoperand(SubCqR, boolean, TempReg); + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); } /* begin JumpZero: */ jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); @@ -25598,7 +25599,7 @@ genJumpIfto(sqInt boolean, sqInt targetBytecodePC) ? (trueObject()) - (falseObject()) : (falseObject()) - (trueObject())); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); /* begin JumpZero: */ ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); genCallMustBeBooleanFor(boolean); @@ -25639,19 +25640,19 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen } if (sendTable == selfSendTrampolines) { annotation = IsNSSelfSend; - goto l2; + goto l1; } if (sendTable == dynamicSuperSendTrampolines) { annotation = IsNSDynamicSuperSend; - goto l2; + goto l1; } if (sendTable == superSendTrampolines) { annotation = IsSuperSend; - goto l2; + goto l1; } assert(sendTable == ordinarySendTrampolines); annotation = IsSendCall; -l2: /* end annotationForSendTable: */; +l1: /* end annotationForSendTable: */; if ((annotation == IsSuperSend) || (0)) { genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); @@ -25688,11 +25689,11 @@ genMethodAbortTrampolineFor(sqInt numArgs) zeroOpcodeIndex(); /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); /* begin JumpNonZero: */ jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); /* begin MoveR:Mw:r: */ - anInstruction1 = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); + anInstruction = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); jmpTarget(jumpSICMiss, gLabel()); @@ -25818,7 +25819,7 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); /* begin gen:quickConstant:operand: */ - anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); /* begin JumpNonZero: */ jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ClassReg); @@ -25833,7 +25834,7 @@ genPrimitiveClosureValue(void) /* begin CmpCq:R: */ quickConstant1 = firstCompiledMethodFormat(); /* begin gen:quickConstant:operand: */ - anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); /* begin JumpLess: */ jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); @@ -25841,7 +25842,7 @@ genPrimitiveClosureValue(void) /* begin MoveM16:r:R: */ offset = offsetof(CogMethod, blockEntryOffset); /* begin gen:quickConstant:operand:operand: */ - anInstruction3 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); /* begin AddR:R: */ genoperandoperand(AddRR, ClassReg, TempReg); primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); @@ -25850,7 +25851,7 @@ genPrimitiveClosureValue(void) return NotFullyInitialized; } /* begin SubCq:R: */ - anInstruction2 = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); } /* begin JumpR: */ genoperand(JumpR, TempReg); @@ -26325,11 +26326,11 @@ genSpecialSelectorArithmetic(void) case AddRR: if (argIsInt) { /* begin AddCq:R: */ - anInstruction = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin SubCq:R: */ - anInstruction3 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); } else { genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); @@ -26339,7 +26340,7 @@ genSpecialSelectorArithmetic(void) jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); if (rcvrIsInt) { /* begin MoveCq:R: */ - anInstruction4 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); } else { /* begin SubR:R: */ @@ -26351,11 +26352,11 @@ genSpecialSelectorArithmetic(void) case SubRR: if (argIsInt) { /* begin SubCq:R: */ - anInstruction5 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); /* begin JumpNoOverflow: */ jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); /* begin AddCq:R: */ - anInstruction1 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); } else { genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); @@ -26371,7 +26372,7 @@ genSpecialSelectorArithmetic(void) case AndRR: if (argIsInt) { /* begin AndCq:R: */ - anInstruction2 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); } else { /* begin AndR:R: */ @@ -26383,7 +26384,7 @@ genSpecialSelectorArithmetic(void) case OrRR: if (argIsInt) { /* begin OrCq:R: */ - anInstruction6 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); } else { /* begin OrR:R: */ @@ -26398,7 +26399,7 @@ genSpecialSelectorArithmetic(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction7 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); } index = byte0 - ((bytecodeSetOffset == 256 ? AltFirstSpecialSelector + 256 @@ -26526,7 +26527,7 @@ genSpecialSelectorComparison(void) } if (argIsInt) { /* begin CmpCq:R: */ - anInstruction = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); } else { /* begin CmpR:R: */ @@ -26541,7 +26542,7 @@ genSpecialSelectorComparison(void) jmpTarget(jumpNotSmallInts, gLabel()); if (argIsInt) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); } index = byte0 - ((bytecodeSetOffset == 256 ? AltFirstSpecialSelector + 256 @@ -26671,7 +26672,7 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI /* begin genStoreTrampolineCall: */ if (slotIndex >= (NumStoreTrampolines - 1)) { /* begin MoveCq:R: */ - anInstruction1 = genoperandoperand(MoveCqR, slotIndex, TempReg); + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); /* begin CallRT: */ abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); (abstractInstruction1->annotation = IsRelativeCall); @@ -26682,8 +26683,8 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI (abstractInstruction2->annotation = IsRelativeCall); } /* begin annotateBytecode: */ - abstractInstruction3 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); - (abstractInstruction3->annotation = HasBytecodePC); + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); /* begin putSelfInReceiverResultReg */ storeToReg((&simSelf), ReceiverResultReg); @@ -26701,10 +26702,10 @@ genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqI ssStoreAndReplacePoptoReg(popBoolean, ClassReg); ssFlushTo(simStackPtr); /* begin MoveCq:R: */ - anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); /* begin CallRT: */ - abstractInstruction = genoperand(Call, ceStoreContextInstVarTrampoline); - (abstractInstruction->annotation = IsRelativeCall); + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); # if IMMUTABILITY if (needsImmCheck) { @@ -27429,7 +27430,7 @@ scanBlock(BlockStart *blockStart) inBlock = InVanillaBlock; pc = (blockStart->startpc); end = ((blockStart->startpc)) + ((blockStart->span)); - framelessStackDelta = (nExts = (extA = (extB = 0))); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); pushingNils = 1; while (pc < end) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; @@ -27475,6 +27476,7 @@ scanBlock(BlockStart *blockStart) pushingNils = 0; } } + /* begin nextBytecodePCFor:at:exts:in: */ pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) : 0)); @@ -27482,7 +27484,7 @@ scanBlock(BlockStart *blockStart) nExts += 1; } else { - nExts = (extA = (extB = 0)); + nExts = (extA = (numExtB = (extB = 0))); } prevBCDescriptor = descriptor; } @@ -27526,7 +27528,7 @@ scanMethod(void) return 0; } pc = (latestContinuation = initialPC); - numBlocks = (framelessStackDelta = (nExts = (extA = (extB = 0)))); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); while (pc <= endPC) { byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; descriptor = generatorAt(byte0); @@ -27612,7 +27614,7 @@ scanMethod(void) pc += (descriptor->numBytes); nExts = ((descriptor->isExtension) ? nExts + 1 - : (extA = (extB = 0))); + : (extA = (numExtB = (extB = 0)))); prevBCDescriptor = descriptor; } return numBlocks; diff --git a/nsspursrc/vm/cogmethod.h b/nsspursrc/vm/cogmethod.h index e9ab4ba44f..f3b3cd0b11 100644 --- a/nsspursrc/vm/cogmethod.h +++ b/nsspursrc/vm/cogmethod.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1822 uuid: f18408b3-d8bb-4ac7-9d7d-b37ace026619 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ typedef struct { diff --git a/nsspursrc/vm/cointerp.c b/nsspursrc/vm/cointerp.c index 184f3cb4a3..81e09c0410 100644 --- a/nsspursrc/vm/cointerp.c +++ b/nsspursrc/vm/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - CoInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CoInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -303,6 +303,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define RemapBufferSize 25 #define RememberedSetRootIndex 4099 #define ReturnToInterpreter 1 +#define ScavengeInProgress 1 #define SchedulerAssociation 3 #define SelectorAboutToReturn 48 #define SelectorAttemptToAssign 50 @@ -318,6 +319,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define ShouldNotJIT -8 #define SistaV1BytecodeSet 0 #define SistaVM 0 +#define SlidingCompactionInProgress 2 #define SmallContextSlots 22 #define SPURVM 1 #define SpecialSelectors 23 @@ -910,6 +912,8 @@ static void NeverInline computeRefCountToShrinkRT(void); static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner); static sqInt NoDbgRegParms copyAndForward(sqInt survivor); static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor); +static void fireEphemeronsInRememberedSet(void); +static void fireEphemeronsOnEphemeronList(void); static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList); static void growRememberedSet(void); static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop); @@ -963,7 +967,7 @@ extern usqInt characterValueOf(sqInt oop); static sqInt NoDbgRegParms cheapAddressCouldBeInHeap(sqInt address); extern sqInt checkedLongAt(sqInt byteAddress); static sqInt checkHeapFreeSpaceIntegrity(void); -static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); extern sqInt checkOkayOop(usqInt oop); extern sqInt checkOopHasOkayClass(usqInt obj); static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name); @@ -1023,6 +1027,7 @@ extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop); static sqInt findLargestFreeChunk(void); extern void findStringBeginningWith(char *aCString); extern void findString(char *aCString); +static void fireAllUnscannedEphemerons(void); static sqInt firstAccessibleObject(void); static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop); extern void * firstFixedField(sqInt objOop); @@ -1124,7 +1129,6 @@ static sqInt NoDbgRegParms isValidObjStack(sqInt objStack); static sqInt NoDbgRegParms isWeakFormat(sqInt format); static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop); extern sqInt isWeak(sqInt oop); -static sqInt NoDbgRegParms isWordsOrBytesNonImm(sqInt objOop); extern sqInt isWordsOrBytes(sqInt oop); extern sqInt isWords(sqInt oop); extern sqInt isYoungObject(sqInt objOop); @@ -1153,12 +1157,12 @@ static void NoDbgRegParms markAndTraceClassOf(sqInt objOop); static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents); extern void NeverInline markAndTrace(sqInt objOop); static sqInt markInactiveEphemerons(void); +static void NoDbgRegParms markLoopFrom(sqInt objOop); static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged); static void markWeaklingsAndMarkAndFireEphemerons(void); extern sqInt maybeSplObj(sqInt index); static sqInt newObjectHash(void); static sqInt newSpaceIsEmpty(void); -extern usqInt nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); extern sqInt nilObject(void); static void NeverInline nilUnmarkedWeaklingSlots(void); static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex); @@ -1179,6 +1183,7 @@ extern sqInt numStrongSlotsOfWeakling(sqInt objOop); extern sqInt objectAfter(sqInt objOop); extern sqInt objectBefore(sqInt objOop); static sqInt NoDbgRegParms objectStartingAt(sqInt address); +static sqInt NoDbgRegParms objectsReachableFromRoots(sqInt arrayOfRoots); extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop); static sqInt NoDbgRegParms okayOop(sqInt signedOop); static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); @@ -1189,6 +1194,7 @@ static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags); extern sqInt primitiveErrorTable(void); extern void printActivationsOf(sqInt aMethodObj); extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); extern void printForwarders(void); extern void printFreeChunks(void); extern void printFreeChunk(sqInt freeChunk); @@ -1202,6 +1208,7 @@ static void NoDbgRegParms printHeaderTypeOf(sqInt objOop); extern void printInstancesOf(sqInt aClassOop); extern void printInstancesWithClassIndex(sqInt classIndex); extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); extern void printMethodReferencesTo(sqInt anOop); extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); extern void printObjectsWithHash(sqInt hash); @@ -1215,17 +1222,15 @@ extern void pushRemappableOop(sqInt oop); static sqInt NoDbgRegParms pushonObjStack(sqInt objOop, sqInt objStack); static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray); extern sqInt rawHashBitsOf(sqInt objOop); -extern sqInt remapObj(sqInt objOop); extern sqInt removeGCRoot(sqInt *varLoc); static void NoDbgRegParms restoreObjectsInsavedHashes(sqInt objArray, sqInt savedHashes); static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes); static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes); -static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion); static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd); static sqInt NoDbgRegParms shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); -extern sqInt shouldRemapObj(sqInt objOop); extern sqInt shouldRemapOop(sqInt oop); static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack); extern sqInt slotSizeOf(sqInt oop); @@ -1252,11 +1257,15 @@ static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt pa static sqInt validObjStacks(void); extern sqInt vmEndianness(void); extern sqInt checkTraversableSortedFreeList(void); -static sqInt NeverInline compact(void); -static sqInt eliminateAndFreeForwardersForPigCompact(void); -static sqInt NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); +static void NeverInline compact(void); +static void eliminateAndFreeForwardersForPigCompact(void); +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); static sqInt NoDbgRegParms moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit); -static sqInt rebuildFreeListsForPigCompact(void); +static usqInt NoDbgRegParms nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); +extern void printSortedFreeList(void); +static void rebuildFreeListsForPigCompact(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit); static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount); static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift); @@ -1355,6 +1364,8 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt p extern sqInt findSelectorOfMethod(sqInt meth); static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage); static sqInt NoDbgRegParms findUnwindThroughContext(sqInt homeContext); +static void NoDbgRegParms fireEphemeron(sqInt ephemeron); +static void NoDbgRegParms fireFinalization(sqInt weakling); extern double floatArg(sqInt index); static void NoDbgRegParms followForwardedFrameContentsstackPointer(char *theFP, char *theSP); extern sqInt forceInterruptCheck(void); @@ -1636,11 +1647,11 @@ _iss usqInt newSpaceStart; _iss sqInt trueObj; _iss SpurSegmentInfo * segments; _iss sqInt falseObj; +_iss sqInt lkupClassTag; _iss sqInt hiddenRootsObj; _iss usqInt totalFreeOldSpace; _iss usqInt pastSpaceStart; _iss usqInt scavengeThreshold; -_iss sqInt lkupClassTag; _iss sqInt bytesPerPage; _iss sqInt numSegments; _iss sqInt localAbsentReceiver; @@ -1656,27 +1667,27 @@ _iss sqInt localAbsentReceiverOrZero; _iss usqInt freeListsMask; _iss StackPage * mostRecentlyUsedPage; _iss sqInt tempOop; +_iss usqInt firstFreeChunk; _iss sqInt remapBufferCount; _iss sqInt markStack; _iss SpurContiguousObjStack unscannedEphemerons; -_iss usqInt firstFreeChunk; -_iss sqInt numStackPages; _iss sqInt weaklingStack; +_iss sqInt numStackPages; _iss sqInt profileProcess; _iss SpurNewSpaceSpace pastSpace; _iss sqLong nextProfileTick; _iss sqInt profileSemaphore; -_iss sqInt numClassTablePages; _iss sqInt profileMethod; _iss sqInt longRunningPrimitiveCheckSemaphore; +_iss sqInt numClassTablePages; _iss sqInt futureSurvivorStart; _iss sqInt classTableIndex; _iss sqInt numRememberedEphemerons; _iss SpurNewSpaceSpace futureSpace; _iss sqInt jmpDepth; +_iss usqInt lastFreeChunk; _iss sqInt longRunningPrimitiveCheckMethod; _iss sqInt mournQueue; -_iss usqInt lastFreeChunk; _iss sqInt tempOop2; _iss sqInt becomeEffectsFlags; _iss SpurNewSpaceSpace eden; @@ -1692,10 +1703,9 @@ _iss sqInt previousRememberedSetSize; _iss sqInt tenureCriterion; _iss sqInt classNameIndex; _iss sqInt methodDictLinearSearchLimit; -_iss sqInt pendingFinalizationSignals; -_iss sqInt metaclassNumSlots; _iss sqInt lastCoggableInterpretedBlockMethod; _iss sqInt lastUncoggableInterpretedBlockMethod; +_iss sqInt metaclassNumSlots; _iss sqInt numSegInfos; _iss sqInt preemptionYields; _iss sqInt cogCompiledCodeCompactionCalledFor; @@ -1705,21 +1715,24 @@ _iss sqInt cogCodeSize; _iss sqInt highestRunnableProcessPriority; _iss usqLong longRunningPrimitiveStartUsecs; _iss usqLong longRunningPrimitiveStopUsecs; -_iss sqInt newFinalization; -_iss sqInt rememberedSetLimit; _iss usqLong statCheckForEvents; _iss usqLong statGCEndUsecs; _iss sqInt weakList; _iss sqInt externalPrimitiveTableFirstFreeIndex; _iss sqInt flagInterpretedMethods; _iss sqInt marking; +_iss sqInt newFinalization; _iss sqInt statSurvivorCount; _iss sqInt thisClassIndex; _iss sqInt firstSegmentSize; +_iss sqInt gcPhaseInProgress; _iss usqLong gcStartUsecs; _iss usqInt lowSpaceThreshold; +_iss sqInt pendingFinalizationSignals; +_iss sqInt rememberedSetLimit; _iss sqInt shrinkThreshold; _iss usqLong statIOProcessEvents; +_iss sqInt sweepIndex; _iss sqInt edenBytes; _iss sqInt imageHeaderFlags; _iss sqInt lastHash; @@ -1727,7 +1740,6 @@ _iss sqInt lastMethodCacheProbeWrite; _iss sqInt longRunningPrimitiveCheckSequenceNumber; _iss usqInt memory; _iss sqInt numCompactionPasses; -_iss sqInt scavengeInProgress; _iss sqInt fullScreenFlag; _iss float heapGrowthToSizeGCRatio; _iss usqInt heapSizeAtPreviousGC; @@ -2455,7 +2467,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */] }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.2041"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-rsf.2077"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -2518,15 +2530,20 @@ volatile int sendTrace; #define firstLongFormat() 10 #define firstShortFormat() 12 #define fixedFieldsFieldWidth() 16 +#define formatFieldWidthShift() 5 #define formatMask() 0x1F #define formatShift() 24 #define freeStart() GIV(freeStart) +#define greyBitShift() 31 #define identityHashFullWordShift() 32 #define identityHashHalfWordMask() 0x3FFFFF +#define immutableBitShift() 23 #define indexablePointersFormat() 3 #define isForwardedObjectClassIndexPun() 8 #define isFreeObjectClassIndexPun() 0 #define lastClassIndexPun() 31 +#define markedBitFullShift() 55 +#define markedBitHalfShift() 23 #define maxOldSpaceSize() maxOldSpaceSize #define memory() GIV(memory) #define newSpaceLimit() GIV(newSpaceLimit) @@ -2534,6 +2551,7 @@ volatile int sendTrace; #define numSlotsHalfShift() 24 #define numSlotsMask() 0xFF #define oldSpaceStart() GIV(oldSpaceStart) +#define pinnedBitShift() 30 #define remapBufferCount() GIV(remapBufferCount) #define rememberedBitShift() 29 #define rootTableCapacity() GIV(rememberedSetLimit) @@ -2585,6 +2603,7 @@ interpret(void) char * localIP; sqInt localReturnValue; char * localSP; + sqInt numExtB; sqInt stackPageBytes; usqIntptr_t stackPagesBytes; char *theStackMemory; @@ -2615,7 +2634,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* begin initExtensions */ - extA = (extB = 0); + extA = (numExtB = (extB = 0)); while (1) { bytecodeDispatchDebugHook(); @@ -4692,7 +4711,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -5022,11 +5041,6 @@ interpret(void) sqInt currentCtx; char *frameToReturnTo; sqInt home; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; StackPage *newPage; sqInt nextCntx; sqInt objOop; @@ -5039,16 +5053,10 @@ interpret(void) char *theFP; char *theFP1; char *theFP2; - char *theFP3; - char *theFP4; - char *theFP5; StackPage *thePage; StackPage *thePage1; StackPage *thePage2; StackPage *thePage3; - char *theSP; - char *theSP1; - char *theSP2; sqInt unwindContextOrNilOrZero; sqInt valuePointer; sqInt valuePointer1; @@ -5059,7 +5067,7 @@ interpret(void) frameToReturnTo = 0; if (!((byteAt((localFP + FoxIFrameFlags) + 3)) != 0)) { goto commonCallerReturn; - goto l726; + goto l673; } closure = longAt(localFP + (frameStackedReceiverOffset(localFP))); @@ -5102,17 +5110,15 @@ interpret(void) /* error: can't find home on chain; cannot return */ /* begin internalCannotReturn: */ - theFP3 = localFP; - theSP = localSP; - if (((((usqInt)(longAt(theFP3 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP3 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP3 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP3))); - ourContext = longAt(theFP3 + FoxThisContext); - goto l742; - } - ourContext = marryFrameSP(theFP3, theSP); - l742: /* end ensureFrameIsMarried:SP: */; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext = longAt(localFP + FoxThisContext); + goto l700; + } + ourContext = marryFrameSP(localFP, localSP); + l700: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -5121,21 +5127,19 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); GIV(argumentCount) = 1; goto normalSend; - goto l726; + goto l673; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ - theFP4 = localFP; - theSP1 = localSP; - if (((((usqInt)(longAt(theFP4 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP4 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP4 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP4))); - ourContext1 = longAt(theFP4 + FoxThisContext); - goto l739; - } - ourContext1 = marryFrameSP(theFP4, theSP1); - l739: /* end ensureFrameIsMarried:SP: */; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext1 = longAt(localFP + FoxThisContext); + goto l693; + } + ourContext1 = marryFrameSP(localFP, localSP); + l693: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -5146,7 +5150,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l726; + goto l673; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { @@ -5160,10 +5164,8 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -5195,17 +5197,15 @@ interpret(void) /* error: home's sender is dead; cannot return */ /* begin internalCannotReturn: */ - theFP5 = localFP; - theSP2 = localSP; - if (((((usqInt)(longAt(theFP5 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP5 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP5 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP5))); - ourContext2 = longAt(theFP5 + FoxThisContext); - goto l736; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext2 = longAt(localFP + FoxThisContext); + goto l686; } - ourContext2 = marryFrameSP(theFP5, theSP2); - l736: /* end ensureFrameIsMarried:SP: */; + ourContext2 = marryFrameSP(localFP, localSP); + l686: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -5214,24 +5214,20 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); GIV(argumentCount) = 1; goto normalSend; - goto l726; + goto l673; } } assert(pageListIsWellFormed()); /* begin stackPageFor: */ - assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage)); - - newPage = stackPageAtpages(index4, GIV(pages)); + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (newPage != GIV(stackPage)) { /* begin frameCallerContext: */ theFP2 = (GIV(stackPage)->baseFP); assert(isBaseFrame(theFP2)); /* begin stackPageFor: */ - assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage3 = stackPageAtpages(index3, GIV(pages)); + thePage3 = stackPageAtpages((assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil2 = longAt((thePage3->baseAddress)); assert(addressCouldBeObj(callerContextOrNil2)); assert((callerContextOrNil2 == (nilObject())) @@ -5244,10 +5240,8 @@ interpret(void) && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFP != ((thePage->headFP))) { /* Since we've just deallocated a page we know that newStackPage won't deallocate an existing one. */ @@ -5257,10 +5251,8 @@ interpret(void) theFP1 = (thePage->baseFP); assert(isBaseFrame(theFP1)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index2, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -5327,11 +5319,11 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l744; + goto l683; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } - l744: /* end maybeReturnToMachineCodeFrame */; + l683: /* end maybeReturnToMachineCodeFrame */; /* begin setMethod: */ aMethodObj = longAt(localFP + FoxMethod); assert((((usqInt)aMethodObj)) >= (startOfMemory())); @@ -5346,7 +5338,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l726: /* end case */; + l673: /* end case */; break; case 121: /* returnTrue */ @@ -5406,8 +5398,6 @@ interpret(void) sqInt contextToReturnTo; char *fp; char *frameAbove; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; sqInt retToContext; @@ -5431,10 +5421,8 @@ interpret(void) /* begin baseFrameReturn */ assert(isBaseFrame(localFP)); /* begin stackPageFor: */ - assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -5452,10 +5440,8 @@ interpret(void) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFP == ((thePage->headFP))) { theSP = (thePage->headSP); } @@ -5468,27 +5454,27 @@ interpret(void) fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l757; + goto l711; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l757; + goto l711; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l757: /* end findFrameAbove:inPage: */; + l711: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l759; + goto l706; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l759: /* end newStackPage */; + l706: /* end newStackPage */; assert(newPage == GIV(stackPage)); moveFramesInthroughtoPage(thePage, frameAbove, newPage); markStackPageMostRecentlyUsed(newPage); @@ -5511,7 +5497,7 @@ interpret(void) longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); GIV(stackPointer) = sp2; ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1); - goto l755; + goto l702; } GIV(instructionPointer) = 0; thePage = makeBaseFrameFor(contextToReturnTo); @@ -5547,15 +5533,15 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP)); /* begin setMethod: */ - aMethodObj1 = longAt(localFP + FoxMethod); - assert((((usqInt)aMethodObj1)) >= (startOfMemory())); - GIV(method) = aMethodObj1; + aMethodObj = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) ? 256 @@ -5565,7 +5551,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); localSP = localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) @@ -5590,14 +5576,14 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - assert((((usqInt)aMethodObj)) >= (startOfMemory())); - GIV(method) = aMethodObj; + aMethodObj1 = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj1)) >= (startOfMemory())); + GIV(method) = aMethodObj1; assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) ? 256 @@ -5608,7 +5594,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l755: /* end case */; + l702: /* end case */; break; case 126: case 127: @@ -5642,10 +5628,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l765; + goto l712; } ourContext = marryFrameSP(theFP, theSP); - l765: /* end ensureFrameIsMarried:SP: */; + l712: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -5743,7 +5729,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5754,7 +5740,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l45; + goto l49; } # endif /* IMMUTABILITY */ @@ -5774,11 +5760,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l45: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l49: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l41; + goto l43; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5790,7 +5776,7 @@ interpret(void) else { longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l41; + goto l43; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5819,7 +5805,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5830,7 +5816,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l52; + goto l47; } # endif /* IMMUTABILITY */ @@ -5850,14 +5836,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l52: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l47: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l41; + goto l43; } error("illegal store"); - l41: /* end extendedStoreBytecodePop: */; + l43: /* end extendedStoreBytecodePop: */; } break; case 130: @@ -5887,7 +5873,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5898,7 +5884,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l58; + goto l61; } # endif /* IMMUTABILITY */ @@ -5918,11 +5904,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l58: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l61: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l54; + goto l55; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5934,7 +5920,7 @@ interpret(void) else { longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l54; + goto l55; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5963,7 +5949,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5974,7 +5960,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l65; + goto l59; } # endif /* IMMUTABILITY */ @@ -5994,14 +5980,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l65: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l59: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l54; + goto l55; } error("illegal store"); - l54: /* end extendedStoreBytecodePop: */; + l55: /* end extendedStoreBytecodePop: */; } break; case 131: @@ -6042,8 +6028,6 @@ interpret(void) usqInt aMethodObj; usqInt aMethodObj1; sqInt aValue; - sqInt classIndex; - sqInt classIndex1; sqInt classOrInteger; sqInt classTablePage; sqInt classTablePage1; @@ -6082,20 +6066,19 @@ interpret(void) sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (recordSendTrace()) { /* begin recordTrace:thing:source: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classOrInteger = null; - goto l783; + goto l730; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); classOrInteger = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l783: /* end classAtIndex: */; + l730: /* end classAtIndex: */; GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger; GIV(traceLog)[GIV(traceLogIndex) + 1] = GIV(messageSelector); GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; @@ -6116,7 +6099,7 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } /* second probe */ @@ -6126,7 +6109,7 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } probe = (((usqInt) hash) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) @@ -6134,30 +6117,30 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } ok = 0; - l769: /* end inlineLookupInMethodCacheSel:classTag: */; + l714: /* end inlineLookupInMethodCacheSel:classTag: */; if (ok) { /* begin ifAppropriateCompileToNativeCode:selector: */ aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader2 & 1)) - || (((((usqInt)methodHeader2)) < (startOfMemory())) - && ((((usqInt)methodHeader2)) >= (minCogMethodAddress())))), - (methodHeader2 & 1) == 0)) { + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod = ((CogMethod *) methodHeader2); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, selector); } } else { - if (((assert((methodHeader2 & 1)), - ((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -6207,24 +6190,23 @@ interpret(void) maybeFlagMethodAsInterpreted(aMethodObj1); } } - goto l786; + goto l731; } } /* begin classAtIndex: */ - classIndex1 = GIV(lkupClassTag); - assert((classIndex1 <= (tagMask())) - || (classIndex1 >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex2 = ((usqInt) classIndex1) >> (classTableMajorIndexShift()); + fieldIndex2 = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord()))))); if (classTablePage1 == GIV(nilObj)) { GIV(lkupClass) = null; - goto l772; + goto l723; } /* begin fetchPointer:ofObject: */ - fieldIndex11 = classIndex1 & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex11 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord()))))); - l772: /* end classAtIndex: */; + l723: /* end classAtIndex: */; lookupOrdinarySend(); /* begin internalizeIPandSP */ @@ -6234,7 +6216,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); } - l786: /* end internalFindNewMethodOrdinary */; + l731: /* end internalFindNewMethodOrdinary */; /* begin internalExecuteNewMethod */ if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { @@ -6247,29 +6229,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l784; + goto l735; } if (localPrimIndex == 256) { - goto l784; + goto l735; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l784; + goto l735; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l784; + goto l735; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l784; + goto l735; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l784: /* end internalQuickPrimitiveResponse */; - goto l779; + goto l735; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -6331,7 +6312,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l779; + goto l735; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -6354,10 +6335,10 @@ interpret(void) } else { /* begin internalActivateNewMethod */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert(!(isCogMethodReference(methodHeader))); - numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; - assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); + methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert(!(isCogMethodReference(methodHeader2))); + numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader2))); /* could new rcvr be set at point of send? */ rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); @@ -6372,8 +6353,8 @@ interpret(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader2); + GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 ? 256 : 0); @@ -6381,8 +6362,8 @@ interpret(void) longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ object = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0)); + ? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0)); longAtPointerput((localSP -= BytesPerOop), object); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); @@ -6392,16 +6373,16 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); } - localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1); + localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), +((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1); if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader & AlternateHeaderHasPrimFlag)) { + methodHeader2 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ localIP += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(localIP + 1)) == (((((int) methodHeader)) < 0 + if ((byteAt(localIP + 1)) == (((((int) methodHeader2)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -6411,11 +6392,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l777; + goto l728; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l777: /* end getErrorObjectFromPrimFailCode */; + l728: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -6430,7 +6411,7 @@ interpret(void) GIV(instructionPointer) = oopForPointer(localIP); GIV(stackPointer) = localSP; GIV(framePointer) = localFP; - switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); + switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); returnToExecutivepostContextSwitch(1, switched); /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); @@ -6439,7 +6420,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l779: /* end internalExecuteNewMethod */; + l735: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6453,14 +6434,12 @@ interpret(void) sqInt byte3; sqInt callerContextOrNil; char *callerFP; - sqInt index; - sqInt index1; sqInt litVar; sqInt litVar1; sqInt obj; sqInt obj1; sqInt object; - sqInt object1; + sqInt object11; sqInt object2; sqInt object3; int onCurrentPage; @@ -6471,8 +6450,8 @@ interpret(void) sqInt senderOop1; char *spouseFP; char * theFP; - StackPage * thePage; - StackPage *thePage1; + StackPage *thePage; + StackPage * thePage1; sqInt top; sqInt value; @@ -6487,7 +6466,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto normalSend; - goto l68; + goto l66; } if (opType == 1) { assert(GIV(method) == (iframeMethod(localFP))); @@ -6496,7 +6475,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto superclassSend; - goto l68; + goto l66; } if (opType == 2) { /* begin fetchNextBytecode */ @@ -6538,17 +6517,17 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); value = result; } - object = value; - goto l75; + object3 = value; + goto l90; } if (isWidowedContext(obj)) { - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l75; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l90; } /* begin frameOfMarriedContext: */ - senderOop1 = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); - assert((senderOop1 & 1)); - spouseFP = pointerForOop(senderOop1 - 1); + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + spouseFP = pointerForOop(senderOop - 1); if (byte3 == SenderIndex) { /* begin ensureCallerContext: */ @@ -6559,49 +6538,47 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index, GIV(pages)); - callerContextOrNil = longAt((thePage1->baseAddress)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); - object = callerContextOrNil; - goto l75; + object3 = callerContextOrNil; + goto l90; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) ? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); - object = longAt(callerFP + FoxThisContext); - goto l75; + object3 = longAt(callerFP + FoxThisContext); + goto l90; } - object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l75; + goto l90; } if (byte3 == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); - object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l75; + object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l90; } if (byte3 == InstructionPointerIndex) { - object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l75; + object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l90; } error("bad index"); - object = 0; - l75: /* end instVar:ofContext: */; - longAtPointerput((localSP -= BytesPerOop), object); + object3 = 0; + l90: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object3); } else { /* begin internalPush: */ - object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object1); + object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object11); } - goto l68; + goto l66; } if (opType == 3) { /* begin fetchNextBytecode */ @@ -6610,10 +6587,10 @@ interpret(void) /* begin pushLiteralConstant: */ assert(GIV(method) == (iframeMethod(localFP))); /* begin fetchPointer:ofObject: */ - object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object2); - goto l68; + longAtPointerput((localSP -= BytesPerOop), object); + goto l66; } if (opType == 4) { /* begin fetchNextBytecode */ @@ -6633,10 +6610,10 @@ interpret(void) litVar = unfollowatIndex(litVar, byte3); } /* begin internalPush: */ - object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object3); + object2 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object2); - goto l68; + goto l66; } top = longAtPointer(localSP); if (opType == 7) { @@ -6666,7 +6643,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar1)))); - if (((((usqInt) (longAt(litVar1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar1); /* begin internalPush: */ @@ -6677,7 +6654,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l92; + goto l94; } # endif /* IMMUTABILITY */ @@ -6697,11 +6674,11 @@ interpret(void) } } longAtput((litVar1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), top); - l92: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l94: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l68; + goto l66; } if (opType == 6) { /* begin internalPop: */ @@ -6746,21 +6723,19 @@ interpret(void) if (byte3 == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1); } - goto l71; + goto l80; } /* begin frameOfMarriedContext: */ - senderOop = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); - assert((senderOop & 1)); - theFP = pointerForOop(senderOop - 1); + senderOop1 = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + theFP = pointerForOop(senderOop1 - 1); if (byte3 == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); - onCurrentPage = thePage == GIV(stackPage); + onCurrentPage = thePage1 == GIV(stackPage); storeSenderOfFramewithValue(theFP, top); if (onCurrentPage) { localFP = (GIV(stackPage)->headFP); @@ -6769,7 +6744,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l71; + goto l80; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -6802,14 +6777,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l71: /* end instVar:ofContext:put: */; + l80: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj1)))); - if (((((usqInt) (longAt(obj1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj1); /* begin internalPush: */ @@ -6820,7 +6795,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l94; + goto l93; } # endif /* IMMUTABILITY */ @@ -6840,13 +6815,13 @@ interpret(void) } } longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); - l94: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l93: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); } - l68: /* end case */; + l66: /* end case */; break; case 133: /* singleExtendedSuperBytecode */ @@ -6980,10 +6955,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l107; + goto l104; } ourContext = marryFrameSP(theFP, theSP); - l107: /* end ensureFrameIsMarried:SP: */; + l104: /* end ensureFrameIsMarried:SP: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6998,7 +6973,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -7018,12 +6992,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -7041,13 +7012,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l108; + goto l105; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l108: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l105: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -7099,15 +7070,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l115; + goto l111; } else { goto respondToUnknownBytecode; - goto l115; + goto l111; } } - l115: /* end case */; + l111: /* end case */; break; case 140: case 506: /*250*/ @@ -7142,7 +7113,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeRemoteTempLongBytecode); /* begin fetchByte */ @@ -7157,21 +7127,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); } break; case 142: @@ -7182,7 +7151,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeAndPopRemoteTempLongBytecode); /* begin storeRemoteTempLongBytecode */ @@ -7197,21 +7165,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); /* begin internalPop: */ localSP += 1 * BytesPerOop; } @@ -7252,10 +7219,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l139; + goto l137; } context = marryFrameSP(theFP, theSP); - l139: /* end ensureFrameIsMarried:SP: */; + l137: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -7283,13 +7250,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l143; + goto l132; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l143: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l132: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -7470,7 +7437,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l150; + goto l145; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7478,7 +7445,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l150: /* end jumplfFalseBy: */; + l145: /* end jumplfFalseBy: */; } break; case 160: @@ -7500,7 +7467,7 @@ interpret(void) localIP += offset; /* begin ifBackwardsCheckForEvents: */ if (offset >= 0) { - goto l153; + goto l148; } if (localSP < GIV(stackLimit)) { /* begin externalizeIPandSP */ @@ -7517,7 +7484,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); if (switched) { - goto l153; + goto l148; } } backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN @@ -7546,7 +7513,7 @@ interpret(void) byteAtput(localFP + ((VMBIGENDIAN ? (FoxIFrameFlags + BytesPerWord) - 1 : FoxIFrameFlags)), backwardJumpCountByte); - l153: /* end ifBackwardsCheckForEvents: */; + l148: /* end ifBackwardsCheckForEvents: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7578,7 +7545,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l156; + goto l151; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7586,7 +7553,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l156: /* end jumplfTrueBy: */; + l151: /* end jumplfTrueBy: */; } break; case 172: @@ -7615,7 +7582,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l160; + goto l155; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7623,7 +7590,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l160: /* end jumplfFalseBy: */; + l155: /* end jumplfFalseBy: */; } break; case 176: @@ -7652,7 +7619,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l162; + goto l157; } } else { @@ -7666,43 +7633,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l169; + goto l162; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l163; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l162; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l163: /* end floatValueOf: */; - l169: /* end loadFloatOrIntFrom: */; + l162: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l164; + goto l158; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l167; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l158; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l167: /* end floatValueOf: */; - l164: /* end loadFloatOrIntFrom: */; + l158: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -7717,7 +7682,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l162; + goto l157; } } /* begin fetchPointer:ofObject: */ @@ -7726,7 +7691,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l162: /* end case */; + l157: /* end case */; break; case 177: /* bytecodePrimSubtract */ @@ -7754,7 +7719,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l171; + goto l164; } } else { @@ -7768,43 +7733,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l178; + goto l169; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l172; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l169; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l172: /* end floatValueOf: */; - l178: /* end loadFloatOrIntFrom: */; + l169: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l173; + goto l165; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l176; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l165; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l176: /* end floatValueOf: */; - l173: /* end loadFloatOrIntFrom: */; + l165: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -7819,7 +7782,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l171; + goto l164; } } /* begin fetchPointer:ofObject: */ @@ -7828,7 +7791,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l171: /* end case */; + l164: /* end case */; break; case 178: /* bytecodePrimLessThan */ @@ -7858,14 +7821,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l180; + goto l171; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l183; + goto l173; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7873,19 +7836,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l185; + goto l173; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l185: /* end floatValueOf: */; - l183: /* end loadFloatOrIntFrom: */; + l173: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l187; + goto l176; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7893,15 +7855,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l181; + goto l176; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l181: /* end floatValueOf: */; - l187: /* end loadFloatOrIntFrom: */; + l176: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7911,7 +7872,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l180; + goto l171; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7919,7 +7880,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l180: /* end case */; + l171: /* end case */; booleanCheatTrue: /* booleanCheatTrue */ @@ -7941,7 +7902,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } if (bytecode == 172) { @@ -7950,7 +7911,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } if (bytecode > 167) { @@ -7960,7 +7921,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -7968,7 +7929,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l799: /* end case */; + l744: /* end case */; break; case 179: /* bytecodePrimGreaterThan */ @@ -7998,14 +7959,14 @@ interpret(void) else { /* goto booleanCheatFalse */ } - goto l188; + goto l177; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l191; + goto l179; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8013,19 +7974,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l193; + goto l179; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l193: /* end floatValueOf: */; - l191: /* end loadFloatOrIntFrom: */; + l179: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l195; + goto l182; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8033,15 +7993,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l189; + goto l182; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l189: /* end floatValueOf: */; - l195: /* end loadFloatOrIntFrom: */; + l182: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8051,7 +8010,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l188; + goto l177; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8059,7 +8018,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l188: /* end case */; + l177: /* end case */; booleanCheatFalse: /* booleanCheatFalse */ @@ -8081,7 +8040,7 @@ interpret(void) localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l802; + goto l747; } if (bytecode == 172) { @@ -8091,14 +8050,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l802; + goto l747; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l802: /* end case */; + l747: /* end case */; break; case 180: /* bytecodePrimLessOrEqual */ @@ -8128,14 +8087,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l196; + goto l183; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l199; + goto l185; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8143,19 +8102,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l201; + goto l185; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l201: /* end floatValueOf: */; - l199: /* end loadFloatOrIntFrom: */; + l185: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l203; + goto l188; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8163,15 +8121,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l197; + goto l188; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l197: /* end floatValueOf: */; - l203: /* end loadFloatOrIntFrom: */; + l188: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8181,7 +8138,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l196; + goto l183; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8189,7 +8146,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l196: /* end case */; + l183: /* end case */; break; case 181: /* bytecodePrimGreaterOrEqual */ @@ -8219,14 +8176,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l204; + goto l189; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l207; + goto l191; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8234,19 +8191,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l209; + goto l191; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l209: /* end floatValueOf: */; - l207: /* end loadFloatOrIntFrom: */; + l191: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l211; + goto l194; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8254,15 +8210,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l205; + goto l194; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l205: /* end floatValueOf: */; - l211: /* end loadFloatOrIntFrom: */; + l194: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8272,7 +8227,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l204; + goto l189; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8280,7 +8235,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l204: /* end case */; + l189: /* end case */; break; case 182: /* bytecodePrimEqual */ @@ -8307,14 +8262,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l212; + goto l195; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l215; + goto l197; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8322,19 +8277,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l217; + goto l197; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l217: /* end floatValueOf: */; - l215: /* end loadFloatOrIntFrom: */; + l197: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l219; + goto l200; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8342,15 +8296,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l213; + goto l200; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l213: /* end floatValueOf: */; - l219: /* end loadFloatOrIntFrom: */; + l200: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8360,7 +8313,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l212; + goto l195; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8368,7 +8321,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l212: /* end case */; + l195: /* end case */; break; case 183: /* bytecodePrimNotEqual */ @@ -8395,14 +8348,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l220; + goto l201; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l223; + goto l203; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8410,19 +8363,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l225; + goto l203; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l225: /* end floatValueOf: */; - l223: /* end loadFloatOrIntFrom: */; + l203: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l227; + goto l206; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8430,15 +8382,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l221; + goto l206; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l221: /* end floatValueOf: */; - l227: /* end loadFloatOrIntFrom: */; + l206: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8448,7 +8399,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l220; + goto l201; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8456,7 +8407,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l220: /* end case */; + l201: /* end case */; break; case 184: /* bytecodePrimMultiply */ @@ -8497,7 +8448,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l228; + goto l207; } } else { @@ -8511,43 +8462,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l235; + goto l212; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l229; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l212; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l229: /* end floatValueOf: */; - l235: /* end loadFloatOrIntFrom: */; + l212: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l230; + goto l208; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l233; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l208; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l233: /* end floatValueOf: */; - l230: /* end loadFloatOrIntFrom: */; + l208: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -8562,7 +8511,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l228; + goto l207; } } /* begin fetchPointer:ofObject: */ @@ -8571,7 +8520,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l228: /* end case */; + l207: /* end case */; break; case 185: /* bytecodePrimDivide */ @@ -8605,7 +8554,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l237; + goto l214; } } } @@ -8620,7 +8569,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l243; + goto l219; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8628,19 +8577,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l239; + goto l219; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l239: /* end floatValueOf: */; - l243: /* end loadFloatOrIntFrom: */; + l219: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l242; + goto l215; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8648,15 +8596,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l238; + goto l215; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l238: /* end floatValueOf: */; - l242: /* end loadFloatOrIntFrom: */; + l215: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -8679,7 +8626,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l237; + goto l214; } } /* begin fetchPointer:ofObject: */ @@ -8688,7 +8635,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l237: /* end case */; + l214: /* end case */; break; case 186: /* bytecodePrimMod */ @@ -8706,7 +8653,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l246; + goto l221; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8714,7 +8661,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l246: /* end case */; + l221: /* end case */; break; case 187: /* bytecodePrimMakePoint */ @@ -8739,7 +8686,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l250; + goto l225; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8747,7 +8694,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l250: /* end case */; + l225: /* end case */; break; case 188: /* bytecodePrimBitShift */ @@ -8778,7 +8725,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -8792,7 +8739,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -8800,7 +8747,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } } else { @@ -8811,7 +8758,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -8820,7 +8767,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l259; + goto l237; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8843,13 +8790,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l255; + goto l231; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l255: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l231: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8860,16 +8807,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l259: /* end maybeInlinePositive32BitIntegerFor: */; - goto l258; + goto l237; - l258: /* end positive32BitIntegerFor: */; + l237: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l261: /* end primitiveBitShift */; + l233: /* end primitiveBitShift */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -8879,7 +8825,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l254; + goto l229; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8887,7 +8833,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l254: /* end case */; + l229: /* end case */; break; case 189: /* bytecodePrimDiv */ @@ -8905,7 +8851,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l266; + goto l239; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8913,7 +8859,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l266: /* end case */; + l239: /* end case */; break; case 190: /* bytecodePrimBitAnd */ @@ -8932,7 +8878,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l270; + goto l243; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8951,7 +8897,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l270; + goto l243; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8959,7 +8905,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l270: /* end case */; + l243: /* end case */; break; case 191: /* bytecodePrimBitOr */ @@ -8978,7 +8924,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l275; + goto l248; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8997,7 +8943,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l275; + goto l248; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9005,7 +8951,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l275: /* end case */; + l248: /* end case */; break; case 192: case 352: /*96*/ @@ -9040,14 +8986,16 @@ interpret(void) { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -9060,114 +9008,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l289; + goto l266; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l289; + goto l266; - l289: /* end is:instanceOf:compactClassIndex: */; + l266: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l287; + goto l268; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l287; + goto l268; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l287; + goto l268; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l287; + goto l268; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l287; + goto l268; } sz = 0; - l287: /* end lengthOf:format: */; + l268: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l284; + goto l257; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l292; + goto l269; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l292; + goto l269; - l292: /* end is:instanceOf:compactClassIndex: */; + l269: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l295; + sz = numSlots2; + goto l267; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l295; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l267; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l295; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l267; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l295; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l267; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l295; + sz = ((usqInt) numSlots2) >> 1; + goto l267; } sz = 0; - l295: /* end lengthOf:format: */; + l267: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l284; + goto l257; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9175,7 +9117,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l284: /* end case */; + l257: /* end case */; break; case 195: case 355: /*99*/ @@ -9299,6 +9241,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9307,18 +9250,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l309; + goto l280; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l309; + goto l280; - l309: /* end is:instanceOf:compactClassIndex: */; + l280: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -9337,7 +9281,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l305; + goto l278; } GIV(primFailCode) = 0; } @@ -9346,12 +9290,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l305: /* end case */; + l278: /* end case */; break; case 202: /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9360,18 +9305,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l315; + goto l286; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l315; + goto l286; - l315: /* end is:instanceOf:compactClassIndex: */; + l286: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -9390,7 +9336,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l311; + goto l284; } GIV(primFailCode) = 0; } @@ -9399,7 +9345,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l311: /* end case */; + l284: /* end case */; break; case 203: case 363: /*107*/ @@ -9460,9 +9406,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9478,7 +9424,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l323; + goto l296; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9487,7 +9433,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l323: /* end case */; + l296: /* end case */; break; case 207: /* bytecodePrimPointY */ @@ -9506,9 +9452,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9524,7 +9470,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l330; + goto l304; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9533,7 +9479,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l330: /* end case */; + l304: /* end case */; break; case 208: case 209: @@ -9712,7 +9658,7 @@ interpret(void) case 0: /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); - goto l353; + goto l328; break; case 1: @@ -9732,10 +9678,10 @@ interpret(void) : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l357; + goto l332; } context = marryFrameSP(localFP, localSP); - l357: /* end ensureFrameIsMarried:SP: */; + l332: /* end ensureFrameIsMarried:SP: */; thing = context; break; @@ -9748,10 +9694,11 @@ interpret(void) } extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), thing); } - l353: /* end case */; + l328: /* end case */; break; case 336: /*80*/ /* bytecodePrimAdd */ @@ -9779,7 +9726,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l361; + goto l336; } } else { @@ -9793,43 +9740,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l368; + goto l341; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l362; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l341; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l362: /* end floatValueOf: */; - l368: /* end loadFloatOrIntFrom: */; + l341: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l363; + goto l337; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l366; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l337; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l366: /* end floatValueOf: */; - l363: /* end loadFloatOrIntFrom: */; + l337: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -9844,7 +9789,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l361; + goto l336; } } /* begin fetchPointer:ofObject: */ @@ -9853,7 +9798,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l361: /* end case */; + l336: /* end case */; break; case 337: /*81*/ /* bytecodePrimSubtract */ @@ -9881,7 +9826,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l370; + goto l343; } } else { @@ -9895,43 +9840,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l377; + goto l348; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l371; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l348; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l371: /* end floatValueOf: */; - l377: /* end loadFloatOrIntFrom: */; + l348: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l372; + goto l344; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l375; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l344; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l375: /* end floatValueOf: */; - l372: /* end loadFloatOrIntFrom: */; + l344: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -9946,7 +9889,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l370; + goto l343; } } /* begin fetchPointer:ofObject: */ @@ -9955,7 +9898,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l370: /* end case */; + l343: /* end case */; break; case 338: /*82*/ /* bytecodePrimLessThanV4 */ @@ -9985,14 +9928,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l379; + goto l350; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l382; + goto l352; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10000,19 +9943,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l384; + goto l352; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l384: /* end floatValueOf: */; - l382: /* end loadFloatOrIntFrom: */; + l352: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l386; + goto l355; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10020,15 +9962,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l380; + goto l355; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l380: /* end floatValueOf: */; - l386: /* end loadFloatOrIntFrom: */; + l355: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10038,7 +9979,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l379; + goto l350; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10046,7 +9987,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l379: /* end case */; + l350: /* end case */; booleanCheatTrueV4: /* booleanCheatTrueV4 */ @@ -10067,7 +10008,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } if (bytecode == 244) { @@ -10076,7 +10017,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } if (bytecode == 243) { @@ -10086,7 +10027,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -10094,7 +10035,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l803: /* end case */; + l748: /* end case */; break; case 339: /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -10124,14 +10065,14 @@ interpret(void) else { /* goto booleanCheatFalseV4 */ } - goto l387; + goto l356; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l390; + goto l358; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10139,19 +10080,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l392; + goto l358; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l392: /* end floatValueOf: */; - l390: /* end loadFloatOrIntFrom: */; + l358: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l394; + goto l361; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10159,15 +10099,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l388; + goto l361; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l388: /* end floatValueOf: */; - l394: /* end loadFloatOrIntFrom: */; + l361: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10177,7 +10116,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l387; + goto l356; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10185,7 +10124,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l387: /* end case */; + l356: /* end case */; booleanCheatFalseV4: /* booleanCheatFalseV4 */ @@ -10207,7 +10146,7 @@ interpret(void) localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l806; + goto l751; } if (bytecode == 244) { @@ -10217,14 +10156,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l806; + goto l751; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l806: /* end case */; + l751: /* end case */; break; case 340: /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -10254,14 +10193,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l395; + goto l362; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l398; + goto l364; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10269,19 +10208,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l400; + goto l364; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l400: /* end floatValueOf: */; - l398: /* end loadFloatOrIntFrom: */; + l364: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l402; + goto l367; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10289,15 +10227,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l396; + goto l367; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l396: /* end floatValueOf: */; - l402: /* end loadFloatOrIntFrom: */; + l367: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10307,7 +10244,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l395; + goto l362; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10315,7 +10252,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l395: /* end case */; + l362: /* end case */; break; case 341: /*85*/ /* bytecodePrimGreaterOrEqualV4 */ @@ -10345,14 +10282,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l403; + goto l368; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l406; + goto l370; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10360,19 +10297,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l408; + goto l370; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l408: /* end floatValueOf: */; - l406: /* end loadFloatOrIntFrom: */; + l370: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l410; + goto l373; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10380,15 +10316,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l404; + goto l373; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l404: /* end floatValueOf: */; - l410: /* end loadFloatOrIntFrom: */; + l373: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10398,7 +10333,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l403; + goto l368; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10406,7 +10341,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l403: /* end case */; + l368: /* end case */; break; case 342: /*86*/ /* bytecodePrimEqualV4 */ @@ -10433,14 +10368,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l411; + goto l374; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l414; + goto l376; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10448,19 +10383,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l416; + goto l376; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l416: /* end floatValueOf: */; - l414: /* end loadFloatOrIntFrom: */; + l376: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l418; + goto l379; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10468,15 +10402,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l412; + goto l379; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l412: /* end floatValueOf: */; - l418: /* end loadFloatOrIntFrom: */; + l379: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10486,7 +10419,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l411; + goto l374; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10494,7 +10427,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l411: /* end case */; + l374: /* end case */; break; case 343: /*87*/ /* bytecodePrimNotEqualV4 */ @@ -10521,14 +10454,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l419; + goto l380; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l422; + goto l382; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10536,19 +10469,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l424; + goto l382; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l424: /* end floatValueOf: */; - l422: /* end loadFloatOrIntFrom: */; + l382: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l426; + goto l385; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10556,15 +10488,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l420; + goto l385; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l420: /* end floatValueOf: */; - l426: /* end loadFloatOrIntFrom: */; + l385: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10574,7 +10505,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l419; + goto l380; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10582,7 +10513,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l419: /* end case */; + l380: /* end case */; break; case 344: /*88*/ /* bytecodePrimMultiply */ @@ -10623,7 +10554,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l427; + goto l386; } } else { @@ -10637,43 +10568,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l434; + goto l391; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l428; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l391; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l428: /* end floatValueOf: */; - l434: /* end loadFloatOrIntFrom: */; + l391: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l429; + goto l387; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l432; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l387; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l432: /* end floatValueOf: */; - l429: /* end loadFloatOrIntFrom: */; + l387: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -10688,7 +10617,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l427; + goto l386; } } /* begin fetchPointer:ofObject: */ @@ -10697,7 +10626,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l427: /* end case */; + l386: /* end case */; break; case 345: /*89*/ /* bytecodePrimDivide */ @@ -10731,7 +10660,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l436; + goto l393; } } } @@ -10746,7 +10675,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l442; + goto l398; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10754,19 +10683,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l438; + goto l398; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l438: /* end floatValueOf: */; - l442: /* end loadFloatOrIntFrom: */; + l398: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l441; + goto l394; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10774,15 +10702,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l437; + goto l394; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l437: /* end floatValueOf: */; - l441: /* end loadFloatOrIntFrom: */; + l394: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -10805,7 +10732,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l436; + goto l393; } } /* begin fetchPointer:ofObject: */ @@ -10814,7 +10741,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l436: /* end case */; + l393: /* end case */; break; case 346: /*90*/ /* bytecodePrimMod */ @@ -10832,7 +10759,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l445; + goto l400; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10840,7 +10767,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l445: /* end case */; + l400: /* end case */; break; case 347: /*91*/ /* bytecodePrimMakePoint */ @@ -10865,7 +10792,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l449; + goto l404; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10873,7 +10800,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l449: /* end case */; + l404: /* end case */; break; case 348: /*92*/ /* bytecodePrimBitShift */ @@ -10904,7 +10831,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -10918,7 +10845,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -10926,7 +10853,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } } else { @@ -10937,7 +10864,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -10946,7 +10873,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l458; + goto l416; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -10969,13 +10896,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l454; + goto l410; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l454: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l410: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -10986,16 +10913,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l458: /* end maybeInlinePositive32BitIntegerFor: */; - goto l457; + goto l416; - l457: /* end positive32BitIntegerFor: */; + l416: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l460: /* end primitiveBitShift */; + l412: /* end primitiveBitShift */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -11005,7 +10931,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l453; + goto l408; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11013,7 +10939,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l453: /* end case */; + l408: /* end case */; break; case 349: /*93*/ /* bytecodePrimDiv */ @@ -11031,7 +10957,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l465; + goto l418; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11039,7 +10965,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l465: /* end case */; + l418: /* end case */; break; case 350: /*94*/ /* bytecodePrimBitAnd */ @@ -11058,7 +10984,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l469; + goto l422; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11077,7 +11003,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l469; + goto l422; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11085,7 +11011,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l469: /* end case */; + l422: /* end case */; break; case 351: /*95*/ /* bytecodePrimBitOr */ @@ -11104,7 +11030,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l474; + goto l427; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11123,7 +11049,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l474; + goto l427; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11131,21 +11057,23 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l474: /* end case */; + l427: /* end case */; break; case 354: /*98*/ /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -11158,114 +11086,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l488; + goto l445; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l488; + goto l445; - l488: /* end is:instanceOf:compactClassIndex: */; + l445: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l486; + goto l447; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l486; + goto l447; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l486; + goto l447; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l486; + goto l447; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l486; + goto l447; } sz = 0; - l486: /* end lengthOf:format: */; + l447: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l483; + goto l436; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l491; + goto l448; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l491; + goto l448; - l491: /* end is:instanceOf:compactClassIndex: */; + l448: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l494; + sz = numSlots2; + goto l446; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l494; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l446; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l494; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l446; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l494; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l446; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l494; + sz = ((usqInt) numSlots2) >> 1; + goto l446; } sz = 0; - l494: /* end lengthOf:format: */; + l446: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l483; + goto l436; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11273,7 +11195,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l483: /* end case */; + l436: /* end case */; break; case 358: /*102*/ /* bytecodePrimIdenticalV4 */ @@ -11331,6 +11253,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -11339,18 +11262,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l508; + goto l459; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l508; + goto l459; - l508: /* end is:instanceOf:compactClassIndex: */; + l459: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -11369,7 +11293,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l504; + goto l457; } GIV(primFailCode) = 0; } @@ -11378,12 +11302,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l504: /* end case */; + l457: /* end case */; break; case 362: /*106*/ /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -11392,18 +11317,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l514; + goto l465; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l514; + goto l465; - l514: /* end is:instanceOf:compactClassIndex: */; + l465: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -11422,7 +11348,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l510; + goto l463; } GIV(primFailCode) = 0; } @@ -11431,7 +11357,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l510: /* end case */; + l463: /* end case */; break; case 366: /*110*/ /* bytecodePrimPointX */ @@ -11450,9 +11376,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -11468,7 +11394,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l522; + goto l475; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -11477,7 +11403,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l522: /* end case */; + l475: /* end case */; break; case 367: /*111*/ /* bytecodePrimPointY */ @@ -11496,9 +11422,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -11514,7 +11440,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l529; + goto l483; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -11523,7 +11449,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l529: /* end case */; + l483: /* end case */; break; case 416: /*160*/ case 417: /*161*/ @@ -11578,7 +11504,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -11589,7 +11515,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l543; + goto l498; } # endif /* IMMUTABILITY */ @@ -11609,7 +11535,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); - l543: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l498: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11645,7 +11571,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l552; + goto l507; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11653,7 +11579,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l552: /* end jumplfTrueBy: */; + l507: /* end jumplfTrueBy: */; } break; case 464: /*208*/ @@ -11686,7 +11612,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l556; + goto l511; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11694,7 +11620,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l556: /* end jumplfFalseBy: */; + l511: /* end jumplfFalseBy: */; } break; case 472: /*216*/ @@ -11713,12 +11639,12 @@ interpret(void) if (extA == 0) { localReturnValue = longAtPointer(localSP); goto commonCallerReturn; - goto l560; + goto l515; } error("shouldBeImplemented"); extA = 0; } - l560: /* end case */; + l515: /* end case */; break; case 477: /*221*/ /* extNopBytecode */ @@ -11727,7 +11653,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extA = (extB = 0); + numExtB = (extA = (extB = 0)); } break; case 478: /*222*/ @@ -11762,10 +11688,11 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte > 0x7F) ? byte - 256 : (((usqInt) extB << 8)) + byte); + numExtB += 1; } break; case 482: /*226*/ @@ -11774,7 +11701,6 @@ interpret(void) sqInt callerContextOrNil; char *callerFP; sqInt index; - sqInt index1; sqInt obj; sqInt object; sqInt object1; @@ -11827,11 +11753,11 @@ interpret(void) value = result; } object = value; - goto l569; + goto l521; } if (isWidowedContext(obj)) { object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l569; + goto l521; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -11847,16 +11773,14 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); object = callerContextOrNil; - goto l569; + goto l521; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) @@ -11864,24 +11788,24 @@ interpret(void) : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); object = longAt(callerFP + FoxThisContext); - goto l569; + goto l521; } object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l569; + goto l521; } if (index == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l569; + goto l521; } if (index == InstructionPointerIndex) { object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l569; + goto l521; } error("bad index"); object = 0; - l569: /* end instVar:ofContext: */; + l521: /* end instVar:ofContext: */; longAtPointerput((localSP -= BytesPerOop), object); } else { @@ -11954,6 +11878,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 1) | 1)); } @@ -11984,7 +11909,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -12004,12 +11928,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -12027,13 +11948,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l580; + goto l535; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l580: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l535: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -12063,7 +11984,6 @@ interpret(void) /* extStoreReceiverVariableBytecode */ { sqInt anObject; - sqInt index1; sqInt obj; int onCurrentPage; sqInt senderOop; @@ -12115,7 +12035,7 @@ interpret(void) if (variableIndex == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); } - goto l587; + goto l547; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12124,10 +12044,8 @@ interpret(void) if (variableIndex == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); storeSenderOfFramewithValue(theFP, anObject); @@ -12138,7 +12056,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l587; + goto l547; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -12171,14 +12089,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l587: /* end instVar:ofContext:put: */; + l547: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12189,7 +12107,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l590; + goto l549; } # endif /* IMMUTABILITY */ @@ -12209,7 +12127,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); - l590: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l549: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12254,7 +12172,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12265,7 +12183,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l600; + goto l550; } # endif /* IMMUTABILITY */ @@ -12285,7 +12203,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), anObject); - l600: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l550: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12314,7 +12232,6 @@ interpret(void) case 491: /*235*/ /* extStoreAndPopReceiverVariableBytecode */ { - sqInt index1; sqInt obj; int onCurrentPage; sqInt senderOop; @@ -12368,7 +12285,7 @@ interpret(void) if (variableIndex == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); } - goto l606; + goto l565; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12377,10 +12294,8 @@ interpret(void) if (variableIndex == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); storeSenderOfFramewithValue(theFP, value); @@ -12391,7 +12306,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l606; + goto l565; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -12424,14 +12339,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l606: /* end instVar:ofContext:put: */; + l565: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12442,7 +12357,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l609; + goto l567; } # endif /* IMMUTABILITY */ @@ -12462,7 +12377,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l609: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l567: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12509,7 +12424,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12520,7 +12435,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l619; + goto l568; } # endif /* IMMUTABILITY */ @@ -12540,7 +12455,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l619: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l568: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12585,6 +12500,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); GIV(lkupClassTag) = (((tagBits = rcvr & (tagMask()))) != 0 ? ((tagBits & 1) != 0 @@ -12608,9 +12524,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; goto superclassSend; } - l626: /* end case */; + l578: /* end case */; break; case 496: /*240*/ /* extSendAbsentImplicitBytecode */ @@ -12626,6 +12543,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendImplicitReceiver */ } @@ -12637,7 +12555,6 @@ interpret(void) sqInt candidateMixin; sqInt candidateMixinApplication; sqInt candidateReceiver; - sqInt classIndex; sqInt classTablePage; sqInt dictionary; sqInt errorCode; @@ -12668,10 +12585,8 @@ interpret(void) sqInt objOop5; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -12685,9 +12600,7 @@ interpret(void) savedFramePointer = 0; savedStackPointer = 0; /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -12725,21 +12638,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l845; + goto l768; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l845: /* end classAtIndex: */; + l768: /* end classAtIndex: */; /* begin lookupImplicitReceiverSend */ GIV(messageSelector) = (((GIV(messageSelector) & (tagMask())) == 0) && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) @@ -12754,8 +12666,8 @@ interpret(void) while (1) { assert(!((isForwarded(candidateMixin)))); assert(!((isForwarded(candidateReceiver)))); - candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits2 = candidateReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits1 = candidateReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) : fetchClassOfNonImm(candidateReceiver))); assert(!((candidateMixinApplication == 0))); assert(!((candidateMixinApplication == (nilObject())))); @@ -12771,13 +12683,9 @@ interpret(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -12802,19 +12710,19 @@ interpret(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; - goto l809; + goto l759; } index += 1; } found = 0; - goto l809; + goto l759; } /* It is assumed that there are some nils in this dictionary, and search will @@ -12825,13 +12733,13 @@ interpret(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -12840,7 +12748,7 @@ interpret(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l809; + goto l759; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -12848,12 +12756,12 @@ interpret(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -12862,24 +12770,24 @@ interpret(void) } GIV(newMethod) = objOop4; found = 1; - goto l809; + goto l759; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l809; + goto l759; } wrapAround = 1; index = SelectorStart; } } found = 0; - l809: /* end lookupMethodInDictionary: */; + l759: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; actualLookupRule = lookupLexicalfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l825; + goto l777; } /* begin followObjField:ofObject: */ objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); @@ -12894,13 +12802,12 @@ interpret(void) } GIV(localAbsentReceiverOrZero) = 0; GIV(localAbsentReceiver) = methodReceiver; - - /* MNU lookup starts here. */ - GIV(lkupClass) = (((tagBits1 = methodReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) + /* begin fetchClassOf: */ + GIV(lkupClass) = (((tagBits2 = methodReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) : fetchClassOfNonImm(methodReceiver)); actualLookupRule = lookupProtectedstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l825: /* end lookupImplicitReceiverSend */; + l777: /* end lookupImplicitReceiverSend */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -12932,29 +12839,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l839; + goto l772; } if (localPrimIndex == 256) { - goto l839; + goto l772; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l839; + goto l772; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l839; + goto l772; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l839; + goto l772; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l839: /* end internalQuickPrimitiveResponse */; - goto l827; + goto l772; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13016,7 +12922,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l827; + goto l772; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13045,8 +12951,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13072,7 +12978,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13096,11 +13002,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l808; + goto l756; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l808: /* end getErrorObjectFromPrimFailCode */; + l756: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13124,7 +13030,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l827: /* end internalExecuteNewMethod */; + l772: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13144,6 +13050,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendDynamicSuper */ } @@ -13152,7 +13059,6 @@ interpret(void) { sqInt actualLookupRule; sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -13171,10 +13077,8 @@ interpret(void) sqInt oop; sqInt probe1; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -13186,9 +13090,7 @@ interpret(void) savedFramePointer = 0; savedStackPointer = 0; /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -13213,7 +13115,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } /* second probe */ @@ -13225,7 +13127,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } probe1 = (((usqInt) hash1) >> 2) & NSMethodCacheMask; if (((((GIV(nsMethodCache)[probe1 + NSMethodCacheSelector]) == GIV(messageSelector)) @@ -13235,7 +13137,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13254,20 +13156,19 @@ interpret(void) } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l862; + goto l806; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l862: /* end classAtIndex: */; + l806: /* end classForClassTag: */; /* begin lookupDynamicSuperSend */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13289,7 +13190,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToNSCache(actualLookupRule); - l870: ; + l803: ; /* begin shuffleArgumentsAndStoreAbsentReceiver: */ @@ -13315,29 +13216,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l864; + goto l808; } if (localPrimIndex == 256) { - goto l864; + goto l808; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l864; + goto l808; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l864; + goto l808; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l864; + goto l808; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l864: /* end internalQuickPrimitiveResponse */; - goto l861; + goto l808; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13399,7 +13299,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l861; + goto l808; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13428,8 +13328,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13455,7 +13355,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13479,11 +13379,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l855; + goto l799; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l855: /* end getErrorObjectFromPrimFailCode */; + l799: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13507,7 +13407,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l861: /* end internalExecuteNewMethod */; + l808: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13525,10 +13425,11 @@ interpret(void) byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; localIP += offset; /* begin ifBackwardsCheckForEvents: */ if (offset >= 0) { - goto l630; + goto l583; } if (localSP < GIV(stackLimit)) { /* begin externalizeIPandSP */ @@ -13545,7 +13446,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); if (switched) { - goto l630; + goto l583; } } backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN @@ -13574,7 +13475,7 @@ interpret(void) byteAtput(localFP + ((VMBIGENDIAN ? (FoxIFrameFlags + BytesPerWord) - 1 : FoxIFrameFlags)), backwardJumpCountByte); - l630: /* end ifBackwardsCheckForEvents: */; + l583: /* end ifBackwardsCheckForEvents: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13590,7 +13491,7 @@ interpret(void) VM_LABEL(extJumpIfTrue); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfTrueBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(trueObj)) { @@ -13605,7 +13506,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l634; + goto l586; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13613,7 +13514,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l634: /* end jumplfTrueBy: */; + l586: /* end jumplfTrueBy: */; } break; case 500: /*244*/ @@ -13626,7 +13527,7 @@ interpret(void) VM_LABEL(extJumpIfFalse); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfFalseBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(falseObj)) { @@ -13641,7 +13542,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l638; + goto l590; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13649,7 +13550,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l638: /* end jumplfFalseBy: */; + l590: /* end jumplfFalseBy: */; } break; case 501: /*245*/ @@ -13658,7 +13559,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt errorCode; @@ -13675,10 +13575,8 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -13698,10 +13596,9 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -13739,21 +13636,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l660; + goto l596; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l660: /* end classAtIndex: */; + l596: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13805,29 +13701,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l657; + goto l612; } if (localPrimIndex == 256) { - goto l657; + goto l612; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l657; + goto l612; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l657; + goto l612; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l657; + goto l612; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l657: /* end internalQuickPrimitiveResponse */; - goto l646; + goto l612; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13889,7 +13784,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l646; + goto l612; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13918,8 +13813,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13945,7 +13840,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13969,11 +13864,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l641; + goto l607; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l641: /* end getErrorObjectFromPrimFailCode */; + l607: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13997,7 +13892,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l646: /* end internalExecuteNewMethod */; + l612: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14029,15 +13924,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l667; + goto l617; } else { goto respondToUnknownBytecode; - goto l667; + goto l617; } } - l667: /* end case */; + l617: /* end case */; break; case 509: /*253*/ /* extPushClosureBytecode */ @@ -14064,7 +13959,7 @@ interpret(void) numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8); extA = 0; blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); - extB = 0; + numExtB = (extB = 0); /* begin pushClosureNumArgs:copiedValues:blockSize: */ theFP = localFP; theSP = localSP + (numCopied * BytesPerOop); @@ -14073,10 +13968,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l691; + goto l642; } context = marryFrameSP(theFP, theSP); - l691: /* end ensureFrameIsMarried:SP: */; + l642: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -14104,13 +13999,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l695; + goto l638; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l695: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l638: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -14155,7 +14050,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt depth; @@ -14173,10 +14067,8 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -14196,11 +14088,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byteAtPointer(++localIP); /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -14238,21 +14129,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l719; + goto l652; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l719: /* end classAtIndex: */; + l652: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14304,29 +14194,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l716; + goto l668; } if (localPrimIndex == 256) { - goto l716; + goto l668; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l716; + goto l668; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l716; + goto l668; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l716; + goto l668; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l716: /* end internalQuickPrimitiveResponse */; - goto l705; + goto l668; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -14388,7 +14277,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l705; + goto l668; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -14417,8 +14306,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14444,7 +14333,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14468,11 +14357,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l700; + goto l663; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l700: /* end getErrorObjectFromPrimFailCode */; + l663: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14496,7 +14385,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l705: /* end internalExecuteNewMethod */; + l668: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14739,13 +14628,9 @@ stackPageAt(sqInt index) static StackPage * NoDbgRegParms stackPageFor(void *pointer) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; - /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - return stackPageAtpages(index, GIV(pages)); + return stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } /* CogStackPages>>#statAverageLivePagesWhenMapping */ @@ -14860,11 +14745,11 @@ activateCoggedNewMethod(sqInt inInterpreter) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -14990,11 +14875,11 @@ activateNewMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -15070,6 +14955,7 @@ addNewMethodToCache(sqInt classObj) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -15224,6 +15110,7 @@ assertValidMachineCodeFrame(sqInt instrPtr) assert(isMachineCodeFrame(GIV(framePointer))); /* begin mframeCogMethod: */ cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((cogMethod->cmType)) == CMMethod ? ((CogMethod *) cogMethod) : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))); @@ -15419,6 +15306,7 @@ attemptToSwitchToMachineCode(sqInt bcpc) assert(isMachineCodeFrame(GIV(framePointer))); /* begin mframeCogMethod: */ cogMethod1 = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((cogMethod1->cmType)) == CMMethod ? ((CogMethod *) cogMethod1) : ((CogMethod *) ((((usqInt)cogMethod1)) - ((cogMethod1->homeOffset))))); @@ -15651,7 +15539,6 @@ ceBaseFrameReturn(sqInt returnValue) sqInt contextToReturnTo; char *fp; char *frameAbove; - sqInt index; sqInt isAContext; StackPage *lruOrFree; StackPage *newPage; @@ -15660,7 +15547,6 @@ ceBaseFrameReturn(sqInt returnValue) char *sp1; char *sp2; char *sp3; - char *theFP; StackPage *thePage; assert((stackPageFor(GIV(stackPointer))) == GIV(stackPage)); @@ -15685,10 +15571,8 @@ ceBaseFrameReturn(sqInt returnValue) GIV(framePointer) = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (GIV(framePointer) == ((thePage->headFP))) { GIV(stackPointer) = (thePage->headSP); } @@ -15698,22 +15582,21 @@ ceBaseFrameReturn(sqInt returnValue) Move the frames above to another page (they may be in use, e.g. via coroutining). Make the interior frame the top frame. */ /* begin findFrameAbove:inPage: */ - theFP = GIV(framePointer); fp = (thePage->headFP); - if (fp == theFP) { + if (fp == GIV(framePointer)) { frameAbove = 0; - goto l3; + goto l2; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { - if (callerFP == theFP) { + if (callerFP == GIV(framePointer)) { frameAbove = fp; - goto l3; + goto l2; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l3: /* end findFrameAbove:inPage: */; + l2: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { @@ -16014,21 +15897,21 @@ ceDynamicSuperSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16069,10 +15952,10 @@ ceDynamicSuperSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -16146,11 +16029,11 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt selector; sqInt tagBits; sqInt tagBits1; @@ -16187,21 +16070,21 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16242,13 +16125,9 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -16273,19 +16152,19 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l26; + goto l17; } index += 1; } found = 0; - goto l26; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -16296,13 +16175,13 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -16311,7 +16190,7 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l26; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -16319,12 +16198,12 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -16333,32 +16212,32 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } GIV(newMethod) = objOop4; found = 1; - goto l26; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l26; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l26: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; errSelIdx = lookupLexicalNoMNUfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l13; + goto l26; } /* begin followObjField:ofObject: */ - objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(EnclosingMixinIndex, candidateMixin, objOop1); + objOop6 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop6)); + if (((longAt(objOop6)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(EnclosingMixinIndex, candidateMixin, objOop6); } - candidateMixin = objOop1; + candidateMixin = objOop6; assert(!((isForwarded(candidateMixin)))); if (candidateMixin == GIV(nilObj)) break; GIV(localAbsentReceiverOrZero) = (candidateReceiver = followObjFieldofObject(EnclosingObjectIndex, candidateMixinApplication)); @@ -16373,7 +16252,7 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) GIV(lkupClass) = fetchClassOfNonImm(methodReceiver); } errSelIdx = lookupProtectedNoMNUstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l13: /* end lookupImplicitReceiverSendNoMNU: */; + l26: /* end lookupImplicitReceiverSendNoMNU: */; if (errSelIdx != 0) { assert(errSelIdx == SelectorDoesNotUnderstand); assert(GIV(localAbsentReceiver) == methodReceiver); @@ -16389,10 +16268,10 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -16469,6 +16348,7 @@ ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -16542,6 +16422,7 @@ ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -16576,11 +16457,6 @@ ceNonLocalReturn(sqInt returnValue) sqInt currentCtx; char *frameToReturnTo; sqInt home; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; StackPage *newPage; sqInt nextCntx; sqInt objOop; @@ -16597,8 +16473,8 @@ ceNonLocalReturn(sqInt returnValue) char *sp21; char *sp22; char *sp3; + char *sp31; char *sp4; - char *sp5; char *theFP; char *theFP1; char *theFP2; @@ -16661,17 +16537,17 @@ ceNonLocalReturn(sqInt returnValue) /* error: can't find home on chain; cannot return */ /* begin ensureFrameIsMarried:SP: */ - theFP3 = GIV(framePointer); + theFP1 = GIV(framePointer); theSP = GIV(stackPointer); - if (((((usqInt)(longAt(theFP3 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP3 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP3 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP3))); - ourContext = longAt(theFP3 + FoxThisContext); - goto l20; + if (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP1))); + ourContext = longAt(theFP1 + FoxThisContext); + goto l14; } - ourContext = marryFrameSP(theFP3, theSP); - l20: /* end ensureFrameIsMarried:SP: */; + ourContext = marryFrameSP(theFP1, theSP); + l14: /* end ensureFrameIsMarried:SP: */; /* begin externalCannotReturn:from: */ longAtput((sp = GIV(stackPointer) - BytesPerWord), ourContext); GIV(stackPointer) = sp; @@ -16700,14 +16576,14 @@ ceNonLocalReturn(sqInt returnValue) longAtput((sp4 = GIV(stackPointer) - BytesPerWord), ourContext1); GIV(stackPointer) = sp4; /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue); - GIV(stackPointer) = sp11; + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp12; /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero); - GIV(stackPointer) = sp21; + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero); + GIV(stackPointer) = sp22; /* begin push: */ - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp3; + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp31; return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))), ourContext1, 2); } contextToReturnTo = null; @@ -16722,10 +16598,8 @@ ceNonLocalReturn(sqInt returnValue) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index2, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -16756,44 +16630,40 @@ ceNonLocalReturn(sqInt returnValue) /* error: home's sender is dead; cannot return */ /* begin ensureFrameIsMarried:SP: */ - theFP4 = GIV(framePointer); + theFP2 = GIV(framePointer); theSP1 = GIV(stackPointer); - if (((((usqInt)(longAt(theFP4 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP4 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP4 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP4))); - ourContext = longAt(theFP4 + FoxThisContext); - goto l21; + if (((((usqInt)(longAt(theFP2 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP2 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP2 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP2))); + ourContext = longAt(theFP2 + FoxThisContext); + goto l17; } - ourContext = marryFrameSP(theFP4, theSP1); - l21: /* end ensureFrameIsMarried:SP: */; + ourContext = marryFrameSP(theFP2, theSP1); + l17: /* end ensureFrameIsMarried:SP: */; /* begin externalCannotReturn:from: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), ourContext); - GIV(stackPointer) = sp5; + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), ourContext); + GIV(stackPointer) = sp3; /* begin push: */ - longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue); - GIV(stackPointer) = sp12; + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp11; /* begin push: */ - longAtput((sp22 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp22; + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp21; return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1); } } assert(pageListIsWellFormed()); /* begin stackPageFor: */ - assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage)); - - newPage = stackPageAtpages(index1, GIV(pages)); + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (newPage != GIV(stackPage)) { /* begin frameCallerContext: */ - theFP2 = (GIV(stackPage)->baseFP); - assert(isBaseFrame(theFP2)); + theFP4 = (GIV(stackPage)->baseFP); + assert(isBaseFrame(theFP4)); /* begin stackPageFor: */ - assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage3 = stackPageAtpages(index4, GIV(pages)); + thePage3 = stackPageAtpages((assert((((((char *) theFP4)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP4)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP4, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil2 = longAt((thePage3->baseAddress)); assert(addressCouldBeObj(callerContextOrNil2)); assert((callerContextOrNil2 == (nilObject())) @@ -16807,18 +16677,14 @@ ceNonLocalReturn(sqInt returnValue) && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin frameCallerContext: */ - theFP1 = (thePage->baseFP); - assert(isBaseFrame(theFP1)); + theFP3 = (thePage->baseFP); + assert(isBaseFrame(theFP3)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index3, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP3)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP3)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP3, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -16921,21 +16787,21 @@ ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16964,10 +16830,10 @@ ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -17091,21 +16957,21 @@ ceSelfSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -17131,10 +16997,10 @@ ceSelfSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -17253,12 +17119,12 @@ ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l5; + goto l4; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l5: /* end classAtIndex: */; + l4: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); assert(0); @@ -17367,12 +17233,12 @@ ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l5; + goto l4; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l5: /* end classAtIndex: */; + l4: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); assert(0); @@ -17408,7 +17274,7 @@ ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize sqInt methodHeader; sqInt methodObj; sqInt oop; - sqInt p; + char *p; char *sp; unsigned short startBcpc; sqInt top; @@ -17425,7 +17291,7 @@ ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize else { methodHeader = ((((CogMethod *) cogMethod))->methodHeader); methodObj = ((((CogMethod *) cogMethod))->methodObject); - startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop; + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; } /* begin popStack */ top = longAt(GIV(stackPointer)); @@ -17571,21 +17437,21 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num /* begin ifAppropriateCompileToNativeCode:selector: */ aMethodObj = GIV(newMethod); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -17611,12 +17477,12 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l9; + goto l8; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l9: /* end classAtIndex: */; + l8: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { if ((errSelIdx == SelectorDoesNotUnderstand) && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) { @@ -17633,10 +17499,10 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, selector); } @@ -17989,7 +17855,8 @@ checkStackIntegrity(void) theSP += BytesPerWord; } if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) : (/* begin iframeHasContext: */ (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) { oop = longAt(theFP + FoxThisContext); @@ -18766,12 +18633,12 @@ findNewMethodInClassTag(sqInt classTagArg) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l4; + goto l2; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l4: /* end classAtIndex: */; + l2: /* end classAtIndex: */; lookupOrdinarySend(); addNewMethodToCache(GIV(lkupClass)); @@ -19033,7 +18900,8 @@ followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) } } if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) : (/* begin iframeHasContext: */ (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) && (((longAt(longAt(theFP + FoxThisContext))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { @@ -19115,15 +18983,12 @@ static sqInt NoDbgRegParms frameCallerContext(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; - sqInt index; StackPage *thePage; assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -19490,7 +19355,6 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq { DECL_MAYBE_SQ_GLOBAL_STRUCT char *callerFP; char *fp; - sqInt index; char *theFPAbove; sqInt theIP; StackPage *thePage; @@ -19501,10 +19365,8 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq } else { /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findFrameAbove:inPage: */ fp = (thePage->headFP); if (fp == spouseFP) { @@ -19730,13 +19592,9 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -19761,12 +19619,12 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; goto l16; } @@ -19784,13 +19642,13 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -19807,12 +19665,12 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -20020,11 +19878,11 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -20039,13 +19897,9 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -20070,19 +19924,19 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -20093,13 +19947,13 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -20108,7 +19962,7 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -20116,12 +19970,12 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -20130,31 +19984,31 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return 0; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return SelectorDoesNotUnderstand; } @@ -20193,6 +20047,7 @@ makeBaseFrameFor(sqInt aContext) sqInt theMethod; char *value; sqInt valuePointer; + sqInt yetToCompact; /* theIP must be typed as signed because it is assigned ceCannotResumePC and so maybe implicitly typed as unsigned. */ @@ -20215,11 +20070,11 @@ makeBaseFrameFor(sqInt aContext) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { page = lruOrFree; - goto l3; + goto l1; } divorceFramesIn(lruOrFree); page = lruOrFree; -l3: /* end newStackPage */; +l1: /* end newStackPage */; longAtput((pointer = (page->baseAddress)), followObjFieldofObject(SenderIndex, aContext)); longAtput((pointer -= BytesPerWord), aContext); /* begin followField:ofObject: */ @@ -20273,26 +20128,35 @@ makeBaseFrameFor(sqInt aContext) /* Since we would have to generate a machine-code method to be able to map the native pc anyway we should create a native method and native frame. */ - /* begin ensureMethodIsCogged: */ + /* begin ensureMethodIsCogged:maybeClosure: */ rawHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((rawHeader & 1)) || (((((usqInt)rawHeader)) < (startOfMemory())) && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), (rawHeader & 1) == 0)) { cogMethod = ((CogMethod *) rawHeader); - goto l10; + goto l12; } - cogMethod1 = cogselector(theMethod, GIV(nilObj)); - if ((cogMethod1 == null) - && (GIV(cogCompiledCodeCompactionCalledFor))) { + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(1))) { + cogMethod1 = cogFullBlockMethodnumCopied(theMethod, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(theMethod, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; commenceCogCompiledCodeCompaction(); - cogMethod1 = cogselector(theMethod, GIV(nilObj)); } if (!(asserta(cogMethod1 != null))) { error("could not compile method that should have been compiled"); } cogMethod = cogMethod1; - l10: /* end ensureMethodIsCogged: */; + l12: /* end ensureMethodIsCogged:maybeClosure: */; theMethod = ((sqInt)cogMethod); if (maybeClosure != GIV(nilObj)) { if (1) { @@ -20488,9 +20352,10 @@ mapStackPages(void) && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxThisContext), ((futureSpace()).start), futureSurvivorStart()))))) { longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext))); } - assert((isMarriedOrWidowedContext(frameContext(theFP))) - && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); - + if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) { + assert((isMarriedOrWidowedContext(frameContext(theFP))) + && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); + } } if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) { if ((((longAt(longAt(theFP + FoxMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) @@ -20698,6 +20563,7 @@ markAndTraceStackPage(StackPage *thePage) if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { /* begin markAndTraceMachineCodeMethod: */ aCogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((aCogMethod->cmType)) == CMMethod ? ((CogMethod *) aCogMethod) : ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset))))); @@ -21089,13 +20955,9 @@ mnuMethodOrNilFor(sqInt rcvr) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -21120,7 +20982,7 @@ mnuMethodOrNilFor(sqInt rcvr) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { mnuMethod = null; - goto l13; + goto l11; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -21128,12 +20990,12 @@ mnuMethodOrNilFor(sqInt rcvr) } if (nextSelector == mnuSelector) { /* begin followObjField:ofObject: */ - objOop2 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop2)); - if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2); + objOop = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop); } - methodArray = objOop2; + methodArray = objOop; /* begin followField:ofObject: */ objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop1 & (tagMask())) == 0) @@ -21141,20 +21003,20 @@ mnuMethodOrNilFor(sqInt rcvr) objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } mnuMethod = objOop1; - goto l13; + goto l11; } index += 1; if (index == length) { if (wrapAround) { mnuMethod = null; - goto l13; + goto l11; } wrapAround = 1; index = SelectorStart; } } mnuMethod = null; - l13: /* end lookupMethodFor:InDictionary: */; + l11: /* end lookupMethodFor:InDictionary: */; if (!(mnuMethod == null)) { /* begin fetchPointer:ofObject: */ methodHeader = longAt((mnuMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); @@ -21170,12 +21032,12 @@ mnuMethodOrNilFor(sqInt rcvr) return mnuMethod; } /* begin followField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop & (tagMask())) == 0) - && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); + objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop2 & (tagMask())) == 0) + && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); } - currentClass = objOop; + currentClass = objOop2; } return null; } @@ -21303,6 +21165,7 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) sqInt methodObj; sqInt rawHeader; sqInt startBcpc; + sqInt yetToCompact; if (theIP == HasBeenReturnedFromMCPC) { return GIV(nilObj); @@ -21316,9 +21179,9 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) } else { assert((((signed)theIP >> 16)) == -1); - startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop; + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; } - /* begin ensureMethodIsCogged: */ + /* begin ensureMethodIsCogged:maybeClosure: */ rawHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((rawHeader & 1)) || (((((usqInt)rawHeader)) < (startOfMemory())) @@ -21327,17 +21190,26 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) cogMethod = ((CogMethod *) rawHeader); goto l3; } - cogMethod1 = cogselector(methodObj, GIV(nilObj)); - if ((cogMethod1 == null) - && (GIV(cogCompiledCodeCompactionCalledFor))) { + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(1))) { + cogMethod1 = cogFullBlockMethodnumCopied(methodObj, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(methodObj, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; commenceCogCompiledCodeCompaction(); - cogMethod1 = cogselector(methodObj, GIV(nilObj)); } if (!(asserta(cogMethod1 != null))) { error("could not compile method that should have been compiled"); } cogMethod = cogMethod1; -l3: /* end ensureMethodIsCogged: */; +l3: /* end ensureMethodIsCogged:maybeClosure: */; /* begin bytecodePCFor:cogMethod:startBcpc: */ assert(theIP < 0); if ((((signed)theIP >> 16)) < -1) { @@ -21470,13 +21342,13 @@ positive32BitIntegerFor(unsigned int integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21586,11 +21458,11 @@ positive64BitIntegerFor(usqLong integerValue) return (((((unsigned int) integerValue)) << 1) | 1); } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); assert(ClassLargePositiveIntegerCompactIndex != 0); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(1 < (numSlotsMask())); newObj = GIV(freeStart); @@ -21606,13 +21478,13 @@ positive64BitIntegerFor(usqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger1 = newObj; - l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21637,13 +21509,13 @@ positive64BitIntegerFor(usqLong integerValue) } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + objFormat1 = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); numSlots = 8 / BytesPerOop; assert((numSlots >= 0) && (ClassLargePositiveIntegerCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -21661,13 +21533,13 @@ positive64BitIntegerFor(usqLong integerValue) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue)); return newLargeInteger; } @@ -21910,6 +21782,7 @@ printCogMethod(CogMethod *cogMethod) theMethod = (cogMethod->methodObject); methodHeader = (cogMethod->methodHeader); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitive = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -22154,10 +22027,10 @@ printFrameWithSP(char *theFP, char *theSP) methodField = longAt(theFP + FoxMethod); if ((methodField & MFMethodFlagIsBlockFlag) != 0) { homeMethod = ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))); - goto l3; + goto l2; } homeMethod = ((CogMethod *) (methodField & MFMethodMask)); - l3: /* end mframeHomeMethod: */; + l2: /* end mframeHomeMethod: */; theMethod = ((sqInt)homeMethod); theMethodEnd = (((sqInt)homeMethod)) + ((homeMethod->blockSize)); numArgs = (cogMethod->cmNumArgs); @@ -22646,20 +22519,20 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea sqInt oop; sqInt seed; sqInt swapBytes; - int w; + sqInt w; int w1; - sqInt w10; + unsigned short w10; sqInt w11; sqInt w12; sqInt w13; - unsigned short w2; - int w3; - unsigned short w4; - unsigned short w5; - sqInt w6; - sqInt w7; - sqInt w8; - sqInt w9; + sqInt w2; + sqInt w3; + sqInt w4; + sqInt w5; + int w6; + unsigned short w7; + int w8; + unsigned short w9; /* guess Metaclass instSize */ @@ -22672,69 +22545,69 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* record header start position */ headerStart = (sqImageFilePosition(f)) - 4; /* begin getWord32FromFile:swap: */ - w = 0; - sqImageFileRead((&w), sizeof(int), 1, f); + w1 = 0; + sqImageFileRead((&w1), sizeof(int), 1, f); headerSize = (swapBytes - ? SQ_SWAP_4_BYTES(w) - : w); + ? SQ_SWAP_4_BYTES(w1) + : w1); /* begin getLongFromFile:swap: */ - w7 = 0; - sqImageFileRead((&w7), sizeof(w7), 1, f); + w2 = 0; + sqImageFileRead((&w2), sizeof(w2), 1, f); dataSize = ((sqInt) ((swapBytes ? (/* begin byteSwapped: */ - SQ_SWAP_4_BYTES(w7)) - : w7))); + SQ_SWAP_4_BYTES(w2)) + : w2))); /* begin getLongFromFile:swap: */ - w8 = 0; - sqImageFileRead((&w8), sizeof(w8), 1, f); + w3 = 0; + sqImageFileRead((&w3), sizeof(w3), 1, f); if (swapBytes) { /* begin byteSwapped: */ - oldBaseAddr = SQ_SWAP_4_BYTES(w8); + oldBaseAddr = SQ_SWAP_4_BYTES(w3); } else { - oldBaseAddr = w8; + oldBaseAddr = w3; } /* begin specialObjectsOop: */ - w9 = 0; - sqImageFileRead((&w9), sizeof(w9), 1, f); + w12 = 0; + sqImageFileRead((&w12), sizeof(w12), 1, f); if (swapBytes) { /* begin byteSwapped: */ - anObject = SQ_SWAP_4_BYTES(w9); + anObject = SQ_SWAP_4_BYTES(w12); } else { - anObject = w9; + anObject = w12; } GIV(specialObjectsOop) = anObject; /* begin lastHash: */ - w10 = 0; - sqImageFileRead((&w10), sizeof(w10), 1, f); + w13 = 0; + sqImageFileRead((&w13), sizeof(w13), 1, f); if (swapBytes) { /* begin byteSwapped: */ - seed = SQ_SWAP_4_BYTES(w10); + seed = SQ_SWAP_4_BYTES(w13); } else { - seed = w10; + seed = w13; } GIV(lastHash) = seed; /* begin getLongFromFile:swap: */ - w11 = 0; - sqImageFileRead((&w11), sizeof(w11), 1, f); + w4 = 0; + sqImageFileRead((&w4), sizeof(w4), 1, f); if (swapBytes) { /* begin byteSwapped: */ - GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w11); + GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w4); } else { - GIV(savedWindowSize) = w11; + GIV(savedWindowSize) = w4; } /* begin getLongFromFile:swap: */ - w12 = 0; - sqImageFileRead((&w12), sizeof(w12), 1, f); + w5 = 0; + sqImageFileRead((&w5), sizeof(w5), 1, f); if (swapBytes) { /* begin byteSwapped: */ - headerFlags = SQ_SWAP_4_BYTES(w12); + headerFlags = SQ_SWAP_4_BYTES(w5); } else { - headerFlags = w12; + headerFlags = w5; } /* begin setImageHeaderFlagsFrom: */ @@ -22748,17 +22621,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(preemptionYields) = (headerFlags & 16) == 0; GIV(newFinalization) = (headerFlags & 64) != 0; /* begin getWord32FromFile:swap: */ - w1 = 0; - sqImageFileRead((&w1), sizeof(int), 1, f); + w6 = 0; + sqImageFileRead((&w6), sizeof(int), 1, f); extraVMMemory = (swapBytes - ? SQ_SWAP_4_BYTES(w1) - : w1); + ? SQ_SWAP_4_BYTES(w6) + : w6); /* begin getShortFromFile:swap: */ - w2 = 0; - sqImageFileRead((&w2), sizeof(unsigned short), 1, f); + w7 = 0; + sqImageFileRead((&w7), sizeof(unsigned short), 1, f); hdrNumStackPages = (swapBytes - ? ((((usqInt) w2) >> 8) & 0xFF) | (((int)((usqInt)((w2 & 0xFF)) << 8))) - : w2); + ? ((((usqInt) w7) >> 8) & 0xFF) | (((int)((usqInt)((w7 & 0xFF)) << 8))) + : w7); GIV(numStackPages) = (desiredNumStackPages != 0 ? desiredNumStackPages : (hdrNumStackPages == 0 @@ -22774,11 +22647,11 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea ? defaultCogCodeSize() : hdrCogCodeSize)); /* begin getWord32FromFile:swap: */ - w3 = 0; - sqImageFileRead((&w3), sizeof(int), 1, f); + w8 = 0; + sqImageFileRead((&w8), sizeof(int), 1, f); hdrEdenBytes = (swapBytes - ? SQ_SWAP_4_BYTES(w3) - : w3); + ? SQ_SWAP_4_BYTES(w8) + : w8); /* begin edenBytes: */ bytes = (desiredEdenBytes != 0 ? desiredEdenBytes @@ -22788,31 +22661,31 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(edenBytes) = bytes; desiredEdenBytes = hdrEdenBytes; /* begin getShortFromFile:swap: */ - w4 = 0; - sqImageFileRead((&w4), sizeof(unsigned short), 1, f); + w9 = 0; + sqImageFileRead((&w9), sizeof(unsigned short), 1, f); hdrMaxExtSemTabSize = (swapBytes - ? ((((usqInt) w4) >> 8) & 0xFF) | (((int)((usqInt)((w4 & 0xFF)) << 8))) - : w4); + ? ((((usqInt) w9) >> 8) & 0xFF) | (((int)((usqInt)((w9 & 0xFF)) << 8))) + : w9); if (hdrMaxExtSemTabSize != 0) { /* begin setMaxExtSemSizeTo: */ GIV(maxExtSemTabSizeSet) = 1; ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize); } /* begin getShortFromFile:swap: */ - w5 = 0; - sqImageFileRead((&w5), sizeof(unsigned short), 1, f); + w10 = 0; + sqImageFileRead((&w10), sizeof(unsigned short), 1, f); GIV(the2ndUnknownShort) = (swapBytes - ? ((((usqInt) w5) >> 8) & 0xFF) | (((int)((usqInt)((w5 & 0xFF)) << 8))) - : w5); + ? ((((usqInt) w10) >> 8) & 0xFF) | (((int)((usqInt)((w10 & 0xFF)) << 8))) + : w10); /* begin getLongFromFile:swap: */ - w13 = 0; - sqImageFileRead((&w13), sizeof(w13), 1, f); + w11 = 0; + sqImageFileRead((&w11), sizeof(w11), 1, f); if (swapBytes) { /* begin byteSwapped: */ - firstSegSize = SQ_SWAP_4_BYTES(w13); + firstSegSize = SQ_SWAP_4_BYTES(w11); } else { - firstSegSize = w13; + firstSegSize = w11; } /* begin firstSegmentSize: */ GIV(firstSegmentSize) = firstSegSize; @@ -22821,14 +22694,14 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* no need to include the stackZone; this is alloca'ed */ minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + allocationReserve; /* begin getLongFromFile:swap: */ - w6 = 0; - sqImageFileRead((&w6), sizeof(w6), 1, f); + w = 0; + sqImageFileRead((&w), sizeof(w), 1, f); if (swapBytes) { /* begin byteSwapped: */ - freeOldSpaceInImage = SQ_SWAP_4_BYTES(w6); + freeOldSpaceInImage = SQ_SWAP_4_BYTES(w); } else { - freeOldSpaceInImage = w6; + freeOldSpaceInImage = w; } /* begin initialHeadroom:givenFreeOldSpaceInImage: */ headroom1 = (extraVMMemory == 0 @@ -22838,26 +22711,26 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea : extraVMMemory); if (freeOldSpaceInImage >= headroom1) { headroom = 0; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) { headroom = headroom1 / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) { headroom = headroom1 / 4; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) { headroom = (headroom1 * 3) / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= (headroom1 / 2)) { headroom = headroom1 / 2; - goto l1; + goto l2; } headroom = headroom1; -l1: /* end initialHeadroom:givenFreeOldSpaceInImage: */; +l2: /* end initialHeadroom:givenFreeOldSpaceInImage: */; /* begin roundUpHeapSize: */ heapSize1 = (((GIV(cogCodeSize) + dataSize) + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve ? 0 @@ -22933,13 +22806,9 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* begin numSlotsOf: */ assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classArrayClass + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(metaclassNumSlots) = longAt(classArrayClass - BaseHeaderSize); - } - else { - GIV(metaclassNumSlots) = numSlots; - } + GIV(metaclassNumSlots) = (numSlots == (numSlotsMask()) + ? longAt(classArrayClass - BaseHeaderSize) + : numSlots); /* default */ GIV(thisClassIndex) = 5; @@ -23184,8 +23053,7 @@ returntoExecutive(sqInt returnValue, sqInt inInterpreter) static void NoDbgRegParms rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void)) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if ((assert(isNonImmediate(GIV(newMethod))), - isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(GIV(newMethod))) { rewritePrimInvocationInto(cogMethodOf(GIV(newMethod)), (localPrimAddress == 0 ? ((void (*)(void)) primitiveFail) : localPrimAddress)); @@ -23334,21 +23202,21 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod = ((CogMethod *) methodHeader); - if (((cogMethod->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod, selector); + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -23356,267 +23224,16 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } } /* begin justActivateNewMethod */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (activateCogMethod = (methodHeader1 & 1) == 0))) { - cogMethod1 = ((CogMethod *) methodHeader1); - methodHeader1 = (cogMethod1->methodHeader); - } - numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if (activateCogMethod - && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), -((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (activateCogMethod) { - /* begin push: */ - object5 = ((usqInt)cogMethod1); - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp10; - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - GIV(instructionPointer) = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); - } - else { - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp21; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader1); - GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 - ? 256 - : 0); - - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp31; - /* begin push: */ - object11 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = initialIP - 1; - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader1 & AlternateHeaderHasPrimFlag)) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - initialIP += 3; - if (!activateCogMethod) { - GIV(instructionPointer) = initialIP; - } - if (GIV(primFailCode) != 0) { - if ((byteAt(initialIP + 1)) == (((((int) methodHeader1)) < 0 - ? AltLongStoreBytecode - : LongStoreBytecode))) { - /* begin getErrorObjectFromPrimFailCode */ - if (GIV(primFailCode) > 0) { - /* begin splObj: */ - table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); - if (GIV(primFailCode) <= (numSlotsOf(table))) { - /* begin fetchPointer:ofObject: */ - errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; - } - } - errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; - longAtPointerput(GIV(stackPointer), errorCode); - } - GIV(primFailCode) = 0; - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin externalWriteBackHeadFramePointers */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - /* begin checkForStackOverflow */ - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt activateCogMethod; - usqInt aMethodObj; - sqInt aSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt errorCode; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object11; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - sqInt table; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((methodHeader & 1)) || (((((usqInt)methodHeader)) < (startOfMemory())) && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ + (activateCogMethod = (methodHeader & 1) == 0))) { cogMethod = ((CogMethod *) methodHeader); - if (((cogMethod->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod, selector); - } - } - else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (activateCogMethod = (methodHeader1 & 1) == 0))) { - cogMethod1 = ((CogMethod *) methodHeader1); - methodHeader1 = (cogMethod1->methodHeader); + methodHeader = (cogMethod->methodHeader); } - numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -23635,17 +23252,17 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); GIV(stackPointer) = sp8; GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), -((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; if (activateCogMethod) { /* begin push: */ - object5 = ((usqInt)cogMethod1); + object5 = ((usqInt)cogMethod); longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); GIV(stackPointer) = sp10; /* begin push: */ longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp11; - GIV(instructionPointer) = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); } else { /* begin push: */ @@ -23654,8 +23271,8 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader1); - GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 ? 256 : 0); @@ -23682,7 +23299,7 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg GIV(stackPointer) = sp6; } if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader1 & AlternateHeaderHasPrimFlag)) { + methodHeader & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ @@ -23691,7 +23308,7 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg GIV(instructionPointer) = initialIP; } if (GIV(primFailCode) != 0) { - if ((byteAt(initialIP + 1)) == (((((int) methodHeader1)) < 0 + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -23701,11 +23318,262 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { + maybeFlagMethodAsInterpreted(GIV(newMethod)); + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + /* begin checkForStackOverflow */ + if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { + handleStackOverflow(); + } + /* begin enterSmalltalkExecutiveFromCallback */ + enterSmalltalkExecutive(); + return 1; +} + + +/* Send the 4 argument callback message + invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied + args. The arguments are raw C addresses + and are converted to integer objects on the way. */ +/* Override to log and check stack alignment. Since this is an implicit send + we need to + log it explicitly. The return side is done via a primitive so that gets + logged normally. */ + + /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ +EXPORT(sqInt) +sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activateCogMethod; + usqInt aMethodObj; + sqInt aSelectorOrImmediate; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt errorCode; + sqInt i; + usqInt initialIP; + sqInt methodHeader; + sqInt methodHeader1; + sqInt numArgs; + sqInt numTemps; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object2; + sqInt object3; + sqInt object4; + sqInt object5; + sqInt rcvr; + sqInt selector; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp2; + char *sp21; + char *sp3; + char *sp31; + char *sp4; + char *sp41; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt table; + + assertCStackWellAligned(); + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + /* begin fetchClassTagOfNonImm: */ + obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + /* begin classIndexOf: */ + classTag = (longAt(obj)) & (classIndexMask()); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(argumentCount) = 4; + if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { + if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { + return 0; + } + } + if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) + && (primitiveFunctionPointer == 0))) { + return 0; + } + /* begin push: */ + object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + object1 = positiveMachineIntegerFor(thunkPtr); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp1; + /* begin push: */ + object2 = positiveMachineIntegerFor(stackPtr); + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp2; + /* begin push: */ + object3 = positiveMachineIntegerFor(regsPtr); + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp3; + /* begin push: */ + object4 = positiveMachineIntegerFor(jmpBufPtr); + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); + GIV(stackPointer) = sp4; + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + /* begin justActivateNewMethod */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (activateCogMethod = (methodHeader & 1) == 0))) { + cogMethod = ((CogMethod *) methodHeader); + methodHeader = (cogMethod->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; + + /* could new rcvr be set at point of send? */ + rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); + assert(!(isOopForwarded(rcvr))); + if (activateCogMethod + && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp7; + /* begin push: */ + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp8; + GIV(framePointer) = GIV(stackPointer); + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + if (activateCogMethod) { + /* begin push: */ + object5 = ((usqInt)cogMethod); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); + GIV(stackPointer) = sp10; + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp11; + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + } + else { + /* begin push: */ + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp21; + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp31; + /* begin push: */ + object11 = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); + longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp41; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp5; + GIV(instructionPointer) = initialIP - 1; + } + /* begin push: */ + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp9; + for (i = (numArgs + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp6; + } + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + initialIP += 3; + if (!activateCogMethod) { + GIV(instructionPointer) = initialIP; + } + if (GIV(primFailCode) != 0) { + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -23890,13 +23758,13 @@ signed64BitIntegerFor(sqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude)); @@ -24328,7 +24196,6 @@ transferTofrom(sqInt newProc, sqInt sourceCode) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt activeContext; sqInt aMethodObj; - sqInt index; StackPage *lastUsedPage; StackPage *lruOrFree; sqInt newContext; @@ -24439,10 +24306,8 @@ transferTofrom(sqInt newProc, sqInt sourceCode) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFrame != ((thePage->headFP))) { /* explicit assignment of suspendedContext can cause switch to interior frame. */ @@ -24450,11 +24315,11 @@ transferTofrom(sqInt newProc, sqInt sourceCode) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l10; + goto l11; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l10: /* end newStackPage */; + l11: /* end newStackPage */; moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage); /* begin markStackPageLeastMostRecentlyUsed: */ assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage))); @@ -24463,7 +24328,7 @@ transferTofrom(sqInt newProc, sqInt sourceCode) lastUsedPage = (lastUsedPage->nextPage); } if (((lastUsedPage->nextPage)) == newPage) { - goto l13; + goto l14; } (((newPage->prevPage))->nextPage = (newPage->nextPage)); (((newPage->nextPage))->prevPage = (newPage->prevPage)); @@ -24472,7 +24337,7 @@ transferTofrom(sqInt newProc, sqInt sourceCode) (newPage->nextPage = lastUsedPage); (lastUsedPage->prevPage = newPage); assert(pageListIsWellFormed()); - l13: /* end markStackPageLeastMostRecentlyUsed: */; + l14: /* end markStackPageLeastMostRecentlyUsed: */; } assert(((thePage->headFP)) == theFrame); } @@ -24575,7 +24440,6 @@ updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP) assert(isContext(theContext)); assert((frameReceiver(theFP)) == (noFixupFollowFieldofObject(ReceiverIndex, theContext))); if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { - /* begin mframeNumArgs: */ tempIndex = ((mframeCogMethod(theFP))->cmNumArgs); pointer = (theFP + FoxMFReceiver) - BytesPerWord; } @@ -24646,7 +24510,6 @@ validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, usqInt theInstrPointer; if (instrPointer == (ceCannotResumePC())) { - /* begin isMachineCodeFrame: */ return (((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory()); } if (instrPointer == (ceReturnToInterpreterPC())) { @@ -24754,10 +24617,10 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -24783,14 +24646,13 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24805,42 +24667,37 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24855,32 +24712,28 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -24891,7 +24744,6 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24907,20 +24759,16 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -24955,39 +24803,39 @@ whereIs(sqInt anOop) && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) { if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) { where = " is in eden"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) { where = " is in future space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) { where = " is in past space"; - goto l2; + goto l1; } where = " is in new space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) { if (!((segmentContainingObj(anOop)) == null)) { where = " is in old space"; - goto l2; + goto l1; } where = " is between old space segments"; - goto l2; + goto l1; } where = null; -l2: /* end whereIsMaybeHeapThing: */; +l1: /* end whereIsMaybeHeapThing: */; if (!(where == null)) { return where; } /* begin whereIsMaybeStackThing: */ if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackBasePlus1) - 1, GIV(pages))) { where = " is in the stack zone"; - goto l1; + goto l2; } where = null; -l1: /* end whereIsMaybeStackThing: */; +l2: /* end whereIsMaybeStackThing: */; if (!(where == null)) { return where; } @@ -25403,15 +25251,14 @@ primitiveMethodPCData(void) } methodReceiver = longAt(GIV(stackPointer)); data = 0; - if ((assert(isNonImmediate(methodReceiver)), - isCogMethodReference(longAt((methodReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(methodReceiver)) { /* begin pcDataFor: */ methodHeader = longAt((methodReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); assert((isNonImmediate(methodHeader)) && ((((usqInt)methodHeader)) < (startOfMemory()))); cogMethod = ((CogMethod *) methodHeader); cm = (cogMethod->methodObject); - nSlots = (((byteSizeOf(cm)) - (((literalCountOfMethodHeader(methodHeaderOf(cm))) + LiteralStart) * BytesPerOop)) * 2) + ((8 * 2) / BytesPerOop); + nSlots = (((byteSizeOf(cm)) - (((literalCountOf(cm)) + LiteralStart) * BytesPerOop)) * 2) + ((8 * 2) / BytesPerOop); data1 = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))), nSlots); if (!(data1)) { data = -1; @@ -25467,6 +25314,7 @@ primitiveMethodXray(void) char *sp; if (methodWithHeaderShouldBeCogged(methodHeaderOf(longAt(GIV(stackPointer))))) { + /* begin maybeMethodHasCogMethod: */ alreadyCogged = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))); @@ -25620,7 +25468,8 @@ primitiveObjectAtPut(void) thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(thisReceiver))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -26076,12 +25925,6 @@ primitiveTerminateTo(void) char *fp1; char *fp2; char *frameAbove; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; - sqInt index5; char *newFP; char *newSP; sqInt nextCntx; @@ -26144,10 +25987,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26172,18 +26013,18 @@ primitiveTerminateTo(void) fp = (pageToStopOn->headFP); if (fp == contextsFP) { frameAbove = 0; - goto l16; + goto l5; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == contextsFP) { frameAbove = fp; - goto l16; + goto l5; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l16: /* end findFrameAbove:inPage: */; + l5: /* end findFrameAbove:inPage: */; contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)))); assert((((((usqInt)contextsIP)) >= (startOfMemory())) || (contextsIP == (ceReturnToInterpreterPC()))) == (!(isMachineCodeFrame(contextsFP)))); @@ -26229,10 +26070,8 @@ primitiveTerminateTo(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index2, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -26247,10 +26086,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index1, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26273,27 +26110,25 @@ primitiveTerminateTo(void) theFP = pointerForOop(senderOop4 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index5 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index5, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (thePage == GIV(stackPage)) { /* begin findFrameAbove:inPage: */ fp1 = (thePage->headFP); if (fp1 == theFP) { frameAbove = 0; - goto l23; + goto l19; } while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) { if (callerFP1 == theFP) { frameAbove = fp1; - goto l23; + goto l19; } fp1 = callerFP1; } error("did not find theFP in stack page"); frameAbove = 0; - l23: /* end findFrameAbove:inPage: */; + l19: /* end findFrameAbove:inPage: */; assert(frameAbove != 0); /* May cause a GC!! May also reclaim aContextOrNil's page, hence... */ @@ -26307,10 +26142,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop3 - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index3, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26326,18 +26159,18 @@ primitiveTerminateTo(void) fp2 = (thePage->headFP); if (fp2 == contextsFP) { frameAbove = 0; - goto l24; + goto l20; } while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) { if (callerFP2 == contextsFP) { frameAbove = fp2; - goto l24; + goto l20; } fp2 = callerFP2; } error("did not find theFP in stack page"); frameAbove = 0; - l24: /* end findFrameAbove:inPage: */; + l20: /* end findFrameAbove:inPage: */; if (frameAbove != 0) { contextsSP = ((assert(!(isBaseFrame(frameAbove))), (frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord)) - BytesPerWord; @@ -26360,10 +26193,8 @@ primitiveTerminateTo(void) theFP1 = (thePage->baseFP); assert(isBaseFrame(theFP1)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index4, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -26474,19 +26305,17 @@ primitiveVoidVMStateForMethod(void) sqInt hasCogMethod; sqInt i; sqInt i1; - sqInt index; usqInt limit; sqInt methodHeader; - sqInt methodHeader1; sqInt methodObj; usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt object; sqInt objOop; sqInt objOop1; @@ -26530,10 +26359,10 @@ primitiveVoidVMStateForMethod(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); activeContext = longAt(theFP + FoxThisContext); - goto l11; + goto l6; } activeContext = marryFrameSP(theFP, theSP); -l11: /* end ensureFrameIsMarried:SP: */; +l6: /* end ensureFrameIsMarried:SP: */; /* begin ensurePushedInstructionPointer */ if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { @@ -26569,18 +26398,12 @@ primitiveVoidVMStateForMethod(void) (GIV(stackPage)->headFP = GIV(framePointer)); (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); - if ((assert(isNonImmediate(methodObj)), - /* begin isCogMethodReference: */ - (methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))), - assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (hasCogMethod = (methodHeader & 1) == 0))) { + if ((hasCogMethod = methodHasCogMethod(methodObj))) { /* begin divorceMachineCodeFramesWithMethod: */ - methodHeader1 = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); do { if (GIV(stackPage) != 0) { @@ -26612,8 +26435,8 @@ primitiveVoidVMStateForMethod(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -26628,37 +26451,33 @@ primitiveVoidVMStateForMethod(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l14; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l14: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -26672,32 +26491,28 @@ primitiveVoidVMStateForMethod(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; + l21: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -26718,32 +26533,28 @@ primitiveVoidVMStateForMethod(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l23; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l23: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } if (hasCogMethod) { unlinkSendsToandFreeIf(methodObj, 1); @@ -26756,10 +26567,8 @@ primitiveVoidVMStateForMethod(void) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(((thePage->headFP)) == theFrame); /* begin setStackPageAndLimit: */ assert(thePage != 0); @@ -27075,16 +26884,16 @@ cStringOrNullFor(sqInt oop) classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (oop & (tagMask())) { isString = 0; - goto l3; + goto l2; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l3; + goto l2; -l3: /* end is:instanceOf:compactClassIndex: */; +l2: /* end is:instanceOf:compactClassIndex: */; if (!isString) { if (oop != GIV(nilObj)) { GIV(primFailCode) = PrimErrBadArgument; @@ -27095,37 +26904,33 @@ cStringOrNullFor(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { len = numSlots; - goto l1; + goto l4; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ len = (numSlots << (shiftForWord())) - (fmt & 7); - goto l1; + goto l4; } if (fmt >= (firstShortFormat())) { len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l1; + goto l4; } if (fmt >= (firstLongFormat())) { len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l1; + goto l4; } if (fmt == (sixtyFourBitIndexableFormat())) { len = ((usqInt) numSlots) >> 1; - goto l1; + goto l4; } len = 0; -l1: /* end lengthOf:format: */; +l4: /* end lengthOf:format: */; if (len == 0) { return 0; } @@ -27708,14 +27513,14 @@ primitiveArctan(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = atan(rcvr); @@ -27896,68 +27701,63 @@ primitiveAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27966,23 +27766,23 @@ primitiveAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l11; + goto l13; } } else { @@ -27996,19 +27796,19 @@ primitiveAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l17; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l17; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l17; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l17; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -28017,7 +27817,7 @@ primitiveAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l17; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -28040,13 +27840,13 @@ primitiveAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l10; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -28057,10 +27857,8 @@ primitiveAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l17; + goto l13; - l17: /* end subscript:with:format: */; - goto l11; } /* begin primitiveFailFor: */ reasonCode = (fmt <= 1 @@ -28068,13 +27866,13 @@ primitiveAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l11: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveAtPut */ @@ -28109,79 +27907,75 @@ primitiveAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(rcvr + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l29; + goto l21; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l29; + goto l21; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l29; + goto l21; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l29; + goto l21; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l29; + goto l21; } totalLength1 = 0; -l29: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l16; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l16; } class1 = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l27: /* end fixedFieldsOf:format:length: */; +l16: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -28190,23 +27984,23 @@ primitiveAtPut(void) sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(rcvr))); stSize1 = sp3; - goto l18; + goto l17; } /* begin fetchStackPointerOf: */ sp11 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l18; + goto l17; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr))); stSize1 = (sp11 >> 1); - l18: /* end stackPointerForMaybeMarriedContext: */; + l17: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value); - goto l33; + goto l29; } } else { @@ -28233,37 +28027,37 @@ primitiveAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l21; + goto l28; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -28271,7 +28065,7 @@ primitiveAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l21; + goto l28; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -28279,7 +28073,7 @@ primitiveAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l21: /* end subscript:with:storing:format: */; + l28: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -28288,14 +28082,14 @@ primitiveAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode1; } -l33: /* end stObject:at:put: */; +l29: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -28324,7 +28118,6 @@ primitiveBeCursor(void) sqInt successBoolean10; sqInt successBoolean11; sqInt successBoolean12; - sqInt successBoolean13; sqInt successBoolean2; sqInt successBoolean3; sqInt successBoolean4; @@ -28353,8 +28146,7 @@ primitiveBeCursor(void) maskObj = longAt(GIV(stackPointer)); } /* begin success: */ - successBoolean13 = GIV(argumentCount) < 2; - if (!successBoolean13) { + if (!(GIV(argumentCount) < 2)) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -28684,10 +28476,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -28695,7 +28487,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -28711,7 +28503,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -28723,18 +28515,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -28745,10 +28537,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -28756,23 +28548,23 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -28784,18 +28576,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue); @@ -28864,10 +28656,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -28875,7 +28667,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -28891,7 +28683,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -28903,18 +28695,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -28925,10 +28717,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -28936,23 +28728,23 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -28964,18 +28756,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue); @@ -29075,7 +28867,7 @@ primitiveBitShift(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29098,13 +28890,13 @@ primitiveBitShift(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l7; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29115,10 +28907,9 @@ primitiveBitShift(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l6: /* end maybeInlinePositive32BitIntegerFor: */; - goto l1; + goto l5; - l1: /* end positive32BitIntegerFor: */; + l5: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); @@ -29245,10 +29036,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (integerArgument & (tagMask())) { /* begin primitiveFail */ @@ -29256,7 +29047,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerArgument))); @@ -29272,7 +29063,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask()); @@ -29284,18 +29075,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } - l5: /* end positiveMachineIntegerValueOf: */; + l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ if ((integerReceiver & 1)) { value1 = (integerReceiver >> 1); @@ -29305,10 +29096,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (integerReceiver & (tagMask())) { /* begin primitiveFail */ @@ -29316,23 +29107,23 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerReceiver))); /* begin classIndexOf: */ ccIndex1 = (longAt(integerReceiver)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask()); @@ -29344,18 +29135,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } - l10: /* end positiveMachineIntegerValueOf: */; + l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue); @@ -29601,7 +29392,7 @@ primitiveClipboardText(void) sqInt fmt; sqInt formatField; usqInt newObj; - usqInt numBytes; + usqInt numBytes1; sqInt numSlots; sqInt s; char *sp; @@ -29637,23 +29428,23 @@ primitiveClipboardText(void) formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? (/* begin allocationUnit */ 8) : (numSlots + (numSlots & 1)) * BytesPerOop)); } - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); - goto l6; + s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex); + goto l4; } if (numSlots >= (numSlotsMask())) { @@ -29666,11 +29457,11 @@ primitiveClipboardText(void) else { long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex); } - assert((numBytes % (allocationUnit())) == 0); + assert((numBytes1 % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); - GIV(freeStart) += numBytes; + GIV(freeStart) += numBytes1; s = newObj; - l6: /* end allocateSlots:format:classIndex: */; + l4: /* end allocateBytes:classIndex: */; if (!(s)) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -29763,7 +29554,7 @@ primitiveClockLogAddresses(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)usecs)))) <= (MaxSmallInteger)) { v1 = (((((usqInt)usecs)) << 1) | 1); - goto l11; + goto l9; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29786,13 +29577,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l18; + goto l7; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l18: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l7: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29803,16 +29594,15 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); v1 = newLargeInteger; -l11: /* end maybeInlinePositive32BitIntegerFor: */; - goto l3; + goto l9; -l3: /* end positive32BitIntegerFor: */; +l9: /* end positive32BitIntegerFor: */; /* begin positive32BitIntegerFor: */ /* begin maybeInlinePositive32BitIntegerFor: */ assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)msecs)))) <= (MaxSmallInteger)) { v2 = (((((usqInt)msecs)) << 1) | 1); - goto l16; + goto l14; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29835,13 +29625,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l19; + goto l12; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; -l19: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l12: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29852,10 +29642,9 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); v2 = newLargeInteger1; -l16: /* end maybeInlinePositive32BitIntegerFor: */; - goto l4; + goto l14; -l4: /* end positive32BitIntegerFor: */; +l14: /* end positive32BitIntegerFor: */; if (GIV(primFailCode)) { /* begin popRemappableOop */ oop = GIV(remapBuffer)[GIV(remapBufferCount)]; @@ -30045,7 +29834,7 @@ primitiveClosureValue(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30096,7 +29885,7 @@ primitiveClosureValue(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30172,7 +29961,7 @@ primitiveClosureValue(void) switched = handleStackOverflowOrEventAllowContextSwitch(1); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l12: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } @@ -30311,7 +30100,7 @@ primitiveClosureValueNoContextSwitch(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30362,7 +30151,7 @@ primitiveClosureValueNoContextSwitch(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30438,7 +30227,7 @@ primitiveClosureValueNoContextSwitch(void) switched = handleStackOverflowOrEventAllowContextSwitch(0); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l12: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } /* InterpreterPrimitives>>#primitiveClosureValueWithArgs */ @@ -30505,13 +30294,9 @@ primitiveClosureValueWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -30613,7 +30398,7 @@ primitiveClosureValueWithArgs(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l14; + goto l10; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30664,7 +30449,7 @@ primitiveClosureValueWithArgs(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l14; + goto l10; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30740,7 +30525,7 @@ primitiveClosureValueWithArgs(void) switched = handleStackOverflowOrEventAllowContextSwitch(1); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l14: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l10: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } @@ -30794,73 +30579,63 @@ primitiveCompareBytes(void) /* begin byteSizeOf: */ if (arg1 & (tagMask())) { len1 = 0; - goto l1; + goto l2; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(arg1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(arg1 - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(arg1 - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len1 = numBytes - (fmt & 7); - goto l5; + goto l2; } if (fmt <= (sixtyFourBitIndexableFormat())) { len1 = numBytes; - goto l5; + goto l2; } if (fmt >= (firstShortFormat())) { len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l2; } len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l1: /* end byteSizeOf: */; +l2: /* end byteSizeOf: */; /* begin byteSizeOf: */ if (arg2 & (tagMask())) { len2 = 0; - goto l2; + goto l4; } /* begin numBytesOf: */ fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(arg2 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes1 = longAt(arg2 - BaseHeaderSize); - } - else { - numBytes1 = numSlots1; - } + numBytes1 = (numSlots1 == (numSlotsMask()) + ? longAt(arg2 - BaseHeaderSize) + : numSlots1); numBytes1 = numBytes1 << (shiftForWord()); if (fmt1 >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len2 = numBytes1 - (fmt1 & 7); - goto l8; + goto l4; } if (fmt1 <= (sixtyFourBitIndexableFormat())) { len2 = numBytes1; - goto l8; + goto l4; } if (fmt1 >= (firstShortFormat())) { len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); - goto l8; + goto l4; } len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); -l8: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l4: /* end byteSizeOf: */; if (!(len1 == len2)) { /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); @@ -30908,7 +30683,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } if (format >= (firstShortFormat())) { if (format >= (firstByteFormat())) { @@ -30918,7 +30693,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24); oddBytes = format & 7; @@ -30929,7 +30704,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 16; oddBytes = ((sqInt)((usqInt)((format & 3)) << 1)); @@ -30946,7 +30721,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 32; oddBytes = ((sqInt)((usqInt)((format & 1)) << 2)); @@ -30954,13 +30729,9 @@ primitiveConstantFill(void) } /* begin addressAfter: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30981,7 +30752,7 @@ primitiveConstantFill(void) } /* begin pop: */ GIV(stackPointer) += 1 * BytesPerWord; -l2: /* end primitiveConstantFillSpur */; +l5: /* end primitiveConstantFillSpur */; } @@ -31088,30 +30859,26 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots1; - } + numBytes = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ length = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { length = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask()))) && (length == (numBytesOf(arg))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -31127,13 +30894,9 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(rcvr - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); if (!((isAppropriateForCopyObject(arg)) && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -31182,11 +30945,11 @@ primitiveCrashVM(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { crashInThisThread = 1; - goto l2; + goto l1; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { crashInThisThread = 0; - goto l2; + goto l1; } /* begin success: */ @@ -31196,7 +30959,7 @@ primitiveCrashVM(void) } crashInThisThread = null; - l2: /* end booleanValueOf: */; + l1: /* end booleanValueOf: */; } if (GIV(primFailCode) || (GIV(argumentCount) != 1)) { @@ -31524,14 +31287,14 @@ primitiveExp(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = exp(rcvr); @@ -31571,14 +31334,14 @@ primitiveExponent(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { /* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */ @@ -31677,14 +31440,13 @@ primitiveFloatAdd(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -31697,14 +31459,13 @@ primitiveFloatAdd(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -31756,7 +31517,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l8; + goto l6; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -31779,13 +31540,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l16; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l16: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -31796,10 +31557,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - l8: /* end maybeInlinePositive32BitIntegerFor: */; - goto l2; + goto l6; - l2: /* end positive32BitIntegerFor: */; + l6: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -31815,7 +31575,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { result = ((integerValue1 << 1) | 1); - goto l14; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -31838,13 +31598,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l17; + goto l9; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l17: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -31855,10 +31615,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger1; - l14: /* end maybeInlinePositive32BitIntegerFor: */; - goto l3; + goto l11; - l3: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp1; @@ -31901,7 +31660,8 @@ primitiveFloatAtPut(void) index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -31967,14 +31727,13 @@ primitiveFloatDivide(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -31987,14 +31746,13 @@ primitiveFloatDivide(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg != 0.0)) { @@ -32017,57 +31775,50 @@ primitiveFloatEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -32085,57 +31836,50 @@ primitiveFloatGreaterOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreaterOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr >= arg; if (!GIV(primFailCode)) { @@ -32153,57 +31897,50 @@ primitiveFloatGreaterThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreater:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr > arg; if (!GIV(primFailCode)) { @@ -32221,57 +31958,50 @@ primitiveFloatLessOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLessOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr <= arg; if (!GIV(primFailCode)) { @@ -32289,57 +32019,50 @@ primitiveFloatLessThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLess:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr < arg; if (!GIV(primFailCode)) { @@ -32379,14 +32102,13 @@ primitiveFloatMultiply(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -32399,14 +32121,13 @@ primitiveFloatMultiply(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -32421,57 +32142,50 @@ primitiveFloatNotEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -32511,14 +32225,13 @@ primitiveFloatSubtract(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -32531,14 +32244,13 @@ primitiveFloatSubtract(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -32583,10 +32295,10 @@ primitiveFlushExternalPrimitives(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -32608,8 +32320,8 @@ primitiveFlushExternalPrimitives(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -32625,37 +32337,33 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -32670,32 +32378,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -32717,32 +32421,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } flushMethodCache(); /* begin flushExternalPrimitiveTable */ @@ -32798,11 +32498,11 @@ primitiveFormPrint(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { landscapeFlag = 1; - goto l5; + goto l2; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { landscapeFlag = 0; - goto l5; + goto l2; } /* begin success: */ @@ -32812,7 +32512,7 @@ primitiveFormPrint(void) } landscapeFlag = null; -l5: /* end booleanValueOf: */; +l2: /* end booleanValueOf: */; /* begin floatValueOf: */ oop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); isFloat = ((oop & (tagMask())) == 0) @@ -32820,14 +32520,14 @@ primitiveFormPrint(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); vScale = result; - goto l6; + goto l5; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } vScale = 0.0; -l6: /* end floatValueOf: */; +l5: /* end floatValueOf: */; /* begin floatValueOf: */ oop1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); isFloat1 = ((oop1 & (tagMask())) == 0) @@ -32835,14 +32535,14 @@ primitiveFormPrint(void) if (isFloat1) { fetchFloatAtinto(oop1 + BaseHeaderSize, result1); hScale = result1; - goto l7; + goto l6; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } hScale = 0.0; -l7: /* end floatValueOf: */; +l6: /* end floatValueOf: */; rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord)); if (!((((rcvr & (tagMask())) == 0) && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) @@ -32873,36 +32573,32 @@ primitiveFormPrint(void) pixelsPerWord = 32 / depth; wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord; if (((bitsArray & (tagMask())) == 0) - && (isWordsOrBytesNonImm(bitsArray))) { + && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) { /* begin numBytesOf: */ fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(bitsArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(bitsArray - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(bitsArray - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ bitsArraySize = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { bitsArraySize = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; /* begin success: */ if (!(bitsArraySize == ((wordsPerLine * h) * 4))) { @@ -32962,14 +32658,14 @@ primitiveFractionalPart(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { frac = modf(rcvr, (&trunc)); /* begin pushFloat: */ @@ -33039,7 +32735,7 @@ primitiveGetImmutability(void) rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin pop:thenPushBool: */ trueOrFalse = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); @@ -33251,7 +32947,6 @@ primitiveGetWindowLabel(void) EXPORT(sqInt) primitiveGetWindowSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt h; sqInt knownClassIndex; @@ -33275,8 +32970,7 @@ primitiveGetWindowSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -33299,13 +32993,13 @@ primitiveGetWindowSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l6; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l6: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 1) | 1)); @@ -33487,13 +33181,13 @@ primitiveHeartbeatFrequency(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -33655,13 +33349,13 @@ primitiveImageFormatVersion(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -33690,6 +33384,7 @@ primitiveImageFormatVersion(void) static void primitiveImageName(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOop; sqInt ok; sqInt okToRename; sqInt s; @@ -33714,11 +33409,13 @@ primitiveImageName(void) } s = longAt(GIV(stackPointer)); /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + /* begin isNonImmediate: */ ok = (s & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(s)); - ok = ((longAt(s)) & (classIndexMask())) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord())))))) + 4)) & (identityHashHalfWordMask())); - + ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); } /* begin success: */ if (!ok) { @@ -33892,37 +33589,33 @@ primitiveIntegerAt(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } sz = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -33972,7 +33665,7 @@ primitiveIntegerAtPut(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { index = (integerPointer >> 1); - goto l7; + goto l6; } else { /* begin primitiveFail */ @@ -33980,18 +33673,18 @@ primitiveIntegerAtPut(void) GIV(primFailCode) = 1; } index = 0; - goto l7; + goto l6; } -l7: /* end stackIntegerValue: */; +l6: /* end stackIntegerValue: */; /* begin signed32BitValueOf: */ if ((valueOop & 1)) { value = (valueOop >> 1); - goto l5; + goto l7; } value = noInlineSigned32BitValueGutsOf(valueOop); - goto l5; + goto l7; -l5: /* end signed32BitValueOf: */; +l7: /* end signed32BitValueOf: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -34006,7 +33699,8 @@ primitiveIntegerAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -34019,37 +33713,33 @@ primitiveIntegerAtPut(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l6; + goto l9; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l6; + goto l9; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l6; + goto l9; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l6; + goto l9; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l6; + goto l9; } sz = 0; -l6: /* end lengthOf:format: */; +l9: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -34146,7 +33836,6 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt objFormat; sqInt runArgs; sqInt runReceiver; char *sp; @@ -34159,13 +33848,10 @@ primitiveInvokeObjectAsMethod(void) sqInt valuePointer; /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2, ClassArrayCompactIndex); for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) { /* begin storePointerUnchecked:ofObject:withValue: */ @@ -34235,6 +33921,7 @@ primitiveIsPinned(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt obj; char *sp; + sqInt trueOrFalse; obj = longAt(GIV(stackPointer)); if ((obj & (tagMask())) @@ -34244,7 +33931,8 @@ primitiveIsPinned(void) return; } /* begin pop:thenPushBool: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((((usqInt) (longAt(obj))) >> 30) & 1) != 0 + trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); GIV(stackPointer) = sp; @@ -34657,14 +34345,14 @@ primitiveLogN(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = log(rcvr); @@ -34721,7 +34409,6 @@ primitiveLowSpaceSemaphore(void) static void primitiveMakePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -34749,8 +34436,7 @@ primitiveMakePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -34773,13 +34459,13 @@ primitiveMakePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pt = 0; - goto l3; + goto l2; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pt = newObj; -l3: /* end eeInstantiateSmallClass:numSlots: */; +l2: /* end eeInstantiateSmallClass:numSlots: */; assert(!(isOopForwarded(pt))); longAtput((pt + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), rcvr); @@ -34958,7 +34644,6 @@ primitiveMouseButtons(void) static void primitiveMousePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -35000,8 +34685,7 @@ primitiveMousePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -35024,13 +34708,13 @@ primitiveMousePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l7; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l7: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 1) | 1)); @@ -35187,12 +34871,13 @@ primitiveNew(void) less than lowSpaceThreshold bytes free. This *will not* cause a GC :-) */ /* begin instantiateClass: */ classObj1 = longAt(GIV(stackPointer)); + /* begin formatOfClass: */ classFormat = ((longAt((classObj1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); if (!((instSpec <= 1) || (instSpec == 5))) { obj = null; - goto l7; + goto l9; } assert(addressCouldBeClassObj(classObj1)); classIndex = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 @@ -35207,8 +34892,9 @@ primitiveNew(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l7; + goto l9; } + /* begin fixedFieldsOfClassFormat: */ numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); /* begin allocateSlots:format:classIndex: */ if (numSlots >= (numSlotsMask())) { @@ -35229,7 +34915,7 @@ primitiveNew(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -35246,7 +34932,7 @@ primitiveNew(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; -l4: /* end allocateSlots:format:classIndex: */; +l5: /* end allocateSlots:format:classIndex: */; if (!(newObj == null)) { /* begin fillObj:numSlots:with: */ assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj))); @@ -35256,7 +34942,7 @@ primitiveNew(void) } } obj = newObj; -l7: /* end instantiateClass: */; +l9: /* end instantiateClass: */; if (obj == null) { /* begin primitiveFailFor: */ reasonCode = (isFixedSizePointerFormat(instSpecOfClass(longAt(GIV(stackPointer)))) @@ -35442,7 +35128,6 @@ primitiveNewWithArg(void) usqInt bs; sqInt ccIndex; sqInt classFormat; - sqInt classPointer; sqInt fmt; sqInt instSpec; sqInt obj; @@ -35472,10 +35157,10 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l9; } size = value; - goto l10; + goto l9; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -35483,23 +35168,23 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); /* begin classIndexOf: */ ccIndex = (longAt(oop1)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; + goto l8; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l8: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -35511,18 +35196,18 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))); - goto l10; + goto l9; } else { size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))); - goto l10; + goto l9; } -l10: /* end positiveMachineIntegerValueOf: */; +l9: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -35533,9 +35218,7 @@ primitiveNewWithArg(void) obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); if (obj == null) { /* begin instSpecOfClass: */ - classPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); /* begin primitiveFailFor: */ reasonCode = (((instSpec >= 2) @@ -35591,42 +35274,38 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(actualObj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (actualObj + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { actualObj = GIV(freeStart); - goto l1; + goto l5; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); actualObj = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l5: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(freeStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } if (oopisGreaterThan(GIV(pastSpaceStart), ((pastSpace()).start))) { /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - actualObj = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + actualObj = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); } @@ -35638,13 +35317,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(actualObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -35655,18 +35330,18 @@ primitiveNextInstance(void) followingWordAddress1 = (actualObj + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { actualObj = GIV(pastSpaceStart); - goto l2; + goto l10; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); actualObj = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l10: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(pastSpaceStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } actualObj = GIV(nilObj); @@ -35674,13 +35349,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(actualObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -35691,22 +35362,22 @@ primitiveNextInstance(void) followingWordAddress2 = (actualObj + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { actualObj = GIV(endOfMemory); - goto l3; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); actualObj = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(endOfMemory)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } subsequentObject = null; - l5: /* end instanceAfter: */; + l15: /* end instanceAfter: */; if (!(subsequentObject == null)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), subsequentObject); @@ -35891,10 +35562,10 @@ primitivePathToUsing(void) sqInt next; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; sqInt path; char *sp; sqInt stack; @@ -35940,38 +35611,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(stack + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(stack - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots11 = byteAt(stack + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(stack - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - stackSize = numSlots1; - goto l4; + stackSize = numSlots2; + goto l7; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - stackSize = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l4; + stackSize = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l7; } if (fmt1 >= (firstShortFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l4; + stackSize = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l7; } if (fmt1 >= (firstLongFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l4; + stackSize = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l7; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - stackSize = ((usqInt) numSlots1) >> 1; - goto l4; + stackSize = ((usqInt) numSlots2) >> 1; + goto l7; } stackSize = 0; -l4: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin mark: */ setIsMarkedOfto(stack, 1); current = GIV(specialObjectsOop); @@ -35980,38 +35647,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(current))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(current + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(current - BaseHeaderSize); - } - else { - numSlots2 = numSlots5; - } + numSlots12 = byteAt(current + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(current - BaseHeaderSize) + : numSlots12); if (fmt2 <= 5) { - index = numSlots2; - goto l5; + index = numSlots3; + goto l9; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - index = (numSlots2 << (shiftForWord())) - (fmt2 & 7); - goto l5; + index = (numSlots3 << (shiftForWord())) - (fmt2 & 7); + goto l9; } if (fmt2 >= (firstShortFormat())) { - index = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l5; + index = (numSlots3 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l9; } if (fmt2 >= (firstLongFormat())) { - index = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l5; + index = (numSlots3 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l9; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - index = ((usqInt) numSlots2) >> 1; - goto l5; + index = ((usqInt) numSlots3) >> 1; + goto l9; } index = 0; -l5: /* end lengthOf:format: */; +l9: /* end lengthOf:format: */; stackp = 0; while(1) { while (((index -= 1)) >= -1) { @@ -36077,7 +35740,7 @@ primitivePathToUsing(void) && ((((((usqInt)next)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages)))))) ? !(frameIsMarked(next)) : (next >= heapBase) - && ((!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) + && ((!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) && (((((next & (tagMask())) == 0) && (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) <= 5)) || (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) @@ -36123,38 +35786,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(next + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(next - BaseHeaderSize); - } - else { - numSlots = numSlots3; - } + numSlots1 = byteAt(next + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(next - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { index = numSlots; - goto l3; + goto l5; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ index = (numSlots << (shiftForWord())) - (fmt & 7); - goto l3; + goto l5; } if (fmt >= (firstShortFormat())) { index = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l3; + goto l5; } if (fmt >= (firstLongFormat())) { index = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l3; + goto l5; } if (fmt == (sixtyFourBitIndexableFormat())) { index = ((usqInt) numSlots) >> 1; - goto l3; + goto l5; } index = 0; - l3: /* end lengthOf:format: */; + l5: /* end lengthOf:format: */; } } current = next; @@ -36254,22 +35913,18 @@ primitivePerformInSuperclass(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l10; + goto l11; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l10; + goto l11; } /* Push newMethod to save it in case of failure, @@ -36293,9 +35948,10 @@ primitivePerformInSuperclass(void) sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), rcvr); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), (lookupClass == null - ? (((tagBits2 = rcvr & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) - : fetchClassOfNonImm(rcvr)) + ? (/* begin fetchClassOf: */ + (((tagBits2 = rcvr & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + : fetchClassOfNonImm(rcvr))) : lookupClass)); /* begin cr */ printf("\n"); @@ -36336,7 +35992,7 @@ primitivePerformInSuperclass(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l10; + goto l11; } /* +2 = receiver + saved newMethod */ @@ -36349,7 +36005,7 @@ primitivePerformInSuperclass(void) executeNewMethod(); /* begin initPrimCall */ GIV(primFailCode) = 0; -l10: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l11: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } /* InterpreterPrimitives>>#primitivePerformWithArgs */ @@ -36382,22 +36038,18 @@ primitivePerformWithArgs(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l6; + goto l7; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l6; + goto l7; } /* Push newMethod to save it in case of failure, @@ -36420,9 +36072,10 @@ primitivePerformWithArgs(void) selector1 = GIV(messageSelector); sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), actualReceiver); if (printOnTrace()) { - printActivationNameForSelectorstartClass(GIV(messageSelector), (((tagBits = actualReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) - : fetchClassOfNonImm(actualReceiver))); + printActivationNameForSelectorstartClass(GIV(messageSelector), (/* begin fetchClassOf: */ + (((tagBits = actualReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) + : fetchClassOfNonImm(actualReceiver)))); /* begin cr */ printf("\n"); } @@ -36452,7 +36105,7 @@ primitivePerformWithArgs(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l6; + goto l7; } /* +2 = receiver + saved newMethod */ @@ -36465,7 +36118,7 @@ primitivePerformWithArgs(void) executeNewMethod(); /* begin initPrimCall */ GIV(primFailCode) = 0; -l6: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l7: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } @@ -37147,7 +36800,6 @@ primitiveScreenScaleFactor(void) static void primitiveScreenSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -37167,8 +36819,7 @@ primitiveScreenSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -37191,13 +36842,13 @@ primitiveScreenSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l5; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l5: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)((((usqInt) pointWord) >> 16) & 0xFFFF) << 1) | 1)); @@ -37254,13 +36905,13 @@ primitiveSecondsClock(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -37424,7 +37075,8 @@ primitiveSetImmutability(void) } wasImmutable = # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -37436,12 +37088,12 @@ primitiveSetImmutability(void) return; } /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) | (1U << 23)); + longAtput(rcvr, (longAt(rcvr)) | (1U << (immutableBitShift()))); } else { if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << 23))); + longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << (immutableBitShift())))); } else { /* begin primitiveFailFor: */ @@ -37521,38 +37173,33 @@ primitiveSetLogDirectory(void) /* begin byteSizeOf: */ if (stringOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(stringOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(stringOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(stringOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(stringOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetLogDirectoryOfSize(firstIndexableField(stringOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -37580,10 +37227,10 @@ primitiveSetOrHasIdentityHash(void) hasHash = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask())); /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (GIV(argumentCount) == 2) { @@ -37618,7 +37265,7 @@ primitiveSetOrHasIdentityHash(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { hash = (integerPointer >> 1); - goto l4; + goto l3; } else { /* begin primitiveFail */ @@ -37626,9 +37273,9 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } hash = 0; - goto l4; + goto l3; } -l4: /* end stackIntegerValue: */; +l3: /* end stackIntegerValue: */; /* begin stackObjectValue: */ oop = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); if (oop & (tagMask())) { @@ -37637,10 +37284,10 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } thisReceiver = null; - goto l5; + goto l4; } thisReceiver = oop; -l5: /* end stackObjectValue: */; +l4: /* end stackObjectValue: */; if (!GIV(primFailCode)) { /* begin hashBitsOf: */ hash1 = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask()); @@ -37665,8 +37312,8 @@ primitiveSetOrHasIdentityHash(void) allInstancesOf(thisReceiver); } /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); + GIV(stackPointer) = sp1; } } @@ -37698,38 +37345,33 @@ primitiveSetWindowLabel(void) /* begin byteSizeOf: */ if (labelOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(labelOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(labelOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(labelOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(labelOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetWindowLabelOfSize(firstIndexableField(labelOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -37813,7 +37455,7 @@ primitiveShortAt(void) } rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; @@ -37861,14 +37503,15 @@ primitiveShortAtPut(void) } rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -38036,14 +37679,14 @@ primitiveSine(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = sin(rcvr); @@ -38090,37 +37733,33 @@ primitiveSize(void) } /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l2; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l2; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l2; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l2; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l2; + goto l3; } totalLength = 0; -l2: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { @@ -38367,14 +38006,14 @@ primitiveSquareRoot(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; /* begin success: */ if (!(rcvr >= 0.0)) { @@ -38504,68 +38143,63 @@ primitiveStringAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -38574,23 +38208,23 @@ primitiveStringAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l11; + goto l13; } } else { @@ -38604,19 +38238,19 @@ primitiveStringAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l17; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l17; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l17; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l17; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -38625,7 +38259,7 @@ primitiveStringAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l17; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -38648,13 +38282,13 @@ primitiveStringAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l10; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -38665,10 +38299,8 @@ primitiveStringAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l17; + goto l13; - l17: /* end subscript:with:format: */; - goto l11; } /* begin primitiveFailFor: */ reasonCode = (fmt <= 1 @@ -38676,14 +38308,14 @@ primitiveStringAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l11: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { if (!(((result >= 0) && (result <= ((1U << 30) - 1))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l1; + goto l14; } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (((sqInt)((usqInt)(((result >> 1))) << (numTagBits())))) + (characterTag()); @@ -38691,7 +38323,7 @@ primitiveStringAt(void) longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveStringAtPut */ @@ -38727,81 +38359,77 @@ primitiveStringAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ value1 = asciiOfCharacter(value); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -38810,23 +38438,23 @@ primitiveStringAtPut(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value1); - goto l17; + goto l15; } } else { @@ -38853,37 +38481,37 @@ primitiveStringAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value1); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value1); @@ -38891,7 +38519,7 @@ primitiveStringAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value1); @@ -38899,7 +38527,7 @@ primitiveStringAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -38908,14 +38536,14 @@ primitiveStringAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } -l17: /* end stObject:at:put: */; +l15: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -38943,8 +38571,8 @@ primitiveStringReplace(void) sqInt integerPointer2; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt repl; usqLong replFmt; sqInt replInstSize; @@ -38961,7 +38589,7 @@ primitiveStringReplace(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { start = (integerPointer >> 1); - goto l15; + goto l12; } else { /* begin primitiveFail */ @@ -38969,15 +38597,15 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } start = 0; - goto l15; + goto l12; } -l15: /* end stackIntegerValue: */; +l12: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { stop = (integerPointer1 >> 1); - goto l16; + goto l13; } else { /* begin primitiveFail */ @@ -38985,16 +38613,16 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } stop = 0; - goto l16; + goto l13; } -l16: /* end stackIntegerValue: */; +l13: /* end stackIntegerValue: */; repl = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { replStart = (integerPointer2 >> 1); - goto l17; + goto l14; } else { /* begin primitiveFail */ @@ -39002,9 +38630,9 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } replStart = 0; - goto l17; + goto l14; } -l17: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -39020,7 +38648,8 @@ primitiveStringReplace(void) if ((stop >= start) && ( # if IMMUTABILITY - ((((usqInt) (longAt(array))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(array))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -39032,38 +38661,34 @@ primitiveStringReplace(void) hdr = long64At(array); arrayFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots2 = byteAt(array + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(array + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (arrayFmt <= 5) { totalLength = numSlots; - goto l12; + goto l18; } if (arrayFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (arrayFmt & 7); - goto l12; + goto l18; } if (arrayFmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (arrayFmt & 3); - goto l12; + goto l18; } if (arrayFmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (arrayFmt & 1); - goto l12; + goto l18; } if (arrayFmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l18; } totalLength = 0; -l12: /* end lengthOf:format: */; +l18: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((arrayFmt >= (sixtyFourBitIndexableFormat())) || (arrayFmt == 2)) { @@ -39089,53 +38714,49 @@ primitiveStringReplace(void) hdr = long64At(repl); replFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots3 = byteAt(repl + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(repl - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(repl + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(repl - BaseHeaderSize) + : numSlots11); if (replFmt <= 5) { - totalLength = numSlots1; - goto l13; + totalLength = numSlots2; + goto l21; } if (replFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (replFmt & 7); - goto l13; + totalLength = (numSlots2 << (shiftForWord())) - (replFmt & 7); + goto l21; } if (replFmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (replFmt & 3); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (replFmt & 3); + goto l21; } if (replFmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (replFmt & 1); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (replFmt & 1); + goto l21; } if (replFmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l13; + totalLength = ((usqInt) numSlots2) >> 1; + goto l21; } totalLength = 0; -l13: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((replFmt >= (sixtyFourBitIndexableFormat())) || (replFmt == 2)) { replInstSize = 0; - goto l21; + goto l22; } if (replFmt < 2) { replInstSize = totalLength; - goto l21; + goto l22; } class1 = fetchClassOfNonImm(repl); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); replInstSize = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l21: /* end fixedFieldsOf:format:length: */; +l22: /* end fixedFieldsOf:format:length: */; if (!((replStart >= 1) && ((((stop - start) + replStart) + replInstSize) <= totalLength))) { /* begin primitiveFailFor: */ @@ -39473,14 +39094,14 @@ primitiveTruncated(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { modf(rcvr, (&trunc)); /* begin success: */ @@ -39529,10 +39150,10 @@ primitiveUnloadModule(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -39584,8 +39205,8 @@ primitiveUnloadModule(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -39601,37 +39222,33 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -39646,32 +39263,28 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -39693,20 +39306,16 @@ primitiveUnloadModule(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -39922,10 +39531,10 @@ primitiveVMProfileSamplesInto(void) ioNewProfileStatus((&running), (&bufferSize)); if (GIV(argumentCount) == 0) { /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (!(GIV(argumentCount) == 1)) { @@ -39943,8 +39552,8 @@ primitiveVMProfileSamplesInto(void) } numSamples = ioNewProfileSamplesInto(firstFixedField(sampleBuffer)); /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); + GIV(stackPointer) = sp1; } @@ -40033,13 +39642,9 @@ signedMachineIntegerValueOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -40106,7 +39711,6 @@ sizeOfAlienData(sqInt oop) GIV(primFailCode) = PrimErrBadArgument; return 0; } - /* begin sizeFieldOfAlien: */ size = longAt(oop + BaseHeaderSize); return SQABS(size); } @@ -40185,10 +39789,10 @@ clearLeakMapAndMapAccessibleObjects(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -40211,8 +39815,8 @@ clearLeakMapAndMapAccessibleObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -40224,37 +39828,33 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -40265,32 +39865,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -40308,32 +39904,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } addCogMethodsToHeapMap(); } @@ -40449,7 +40041,7 @@ methodHeaderOf(sqInt methodObj) sqLong nullHeaderForMachineCodeMethod(void) { - return ((((sqInt)((usqInt)((firstLongFormat())) << (formatShift())))) + (1ULL << 55)) + ClassBitmapCompactIndex; + return ((((sqInt)((usqInt)((firstLongFormat())) << (formatShift())))) + (1ULL << (markedBitFullShift()))) + ClassBitmapCompactIndex; } /* Spur32BitCoMemoryManager>>#scavengeThresholdAddress */ @@ -40508,13 +40100,9 @@ addressAfter(sqInt objOop) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -40799,18 +40387,10 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to l16: /* end allocateOldSpaceChunkOfBytes:suchThat: */; if (!(chunk)) { chunk = allocateOldSpaceChunkOfBytes(totalBytes); - if (!(chunk == null)) { - ((segmentContainingObj(chunk))->containsPinned = 1); + if (!(chunk)) { + return null; } - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - if (!(chunk)) { - return null; + ((segmentContainingObj(chunk))->containsPinned = 1); } if (numSlots >= (numSlotsMask())) { @@ -40818,10 +40398,22 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to flag("endianness"); longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << 30)); + long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } - long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << 30)); + long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -40837,12 +40429,6 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt chunk; chunk = allocateOldSpaceChunkOfBytes(totalBytes); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } if (!(chunk)) { return null; } @@ -40853,9 +40439,21 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(chunk + BaseHeaderSize, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } long64Atput(chunk, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -40883,7 +40481,6 @@ bytesInObject(sqInt objOop) headerNumSlots = byteAt(objOop + 7); if (headerNumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ numSlots = longAt(objOop - BaseHeaderSize); } else { @@ -40925,7 +40522,8 @@ changeClassOfto(sqInt rcvr, sqInt argClass) if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -40939,16 +40537,16 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin classFormatForInstanceFormat: */ if (instFormat < (firstLongFormat())) { normalizedInstFormat = instFormat; - goto l2; + goto l5; } if (instFormat >= (firstByteFormat())) { normalizedInstFormat = instFormat & -8; - goto l2; + goto l5; } normalizedInstFormat = (instFormat >= (firstShortFormat()) ? instFormat & -4 : instFormat & -2); -l2: /* end classFormatForInstanceFormat: */; +l5: /* end classFormatForInstanceFormat: */; if (((assert(addressCouldBeClassObj(argClass)), (classIndex = (((hash = (long32At(argClass + 4)) & (identityHashHalfWordMask()))) != 0 ? hash @@ -40984,13 +40582,9 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -41183,13 +40777,13 @@ floatObjectOf(double aFloat) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newFloatObj = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFloatCompactIndex); GIV(freeStart) += numBytes; newFloatObj = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; storeFloatAtfrom(newFloatObj + BaseHeaderSize, aFloat); return newFloatObj; } @@ -41284,16 +40878,16 @@ initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address) if (numSlots == 0) { /* short bridge for adjacent segments */ - longAtput(address, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 4, 1U << 23); + longAtput(address, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 4, 1U << (markedBitHalfShift())); } else { /* long bridge */ longAtput(address, numSlots); longAtput(address + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - longAtput(address + 8, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << 23)); + longAtput(address + 8, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << (markedBitHalfShift()))); } } @@ -41502,7 +41096,7 @@ sqInt isMarked(sqInt objOop) { flag("endianness"); - return ((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0; + return ((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0; } @@ -41519,13 +41113,9 @@ lengthOfformat(sqInt objOop, sqInt fmt) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -41575,7 +41165,7 @@ numFreeLists(void) /* Object parsing. 1. all objects have at least a word following the header, for a forwarding - pointer. 2. objects with an overflow size have a preceeing word with a + pointer. 2. objects with an overflow size have a preceding word with a saturated numSlots. If the word following an object doesn't have a saturated numSlots field it must be a single-header object. @@ -41594,13 +41184,9 @@ objectAfterlimit(sqInt objOop, sqInt limit) /* begin addressAfter: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -41626,8 +41212,8 @@ setIsMarkedOfto(sqInt objOop, sqInt aBoolean) assert(!(isFreeObject(objOop))); flag("endianness"); longAtput(objOop + 4, (aBoolean - ? (longAt(objOop + 4)) | (1U << 23) - : (longAt(objOop + 4)) & ((unsigned int)~(1U << 23)))); + ? (longAt(objOop + 4)) | (1U << (markedBitHalfShift())) + : (longAt(objOop + 4)) & ((unsigned int)~(1U << (markedBitHalfShift()))))); } @@ -41677,7 +41263,7 @@ addToEphemeronList(sqInt ephemeronCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) ephemeronListOffset) >> 5; + hash = ((usqInt) ephemeronListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(ephemeronCorpse + 4, ((((long32At(ephemeronCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -41714,7 +41300,7 @@ addToWeakList(sqInt weakCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) weakListOffset) >> 5; + hash = ((usqInt) weakListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(weakCorpse + 4, ((((long32At(weakCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -41776,13 +41362,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -41793,14 +41375,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); @@ -41819,13 +41401,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -41836,14 +41414,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 1; } @@ -41869,8 +41447,8 @@ allWeakSurvivorsOnWeakList(void) prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = (GIV(futureSpace).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(futureSurvivorStart); @@ -41885,31 +41463,27 @@ allWeakSurvivorsOnWeakList(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -42039,7 +41613,6 @@ copyAndForwardMourner(sqInt mourner) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -42089,11 +41662,10 @@ copyAndForwardMourner(sqInt mourner) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(mourner); } @@ -42113,7 +41685,6 @@ copyAndForward(sqInt survivor) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -42179,11 +41750,10 @@ copyAndForward(sqInt survivor) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(survivor); } @@ -42269,10 +41839,134 @@ copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSur return newOop; } + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Leave it to scavengeLoop + to remove any scavenged ephemerons that no longer have + new referents. */ + + /* SpurGenerationScavenger>>#fireEphemeronsInRememberedSet */ +static void +fireEphemeronsInRememberedSet(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt i; + sqInt key; + sqInt valuePointer; + + assert(noUnfiredEphemeronsAtEndOfRememberedSet()); + i = 0; + while (i < GIV(numRememberedEphemerons)) { + ephemeron = GIV(rememberedSet)[i]; + assert(isEphemeron(ephemeron)); + assert((isNonImmediate(ephemeron)) + && (isObjEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + if (scavengeReferentsOf(ephemeron)) { + + /* keep in set */ + i += 1; + } + else { + /* begin setIsRememberedOf:to: */ + longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(numRememberedEphemerons) -= 1; + GIV(previousRememberedSetSize) -= 1; + + /* First overwrite with last firable ephemeron (could be a noop if this is the last one). + Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). + Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); + GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + GIV(numRememberedEphemerons) = 0; +} + + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Be careful since copyAndForward: + can remember ephemerons (ephemerons pointing to ephemerons). */ +/* old ones for debugging */ + + /* SpurGenerationScavenger>>#fireEphemeronsOnEphemeronList */ +static void +fireEphemeronsOnEphemeronList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + usqInt ephemeronCorpse; + sqInt key; + sqInt listOffset; + sqInt oldCorpse; + sqInt oldList; + sqInt referent; + sqInt valuePointer; + + if (!(GIV(ephemeronList))) { + return; + } + oldCorpse = null; + /* begin corpseForCorpseOffset: */ + ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); + oldList = GIV(ephemeronList); + GIV(ephemeronList) = null; + while (ephemeronCorpse != null) { + assert((isYoung(ephemeronCorpse)) + && (isForwarded(ephemeronCorpse))); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(ephemeronCorpse)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + ephemeron = referent; + assert((isNonImmediate(ephemeron)) + && (isMaybeFiredEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + ((void) (scavengeReferentsOf(ephemeron))); + oldCorpse = ephemeronCorpse; + /* begin nextCorpseOrNil: */ + assert(isYoung(ephemeronCorpse)); + listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + ephemeronCorpse = (listOffset != 0 + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) + : 0); + } +} + /* SpurGenerationScavenger>>#firstCorpse: */ static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList) { DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin corpseForCorpseOffset: */ return (((sqInt)((usqInt)((headOfCorpseList - 1)) << 3))) + GIV(newSpaceStart); } @@ -42302,13 +41996,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(obj - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); assert(numSlots >= 1024); /* begin allocatePinnedSlots: */ nSlots1 = numSlots * 2; @@ -42356,7 +42046,7 @@ growRememberedSet(void) for (i = 0; i < GIV(rememberedSetSize); i += 1) { base[i] = (GIV(rememberedSet)[i]); } - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { setIsMarkedOfto(newObj, 1); setIsMarkedOfto(obj, 0); } @@ -42365,13 +42055,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(newObj)) > (isForwardedObjectClassIndexPun())); numSlots2 = byteAt(newObj + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(newObj - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots2; - } + GIV(rememberedSetLimit) = (numSlots2 == (numSlotsMask()) + ? longAt(newObj - BaseHeaderSize) + : numSlots2); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -42427,7 +42113,7 @@ isMaybeOldScavengeSurvivor(sqInt oop) return ((assert(isNonImmediate(target)), oopisGreaterThanOrEqualTo(target, GIV(oldSpaceStart))) ? (GIV(tenureCriterion) != MarkOnTenure) - || (((((usqInt) (longAt(target + 4))) >> 23) & 1) != 0) + || (((((usqInt) (longAt(target + 4))) >> (markedBitHalfShift())) & 1) != 0) : oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart())); } @@ -42481,6 +42167,7 @@ isonWeaklingList(sqInt oop, sqInt listHead) usqInt corpse; sqInt listOffset; + /* begin firstCorpse: */ corpse = (((sqInt)((usqInt)((listHead - 1)) << 3))) + GIV(newSpaceStart); while (corpse != null) { if (oop == (followForwarded(corpse))) { @@ -42488,9 +42175,10 @@ isonWeaklingList(sqInt oop, sqInt listHead) } /* begin nextCorpseOrNil: */ assert(isYoung(corpse)); - listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); corpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } return 0; @@ -42562,31 +42250,17 @@ printRememberedSet(void) static void processEphemerons(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt ephemeron1; - usqInt ephemeronCorpse; - sqInt format; - sqInt format1; sqInt hasNewReferents; sqInt i; - sqInt i1; - sqInt key; - sqInt key1; - sqInt listOffset; - sqInt oldCorpse; - sqInt oldList; - sqInt referent; sqInt referrer; sqInt unfiredEphemeronsScavenged; sqInt unfiredEphemeronsScavenged1; - sqInt valuePointer; - sqInt valuePointer1; /* begin scavengeUnfiredEphemeronsInRememberedSet */ unfiredEphemeronsScavenged1 = 0; - i1 = 0; - while (i1 < GIV(numRememberedEphemerons)) { - referrer = GIV(rememberedSet)[i1]; + i = 0; + while (i < GIV(numRememberedEphemerons)) { + referrer = GIV(rememberedSet)[i]; assert(isEphemeron(referrer)); if (isScavengeSurvivor((assert((isNonImmediate(referrer)) && (isObjEphemeron(referrer))), @@ -42597,7 +42271,7 @@ processEphemerons(void) /* remove from unscanned ephemerons in set by swapping with last ephemeron */ hasNewReferents = scavengeReferentsOf(referrer); GIV(numRememberedEphemerons) -= 1; - GIV(rememberedSet)[i1] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); if (hasNewReferents) { /* keep in set */ @@ -42615,7 +42289,7 @@ processEphemerons(void) } } else { - i1 += 1; + i += 1; } } unfiredEphemeronsScavenged = unfiredEphemeronsScavenged1; @@ -42623,111 +42297,8 @@ processEphemerons(void) unfiredEphemeronsScavenged = 1; } if (!unfiredEphemeronsScavenged) { - /* begin fireEphemeronsInRememberedSet */ - assert(noUnfiredEphemeronsAtEndOfRememberedSet()); - i = 0; - while (i < GIV(numRememberedEphemerons)) { - ephemeron = GIV(rememberedSet)[i]; - assert(isEphemeron(ephemeron)); - assert((isNonImmediate(ephemeron)) - && (isObjEphemeron(ephemeron))); - /* begin fetchPointer:ofObject: */ - key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer = copyAndForward(key); - assert(!(isOopForwarded(ephemeron))); - longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); - } - assert(!(((isScavengeSurvivor(key)) - && (isEphemeron(ephemeron))))); - if (scavengeReferentsOf(ephemeron)) { - - /* keep in set */ - i += 1; - } - else { - /* begin setIsRememberedOf:to: */ - longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(numRememberedEphemerons) -= 1; - GIV(previousRememberedSetSize) -= 1; - - /* First overwrite with last firable ephemeron (could be a noop if this is the last one). - Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). - Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); - GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); - GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - GIV(numRememberedEphemerons) = 0; - /* begin fireEphemeronsOnEphemeronList */ - if (!(GIV(ephemeronList))) { - goto l12; - } - oldCorpse = null; - /* begin corpseForCorpseOffset: */ - ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); - oldList = GIV(ephemeronList); - GIV(ephemeronList) = null; - while (ephemeronCorpse != null) { - assert((isYoung(ephemeronCorpse)) - && (isForwarded(ephemeronCorpse))); - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(ephemeronCorpse)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - ephemeron1 = referent; - assert((isNonImmediate(ephemeron1)) - && (isMaybeFiredEphemeron(ephemeron1))); - /* begin fetchPointer:ofObject: */ - key1 = longAt((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key1))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron1); - /* begin setFormatOf:to: */ - format1 = 1; - assert(((format1 >= 0) && (format1 <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron1, ((longAt(ephemeron1)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format1) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer1 = copyAndForward(key1); - assert(!(isOopForwarded(ephemeron1))); - longAtput((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1); - } - assert(!(((isScavengeSurvivor(key1)) - && (isEphemeron(ephemeron1))))); - ((void) (scavengeReferentsOf(ephemeron1))); - oldCorpse = ephemeronCorpse; - /* begin nextCorpseOrNil: */ - assert(isYoung(ephemeronCorpse)); - listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); - ephemeronCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) - : 0); - } - l12: /* end fireEphemeronsOnEphemeronList */; + fireEphemeronsInRememberedSet(); + fireEphemeronsOnEphemeronList(); } } @@ -42771,6 +42342,7 @@ processWeaklings(void) } } if (!(GIV(weakList) == null)) { + /* begin firstCorpse: */ weakCorpse = (((sqInt)((usqInt)((GIV(weakList) - 1)) << 3))) + GIV(newSpaceStart); while (weakCorpse != null) { assert(isForwarded(weakCorpse)); @@ -42792,9 +42364,10 @@ processWeaklings(void) } /* begin nextCorpseOrNil: */ assert(isYoung(weakCorpse)); - listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); weakCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } GIV(weakList) = null; @@ -42873,13 +42446,7 @@ processWeakSurvivor(sqInt weakObj) } } if (weakObjShouldMourn) { - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakObj); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakObj); } return hasYoungReferents; } @@ -42934,13 +42501,9 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress) : ptr); /* begin addressAfter: */ numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(obj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43116,16 +42679,12 @@ scavengeReferentsOf(sqInt referrer) /* begin numSlotsOf: */ assert((classIndexOf(referrer)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(referrer + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(referrer - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(referrer - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (indexablePointersFormat())) { if (((longAt(referrer)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -43140,10 +42699,10 @@ scavengeReferentsOf(sqInt referrer) contextSize = (sp >> 1); l4: /* end fetchStackPointerOf: */; numSlots = CtxtTempFrameStart + contextSize; - goto l8; + goto l9; } numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -43151,21 +42710,21 @@ scavengeReferentsOf(sqInt referrer) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l8; + goto l9; } assert(fmt == (ephemeronFormat())); numSlots = (isScavengeSurvivor((keyOfEphemeron(referrer))) ? numSlots2 : 0); - goto l8; + goto l9; } if (fmt == 7) { numSlots = 1; - goto l8; + goto l9; } if (fmt < (firstCompiledMethodFormat())) { numSlots = 0; - goto l8; + goto l9; } /* begin methodHeaderOf: */ assert(isCompiledMethod(referrer)); @@ -43178,11 +42737,11 @@ scavengeReferentsOf(sqInt referrer) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numSlots = numLiterals + LiteralStart; -l8: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; +l9: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; for (i = 0; i < numSlots; i += 1) { referent = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { @@ -43321,6 +42880,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) unfiredEphemeronsScavenged = 0; corpseOffset = GIV(ephemeronList); while (corpseOffset != 0) { + /* begin corpseForCorpseOffset: */ ephemeronCorpse = (((sqInt)((usqInt)((corpseOffset - 1)) << 3))) + GIV(newSpaceStart); assert(isForwarded(ephemeronCorpse)); /* begin followForwarded: */ @@ -43333,7 +42893,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); } ephemeron = referent; - nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); if (isScavengeSurvivor((assert((isNonImmediate(ephemeron)) && (isObjEphemeron(ephemeron))), /* begin fetchPointer:ofObject: */ @@ -43350,7 +42910,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) nextCorpseOffset) >> 5; + hash = ((usqInt) nextCorpseOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(previousCorpse + 4, ((((long32At(previousCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -43419,31 +42979,27 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objAfter + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objAfter + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { objAfter = GIV(freeStart); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objAfter = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(freeStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -43454,8 +43010,8 @@ accessibleObjectAfter(sqInt objOop) } /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objAfter = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objAfter = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { @@ -43465,13 +43021,9 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objAfter + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -43482,14 +43034,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress1 = (objAfter + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { objAfter = GIV(pastSpaceStart); - goto l2; + goto l9; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objAfter = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l9: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(pastSpaceStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -43500,13 +43052,9 @@ accessibleObjectAfter(sqInt objOop) while(1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(objAfter + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -43517,14 +43065,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress2 = (objAfter + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objAfter = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objAfter = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; if (objAfter == GIV(endOfMemory)) { return null; } @@ -43550,7 +43098,7 @@ activeAndDeferredScan(sqInt anEphemeron) && (isObjEphemeron(anEphemeron))), /* begin fetchPointer:ofObject: */ (key = longAt((anEphemeron + BaseHeaderSize) + (0U << (shiftForWord()))))))) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } return pushOnUnscannedEphemeronsStack(anEphemeron); @@ -43645,7 +43193,7 @@ addressCouldBeObj(sqInt address) && ((oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))))); } @@ -43824,7 +43372,6 @@ allInstancesOf(sqInt aClass) usqInt followingWordAddress2; usqInt followingWordAddress21; usqInt followingWordAddress3; - sqInt format; sqInt freeChunk; sqInt i; sqInt i1; @@ -43845,9 +43392,7 @@ allInstancesOf(sqInt aClass) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots131; usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; @@ -43855,7 +43400,9 @@ allInstancesOf(sqInt aClass) usqInt numSlots4; usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; + usqInt numSlots7; sqInt obj; sqInt obj1; sqInt objOop; @@ -43899,7 +43446,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } freeChunk = allocateSlotsInOldSpacebytesformatclassIndex(0, numBytes, 2, ClassArrayCompactIndex); - goto l5; + goto l6; } long64Atput(newObj, (((((usqLong) 0)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); @@ -43907,20 +43454,16 @@ allInstancesOf(sqInt aClass) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; freeChunk = newObj; - l5: /* end allocateSlots:format:classIndex: */; + l6: /* end allocateSlots:format:classIndex: */; return freeChunk; } freeChunk = allocateLargestFreeChunk(); start = freeChunk + BaseHeaderSize; /* begin addressAfter: */ numSlots1 = byteAt(freeChunk + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43960,32 +43503,28 @@ allInstancesOf(sqInt aClass) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l20; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l20: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -43995,8 +43534,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots5 = byteAt(address + 7); - objOop = (numSlots5 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -44020,37 +43559,33 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l17; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop = (numSlots14 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44073,32 +43608,28 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l23; + goto l20; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l23: /* end objectAfter:limit: */; + l20: /* end objectAfter:limit: */; } count = count1; ptr = ptr1; @@ -44143,32 +43674,28 @@ allInstancesOf(sqInt aClass) prevPrevObj11 = prevObj11; prevObj11 = objOop11; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots121 = byteAt(objOop11 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes4 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes4; + followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes21; if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l31; + goto l36; } flag("endianness"); followingWord21 = longAt(followingWordAddress21 + 4); objOop11 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress21 + BaseHeaderSize : followingWordAddress21); - l31: /* end objectAfter:limit: */; + l36: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44178,8 +43705,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots6 = byteAt(address2 + 7); - objOop2 = (numSlots6 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit11 = GIV(pastSpaceStart); @@ -44210,37 +43737,33 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop2 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots14 = byteAt(objOop2 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes11; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit11)) { objOop2 = limit11; - goto l27; + goto l24; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l27: /* end objectAfter:limit: */; + l24: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots15 = byteAt(address11 + 7); - objOop2 = (numSlots15 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop2 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop2, GIV(freeStart))) { @@ -44270,32 +43793,28 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots131 = byteAt(objOop2 + 7); - if (numSlots131 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots41 = numSlots131; - } - if (numSlots41 == 0) { + numSlots111 = byteAt(objOop2 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ - slotBytes21 = ((sqInt) 8); + slotBytes11 = ((sqInt) 8); } else { - slotBytes21 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } - followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes21; + followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { objOop2 = GIV(freeStart); - goto l36; + goto l32; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop2 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l36: /* end objectAfter:limit: */; + l32: /* end objectAfter:limit: */; } /* begin purgeDuplicateClassTableEntriesFor: */ expectedIndex1 = (long32At(aClass + 4)) & (identityHashHalfWordMask()); @@ -44354,7 +43873,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } smallObj = allocateSlotsInOldSpacebytesformatclassIndex(count, numBytes1, 2, ClassArrayCompactIndex); - goto l7; + goto l8; } if (count >= (numSlotsMask())) { @@ -44371,7 +43890,7 @@ allInstancesOf(sqInt aClass) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; smallObj = newObj1; - l7: /* end allocateSlots:format:classIndex: */; + l8: /* end allocateSlots:format:classIndex: */; for (i = 0; i < count; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(smallObj))); @@ -44389,21 +43908,18 @@ allInstancesOf(sqInt aClass) } return smallObj; } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -44439,7 +43955,6 @@ allObjects(void) usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress2; - sqInt format; sqInt freeChunk; usqInt limit; usqInt limit1; @@ -44448,11 +43963,11 @@ allObjects(void) usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; - usqInt numSlots14; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44470,22 +43985,18 @@ allObjects(void) freeChunk = allocateLargestFreeChunk(); ptr = (start = freeChunk + BaseHeaderSize); /* begin addressAfter: */ - numSlots13 = byteAt(freeChunk + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - limit = (freeChunk + BaseHeaderSize) + slotBytes2; + limit = (freeChunk + BaseHeaderSize) + slotBytes; count = 0; /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -44512,32 +44023,28 @@ allObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop1 + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots14; - } + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l16; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l16: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44547,8 +44054,8 @@ allObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -44570,37 +44077,33 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44621,32 +44124,28 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); @@ -44668,21 +44167,18 @@ allObjects(void) } return (((usqInt)count << 1) | 1); } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -44714,10 +44210,10 @@ allObjectsUnmarked(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -44739,14 +44235,14 @@ allObjectsUnmarked(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44754,42 +44250,38 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44797,32 +44289,28 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44833,7 +44321,7 @@ allObjectsUnmarked(void) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44842,32 +44330,28 @@ allObjectsUnmarked(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return 1; } @@ -44895,7 +44379,7 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; assert((long64At(objOop)) != 0); if ((isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()))) - && (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) { + && (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { if (!(isonObjStack(objOop, GIV(weaklingStack)))) { return 0; } @@ -44905,13 +44389,9 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -44922,14 +44402,14 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -44989,7 +44469,6 @@ allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt c if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - /* begin largeObjectBytesForSlots: */ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { @@ -45257,7 +44736,7 @@ allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling) classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) { referent = longAt((aWeakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -45279,7 +44758,7 @@ allUnscannedEphemeronsAreActive(void) key = longAt(((longAt(p)) + BaseHeaderSize) + (0U << (shiftForWord()))); if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -45345,7 +44824,6 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt errCode; sqInt fieldOffset; sqInt fmt; - sqInt format; sqInt hash; sqInt header; sqInt header1; @@ -45363,18 +44841,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt obj21; sqInt objOop; sqInt objOop1; + sqInt objOop11; sqInt objOop2; + sqInt objOop21; sqInt objOop3; sqInt objOop4; - sqInt objOop5; - sqInt objOop6; sqInt oop1; sqInt oop2; sqInt referent; sqInt referent1; + sqInt referent11; sqInt referent2; sqInt referent3; - sqInt referent4; sqInt size; sqInt sp; @@ -45401,20 +44879,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sp = longAt((array1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l35; + goto l27; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array1))); contextSize = (sp >> 1); - l35: /* end fetchStackPointerOf: */; + l27: /* end fetchStackPointerOf: */; fieldOffset = (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l23; } fieldOffset = (((numSlotsOf(array1)) - 1) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l23; } if (fmt < (firstCompiledMethodFormat())) { fieldOffset = 0; - goto l40; + goto l23; } /* begin methodHeaderOf: */ assert(isCompiledMethod(array1)); @@ -45430,7 +44908,7 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop fieldOffset = (((((assert((header & 1)), /* begin literalCountOfAlternateHeader: */ ((header >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize; -l40: /* end lastPointerOf: */; +l23: /* end lastPointerOf: */; /* array1 is known to be the same size as array2 */ effectsFlags = (size = 0); @@ -45441,41 +44919,42 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop1 = referent1; + oop1 = referent3; longAtput(array1 + fieldOffset, oop1); } /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop1 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l34; - goto l27; + goto l32; } - if (((((usqInt) (longAt(oop1))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l34; - goto l27; + goto l32; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop1))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop1))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l34; - goto l27; + goto l32; } - l27: /* end ifOopInvalidForBecome:errorCodeInto: */; + l32: /* end ifOopInvalidForBecome:errorCodeInto: */; effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop1)); oop2 = longAt(array2 + fieldOffset); if (((oop2 & (tagMask())) == 0) @@ -45483,42 +44962,43 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop2 = referent2; + oop2 = referent11; longAtput(array2 + fieldOffset, oop2); } if (twoWayFlag) { /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop2 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l34; - goto l26; + goto l29; } - if (((((usqInt) (longAt(oop2))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l34; - goto l26; + goto l29; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop2))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l34; - goto l26; + goto l29; } - l26: /* end ifOopInvalidForBecome:errorCodeInto: */; + l29: /* end ifOopInvalidForBecome:errorCodeInto: */; size = (size + (bytesInObject(oop1))) + (bytesInObject(oop2)); effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop2)); } @@ -45526,18 +45006,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop if (copyHashFlag && (oop2 & (tagMask()))) { ec = PrimErrInappropriate; - goto l19; + goto l34; } } fieldOffset -= BytesPerOop; } if (size >= (GIV(totalFreeOldSpace) + (GIV(scavengeThreshold) - GIV(freeStart)))) { ec = PrimErrNoMemory; - goto l19; + goto l34; } GIV(becomeEffectsFlags) = effectsFlags; ec = 0; -l19: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; +l34: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; if (ec != 0) { GIV(becomeEffectsFlags) = 0; return ec; @@ -45597,11 +45077,11 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop && ((o1ClassIndex == 0) && (o2ClassIndex == 0))) { inPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); - goto l1; + goto l15; } outOfPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); if (copyHashFlag) { - goto l1; + goto l15; } if (o1ClassIndex != 0) { if (o2ClassIndex != 0) { @@ -45614,13 +45094,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj2 = referent3; + newObj2 = referent2; assert((rawHashBitsOf(newObj2)) == 0); /* begin setHashBitsOf:to: */ assert(((o1ClassIndex >= 0) && (o1ClassIndex <= (identityHashHalfWordMask())))); @@ -45634,20 +45114,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj1 = referent4; + newObj1 = referent1; assert((rawHashBitsOf(newObj1)) == 0); /* begin setHashBitsOf:to: */ assert(((o2ClassIndex >= 0) && (o2ClassIndex <= (identityHashHalfWordMask())))); long32Atput(newObj1 + 4, ((((long32At(newObj1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o2ClassIndex); } } - l1: /* end doBecome:and:copyHash: */; + l15: /* end doBecome:and:copyHash: */; /* begin followField:ofObject: */ objOop = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if (((objOop & (tagMask())) == 0) @@ -45673,31 +45153,30 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop appear in the other array. So the enumeration could encounter an object already becommed earlier in the same enumeration. */ /* begin followField:ofObject: */ - objOop5 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop5 & (tagMask())) == 0) - && (((longAt(objOop5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop5 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop5); + objOop11 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop11); } - obj11 = objOop5; + obj11 = objOop11; /* begin followField:ofObject: */ - objOop6 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop6 & (tagMask())) == 0) - && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop6 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop6); + objOop21 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop21 & (tagMask())) == 0) + && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop21 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop21); } - obj21 = objOop6; + obj21 = objOop21; if (obj11 != obj21) { /* begin doBecome:to:copyHash: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << 23))); + longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -45839,13 +45318,9 @@ byteSizeOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -45940,10 +45415,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45955,8 +45430,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; + usqInt total; ok = 1; + total = 0; for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { if ((GIV(freeLists)[i]) != 0) { if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) == 0) { @@ -45978,8 +45455,8 @@ checkHeapFreeSpaceIntegrity(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46015,37 +45492,33 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -46080,32 +45553,28 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -46155,6 +45624,7 @@ checkHeapFreeSpaceIntegrity(void) } } } + total += bytesInObject(objOop1); } else { for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { @@ -46179,32 +45649,37 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; + } + if (total != GIV(totalFreeOldSpace)) { + print("incorrect totalFreeOldSpace; expected "); + printNum(GIV(totalFreeOldSpace)); + print(" found "); + printNum(total); + /* begin cr */ + printf("\n"); + ok = 0; } return ok; } @@ -46222,7 +45697,7 @@ checkHeapFreeSpaceIntegrity(void) /* SpurMemoryManager>>#checkHeapIntegrity:classIndicesShouldBeValid: */ static sqInt NoDbgRegParms -checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; sqInt address1; @@ -46261,10 +45736,10 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -46303,8 +45778,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46318,8 +45793,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -46394,37 +45869,33 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -46437,8 +45908,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -46513,32 +45984,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -46590,98 +46057,101 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } } else { - containsYoung = 0; - if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { - numRememberedObjectsInHeap += 1; - if (!(isInRememberedSet(objOop1))) { - print("remembered object "); - printHex(objOop1); - print(" is not in remembered table"); - /* begin cr */ - printf("\n"); - ok = 0; - } - } - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in forwarder "); - printHex(objOop1); - print(" to unmapped "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - (oopisLessThan(fieldOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { - containsYoung = 1; - } - } - else { - /* begin classOrNilAtIndex: */ - classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); - assert((classIndex3 <= (tagMask())) - || (classIndex3 >= (arrayClassIndexPun()))); - /* begin fetchPointer:ofObject: */ - fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); - classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); - if (classTablePage2 == GIV(nilObj)) { - classOop = GIV(nilObj); - goto l27; + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { + containsYoung = 0; + if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { + numRememberedObjectsInHeap += 1; + if (!(isInRememberedSet(objOop1))) { + print("remembered object "); + printHex(objOop1); + print(" is not in remembered table"); + /* begin cr */ + printf("\n"); + ok = 0; + } } - /* begin fetchPointer:ofObject: */ - fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); - classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); - l27: /* end classOrNilAtIndex: */; - if (classIndicesShouldBeValid - && ((classOop == GIV(nilObj)) - && (classIndex > (lastClassIndexPun())))) { - print("object leak in "); - printHex(objOop1); - print(" invalid class index "); - printHex(classIndex); - print(" -> "); - print((classOop == null - ? "nil" - : "nilObj")); - /* begin cr */ - printf("\n"); - ok = 0; + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in forwarder "); + printHex(objOop1); + print(" to unmapped "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + (oopisLessThan(fieldOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { + containsYoung = 1; + } } - for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); - if ((fieldOop & (tagMask())) == 0) { - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in "); - printHex(objOop1); - print(" @ "); - printNum(fi); - print(" = "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - (oopisLessThan(fieldOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { - containsYoung = 1; + else { + /* begin classOrNilAtIndex: */ + classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); + assert((classIndex3 <= (tagMask())) + || (classIndex3 >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); + classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); + if (classTablePage2 == GIV(nilObj)) { + classOop = GIV(nilObj); + goto l27; + } + /* begin fetchPointer:ofObject: */ + fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); + classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + l27: /* end classOrNilAtIndex: */; + if (classIndicesShouldBeValid + && ((classOop == GIV(nilObj)) + && (classIndex > (lastClassIndexPun())))) { + print("object leak in "); + printHex(objOop1); + print(" invalid class index "); + printHex(classIndex); + print(" -> "); + print((classOop == null + ? "nil" + : "nilObj")); + /* begin cr */ + printf("\n"); + ok = 0; + } + for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); + if ((fieldOop & (tagMask())) == 0) { + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in "); + printHex(objOop1); + print(" @ "); + printNum(fi); + print(" = "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + (oopisLessThan(fieldOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { + containsYoung = 1; + } } } } - } - if (containsYoung) { - if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { - print("unremembered object "); - printHex(objOop1); - print(" contains young oop(s)"); - /* begin cr */ - printf("\n"); - ok = 0; + if (containsYoung) { + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + print("unremembered object "); + printHex(objOop1); + print(" contains young oop(s)"); + /* begin cr */ + printf("\n"); + ok = 0; + } } } } @@ -46689,32 +46159,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l23; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } if (numRememberedObjectsInHeap != (rememberedSetSize())) { print("root count mismatch. #heap roots "); @@ -46764,7 +46230,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } /* begin objStack:do: */ if (GIV(mournQueue) == GIV(nilObj)) { - goto l9; + goto l14; } eassert(isValidObjStack(GIV(mournQueue))); objStackPage = GIV(mournQueue); @@ -46785,10 +46251,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!(excludeUnmarkedNewSpaceObjs - && ((((obj & (tagMask())) == 0) - && (oopisLessThan(obj, GIV(newSpaceLimit)))) - && (!(((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0))))) { + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { if ((heapMapAtWord(pointerForOop(obj))) == 0) { print("object leak in mournQueue @ "); printNum(i2); @@ -46807,7 +46271,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s /* begin fetchPointer:ofObject: */ objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } -l9: /* end objStack:do: */; +l14: /* end objStack:do: */; for (ri = 1; ri <= GIV(remapBufferCount); ri += 1) { obj = GIV(remapBuffer)[ri]; if ((obj & (BytesPerWord - 1)) != 0) { @@ -46921,7 +46385,7 @@ checkOkayOop(usqInt oop) print(" has some unused header bits set; should be zero"); return 0; } - unusedBitsInYoungObjects = (1U << 0x1F) | ((1U << 30) | (1U << (rememberedBitShift()))); + unusedBitsInYoungObjects = (1U << (greyBitShift())) | ((1U << (pinnedBitShift())) | (1U << (rememberedBitShift()))); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { print("oop "); printHex(oop); @@ -46981,7 +46445,6 @@ checkOopHasOkayClass(usqInt obj) objFormat = ((((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) | 7) - 7); } else { - /* begin formatOf: */ objFormat = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask()); } if ((instSpecOfClassFormat(((longAt((objClass + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) != objFormat) { @@ -47396,13 +46859,9 @@ clearLeakMapAndMapAccessibleFreeSpace(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -47413,14 +46872,14 @@ clearLeakMapAndMapAccessibleFreeSpace(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } } @@ -47442,13 +46901,9 @@ cloneInOldSpaceForPinning(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); newObj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(numSlots, ((numSlots == 0 ? 8 @@ -47543,13 +46998,9 @@ clone(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { /* begin allocateSlotsInOldSpace:format:classIndex: */ @@ -47581,7 +47032,7 @@ clone(sqInt objOop) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, fmt, classIndex1); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -47598,7 +47049,7 @@ clone(sqInt objOop) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l4: /* end allocateSlots:format:classIndex: */; + l5: /* end allocateSlots:format:classIndex: */; } if (!(newObj)) { return 0; @@ -47799,10 +47250,10 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -47825,14 +47276,14 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -47849,42 +47300,38 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -47901,32 +47348,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -47937,7 +47380,7 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop11); @@ -47955,32 +47398,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } print("n marked: "); printNum(nm); @@ -48139,7 +47578,7 @@ doScavenge(sqInt tenuringCriterion) sqInt p; SpurNewSpaceSpace temp; - GIV(scavengeInProgress) = 1; + GIV(gcPhaseInProgress) = ScavengeInProgress; /* begin scavenge: */ GIV(statSurvivorCount) = 0; GIV(tenureCriterion) = tenuringCriterion; @@ -48177,7 +47616,7 @@ doScavenge(sqInt tenuringCriterion) } } } - GIV(scavengeInProgress) = 0; + GIV(gcPhaseInProgress) = 0; } @@ -48482,9 +47921,9 @@ existInstancesInNewSpaceOf(sqInt classObj) usqInt numSlots; usqInt numSlots1; usqInt numSlots11; - usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt obj; sqInt objOop; sqInt objOop1; @@ -48502,8 +47941,8 @@ existInstancesInNewSpaceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -48517,37 +47956,33 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -48560,32 +47995,28 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 0; } @@ -48765,10 +48196,10 @@ findStringBeginningWith(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -48791,8 +48222,8 @@ findStringBeginningWith(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -48816,37 +48247,33 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -48869,32 +48296,28 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -48924,32 +48347,28 @@ findStringBeginningWith(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -48976,10 +48395,10 @@ findString(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -49002,8 +48421,8 @@ findString(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -49024,37 +48443,33 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -49074,32 +48489,28 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -49126,34 +48537,43 @@ findString(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; + } } + + /* SpurMemoryManager>>#fireAllUnscannedEphemerons */ +static void +fireAllUnscannedEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt p; + + assert(!(noUnscannedEphemerons())); + assert(allUnscannedEphemeronsAreActive()); + for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { + fireEphemeron(longAt(p)); } +} /* SpurMemoryManager>>#firstAccessibleObject */ static sqInt @@ -49737,6 +49157,10 @@ freeObject(sqInt objOop) usqLong NeverInline fullGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt index; + sqInt obj; + GIV(needGCFlag) = 0; GIV(gcStartUsecs) = ioUTCMicrosecondsNow(); GIV(statMarkCount) = 0; @@ -49746,10 +49170,38 @@ fullGC(void) assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); markObjects(1); - /* begin freeUnmarkedObjectsAndPrepareFreeSpace */ - freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); - runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin forgetUnmarkedRememberedObjects */ + index = 0; + while (index < GIV(rememberedSetSize)) { + obj = GIV(rememberedSet)[index]; + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { + index += 1; + } + else { + + /* unmarked; remove by overwriting with last element. */ + /* begin setIsRememberedOf:to: */ + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + assert(GIV(rememberedSetSize) >= 0); + doScavenge(MarkOnTenure); + runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin prepareForGlobalSweep */ + GIV(sweepIndex) = 0; + for (i = 0; i < GIV(numSegments); i += 1) { + ((GIV(segments)[i]).containsPinned = 0); + } + setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); compact(); + /* begin attemptToShrink */ + if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) + && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { + GIV(statShrinkMemory) += 1; + shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); + } /* begin setHeapSizeAtPreviousGC */ GIV(heapSizeAtPreviousGC) = (GIV(endOfMemory) - GIV(nilObj)) - GIV(totalFreeOldSpace); assert(validObjStacks()); @@ -49757,12 +49209,6 @@ fullGC(void) assert(isEmptyObjStack(GIV(weaklingStack))); assert(allObjectsUnmarked()); runLeakCheckerFor(GCModeFull); - /* begin attemptToShrink */ - if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) - && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { - GIV(statShrinkMemory) += 1; - shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); - } postGCAction(GCModeFull); GIV(statFullGCs) += 1; GIV(statGCEndUsecs) = ioUTCMicrosecondsNow(); @@ -49789,13 +49235,9 @@ goodContextSize(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); return (numSlots == SmallContextSlots) || (numSlots == LargeContextSlots); } @@ -49981,7 +49423,7 @@ imageSegmentVersion(void) sqInt immutableBitMask(void) { - return 1U << 23; + return 1U << (immutableBitShift()); } #endif /* IMMUTABILITY */ @@ -50075,10 +49517,10 @@ initialInstanceOf(sqInt classObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -50116,8 +49558,8 @@ initialInstanceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -50131,37 +49573,33 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -50174,32 +49612,28 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -50219,20 +49653,16 @@ initialInstanceOf(sqInt classObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -50337,21 +49767,17 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(classTableRoot)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classTableRoot + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(numClassTablePages) = longAt(classTableRoot - BaseHeaderSize); - } - else { - GIV(numClassTablePages) = numSlots1; - } + GIV(numClassTablePages) = (numSlots1 == (numSlotsMask()) + ? longAt(classTableRoot - BaseHeaderSize) + : numSlots1); assert(GIV(numClassTablePages) == ((classTableRootSlots()) + (hiddenRootSlots()))); for (i1 = 2; i1 < GIV(numClassTablePages); i1 += 1) { if ((longAt((classTableRoot + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))))) == nilObjPreSwizzle) { GIV(numClassTablePages) = i1; - goto l11; + goto l8; } } -l11: /* end countNumClassPagesPreSwizzle: */; +l8: /* end countNumClassPagesPreSwizzle: */; if ((bytesToShift != 0) || ((numSegments()) > 1)) { /* begin objectStartingAt: */ @@ -50427,16 +49853,17 @@ initializeObjectMemory(sqInt bytesToShift) flag("endianness"); longAtput(GIV(classTableFirstPage), ((longAt(GIV(classTableFirstPage))) & ((unsigned int)~(classIndexMask()))) + classIndex1); } + /* begin classTableRootSlots */ GIV(numClassTablePages) = 1U << (22 - (classTableMajorIndexShift())); for (i2 = 2; i2 < GIV(numClassTablePages); i2 += 1) { if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))))) == GIV(nilObj)) { GIV(numClassTablePages) = i2; GIV(classTableIndex) = ((sqInt)((usqInt)(((((GIV(numClassTablePages) - 1) < 1) ? 1 : (GIV(numClassTablePages) - 1)))) << (classTableMajorIndexShift()))); - goto l13; + goto l14; } } GIV(classTableIndex) = 1U << (classTableMajorIndexShift()); -l13: /* end setHiddenRootsObj: */; +l14: /* end setHiddenRootsObj: */; GIV(markStack) = swizzleObjStackAt(MarkStackRootIndex); GIV(weaklingStack) = swizzleObjStackAt(WeaklingStackRootIndex); GIV(mournQueue) = swizzleObjStackAt(MournQueueRootIndex); @@ -50504,13 +49931,9 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(obj2)) > (isForwardedObjectClassIndexPun())); numSlots3 = byteAt(obj2 + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(obj2 - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots3; - } + GIV(rememberedSetLimit) = (numSlots3 == (numSlotsMask()) + ? longAt(obj2 - BaseHeaderSize) + : numSlots3); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -50625,7 +50048,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o1HasYoung && ((assert(isNonImmediate(obj1)), oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj1))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -50638,7 +50060,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o2HasYoung && ((assert(isNonImmediate(obj2)), oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj2))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -50740,7 +50161,6 @@ isBytes(sqInt oop) sqInt isCharacterObject(sqInt oop) { - /* begin isImmediateCharacter: */ return (oop & (tagMask())) == (characterTag()); } @@ -50959,7 +50379,6 @@ isIndexable(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); return (fmt >= 2) && ((fmt <= (weakArrayFormat())) @@ -50993,7 +50412,7 @@ isInMemory(sqInt address) && (oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))) { return (oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))); } /* begin isInSegments: */ @@ -51066,7 +50485,8 @@ isObjImmutable(sqInt anOop) { return # if IMMUTABILITY - ((((usqInt) (longAt(anOop))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(anOop))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -51108,7 +50528,7 @@ sqInt isOopImmutable(sqInt oop) { return (oop & (tagMask())) - || (((((usqInt) (longAt(oop))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0); } /* SpurMemoryManager>>#isOopMutable: */ @@ -51116,14 +50536,14 @@ sqInt isOopMutable(sqInt oop) { return ((oop & (tagMask())) == 0) - && (!(((((usqInt) (longAt(oop))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0)); } /* SpurMemoryManager>>#isPinned: */ sqInt isPinned(sqInt objOop) { - return ((((usqInt) (longAt(objOop))) >> 30) & 1) != 0; + return ((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0; } @@ -51298,7 +50718,7 @@ isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx) return 0; } if (GIV(marking) - && (!(((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0))) { + && (!(((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0))) { GIV(objStackInvalidBecause) = "marking but page is unmarked"; GIV(invalidObjStackPage) = objStackPage; return 0; @@ -51427,25 +50847,7 @@ sqInt isWeak(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWeakNonImm(oop)); -} - - -/* Answer if the contains only indexable words or bytes (no oops). See - comment in formatOf: - */ -/* Note: Excludes CompiledMethods. */ - - /* SpurMemoryManager>>#isWordsOrBytesNonImm: */ -static sqInt NoDbgRegParms -isWordsOrBytesNonImm(sqInt objOop) -{ - sqInt format; - - /* begin isPureBitsFormat: */ - format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); - return (format >= (sixtyFourBitIndexableFormat())) - && (format < (firstCompiledMethodFormat())); + && (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -51459,7 +50861,7 @@ sqInt isWordsOrBytes(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)); + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -51590,7 +50992,6 @@ lastPointerOfWhileSwizzling(sqInt objOop) sqInt header; sqInt header1; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -51629,7 +51030,6 @@ lastPointerOf(sqInt objOop) sqInt header1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -51641,11 +51041,11 @@ lastPointerOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l2; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l2: /* end fetchStackPointerOf: */; return (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; } return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize; @@ -51715,13 +51115,9 @@ lengthOfMaybeImmediate(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -51759,13 +51155,9 @@ lengthOf(sqInt objOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -51853,8 +51245,6 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) usqInt followingWordAddress1; usqInt followingWordAddress2; usqInt followingWordAddress3; - sqInt format; - sqInt format1; sqInt hash; sqInt i; sqInt iLimiT; @@ -51865,24 +51255,23 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt numLoadedObjects; usqInt numOutPointers; sqInt numSegObjs; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots10; usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; usqInt numSlots14; usqInt numSlots15; - usqInt numSlots16; usqInt numSlots2; usqInt numSlots21; + usqInt numSlots22; usqInt numSlots3; + usqInt numSlots31; usqInt numSlots4; usqInt numSlots5; usqInt numSlots6; usqInt numSlots7; usqInt numSlots8; - usqInt numSlots9; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -51903,14 +51292,10 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin numSlotsOf: */ assert((classIndexOf(segmentWordArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(segmentWordArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - segmentLimit = longAt(segmentWordArray - BaseHeaderSize); - } - else { - segmentLimit = numSlots1; - } + numSlots = byteAt(segmentWordArray + 7); + segmentLimit = (numSlots == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots); if ((((segmentLimit == 0 ? 8 : (segmentLimit + (segmentLimit & 1)) << (shiftForWord()))) + ((segmentLimit >= (numSlotsMask()) @@ -51927,22 +51312,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots12 = byteAt(segmentWordArray + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots13 = byteAt(segmentWordArray + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes1; + stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes3; addr1 = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr1, stopAddr1)) { long32Atput(addr1, SQ_SWAP_4_BYTES((long32At(addr1)))); @@ -51954,22 +51335,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(segmentWordArray + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes; + stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes2; addr = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr, stopAddr)) { long32Atput(addr, SQ_SWAP_4_BYTES((long32At(addr)))); @@ -51994,53 +51371,49 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } /* begin mapOopsAndValidateClassRefsFrom:to:outPointers: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots8 = byteAt(outPointerArray + 7); - if (numSlots8 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numOutPointers = longAt(outPointerArray - BaseHeaderSize); - } - else { - numOutPointers = numSlots8; - } + numSlots21 = byteAt(outPointerArray + 7); + numOutPointers = (numSlots21 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots21); numSegObjs = 0; /* begin objectStartingAt: */ - numSlots9 = byteAt(segmentStart + 7); - objOop1 = (numSlots9 == (numSlotsMask()) + numSlots31 = byteAt(segmentStart + 7); + objOop1 = (numSlots31 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); while (objOop1 < segmentLimit) { numSegObjs += 1; - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } /* validate the class ref, but don't update it until any internal classes have been added to the class table. */ - classIndex = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); - if (classIndex & TopHashBit) { - if ((classIndex - TopHashBit) >= numOutPointers) { + classIndex1 = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); + if (classIndex1 & TopHashBit) { + if ((classIndex1 - TopHashBit) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } /* begin fetchPointer:ofObject: */ - mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex - TopHashBit)) << (shiftForWord()))))); + mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex1 - TopHashBit)) << (shiftForWord()))))); hash = (long32At(mappedOop + 4)) & (identityHashHalfWordMask()); if (!((hash > (lastClassIndexPun())) && ((classOrNilAtIndex(hash)) == mappedOop))) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } } else { /* The class is contained within the segment. */ - if (((oop1 = (classIndex * 8) + segmentStart)) >= segmentLimit) { + if (((oop1 = (classIndex1 * 8) + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } if (((long32At(oop1 + 4)) & (identityHashHalfWordMask())) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } } for (i = 0, iLimiT = ((numPointerSlotsOf(objOop1)) - 1); i <= iLimiT; i += 1) { @@ -52050,7 +51423,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) if (oop1 & TopOopBit) { if (((oop1 = (oop1 - TopOopBit) / BytesPerOop)) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } /* begin fetchPointer:ofObject: */ mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(oop1) << (shiftForWord()))))); @@ -52058,11 +51431,11 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) else { if ((oop1 & (8 - 1)) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } if (((mappedOop = oop1 + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } } assert(!(isOopForwarded(objOop1))); @@ -52070,35 +51443,31 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } } /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots14 = byteAt(objOop1 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { objOop1 = segmentLimit; - goto l9; + goto l22; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l9: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } errorCode = -numSegObjs; -l11: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; +l31: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; if (errorCode > 0) { return errorCode; } @@ -52122,7 +51491,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) forceInterruptCheck(); } loadedObjectsArray = allocateSlotsInOldSpacebytesformatclassIndex(numLoadedObjects, numBytes, 2, ClassArrayCompactIndex); - goto l13; + goto l14; } if (numLoadedObjects >= (numSlotsMask())) { @@ -52139,7 +51508,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; loadedObjectsArray = newObj; -l13: /* end allocateSlots:format:classIndex: */; +l14: /* end allocateSlots:format:classIndex: */; if (!(loadedObjectsArray)) { return PrimErrNoMemory; } @@ -52155,72 +51524,64 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) while (objOop < oop) { expungeFromClassTable(objOop); /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots6 = numSlots14; - } - if (numSlots6 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots3 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segmentLimit)) { objOop = segmentLimit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } errorCode = errorCode1; - goto l5; + goto l12; } /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots7 = numSlots15; - } - if (numSlots7 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes4; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, segmentLimit)) { objOop = segmentLimit; - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } errorCode = 0; -l5: /* end enterClassesIntoClassTableFrom:to: */; +l12: /* end enterClassesIntoClassTableFrom:to: */; if (errorCode != 0) { return errorCode; } /* begin assignClassIndicesAndPinFrom:to:outPointers:filling: */ - numSlots10 = byteAt(segmentStart + 7); - objOop2 = (numSlots10 == (numSlotsMask()) + numSlots22 = byteAt(segmentStart + 7); + objOop2 = (numSlots22 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); fillIdx = 0; @@ -52249,22 +51610,21 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~(classIndexMask()))) + classIndex2); if (((oopisLessThan(objOop2, GIV(newSpaceLimit))) && (oopisGreaterThanOrEqualTo(objOop2, GIV(newSpaceStart)))) - && (((((usqInt) (longAt(objOop2))) >> 30) & 1) != 0)) { + && (((((usqInt) (longAt(objOop2))) >> (pinnedBitShift())) & 1) != 0)) { oldClone = cloneInOldSpaceForPinning(objOop2); if (oldClone != 0) { /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex11 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex11 >= 0) && (classIndex11 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << 23))); + longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -52290,53 +51650,47 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } } /* begin objectAfter:limit: */ - numSlots16 = byteAt(objOop2 + 7); - if (numSlots16 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots21 = numSlots16; - } - if (numSlots21 == 0) { + numSlots15 = byteAt(objOop2 + 7); + numSlots8 = (numSlots15 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots15); + if (numSlots8 == 0) { /* begin allocationUnit */ slotBytes5 = ((sqInt) 8); } else { - slotBytes5 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes5 = (numSlots8 + (numSlots8 & 1)) << (shiftForWord()); } followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { objOop2 = segmentLimit; - goto l35; + goto l33; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l35: /* end objectAfter:limit: */; + l33: /* end objectAfter:limit: */; } if ((byteAt(segmentWordArray + 7)) == (numSlotsMask())) { /* begin rawOverflowSlotsOf:put: */ - numSlots = 8 / BytesPerOop; - longAtput(segmentWordArray - BaseHeaderSize, numSlots); + longAtput(segmentWordArray - BaseHeaderSize, 8 / BytesPerOop); } else { /* begin rawNumSlotsOf:put: */ byteAtput(segmentWordArray + 7, 8 / BytesPerOop); } /* begin forward:to: */ - classIndex1 = isForwardedObjectClassIndexPun(); - format = 7; - assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + classIndex = isForwardedObjectClassIndexPun(); + assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << 23))); + longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -52361,8 +51715,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } runLeakCheckerFor(GCModeImageSegment); /* begin objectStartingAt: */ - numSlots2 = byteAt(segmentStart + 7); - return (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(segmentStart + 7); + return (numSlots4 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); } @@ -52406,10 +51760,10 @@ longPrintInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -52438,32 +51792,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -52473,8 +51823,8 @@ longPrintInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -52488,37 +51838,33 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -52531,32 +51877,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -52583,11 +51925,11 @@ longPrintReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -52611,8 +51953,8 @@ longPrintReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -52621,7 +51963,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52631,13 +51973,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52661,37 +51999,33 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -52699,7 +52033,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52709,13 +52043,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52739,32 +52069,28 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -52778,7 +52104,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart; + i = (literalCountOf(objOop11)) + LiteralStart; } else { if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52788,13 +52114,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52819,14 +52141,10 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -52922,11 +52240,11 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe sqInt hash2; sqInt i; sqInt iLimiT; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots11; - usqInt numSlots2; + sqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt objOop; sqInt oop; sqInt outIndex; @@ -52939,27 +52257,23 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe outIndex = 0; /* begin fillObj:numSlots:with: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(outPointerArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(outPointerArray - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(outPointerArray))); - for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { + numSlots4 = byteAt(outPointerArray + 7); + numSlots2 = (numSlots4 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots4); + assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1, addressAfter(outPointerArray))); + for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1))); p += 8) { longAtput(p, GIV(nilObj)); longAtput(p + 4, GIV(nilObj)); } /* begin objectStartingAt: */ - numSlots2 = byteAt(segStart + 7); - objOop = (numSlots2 == (numSlotsMask()) + numSlots3 = byteAt(segStart + 7); + objOop = (numSlots3 == (numSlotsMask()) ? segStart + BaseHeaderSize : segStart); while (objOop < segAddr) { oop = fetchClassOfNonImm(objOop); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -52967,7 +52281,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l7; + goto l11; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -52993,7 +52307,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1); setIsMarkedOfto(oop, 1); outIndex += 1; - l7: /* end newOutPointer:at:in:hashes: */; + l11: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -53010,7 +52324,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* begin fetchPointer:ofObject: */ oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -53018,7 +52332,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l9; + goto l14; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -53044,7 +52358,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2); setIsMarkedOfto(oop, 1); outIndex += 1; - l9: /* end newOutPointer:at:in:hashes: */; + l14: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -53062,32 +52376,28 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe } } /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segAddr)) { objOop = segAddr; - goto l2; + goto l6; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l2: /* end objectAfter:limit: */; + l6: /* end objectAfter:limit: */; } return outIndex; } @@ -53138,7 +52448,7 @@ markAndTraceClassOf(sqInt objOop) flag("endianness"); longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~(classIndexMask()))) + realClassIndex); } - if (!(((((usqInt) (longAt(classObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(classObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { setIsMarkedOfto(classObj, 1); markAndTraceClassOf(classObj); pushonObjStack(classObj, GIV(markStack)); @@ -53206,25 +52516,8 @@ markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents) void NeverInline markAndTrace(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; - sqInt contextSize; - sqInt field; - sqInt fmt; sqInt format1; - sqInt format11; - sqInt header; - sqInt header1; - sqInt index; - sqInt numLiterals; - usqInt numSlots; - usqInt numSlots1; - sqInt numStrongSlots; - sqInt objOop1; - sqInt objToScan; - sqInt scanLargeObject; - sqInt sp; - numStrongSlots = 0; /* inline markAndShouldScan: */ if (objOop & (tagMask())) { @@ -53232,12 +52525,11 @@ markAndTrace(sqInt objOop) } assert(!(isForwarded(objOop))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { return; } setIsMarkedOfto(objOop, 1); - /* begin formatOf: */ format1 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if ((format1 >= (sixtyFourBitIndexableFormat())) && (format1 < (firstCompiledMethodFormat()))) { @@ -53263,7 +52555,89 @@ markAndTrace(sqInt objOop) } - /* begin markLoopFrom: */ + markLoopFrom(objOop); +} + + +/* Go through the unscanned ephemerons, marking the inactive ones, and + removing them from the unscanned ephemerons. Answer if any inactive + ones were found. We cannot fire the ephemerons until all are found to + be active since scan-marking an inactive ephemeron later in the set may + render a previously-observed active ephemeron as inactive. */ + + /* SpurMemoryManager>>#markInactiveEphemerons */ +static sqInt +markInactiveEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt foundInactive; + sqInt key; + sqInt objOop; + sqInt oop; + usqInt ptr; + + foundInactive = 0; + ptr = (GIV(unscannedEphemerons).start); + while (ptr < ((GIV(unscannedEphemerons).top))) { + /* begin followedKeyOfEphemeron: */ + objOop = (ephemeron = longAt(ptr)); + assert((isNonImmediate(objOop)) + && (isEphemeron(objOop))); + /* begin followOopField:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); + } + key = oop; + if ((key & (tagMask())) + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + + /* Now remove the inactive ephemeron from the set, and scan-mark it. + Scan-marking it may add more ephemerons to the set. */ + foundInactive = 1; + (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); + if (((GIV(unscannedEphemerons).top)) > ptr) { + longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); + } + markAndTrace(ephemeron); + } + else { + ptr += BytesPerOop; + } + } + return foundInactive; +} + + +/* Scan objOop and all objects on the mark stack, until the mark stack is + empty. N.B. When the incremental GC is written this will probably be + refactored as + markLoopFrom: objOop while: aBlock */ +/* Now scan the object, and any remaining objects on the mark stack. */ + + /* SpurMemoryManager>>#markLoopFrom: */ +static void NoDbgRegParms +markLoopFrom(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt contextSize; + sqInt field; + sqInt fmt; + sqInt format1; + sqInt header; + sqInt header1; + sqInt index; + sqInt numLiterals; + usqInt numSlots; + usqInt numSlots1; + sqInt numStrongSlots; + sqInt objOop1; + sqInt objToScan; + sqInt scanLargeObject; + sqInt sp; + + numStrongSlots = 0; /* To avoid overflowing the mark stack when we encounter large objects, we push the obj, then its numStrongSlots, and then index the object from the stack. */ @@ -53281,16 +52655,12 @@ markAndTrace(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objToScan)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objToScan + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objToScan - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objToScan - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (indexablePointersFormat())) { if (((longAt(objToScan)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -53299,16 +52669,16 @@ markAndTrace(sqInt objOop) sp = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l7; + goto l8; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objToScan))); contextSize = (sp >> 1); - l7: /* end fetchStackPointerOf: */; + l8: /* end fetchStackPointerOf: */; numStrongSlots = CtxtTempFrameStart + contextSize; - goto l12; + goto l10; } numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -53316,16 +52686,16 @@ markAndTrace(sqInt objOop) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l12; + goto l10; } } if (fmt == 7) { numStrongSlots = 1; - goto l12; + goto l10; } if (fmt < (firstCompiledMethodFormat())) { numStrongSlots = 0; - goto l12; + goto l10; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objToScan)); @@ -53338,11 +52708,11 @@ markAndTrace(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numStrongSlots = numLiterals + LiteralStart; - l12: /* end numStrongSlotsOfInephemeral: */; + l10: /* end numStrongSlotsOfInephemeral: */; scanLargeObject = numStrongSlots > 64; } if (scanLargeObject) { @@ -53370,14 +52740,13 @@ markAndTrace(sqInt objOop) goto l3; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l3; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -53386,13 +52755,13 @@ markAndTrace(sqInt objOop) } goto l3; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l3; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l3; } @@ -53436,14 +52805,13 @@ markAndTrace(sqInt objOop) goto l4; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l4; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -53452,13 +52820,13 @@ markAndTrace(sqInt objOop) } goto l4; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l4; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l4; } @@ -53477,57 +52845,6 @@ markAndTrace(sqInt objOop) } -/* Go through the unscanned ephemerons, marking the inactive ones, and - removing them from the unscanned ephemerons. Answer if any inactive - ones were found. We cannot fire the ephemerons until all are found to - be active since scan-marking an inactive ephemeron later in the set may - render a previously-observed active ephemeron as inactive. */ - - /* SpurMemoryManager>>#markInactiveEphemerons */ -static sqInt -markInactiveEphemerons(void) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt foundInactive; - sqInt key; - sqInt objOop; - sqInt oop; - usqInt ptr; - - foundInactive = 0; - ptr = (GIV(unscannedEphemerons).start); - while (ptr < ((GIV(unscannedEphemerons).top))) { - /* begin followedKeyOfEphemeron: */ - objOop = (ephemeron = longAt(ptr)); - assert((isNonImmediate(objOop)) - && (isEphemeron(objOop))); - /* begin followOopField:ofObject: */ - oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - if (((oop & (tagMask())) == 0) - && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); - } - key = oop; - if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { - - /* Now remove the inactive ephemeron from the set, and scan-mark it. - Scan-marking it may add more ephemerons to the set. */ - foundInactive = 1; - (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); - if (((GIV(unscannedEphemerons).top)) > ptr) { - longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); - } - markAndTrace(ephemeron); - } - else { - ptr += BytesPerOop; - } - } - return foundInactive; -} - - /* for profiling */ /* Mark all accessible objects. objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged is true if all @@ -53605,9 +52922,9 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } - for (i4 = 0; i4 < GIV(numStackPages); i4 += 1) { + for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { /* begin stackPageAt: */ - thePage = stackPageAtpages(i4, GIV(pages)); + thePage = stackPageAtpages(i1, GIV(pages)); (thePage->trace = StackPageUnreached); } /* begin markAndTraceHiddenRoots */ @@ -53617,20 +52934,20 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((int)((usqInt)(RememberedSetRootIndex) << (shiftForWord()))))), 1); setIsMarkedOfto((assert((firstIndexableField(objectAfter(GIV(trueObj)))) == GIV(freeLists)), objectAfter(GIV(trueObj))), 1); - if (isWeakNonImm(GIV(classTableFirstPage))) { + if (isWeakFormat((((usqInt) (longAt(GIV(classTableFirstPage)))) >> (formatShift())) & (formatMask()))) { markAndTrace(GIV(hiddenRootsObj)); - goto l1; + goto l2; } setIsMarkedOfto(GIV(hiddenRootsObj), 1); markAndTrace(GIV(classTableFirstPage)); for (i2 = 1; i2 < GIV(numClassTablePages); i2 += 1) { setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))), 1); } -l1: /* end markAndTraceHiddenRoots */; +l2: /* end markAndTraceHiddenRoots */; /* begin markAndTraceExtraRoots */ assert(GIV(remapBufferCount) == 0); - for (i = 1; i <= GIV(extraRootCount); i += 1) { - oop = (GIV(extraRoots)[i])[0]; + for (i4 = 1; i4 <= GIV(extraRootCount); i4 += 1) { + oop = (GIV(extraRoots)[i4])[0]; if (!((oop & (tagMask())) || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { markAndTrace(oop); @@ -53748,13 +53065,13 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) markWeaklingsAndMarkAndFireEphemerons(); assert(validObjStacks()); /* begin expungeDuplicateAndUnmarkedClasses: */ - for (i1 = 1; i1 < GIV(numClassTablePages); i1 += 1) { + for (i = 1; i < GIV(numClassTablePages); i += 1) { /* Avoid expunging the puns by not scanning the 0th page. */ - classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) { classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord()))))); - classIndex = (((sqInt)((usqInt)(i1) << (classTableMajorIndexShift())))) + j; + classIndex = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j; assert((classOrNil == GIV(nilObj)) || (addressCouldBeClassObj(classOrNil))); if (classOrNil == GIV(nilObj)) { @@ -53764,7 +53081,7 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) } else { if ((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged - && (!(((((usqInt) (longAt(classOrNil + 4))) >> 23) & 1) != 0))) + && (!(((((usqInt) (longAt(classOrNil + 4))) >> (markedBitHalfShift())) & 1) != 0))) || (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) != classIndex)) { assert(!(isOopForwarded(classTablePage))); longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj)); @@ -53798,7 +53115,6 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt classFormat; sqInt ephemeron; sqInt field; - sqInt format; sqInt i; sqInt i1; sqInt iLimiT; @@ -53809,11 +53125,9 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt numToEnumerateOnThisPage; sqInt numTracedWeaklings; sqInt objOop; - sqInt objStack; sqInt objStackPage; sqInt oop; sqInt oop1; - sqInt p; sqInt size; sqInt topIndex; sqInt weakling; @@ -53824,12 +53138,11 @@ markWeaklingsAndMarkAndFireEphemerons(void) markAndTraceMachineCodeOfMarkedMethods(); do { /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -53837,7 +53150,7 @@ markWeaklingsAndMarkAndFireEphemerons(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size - numTracedWeaklings; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); @@ -53862,7 +53175,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += } field = oop; if (!((field & (tagMask())) - || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0))) { markAndTrace(field); } } @@ -53882,21 +53195,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += return; } if (!(markInactiveEphemerons())) { - /* begin fireAllUnscannedEphemerons */ - assert(!(noUnscannedEphemerons())); - assert(allUnscannedEphemeronsAreActive()); - for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { - /* begin fireEphemeron: */ - queueMourner(longAt(p)); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(longAt(p), ((longAt(longAt(p))) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - } + fireAllUnscannedEphemerons(); } /* begin markAllUnscannedEphemerons */ assert(!(noUnscannedEphemerons())); @@ -53908,7 +53207,6 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += longAtput((GIV(unscannedEphemerons).start), longAt(lastptr)); } (GIV(unscannedEphemerons).top = lastptr); - /* begin followedKeyOfMaybeFiredEphemeron: */ assert((isNonImmediate(ephemeron)) && (isMaybeFiredEphemeron(ephemeron))); /* begin followOopField:ofObject: */ @@ -53918,6 +53216,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += oop1 = fixFollowedFieldofObjectwithInitialValue(0, ephemeron, oop1); } key = oop1; + setIsMarkedOfto(ephemeron, 0); markAndTrace(key); markAndTrace(ephemeron); @@ -53967,20 +53266,6 @@ newSpaceIsEmpty(void) && (GIV(pastSpaceStart) == (((pastSpace()).start))); } - -/* Answer the next free free chunk using the xor trick to use only one field, - see e.g. - The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 - `Circular Lists', exercise. 18 - http://en.wikipedia.org/wiki/XOR_linked_list. */ - - /* SpurMemoryManager>>#nextInSortedFreeListLink:given: */ -usqInt -nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) -{ - return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); -} - /* SpurMemoryManager>>#nilObject */ sqInt nilObject(void) @@ -54006,7 +53291,6 @@ nilUnmarkedWeaklingSlots(void) sqInt numOnThisPage; sqInt numToEnumerate; sqInt numToEnumerateOnThisPage; - sqInt objStack; sqInt objStackPage; sqInt referent; sqInt size; @@ -54018,12 +53302,11 @@ nilUnmarkedWeaklingSlots(void) return; } /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -54031,30 +53314,30 @@ nilUnmarkedWeaklingSlots(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage); topIndex = (numOnThisPage + ObjStackFixedSlots) - 1; - for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) { - assert(isWeak(fetchPointerofObject(i1, objStackPage))); - weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + for (i = topIndex; i >= ((topIndex - numToEnumerateOnThisPage) + 1); i += -1) { + assert(isWeak(fetchPointerofObject(i, objStackPage))); + weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); /* begin nilUnmarkedWeaklingSlotsIn: */ anyUnmarked1 = 0; assert(allStrongSlotsOfWeaklingAreMarked(weakling)); - for (i = ((assert((formatOf(weakling)) == (weakArrayFormat())), -fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i <= iLimiT; i += 1) { + for (i1 = ((assert((formatOf(weakling)) == (weakArrayFormat())), +fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i1 <= iLimiT; i1 += 1) { /* begin fetchPointer:ofObject: */ - referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { if (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - referent = fixFollowedFieldofObjectwithInitialValue(i, weakling, referent); + referent = fixFollowedFieldofObjectwithInitialValue(i1, weakling, referent); } if (!((referent & (tagMask())) - || (((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0))) { assert(!(isOopForwarded(weakling))); - longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); + longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); anyUnmarked1 = 1; } @@ -54066,13 +53349,7 @@ fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakli /* fireFinalization: could grow the mournQueue and if so, additional pages must be marked to avoid being GC'ed. */ assert(GIV(marking)); - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakling); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakling); } } @@ -54198,13 +53475,9 @@ noInlineObjectAfterlimit(sqInt objOop, sqInt limit) /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -54248,7 +53521,6 @@ numBytesOfBytes(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt >= (firstByteFormat())); return ((numSlotsOf(objOop)) << (shiftForWord())) - (fmt & 7); @@ -54266,18 +53538,13 @@ numBytesOf(sqInt objOop) usqInt numBytes; usqInt numSlots; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(objOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -54311,10 +53578,10 @@ numberOfForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -54342,32 +53609,28 @@ numberOfForwarders(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -54377,8 +53640,8 @@ numberOfForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -54390,37 +53653,33 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -54431,32 +53690,28 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return n; } @@ -54477,7 +53732,6 @@ numPointerSlotsOf(sqInt objOop) usqInt numSlots; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -54488,19 +53742,18 @@ numPointerSlotsOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l4; + goto l3; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l4: /* end fetchStackPointerOf: */; + l3: /* end fetchStackPointerOf: */; return CtxtTempFrameStart + contextSize; } /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } if (fmt == 7) { @@ -54520,9 +53773,9 @@ numPointerSlotsOf(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -54539,8 +53792,7 @@ numSlotsOfAny(sqInt objOop) numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -54554,8 +53806,7 @@ numSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -54579,7 +53830,6 @@ numStrongSlotsOfInephemeral(sqInt objOop) sqInt objOop1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert((fmt != (ephemeronFormat())) || (isMarked(keyOfEphemeron(objOop)))); @@ -54587,13 +53837,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { return numSlots; } @@ -54604,11 +53850,11 @@ numStrongSlotsOfInephemeral(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l4; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l4: /* end fetchStackPointerOf: */; return CtxtTempFrameStart + contextSize; } return numSlots; @@ -54638,9 +53884,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -54701,13 +53947,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart))) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -54728,13 +53970,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((pastSpace()).start), GIV(pastSpaceStart))) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -54756,13 +53994,9 @@ objectAfter(sqInt objOop) limit = futureSurvivorStart(); /* begin addressAfter: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -54782,13 +54016,9 @@ objectAfter(sqInt objOop) } /* begin objectAfter:limit: */ numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } + numSlots4 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); @@ -54824,10 +54054,10 @@ objectBefore(sqInt objOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop1; sqInt objOop2; @@ -54850,8 +54080,8 @@ objectBefore(sqInt objOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -54864,37 +54094,33 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -54906,32 +54132,28 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return prev; } @@ -54951,32 +54173,28 @@ objectBefore(sqInt objOop) prevPrevObj1 = prevObj1; prevObj1 = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop2 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop2 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop2 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return prev; } @@ -54999,6 +54217,335 @@ objectStartingAt(sqInt address) } +/* This is part of storeImageSegmentInto:outPointers:roots:. + Answer an Array of all the objects only reachable from the argument, an + Array of root objects, + starting with arrayOfRoots. If there is no space, answer a SmallInteger + whose value is the + number of slots required. This is used to collect the objects to include + in an image segment + on Spur, separate from creating the segment, hence simplifying the + implementation. Thanks to Igor Stasenko for this idea. */ + + /* SpurMemoryManager>>#objectsReachableFromRoots: */ +static sqInt NoDbgRegParms +objectsReachableFromRoots(sqInt arrayOfRoots) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt count; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt freeChunk; + sqInt i; + sqInt i1; + sqInt iLimiT; + sqInt iLimiT1; + usqInt limit; + usqInt limit1; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots13; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + usqInt numSlots6; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oop; + sqInt oop1; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + sqInt ptr; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + usqInt slotBytes3; + sqInt start; + + assert(isArray(arrayOfRoots)); + assert(allObjectsUnmarked()); + /* begin markObjectsIn: */ + setIsMarkedOfto(arrayOfRoots, 1); + for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { + /* begin followField:ofObject: */ + objOop1 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop1); + } + oop1 = objOop1; + if ((oop1 & (tagMask())) == 0) { + setIsMarkedOfto(oop1, 1); + } + } + markObjects(0); + assert(isEmptyObjStack(GIV(markStack))); + assert(isEmptyObjStack(GIV(weaklingStack))); + assert(noUnscannedEphemerons()); + freeChunk = allocateLargestFreeChunk(); + ptr = (start = freeChunk + BaseHeaderSize); + /* begin addressAfter: */ + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + limit = (freeChunk + BaseHeaderSize) + slotBytes; + + /* First put the arrayOfRoots; order is important. */ + count = 0; + count += 1; + if (ptr < limit) { + longAtput(ptr, arrayOfRoots); + ptr += BytesPerOop; + } + for (i = 0, iLimiT = ((numSlotsOf(arrayOfRoots)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if ((oop & (tagMask())) == 0) { + pushonObjStack(oop, GIV(markStack)); + } + } + while (!(isEmptyObjStack(GIV(markStack)))) { + objOop = popObjStack(GIV(markStack)); + count += 1; + if (ptr < limit) { + longAtput(ptr, objOop); + ptr += BytesPerOop; + } + oop = fetchClassOfNonImm(objOop); + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + if ((((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((((longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(objOop))))) { + + /* widow now, before the loop */ + for (i = 0, iLimiT = ((numSlotsOfMarriedContext(objOop)) - 1); i <= iLimiT; i += 1) { + oop = fetchPointerofMarriedContext(i, objOop); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + else { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + } + /* begin unmarkAllObjects */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop11, 0); + } + else { + if (!(((longAt(objOop11)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop11, 0); + } + } + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + /* begin allNewSpaceEntitiesDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit1 = GIV(pastSpaceStart); + while (oopisLessThan(objOop2, limit1)) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots13 = byteAt(objOop2 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); + } + else { + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { + objOop2 = limit1; + goto l16; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l16: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop2 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + + /* Now try and allocate the result */ + GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); + if ((count > ((ptr - start) / BytesPerOop)) + || ((limit != ptr) + && ((limit - ptr) <= 8))) { + + /* can't split a single word */ + freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) + ? freeChunk - BaseHeaderSize + : freeChunk)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + return (((usqInt)count << 1) | 1); + } + /* begin setFormatOf:to: */ + assert(((2 >= 0) && (2 <= (formatMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (2U << (formatShift()))); + /* begin setClassIndexOf:to: */ + assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); + shortentoIndexableSize(freeChunk, count); + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { + remember(freeChunk); + } + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + runLeakCheckerFor(GCModeImageSegment); + return freeChunk; +} + + /* This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code @@ -55050,7 +54597,6 @@ okayOop(sqInt signedOop) error("oop header has overflow header word, but overflow word does not have a saturated numSlots field"); return 0; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if ((fmt == 6) || (fmt == 8)) { error("oop has an unknown format type"); @@ -55065,7 +54611,7 @@ okayOop(sqInt signedOop) error("some unused header bits are set; should be zero"); return 0; } - unusedBitsInYoungObjects = ((1U << 0x1F) | (1U << 30)) | (1U << (rememberedBitShift())); + unusedBitsInYoungObjects = ((1U << (greyBitShift())) | (1U << (pinnedBitShift()))) | (1U << (rememberedBitShift())); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { error("some header bits unused in young objects are set; should be zero"); return 0; @@ -55087,8 +54633,6 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) sqInt classIndex1; sqInt clone1; sqInt clone2; - sqInt format; - sqInt format1; sqInt hash; sqInt hash1; sqInt hash2; @@ -55122,15 +54666,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << 23))); + longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55155,15 +54698,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << 23))); + longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55206,7 +54748,6 @@ sqInt pinObject(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt format; sqInt i; sqInt oldClone; sqInt referent; @@ -55227,12 +54768,12 @@ pinObject(sqInt objOop) l1: /* end segmentContainingObj: */; if ((seg->containsPinned)) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); return objOop; } if (!(someSegmentContainsPinned())) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); (seg->containsPinned = 1); return objOop; } @@ -55241,18 +54782,17 @@ pinObject(sqInt objOop) if (oldClone != 0) { GIV(becomeEffectsFlags) = becomeEffectFlagsFor(objOop); /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 23))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55499,10 +55039,10 @@ printActivationsOf(sqInt aMethodObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -55524,8 +55064,8 @@ printActivationsOf(sqInt aMethodObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -55547,37 +55087,33 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -55598,32 +55134,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -55651,32 +55183,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -55703,10 +55231,10 @@ printContextReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -55728,8 +55256,8 @@ printContextReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -55758,90 +55286,82 @@ printContextReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { - /* begin allocationUnit */ - slotBytes = ((sqInt) 8); - } - else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l1: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop1)); - if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { - i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); - while (((i -= 1)) >= 0) { - if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { - printHex(objOop1); - print(" @ "); - printNum(i); - /* begin space */ - putchar(' '); - printOopShort(objOop1); - print(" pc "); - printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); - /* begin cr */ - printf("\n"); - i = 0; - } - } - } - - - prevPrevObj = prevObj; - prevObj = objOop1; - /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); } else { - numSlots3 = numSlots12; + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - if (numSlots3 == 0) { + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { + i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); + while (((i -= 1)) >= 0) { + if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { + printHex(objOop1); + print(" @ "); + printNum(i); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + print(" pc "); + printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); + /* begin cr */ + printf("\n"); + i = 0; + } + } + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -55876,35 +55396,92 @@ printContextReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#printEntity: */ +void +printEntity(sqInt oop) +{ + sqInt isObj; + sqInt n; + + isObj = 0; + printHex(oop); + /* begin space */ + putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + return; + } + print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) + ? "free" + : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) + ? "bridge" + : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 + ? "forwarder" + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } + /* begin cr */ + printf("\n"); +} + /* SpurMemoryManager>>#printForwarders */ void printForwarders(void) @@ -55922,10 +55499,10 @@ printForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -55940,46 +55517,42 @@ printForwarders(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop2 = GIV(nilObj); + objOop1 = GIV(nilObj); while (1) { - assert((objOop2 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break; - assert((long64At(objOop2)) != 0); - if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop2); + assert((objOop1 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; + assert((long64At(objOop1)) != 0); + if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop1); /* begin cr */ printf("\n"); } prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop2 = GIV(endOfMemory); - goto l3; + objOop1 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -55989,90 +55562,82 @@ printForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, limit)) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop2 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; + objOop2 = limit; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l2; + objOop2 = GIV(freeStart); + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -56098,10 +55663,10 @@ printFreeChunks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -56123,8 +55688,8 @@ printFreeChunks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -56143,37 +55708,33 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -56191,32 +55752,28 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -56234,32 +55791,28 @@ printFreeChunks(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -56419,13 +55972,9 @@ printHeaderOf(sqInt objOop) print(" hdr16 slotf "); /* begin printHexnp: */ numSlots = byteAt((objOop - 8) + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n = longAt((objOop - 8) - BaseHeaderSize); - } - else { - n = numSlots; - } + n = (numSlots == (numSlotsMask()) + ? longAt((objOop - 8) - BaseHeaderSize) + : numSlots); printf("0x%lx", ((unsigned long) n)); print(" slotc "); /* begin printHexnp: */ @@ -56437,29 +55986,25 @@ printHeaderOf(sqInt objOop) print(" hdr8 slots "); /* begin printHexnp: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n1 = longAt(objOop - BaseHeaderSize); - } - else { - n1 = numSlots1; - } + n1 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); printf("0x%lx", ((unsigned long) n1)); } /* begin space */ putchar(' '); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'M' : 'm'); putchar(aByte); /* begin printChar: */ - aByte1 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte1 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'G' : 'g'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'P' : 'p'); putchar(aByte2); @@ -56469,7 +56014,7 @@ printHeaderOf(sqInt objOop) : 'r'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'I' : 'i'); putchar(aByte4); @@ -56503,7 +56048,7 @@ printHeaderTypeOf(sqInt objOop) ? " hdr16 " : " hdr8 ")); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'i' : '.'); putchar(aByte); @@ -56513,17 +56058,17 @@ printHeaderTypeOf(sqInt objOop) : '.'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'p' : '.'); putchar(aByte2); /* begin printChar: */ - aByte3 = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte3 = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'm' : '.'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'g' : '.'); putchar(aByte4); @@ -56568,10 +56113,10 @@ printInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -56600,32 +56145,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -56635,8 +56176,8 @@ printInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -56650,37 +56191,33 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -56693,32 +56230,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -56772,6 +56305,191 @@ printInvalidClassTableEntries(void) } +/* Scan the heap printing the oops of any and all methods that implement + anOop + */ + + /* SpurMemoryManager>>#printMethodImplementorsOf: */ +void +printMethodImplementorsOf(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + /* begin allObjectsDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == anOop)) { + printHex(objOop11); + /* begin space */ + putchar(' '); + printOopShort(objOop11); + /* begin cr */ + printf("\n"); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + } + + /* Scan the heap printing the oops of any and all methods that refer to anOop */ /* SpurMemoryManager>>#printMethodReferencesTo: */ @@ -56792,10 +56510,10 @@ printMethodReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -56817,15 +56535,15 @@ printMethodReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -56845,43 +56563,39 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -56901,32 +56615,28 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -56938,7 +56648,7 @@ printMethodReferencesTo(sqInt anOop) assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart) - 1; + i = ((literalCountOf(objOop11)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -56959,32 +56669,28 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -57031,10 +56737,10 @@ printObjectsWithHash(sqInt hash) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -57063,32 +56769,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -57098,8 +56800,8 @@ printObjectsWithHash(sqInt hash) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -57113,37 +56815,33 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -57156,32 +56854,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -57268,7 +56962,7 @@ printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType) printNum(longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackMyx) << (shiftForWord())))))); print(" ("); printNum(myx); - print((((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0 + print((((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0 ? ") mkd" : ") unmkd")); /* begin cr */ @@ -57293,7 +56987,9 @@ printObjStack(sqInt objStack) void printOopsFromto(sqInt startAddress, sqInt endAddress) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt isObj; sqInt limit; + sqInt n; sqInt oop; oop = objectBefore(startAddress); @@ -57304,20 +57000,60 @@ printOopsFromto(sqInt startAddress, sqInt endAddress) ? startAddress : oop)); while (oopisLessThan(oop, limit)) { + /* begin printEntity: */ + isObj = 0; printHex(oop); - print("/"); - printNum(oop); /* begin space */ putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + goto l1; + } print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) ? "free" : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) ? "bridge" : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 ? "forwarder" - : "object")))); + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } /* begin cr */ printf("\n"); + l1: /* end printEntity: */; oop = objectAfter(oop); } } @@ -57348,11 +57084,11 @@ printReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -57375,8 +57111,8 @@ printReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -57404,13 +57140,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); goto l20; } if (fmt == 7) { @@ -57432,9 +57164,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l20: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57455,37 +57187,33 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l12; + goto l15; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l12: /* end objectAfter:limit: */; + l15: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -57512,13 +57240,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); goto l22; } if (fmt == 7) { @@ -57540,9 +57264,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l22: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57563,32 +57287,28 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l15; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l15: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -57621,13 +57341,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); goto l24; } if (fmt == 7) { @@ -57649,9 +57365,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l24: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57673,14 +57389,10 @@ printReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -57691,14 +57403,14 @@ printReferencesTo(sqInt anOop) followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l17; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l17: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -57791,46 +57503,6 @@ rawHashBitsOf(sqInt objOop) } -/* Scavenge or simply follow objOop. Answer the new location of objOop. - The send should have been guarded by a send of shouldRemapOop:. - The method is called remapObj: for compatibility with ObjectMemory. */ - - /* SpurMemoryManager>>#remapObj: */ -sqInt -remapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt referent; - sqInt resolvedObj; - - assert(shouldRemapOop(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(objOop)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - resolvedObj = referent; - } - else { - assert(!((isInFutureSpace(objOop)))); - resolvedObj = objOop; - } - if (GIV(scavengeInProgress) - && ((((resolvedObj & (tagMask())) == 0) - && ((assert(isNonImmediate(resolvedObj)), - (oopisLessThan(resolvedObj, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(resolvedObj, GIV(newSpaceStart)))))) - && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { - return copyAndForward(resolvedObj); - } - return resolvedObj; -} - - /* Remove the given variable location to the extra roots table. */ /* SpurMemoryManager>>#removeGCRoot: */ @@ -57902,7 +57574,7 @@ runLeakCheckerForFreeSpace(sqInt gcModes) static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -57912,18 +57584,18 @@ runLeakCheckerFor(sqInt gcModes) } clearLeakMapAndMapAccessibleObjects(); asserta(checkHeapIntegrityclassIndicesShouldBeValid(0, 1)); - asserta(checkInterpreterIntegrity()); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } return; } - /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ static void NoDbgRegParms -runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -57932,8 +57604,8 @@ runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcMo reverseDisplayFromto(8, 15); } clearLeakMapAndMapAccessibleObjects(); - asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedNewSpaceObjs, classIndicesShouldBeValid)); - asserta(checkInterpreterIntegrity()); + asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedObjs, classIndicesShouldBeValid)); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } @@ -58133,7 +57805,6 @@ shortentoIndexableSize(sqInt objOop, sqInt indexableSize) } bytesBefore = bytesInObject(objOop); if ((byteAt(objOop + 7)) == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ longAtput(objOop - BaseHeaderSize, numSlots); } else { @@ -58191,26 +57862,6 @@ shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress) } -/* Answer if the obj should be scavenged (or simply followed). The method is - called shouldRemapObj: for compatibility with ObjectMemory. We test for - being already - scavenged because mapStackPages via mapInterpreterOops may be applied - twice in the context of a global GC where a scavenge, followed by a - scan-mark-free, and - final compaction passes may result in scvenged fields being visited twice. */ - - /* SpurMemoryManager>>#shouldRemapObj: */ -sqInt -shouldRemapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) - || (((assert(isNonImmediate(objOop)), - (oopisLessThan(objOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart))))) - && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); -} - - /* Answer if the oop should be scavenged.. The method is called shouldRemapOop: for compatibility with ObjectMemory. */ @@ -58271,13 +57922,9 @@ slotSizeOf(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -58369,35 +58016,18 @@ storeCheckBoundary(void) static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt address; - sqInt address1; sqInt arrayOfObjects; sqInt classIndex; sqInt classIndex1; - sqInt count; usqInt endSeg; sqInt fillValue; - sqInt followingWord; - sqInt followingWord1; - sqInt followingWord2; - usqInt followingWordAddress; - usqInt followingWordAddress1; - usqInt followingWordAddress2; - sqInt format; sqInt formatField; sqInt formatField1; - sqInt freeChunk; sqInt hash; sqInt here; sqInt hereLimiT; sqInt i; - sqInt i1; - sqInt i2; sqInt iLimiT; - sqInt iLimiT1; - sqInt iLimiT2; - usqInt limit; - usqInt limit1; usqInt newObj; usqInt newObj1; sqInt newSegAddrOrError; @@ -58408,360 +58038,46 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr sqInt numSlots; sqInt numSlots1; usqInt numSlots11; - usqInt numSlots111; - usqInt numSlots12; - usqInt numSlots121; - usqInt numSlots13; - usqInt numSlots14; - sqInt numSlots2; - usqInt numSlots21; + usqInt numSlots2; sqInt numSlots3; - usqInt numSlots31; - usqInt numSlots4; - usqInt numSlots41; + sqInt numSlots4; usqInt numSlots5; usqInt numSlots6; - usqInt numSlots7; - usqInt numSlots8; - sqInt obj; sqInt objOop; sqInt objOop1; - sqInt objOop11; - sqInt objOop12; - sqInt objOop2; - sqInt objOop3; - sqInt oop; - sqInt oop1; sqInt outIndex; usqInt p; usqInt p1; - sqInt prevObj; - sqInt prevObj1; - sqInt prevPrevObj; - sqInt prevPrevObj1; - sqInt ptr; sqInt savedInHashes; sqInt savedOutHashes; sqInt segAddr; sqInt segStart; usqInt slotBytes; - usqInt slotBytes1; - usqInt slotBytes11; - usqInt slotBytes2; - usqInt slotBytes3; - sqInt start; sqInt tempObjOop; sqInt there; sqInt valueWord; runLeakCheckerFor(GCModeImageSegment); - /* begin objectsReachableFromRoots: */ - assert(isArray(arrayOfRoots)); - assert(allObjectsUnmarked()); - /* begin markObjectsIn: */ - setIsMarkedOfto(arrayOfRoots, 1); - for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { - /* begin followField:ofObject: */ - objOop11 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop11); - } - oop1 = objOop11; - if ((oop1 & (tagMask())) == 0) { - setIsMarkedOfto(oop1, 1); - } - } - markObjects(0); - assert(isEmptyObjStack(GIV(markStack))); - assert(isEmptyObjStack(GIV(weaklingStack))); - assert(noUnscannedEphemerons()); - freeChunk = allocateLargestFreeChunk(); - ptr = (start = freeChunk + BaseHeaderSize); - /* begin addressAfter: */ - numSlots12 = byteAt(freeChunk + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots7 = numSlots12; - } - if (numSlots7 == 0) { - /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); - } - else { - slotBytes1 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); - } - limit = (freeChunk + BaseHeaderSize) + slotBytes1; - - /* First put the arrayOfRoots; order is important. */ - count = 0; - count += 1; - if (ptr < limit) { - longAtput(ptr, arrayOfRoots); - ptr += BytesPerOop; - } - for (i2 = 0, iLimiT2 = ((numSlotsOf(arrayOfRoots)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if ((oop & (tagMask())) == 0) { - pushonObjStack(oop, GIV(markStack)); - } - } - while (!(isEmptyObjStack(GIV(markStack)))) { - objOop2 = popObjStack(GIV(markStack)); - count += 1; - if (ptr < limit) { - longAtput(ptr, objOop2); - ptr += BytesPerOop; - } - oop = fetchClassOfNonImm(objOop2); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - if ((((longAt(objOop2)) & (classIndexMask())) == ClassMethodContextCompactIndex) - && ((((longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) - && (!(isWidowedContext(objOop2))))) { - - /* widow now, before the loop */ - for (i2 = 0, iLimiT2 = ((numSlotsOfMarriedContext(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - oop = fetchPointerofMarriedContext(i2, objOop2); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - else { - for (i2 = 0, iLimiT2 = ((numPointerSlotsOf(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - } - /* begin unmarkAllObjects */ - assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); - while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (((((usqInt) (longAt(objOop12 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop12)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop12, 0); - } - else { - if (!(((longAt(objOop12)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop12, 0); - } - } - } - - prevPrevObj1 = prevObj1; - prevObj1 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l30; - } - flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l30: /* end objectAfter:limit: */; - } - /* begin allNewSpaceEntitiesDo: */ - - /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are - in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ - prevPrevObj = (prevObj = null); - assert((((pastSpace()).start)) < (((eden()).start))); - /* begin objectStartingAt: */ - address = ((pastSpace()).start); - numSlots8 = byteAt(address + 7); - objOop3 = (numSlots8 == (numSlotsMask()) - ? address + BaseHeaderSize - : address); - limit1 = GIV(pastSpaceStart); - while (oopisLessThan(objOop3, limit1)) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop3 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { - /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); - } - else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop3 + BaseHeaderSize) + slotBytes11; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { - objOop3 = limit1; - goto l26; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop3 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l26: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop3 = (numSlots14 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop3, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop3 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots41 = numSlots13; - } - if (numSlots41 == 0) { - /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); - } - else { - slotBytes2 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); - } - followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop3 = GIV(freeStart); - goto l35; - } - flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l35: /* end objectAfter:limit: */; - } - - /* Now try and allocate the result */ - GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); - if ((count > ((ptr - start) / BytesPerOop)) - || ((limit != ptr) - && ((limit - ptr) <= 8))) { - - /* can't split a single word */ - freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) - ? freeChunk - BaseHeaderSize - : freeChunk)); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - arrayOfObjects = (((usqInt)count << 1) | 1); - goto l23; - } - /* begin setFormatOf:to: */ - format = 2; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin setClassIndexOf:to: */ - assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); - shortentoIndexableSize(freeChunk, count); - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { - remember(freeChunk); - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - runLeakCheckerFor(GCModeImageSegment); - arrayOfObjects = freeChunk; -l23: /* end objectsReachableFromRoots: */; + arrayOfObjects = objectsReachableFromRoots(arrayOfRoots); if (!(arrayOfObjects)) { return PrimErrNoMemory; } assert(allObjectsUnmarked()); /* begin allocateSlots:format:classIndex: */ numBytes2 = (numSlotsOf(arrayOfObjects)) * 4; - numSlots2 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; + numSlots3 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; formatField = firstLongFormat(); classIndex = thirtyTwoBitLongsClassIndexPun(); - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots2 + (numSlots2 & 1)) * BytesPerOop); + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots2 <= 1 + numBytes = BaseHeaderSize + ((numSlots3 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots2 + (numSlots2 & 1)) * BytesPerOop)); + : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -58769,40 +58085,40 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots2, numBytes, formatField, classIndex); - goto l6; + savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes, formatField, classIndex); + goto l9; } - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots2); + longAtput(GIV(freeStart), numSlots3); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); } else { - long64Atput(newObj, (((((usqLong) numSlots2)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + long64Atput(newObj, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); } assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; savedInHashes = newObj; -l6: /* end allocateSlots:format:classIndex: */; +l9: /* end allocateSlots:format:classIndex: */; /* begin allocateSlots:format:classIndex: */ numBytes3 = (numSlotsOf(outPointerArray)) * 4; - numSlots3 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; + numSlots4 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; formatField1 = firstLongFormat(); classIndex1 = thirtyTwoBitLongsClassIndexPun(); - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { newObj1 = GIV(freeStart) + BaseHeaderSize; - numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots4 + (numSlots4 & 1)) * BytesPerOop); } else { newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + ((numSlots3 <= 1 + numBytes1 = BaseHeaderSize + ((numSlots4 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); + : (numSlots4 + (numSlots4 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -58810,25 +58126,25 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes1, formatField1, classIndex1); - goto l8; + savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots4, numBytes1, formatField1, classIndex1); + goto l11; } - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots3); + longAtput(GIV(freeStart), numSlots4); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), formatField1, classIndex1)); } else { - long64Atput(newObj1, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); + long64Atput(newObj1, (((((usqLong) numSlots4)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); } assert((numBytes1 % (allocationUnit())) == 0); assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; savedOutHashes = newObj1; -l8: /* end allocateSlots:format:classIndex: */; +l11: /* end allocateSlots:format:classIndex: */; if ((savedInHashes == null) || (savedOutHashes == null)) { freeObject(arrayOfObjects); @@ -58837,14 +58153,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr fillValue = (identityHashHalfWordMask()) + 1; /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedInHashes)) > (isForwardedObjectClassIndexPun())); - numSlots4 = byteAt(savedInHashes + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(savedInHashes - BaseHeaderSize); - } - else { - numSlots = numSlots4; - } + numSlots5 = byteAt(savedInHashes + 7); + numSlots = (numSlots5 == (numSlotsMask()) + ? longAt(savedInHashes - BaseHeaderSize) + : numSlots5); assert(oopisLessThan(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(savedInHashes))); for (p = (((usqInt)(savedInHashes + BaseHeaderSize))); p <= (((usqInt)(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { longAtput(p, fillValue); @@ -58852,14 +58164,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr } /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedOutHashes)) > (isForwardedObjectClassIndexPun())); - numSlots5 = byteAt(savedOutHashes + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(savedOutHashes - BaseHeaderSize); - } - else { - numSlots1 = numSlots5; - } + numSlots6 = byteAt(savedOutHashes + 7); + numSlots1 = (numSlots6 == (numSlotsMask()) + ? longAt(savedOutHashes - BaseHeaderSize) + : numSlots6); assert(oopisLessThan(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(savedOutHashes))); for (p1 = (((usqInt)(savedOutHashes + BaseHeaderSize))); p1 <= (((usqInt)(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p1 += 8) { longAtput(p1, fillValue); @@ -58898,19 +58206,15 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr segAddr = segmentWordArray + BaseHeaderSize; /* begin addressAfter: */ numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots6 = numSlots11; - } - if (numSlots6 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } endSeg = (segmentWordArray + BaseHeaderSize) + slotBytes; if (segAddr >= endSeg) { @@ -59430,7 +58734,7 @@ unpinObject(sqInt objOop) { assert(isNonImmediate(objOop)); /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 30))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (pinnedBitShift())))); return 0; } @@ -59629,13 +58933,9 @@ checkTraversableSortedFreeList(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -59646,14 +58946,14 @@ checkTraversableSortedFreeList(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } assert(prevFree == GIV(lastFreeChunk)); assert((nextInSortedFreeListLinkgiven(GIV(lastFreeChunk), 0)) == prevPrevFree); @@ -59668,7 +58968,7 @@ checkTraversableSortedFreeList(void) /* for profiling */ /* SpurPigCompactor>>#compact */ -static sqInt NeverInline +static void NeverInline compact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; @@ -59683,6 +58983,7 @@ compact(void) usqInt scanAddress; usqInt slotBytes; + freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); /* begin statCompactPassCount: */ anInteger = GIV(statCompactPassCount) + 1; GIV(statCompactPassCount) = anInteger; @@ -59696,18 +58997,15 @@ compact(void) while (free != 0) { high = (prevFree == 0 ? (endOfMemory()) - (2 * BaseHeaderSize) - : ((byteAt(prevFree + 7)) == (numSlotsMask()) - ? prevFree - BaseHeaderSize - : prevFree)); + : (/* begin startOfObject: */ + ((byteAt(prevFree + 7)) == (numSlotsMask()) + ? prevFree - BaseHeaderSize + : prevFree))); /* begin addressAfter: */ numSlots1 = byteAt(free + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(free - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(free - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -59719,7 +59017,7 @@ compact(void) while (oopisLessThan(scanAddress, high)) { scanAddress = moveARunOfObjectsStartingAtupTo(scanAddress, high); if (scanAddress == 0) { - goto l2; + goto l6; } } @@ -59744,12 +59042,11 @@ compact(void) } } assert(checkTraversableSortedFreeList()); - l2: /* end pigCompact */; + l6: /* end pigCompact */; eliminateAndFreeForwardersForPigCompact(); } assert(freeListHeadsEmpty()); rebuildFreeListsForPigCompact(); - return 0; } @@ -59757,7 +59054,7 @@ compact(void) forwarders, then free forwarders, coalescing with free space as we go. */ /* SpurPigCompactor>>#eliminateAndFreeForwardersForPigCompact */ -static sqInt +static void eliminateAndFreeForwardersForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; @@ -59882,50 +59179,46 @@ eliminateAndFreeForwardersForPigCompact(void) index += 1; } } - /* begin unmarkSurvivingObjectsForPigCompact */ - prevPrevObj1 = (prevObj1 = null); + /* begin unmarkSurvivingObjectsForCompact */ + prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots3 = byteAt(address + 7); - objOop2 = (numSlots3 == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop1 = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); - while (oopisLessThan(objOop2, GIV(pastSpaceStart))) { - assert(isEnumerableObjectNoAssert(objOop2)); - if (((((usqInt) (longAt(objOop2 + 4))) >> 23) & 1) != 0) { - setIsMarkedOfto(objOop2, 0); + while (oopisLessThan(objOop1, GIV(pastSpaceStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + setIsMarkedOfto(objOop1, 0); } - prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevPrevObj = prevObj; + prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { - objOop2 = GIV(pastSpaceStart); - goto l18; + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(pastSpaceStart))) { + objOop1 = GIV(pastSpaceStart); + goto l4; } flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l18: /* end objectAfter:limit: */; + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; } /* begin sweepToFollowForwardersForPigCompact */ assert(((freeStart()) == (((eden()).start))) @@ -59934,8 +59227,8 @@ eliminateAndFreeForwardersForPigCompact(void) prevPrevObj2 = (prevObj2 = null); /* begin objectStartingAt: */ address1 = ((pastSpace()).start); - numSlots4 = byteAt(address1 + 7); - objOop12 = (numSlots4 == (numSlotsMask()) + numSlots21 = byteAt(address1 + 7); + objOop12 = (numSlots21 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop12, GIV(pastSpaceStart))) { @@ -59968,31 +59261,27 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj2 = objOop12; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop12 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots12; - } - if (numSlots21 == 0) { + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots12); + if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(pastSpaceStart))) { objOop12 = GIV(pastSpaceStart); - goto l31; + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l31: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } lowestForwarder1 = 0; /* begin allOldSpaceObjectsDo: */ @@ -60050,13 +59339,9 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj11 = objOop11; /* begin objectAfter:limit: */ numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots31 = numSlots111; - } + numSlots31 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots111); if (numSlots31 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); @@ -60067,14 +59352,14 @@ eliminateAndFreeForwardersForPigCompact(void) followingWordAddress11 = (objOop11 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l38; + goto l37; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop11 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l38: /* end objectAfter:limit: */; + l37: /* end objectAfter:limit: */; } lowestForwarder = lowestForwarder1; /* begin sweepToCoallesceFreeSpaceForPigCompactFrom: */ @@ -60090,28 +59375,29 @@ eliminateAndFreeForwardersForPigCompact(void) firstOfFreeRun = (prevPrevFree = (prevFree = 0)); /* begin allOldSpaceEntitiesFrom:do: */ assert(isOldObject(lowest)); - prevPrevObj = (prevObj = null); - objOop = lowest; + prevPrevObj1 = (prevObj1 = null); + objOop3 = lowest; while (1) { - assert((objOop % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; - assert((long64At(objOop)) != 0); - if ((((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) - || (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + assert((objOop3 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; + assert((long64At(objOop3)) != 0); + if ((((longAt(objOop3)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) + || (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { if (firstOfFreeRun == 0) { /* begin setObjectFree: */ - if ((byteAt(objOop + 7)) == 0) { + if ((byteAt(objOop3 + 7)) == 0) { /* begin rawNumSlotsOf:put: */ - byteAtput(objOop + 7, 1); + byteAtput(objOop3 + 7, 1); } /* begin setFree: */ - long32Atput(objOop, 0); - firstOfFreeRun = objOop; - startOfFreeRun = ((byteAt(objOop + 7)) == (numSlotsMask()) - ? objOop - BaseHeaderSize - : objOop); + long32Atput(objOop3, 0); + firstOfFreeRun = objOop3; + /* begin startOfObject: */ + startOfFreeRun = ((byteAt(objOop3 + 7)) == (numSlotsMask()) + ? objOop3 - BaseHeaderSize + : objOop3); } - endOfFreeRun = objOop; + endOfFreeRun = objOop3; } else { if (firstOfFreeRun != 0) { @@ -60123,9 +59409,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex1 = 0; + fieldIndex = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -60133,35 +59419,31 @@ eliminateAndFreeForwardersForPigCompact(void) } } - prevPrevObj = prevObj; - prevObj = objOop; + prevPrevObj1 = prevObj1; + prevObj1 = objOop3; /* begin objectAfter:limit: */ - numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - if (numSlots == 0) { + numSlots11 = byteAt(objOop3 + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop3 - BaseHeaderSize) + : numSlots11); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { - objOop = GIV(endOfMemory); - goto l7; + followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { + objOop3 = GIV(endOfMemory); + goto l15; } flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l7: /* end objectAfter:limit: */; + followingWord1 = longAt(followingWordAddress1 + 4); + objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l15: /* end objectAfter:limit: */; } if (firstOfFreeRun != 0) { bytes = (addressAfter(endOfFreeRun)) - startOfFreeRun; @@ -60172,9 +59454,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex2 = 0; + fieldIndex1 = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -60182,11 +59464,11 @@ eliminateAndFreeForwardersForPigCompact(void) } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ - fieldIndex = 0; + fieldIndex2 = 0; assert(isFreeObject(prevFree)); assert((prevPrevFree == 0) || (isFreeObject(prevPrevFree))); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree); } GIV(lastFreeChunk) = prevFree; /* begin inSortedFreeListLink:to:given: */ @@ -60201,7 +59483,6 @@ eliminateAndFreeForwardersForPigCompact(void) } assert(checkTraversableSortedFreeList()); assert((numberOfForwarders()) == 0); - return 0; } @@ -60221,7 +59502,7 @@ eliminateAndFreeForwardersForPigCompact(void) */ /* SpurPigCompactor>>#freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact */ -static sqInt NeverInline +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt fieldIndex; @@ -60238,20 +59519,16 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) sqInt here; sqInt here1; sqInt i; - sqInt i1; sqInt iLimiT; - sqInt index; usqInt newNumSlots; sqInt next; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt o; - sqInt obj; usqInt obj2slots; sqInt objOop; sqInt prevFree; @@ -60263,7 +59540,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; - sqInt sweepIndex; /* for profiling */ @@ -60273,30 +59549,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - /* begin forgetUnmarkedRememberedObjects */ - index = 0; - while (index < GIV(rememberedSetSize)) { - obj = GIV(rememberedSet)[index]; - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { - index += 1; - } - else { - - /* unmarked; remove by overwriting with last element. */ - /* begin setIsRememberedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - assert(GIV(rememberedSetSize) >= 0); - doScavenge(MarkOnTenure); - /* begin prepareForGlobalSweep */ - sweepIndex = 0; - for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { - ((GIV(segments)[i1]).containsPinned = 0); - } - setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); /* begin resetFreeListHeads */ for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { GIV(freeLists)[i] = 0; @@ -60312,22 +59564,22 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) rawNumSlots = byteAt(objOop + 7); assert((GIV(firstFreeChunk) == 0) || (isFreeObject(GIV(firstFreeChunk)))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { /* forwarders should have been followed in markAndTrace: */ assert(!(isForwarded(objOop))); setIsMarkedOfto(objOop, 0); - if (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) { /* begin notePinned: */ assert(isPinned(objOop)); if (((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun())) { setIsMarkedOfto(objOop, 1); } else { - while (((((GIV(segments)[sweepIndex]).segSize)) + (((GIV(segments)[sweepIndex]).segStart))) < objOop) { - sweepIndex += 1; + while (((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart))) < objOop) { + GIV(sweepIndex) += 1; } - ((GIV(segments)[sweepIndex]).containsPinned = 1); + ((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1); } } } @@ -60341,32 +59593,28 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) assert(isMarked(lastBridge())); /* begin objectAfter:limit: */ numSlots11 = byteAt(here1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (here1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); next = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; - while (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) { + l21: /* end objectAfter:limit: */; + while (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* coalescing; rare case */ assert(!(isRemembered(next))); @@ -60384,11 +59632,9 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) obj2slots += obj2slots & 1; assert((obj2slots * BytesPerWord) == (bytesInObject(next))); if (header1NumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ - numSlots = obj2slots + (longAt(here1 - BaseHeaderSize)); - longAtput(here1 - BaseHeaderSize, numSlots); + longAtput(here1 - BaseHeaderSize, obj2slots + (longAt(here1 - BaseHeaderSize))); here1 = here1; - goto l21; + goto l20; } header1NumSlots = (header1NumSlots == 0 ? 2 @@ -60400,7 +59646,7 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (newNumSlots < (numSlotsMask())) { byteAtput(here1 + 7, newNumSlots); here1 = here1; - goto l21; + goto l20; } newNumSlots -= BaseHeaderSize / BytesPerWord; longAtput(here1 + BaseHeaderSize, longAt(here1)); @@ -60408,34 +59654,30 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput(here1, newNumSlots); longAtput(here1 + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); here1 += BaseHeaderSize; - l21: /* end coalesce:and: */; + l20: /* end coalesce:and: */; /* begin objectAfter:limit: */ numSlots1 = byteAt(here1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (here1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l22; + goto l19; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); next = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l22: /* end objectAfter:limit: */; + l19: /* end objectAfter:limit: */; } here = here1; /* begin setObjectFree: */ @@ -60470,31 +59712,27 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); + if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l6; + goto l16; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ @@ -60516,7 +59754,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput((GIV(lastFreeChunk) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ 0); } assert(checkTraversableSortedFreeList()); - return 0; } @@ -60557,8 +59794,6 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) sqInt fieldIndex4; sqInt fieldIndex41; sqInt fieldIndex5; - sqInt format; - sqInt format1; usqInt freeBytes; usqInt freeChunk; usqInt here; @@ -60607,17 +59842,13 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (thisFreeChunk != 0) { /* skip any initial immobile objects */ - while (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + while (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { /* begin addressAfter: */ numSlots11 = byteAt(hereObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots11; - } + numSlots4 = (numSlots11 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots11); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -60643,6 +59874,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) && (isFreeObject(thisFreeChunk))); freeBytes = bytesInObject(thisFreeChunk); nextFree = ((usqInt)((longAt((thisFreeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFreeChunk)); + /* begin startOfObject: */ destination = ((byteAt(thisFreeChunk + 7)) == (numSlotsMask()) ? thisFreeChunk - BaseHeaderSize : thisFreeChunk); @@ -60654,13 +59886,9 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (1) { /* begin addressAfter: */ numSlots12 = byteAt(hereObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots5 = numSlots12; - } + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -60669,7 +59897,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) slotBytes1 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } there = (hereObj + BaseHeaderSize) + slotBytes1; - if (!(((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!(((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun()))) && ((freeBytes > ((there - here) + 8)) || (freeBytes == (there - here))))) break; @@ -60684,11 +59912,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); destination += there - here; freeBytes -= there - here; /* begin objectStartingAt: */ @@ -60781,7 +60008,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) prevFreeChunk = thisFreeChunk; thisFreeChunk = nextFree; } - if (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { return (maxFreeChunk >= startAddress ? 0 @@ -60797,6 +60024,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while ((freeChunk != 0) && (freeChunk < hereObj)) { next = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + /* begin startOfObject: */ dest = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); @@ -60815,11 +60043,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); if (next != 0) { nextNext = ((usqInt)((longAt((next + BaseHeaderSize) + (0U << (shiftForWord())))) ^ freeChunk)); } @@ -60885,14 +60112,14 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } } usedChunk = freeChunk; - goto l25; + goto l27; } prevPrevFree = prevFree; prevFree = freeChunk; freeChunk = next; } usedChunk = 0; - l25: /* end tryToMovePig:at:end: */; + l27: /* end tryToMovePig:at:end: */; /* begin objectStartingAt: */ numSlots2 = byteAt(there + 7); hereObj = (numSlots2 == (numSlotsMask()) @@ -60922,10 +60149,59 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } +/* Answer the next free free chunk using the xor trick to use only one field, + see e.g. + The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 + `Circular Lists', exercise. 18 + http://en.wikipedia.org/wiki/XOR_linked_list. */ + + /* SpurPigCompactor>>#nextInSortedFreeListLink:given: */ +static usqInt NoDbgRegParms +nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) +{ + return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); +} + + /* SpurPigCompactor>>#printSortedFreeList */ +void +printSortedFreeList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt freeChunk; + usqInt nextFree; + sqInt prevFree; + + if (!((GIV(firstFreeChunk) > 0) + && (GIV(lastFreeChunk) > GIV(firstFreeChunk)))) { + print("sorted free list empty or corrupt"); + /* begin cr */ + printf("\n"); + return; + } + freeChunk = GIV(firstFreeChunk); + prevFree = 0; + while (1) { + if (!((addressCouldBeObj(freeChunk)) + && (((longAt(freeChunk)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) freeChunk)); + print(" is not a free chunk!"); + /* begin cr */ + printf("\n"); + return; + } + printFreeChunkprintAsTreeNode(freeChunk, 0); + if (!(freeChunk != GIV(lastFreeChunk))) break; + nextFree = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + prevFree = freeChunk; + freeChunk = nextFree; + } +} + + /* Rebuild the free lists from the doubly-linked free list. */ /* SpurPigCompactor>>#rebuildFreeListsForPigCompact */ -static sqInt +static void rebuildFreeListsForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt bytes; @@ -60951,6 +60227,7 @@ rebuildFreeListsForPigCompact(void) assert((prevFree == 0) || (prevFree < free)); bytes = bytesInObject(free); + /* begin startOfObject: */ start = ((byteAt(free + 7)) == (numSlotsMask()) ? free - BaseHeaderSize : free); @@ -60968,7 +60245,66 @@ rebuildFreeListsForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - return 0; +} + + +/* Scavenge or simply follow objOop. Answer the new location of objOop. + The send should have been guarded by a send of shouldRemapOop:. + The method is called remapObj: for compatibility with ObjectMemory. */ + + /* SpurPigCompactor>>#remapObj: */ +sqInt +remapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt referent; + sqInt resolvedObj; + + /* begin vanillaRemapObj: */ + assert(shouldRemapOop(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(objOop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + resolvedObj = referent; + } + else { + assert(!((isInFutureSpace(objOop)))); + resolvedObj = objOop; + } + if ((GIV(gcPhaseInProgress) == ScavengeInProgress) + && ((((resolvedObj & (tagMask())) == 0) + && ((assert(isNonImmediate(resolvedObj)), + (oopisLessThan(resolvedObj, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(resolvedObj, GIV(newSpaceStart)))))) + && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { + return copyAndForward(resolvedObj); + } + return resolvedObj; +} + + +/* Answer if the obj should be scavenged (or simply followed). The method is + called shouldRemapObj: for compatibility with ObjectMemory. Defer to the + compactor to choose the actual test, there being a difference between the + vanilla test and + that used with a sliding compactor where objects are not marked as + forwarded. */ + + /* SpurPigCompactor>>#shouldRemapObj: */ +sqInt +shouldRemapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(objOop)), + (oopisLessThan(objOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); } /* SpurSegmentInfo>>#segLimit */ @@ -61066,19 +60402,22 @@ static sqInt allBridgesMarked(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; + SpurSegmentInfo *aSegment; sqInt bridgeObj; sqInt i; usqInt numSlots; for (i = 0; i < GIV(numSegments); i += 1) { + /* begin bridgeFor: */ + aSegment = ((SpurSegmentInfo *) ((&(GIV(segments)[i])))); /* begin objectStartingAt: */ - address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * BaseHeaderSize); + address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize); numSlots = byteAt(address + 7); bridgeObj = (numSlots == (numSlotsMask()) ? address + BaseHeaderSize : address); assert(isValidSegmentBridge(bridgeObj)); - if (!(((((usqInt) (longAt(bridgeObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(bridgeObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -61150,7 +60489,6 @@ bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil) sqInt clifton; usqInt segEnd; - /* begin segLimit */ segEnd = ((aSegment->segSize)) + ((aSegment->segStart)); /* clifton is where the Avon bridge begins... */ @@ -61330,7 +60668,7 @@ nextNonEmptySegmentAfter(sqInt i) static void postSnapshot(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt address; + sqInt address; sqInt bytes; usqInt freeChunk; sqInt i; @@ -61414,7 +60752,7 @@ prepareForSnapshot(void) /* begin freeTreeNodesDo: */ treeNode = GIV(freeLists)[0]; if (treeNode == 0) { - goto l7; + goto l5; } cameFrom = -1; do { @@ -61442,13 +60780,9 @@ prepareForSnapshot(void) limit = endOfMemory(); /* begin addressAfter: */ numSlots1 = byteAt(node + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(node - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(node - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -61505,7 +60839,7 @@ prepareForSnapshot(void) cameFrom = -1; } } while(treeNode != 0); -l7: /* end freeTreeNodesDo: */; +l5: /* end freeTreeNodesDo: */; for (i = 0; i < GIV(numSegments); i += 1) { freeChunk = ((GIV(segments)[i]).lastFreeObject); if (!(freeChunk == null)) { @@ -61619,14 +60953,14 @@ shrinkObjectMemory(usqInt delta) SpurSegmentInfo *segInfo; usqInt shrinkage; - i2 = 0; + i = 0; shrinkage = delta; while (1) { /* begin findEmptySegNearestInSizeTo: */ best = null; delta1 = shrinkage; - for (i = 0; i < GIV(numSegments); i += 1) { - seg = (&(GIV(segments)[i])); + for (i2 = 0; i2 < GIV(numSegments); i2 += 1) { + seg = (&(GIV(segments)[i2])); if (isEmptySegment(seg)) { if (best == null) { best = seg; @@ -61650,20 +60984,20 @@ shrinkObjectMemory(usqInt delta) /* begin removeSegment: */ for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { if (((emptySeg->segStart)) == (((GIV(segments)[i1]).segStart))) { - i2 = i1; - goto l2; + i = i1; + goto l1; } } error("segment not found"); - l2: /* end indexOfSegment: */; - assert(i2 > 0); + l1: /* end indexOfSegment: */; + assert(i > 0); sqDeallocateMemorySegmentAtOfSize(((void *)((emptySeg->segStart))), (emptySeg->segSize)); - for (j = i2; j < GIV(numSegments); j += 1) { + for (j = i; j < GIV(numSegments); j += 1) { GIV(segments)[j] = (GIV(segments)[j + 1]); } GIV(numSegments) -= 1; - bridgeFromto((&(GIV(segments)[i2 - 1])), (i2 <= (GIV(numSegments) - 1) - ? (&(GIV(segments)[i2])) + bridgeFromto((&(GIV(segments)[i - 1])), (i <= (GIV(numSegments) - 1) + ? (&(GIV(segments)[i])) : 0)); /* begin setLastSegment: */ segInfo = ((SpurSegmentInfo *) ((&(GIV(segments)[GIV(numSegments) - 1])))); @@ -61753,8 +61087,8 @@ writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSeg { usqLong firstSavedBridgeWord; sqInt nWritten; - usqInt pier1; - usqInt pier2; + sqInt pier1; + sqInt pier2; usqLong secondSavedBridgeWord; pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize); @@ -61926,6 +61260,7 @@ addNewMethodToNSCache(sqInt rule) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -62046,7 +61381,7 @@ void * arrayValueOf(sqInt arrayOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -62063,7 +61398,7 @@ arrayValueOf(sqInt arrayOop) static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if (isCharacterObject(characterObj)) { + if ((characterObj & (tagMask())) == (characterTag())) { return (/* begin integerObjectOfCharacterObject: */ ((usqInt) (((usqInt) characterObj))) >> 1); } @@ -62188,8 +61523,7 @@ canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader) sqInt characterForAscii(sqInt ascii) { - return (/* begin characterObjectOf: */ - (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag())); + return (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag()); } @@ -62212,10 +61546,10 @@ checkAllAccessibleObjectsOkay(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -62239,8 +61573,8 @@ checkAllAccessibleObjectsOkay(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -62252,37 +61586,33 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -62293,32 +61623,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -62336,32 +61662,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return ok; } @@ -62620,58 +61942,58 @@ checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset) /* Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccessibleObjects has set a bit at each object's header. Check that all oops in the interpreter's state - points to a header. Answer if all checks pass. */ + points to a header. Answer 0 if all checks pass. */ /* StackInterpreter>>#checkInterpreterIntegrity */ static sqInt checkInterpreterIntegrity(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt flags; sqInt i; - sqInt ok; - ok = 1; + flags = 0; if (!(checkOopIntegritynamed(GIV(specialObjectsOop), "specialObjectsOop"))) { - ok = 0; + flags = 1; } if (!(checkOopIntegritynamed(GIV(newMethod), "newMethod"))) { - ok = 0; + flags += 2; } if (!(checkOopIntegritynamed(GIV(profileProcess), "profileProcess"))) { - ok = 0; + flags += 4; } if (!(checkOopIntegritynamed(GIV(profileMethod), "profileMethod"))) { - ok = 0; + flags += 8; } if (!(checkOopIntegritynamed(GIV(profileSemaphore), "profileSemaphore"))) { - ok = 0; + flags += 16; } if (!(GIV(tempOop) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop), "tempOop"))) { - ok = 0; + flags += 32; } } if (!(GIV(tempOop2) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop2), "tempOop2"))) { - ok = 0; + flags += 64; } } if (!(GIV(tempOop3) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop3), "tempOop3"))) { - ok = 0; + flags += 128; } } for (i = 1; i <= GIV(jmpDepth); i += 1) { if (!(checkOopIntegritynamedindex(GIV(suspendedCallbacks)[i], "suspendedCallbacks", i))) { - ok = 0; + flags += 256; } if (!(checkOopIntegritynamedindex(GIV(suspendedMethods)[i], "suspendedMethods", i))) { - ok = 0; + flags += 512; } } if (!(checkLogIntegrity())) { - ok = 0; + flags += 1024; } - return ok; + return flags; } @@ -62682,7 +62004,6 @@ checkInterpreterIntegrity(void) static sqInt NoDbgRegParms checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; char *limitFP; char *maybeFP; sqInt maybeFrameCtxt; @@ -62701,10 +62022,8 @@ checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP) maybeFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) maybeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(maybeFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) maybeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(maybeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); limitFP = ((thePage == GIV(stackPage)) && (currentFP != null) ? currentFP @@ -62957,7 +62276,6 @@ static sqInt NoDbgRegParms checkStackPointerIndexForFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *aFrame; - sqInt index; char *prevFrame; char *startFrame; StackPage *thePage; @@ -62969,10 +62287,8 @@ checkStackPointerIndexForFrame(char *theFP) : (((usqInt) ((theFP + FoxIFReceiver) - GIV(stackPointer))) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1))); } /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findSPOrNilOf:on:startingFrom: */ startFrame = (thePage == GIV(stackPage) ? GIV(framePointer) @@ -63188,10 +62504,6 @@ createActualMessageTo(sqInt lookupClass) usqInt numBytes; usqInt numBytes1; sqInt numSlots; - sqInt numSlots1; - sqInt objFormat; - sqInt objFormat1; - sqInt selector; char *sp; @@ -63199,22 +62511,17 @@ createActualMessageTo(sqInt lookupClass) assert((isImmediate(GIV(messageSelector))) || (addressCouldBeObj(GIV(messageSelector)))); /* begin mnuBreakpoint:receiver: */ - selector = GIV(messageSelector); - mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null); + mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), null); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - numSlots1 = GIV(argumentCount); - assert(numSlots1 < (numSlotsMask())); + assert(GIV(argumentCount) < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots1 <= 1 + numBytes = BaseHeaderSize + ((GIV(argumentCount) <= 1 ? 8 - : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); + : (GIV(argumentCount) + (GIV(argumentCount) & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -63226,21 +62533,18 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); argumentArray = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) GIV(argumentCount))) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; argumentArray = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = 1; numSlots = MessageLookupClassIndex + 1; assert((numSlots >= 0) && (ClassMessageCompactIndex != 0)); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); + assert((1) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -63258,13 +62562,13 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); message = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassMessageCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + ClassMessageCompactIndex); GIV(freeStart) += numBytes1; message = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) { longAtput((argumentArray + BaseHeaderSize) + i, popStack()); @@ -63464,7 +62768,6 @@ divorceFramesIn(StackPage *aStackPage) sqInt calleeContext; char *calleeFP; sqInt callerContextOrNil; - sqInt index; sqInt theContext; char *theFP; sqInt theIP; @@ -63529,10 +62832,8 @@ divorceFramesIn(StackPage *aStackPage) /* begin storePointer:ofObject:withValue: */ assert(isBaseFrame(calleeFP)); /* begin stackPageFor: */ - assert((((((char *) calleeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) calleeFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(calleeFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) calleeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) calleeFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(calleeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -63567,6 +62868,7 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) int posArg; int posRcvr; sqInt result; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -63615,7 +62917,8 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -63632,6 +62935,7 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) sqInt integerArg; sqInt integerRcvr; sqInt integerResult; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -63670,7 +62974,8 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -63793,7 +63098,6 @@ ensureCallerContext(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; char *callerFP; - sqInt index; StackPage *thePage; callerFP = pointerForOop(longAt(theFP + FoxSavedFP)); @@ -63803,10 +63107,8 @@ ensureCallerContext(char *theFP) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -63842,14 +63144,14 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) sqInt followingWord1; sqInt followingWord11; sqInt followingWord2; + sqInt followingWord21; sqInt followingWord3; - sqInt followingWord4; usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress11; usqInt followingWordAddress2; + usqInt followingWordAddress21; usqInt followingWordAddress3; - usqInt followingWordAddress4; usqInt limit; usqInt limit1; sqInt methodHeader; @@ -63860,39 +63162,39 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; usqInt numSlots31; usqInt numSlots4; + usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; sqInt objOop11; + sqInt objOop111; sqInt objOop12; - sqInt objOop13; sqInt objOop2; + sqInt objOop21; sqInt objOop3; - sqInt objOop4; sqInt oop; sqInt prevObj; sqInt prevObj1; + sqInt prevObj11; sqInt prevObj2; - sqInt prevObj3; sqInt prevPrevObj; sqInt prevPrevObj1; + sqInt prevPrevObj11; sqInt prevPrevObj2; - sqInt prevPrevObj3; usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes11; usqInt slotBytes2; + usqInt slotBytes21; usqInt slotBytes3; - usqInt slotBytes4; sqInt stopAddr; int swapFloatWords; int temp; @@ -63917,14 +63219,13 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots5 = byteAt(address2 + 7); - objOop12 = (numSlots5 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop12 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit1 = GIV(pastSpaceStart); while (oopisLessThan(objOop12, limit1)) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -63962,20 +63263,16 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots13 = byteAt(objOop12 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); } else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { @@ -63991,13 +63288,12 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots14 = byteAt(address11 + 7); - objOop12 = (numSlots14 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop12 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop12, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -64035,20 +63331,16 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop12 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots111 = byteAt(objOop12 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } followingWordAddress11 = (objOop12 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { @@ -64064,28 +63356,27 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop11 = GIV(nilObj); + prevPrevObj11 = (prevObj11 = null); + objOop111 = GIV(nilObj); while (1) { - assert((objOop11 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; - assert((long64At(objOop11)) != 0); - if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); + assert((objOop111 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop111, GIV(endOfMemory)))) break; + assert((long64At(objOop111)) != 0); + if (isEnumerableObject(objOop111)) { + fmt = (((usqInt) (longAt(objOop111))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { /* oop contains bytes */ - wordAddr = objOop11 + BaseHeaderSize; + wordAddr = objOop111 + BaseHeaderSize; if (fmt >= (firstCompiledMethodFormat())) { /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop11 + BaseHeaderSize); + methodHeader = longAt(objOop111 + BaseHeaderSize); wordAddr += (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; } /* begin reverseBytesFrom:to: */ - stopAddr = objOop11 + (((numSlotsOf(objOop11)) << (shiftForWord())) + BaseHeaderSize); + stopAddr = objOop111 + (((numSlotsOf(objOop111)) << (shiftForWord())) + BaseHeaderSize); addr1 = wordAddr; while (oopisLessThan(addr1, stopAddr)) { longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); @@ -64096,10 +63387,10 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) /* Bitmap, Float etc */ if (swapFloatWords - && ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop11 + BaseHeaderSize); - longAtput(objOop11 + BaseHeaderSize, longAt((objOop11 + BaseHeaderSize) + 4)); - longAtput((objOop11 + BaseHeaderSize) + 4, temp1); + && ((compactClassIndexOf(objOop111)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop111 + BaseHeaderSize); + longAtput(objOop111 + BaseHeaderSize, longAt((objOop111 + BaseHeaderSize) + 4)); + longAtput((objOop111 + BaseHeaderSize) + 4, temp1); } else { } @@ -64107,41 +63398,37 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } - prevPrevObj1 = prevObj1; - prevObj1 = objOop11; + prevPrevObj11 = prevObj11; + prevObj11 = objOop111; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots121 = byteAt(objOop111 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop111 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop11 = GIV(endOfMemory); - goto l18; + followingWordAddress21 = (objOop111 + BaseHeaderSize) + slotBytes21; + if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { + objOop111 = GIV(endOfMemory); + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l18: /* end objectAfter:limit: */; + followingWord21 = longAt(followingWordAddress21 + 4); + objOop111 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress21 + BaseHeaderSize + : followingWordAddress21); + l29: /* end objectAfter:limit: */; } } else { /* begin convertFloatsToPlatformOrder */ if (VMBIGENDIAN == GIV(imageFloatsBigEndian)) { - goto l1; + goto l15; } assert(ClassFloatCompactIndex != 0); /* begin allObjectsDo: */ @@ -64152,8 +63439,8 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -64169,37 +63456,33 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -64214,81 +63497,73 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj3 = (prevObj3 = null); - objOop13 = GIV(nilObj); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); while (1) { - assert((objOop13 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop13, GIV(endOfMemory)))) break; - assert((long64At(objOop13)) != 0); - if (isEnumerableObject(objOop13)) { - if ((compactClassIndexOf(objOop13)) == ClassFloatCompactIndex) { - temp = long32At(objOop13 + BaseHeaderSize); - long32Atput(objOop13 + BaseHeaderSize, long32At((objOop13 + BaseHeaderSize) + 4)); - long32Atput((objOop13 + BaseHeaderSize) + 4, temp); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex) { + temp = long32At(objOop11 + BaseHeaderSize); + long32Atput(objOop11 + BaseHeaderSize, long32At((objOop11 + BaseHeaderSize) + 4)); + long32Atput((objOop11 + BaseHeaderSize) + 4, temp); } } - prevPrevObj3 = prevObj3; - prevObj3 = objOop13; + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop13 + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop13 - BaseHeaderSize); - } - else { - numSlots6 = numSlots15; - } - if (numSlots6 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes4 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress4 = (objOop13 + BaseHeaderSize) + slotBytes4; - if (oopisGreaterThanOrEqualTo(followingWordAddress4, GIV(endOfMemory))) { - objOop13 = GIV(endOfMemory); - goto l28; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); - followingWord4 = longAt(followingWordAddress4 + 4); - objOop13 = ((((usqInt) followingWord4) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress4 + BaseHeaderSize - : followingWordAddress4); - l28: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; } - l1: /* end convertFloatsToPlatformOrder */; + l15: /* end convertFloatsToPlatformOrder */; } } @@ -64337,8 +63612,6 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) sqInt callerIP; char *callerSP; char *frameAbove; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; int onCurrent; @@ -64353,10 +63626,8 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) assert((GIV(stackPage) == 0) || (GIV(stackPage) == (mostRecentlyUsedPage()))); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((onCurrent = thePage == GIV(stackPage)))) { markStackPageNextMostRecentlyUsed(thePage); } @@ -64370,16 +63641,14 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); callerCtx = callerContextOrNil; - goto l5; + goto l6; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP1 + FoxMethod)))) < (startOfMemory()) @@ -64387,12 +63656,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) : (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP1))); callerCtx = longAt(callerFP1 + FoxThisContext); - goto l7; + goto l6; } callerCtx = marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l7: /* end ensureFrameIsMarried:SP: */; -l5: /* end ensureCallerContext: */; +l6: /* end ensureCallerContext: */; if (((frameAbove = findFrameAboveinPage(theFP, thePage))) == 0) { /* If we're divorcing the top frame we can simply peel it off. */ @@ -64405,11 +63673,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l2: /* end newStackPage */; + l1: /* end newStackPage */; theIP = oopForPointer(pointerForOop(longAt(frameAbove + FoxCallerSavedIP))); frameAbove = moveFramesInthroughtoPage(thePage, frameAbove, newPage); if (onCurrent) { @@ -64477,7 +63745,6 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) static char * NoDbgRegParms externalEnsureIsBaseFrame(char *aFramePtr) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; int onCurrent; char *theFP; StackPage *thePage; @@ -64487,10 +63754,8 @@ externalEnsureIsBaseFrame(char *aFramePtr) } theFP = aFramePtr; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* Storing the frame's sender with its caller's context has the side effect of making theFP a base frame. */ @@ -64513,7 +63778,6 @@ externalEnsureIsBaseFrame(char *aFramePtr) static sqInt NoDbgRegParms externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index1; int onCurrentPage; sqInt senderOop; char *theFP; @@ -64561,10 +63825,8 @@ externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); if (index == SenderIndex) { @@ -64686,7 +63948,7 @@ fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer) arrayOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); /* begin arrayValueOf: */ if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -64765,7 +64027,6 @@ fetchPointerofMarriedContext(sqInt offset, sqInt aContext) char *callerFP; sqInt frameNumArgs; sqInt frameNumArgs1; - sqInt index; sqInt senderOop; sqInt senderOop1; char *spouseFP; @@ -64794,10 +64055,8 @@ fetchPointerofMarriedContext(sqInt offset, sqInt aContext) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -64951,26 +64210,22 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop1 = referent1; + objOop1 = referent2; } classDict = objOop1; assert(!(isForwarded(classDict))); /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin noFixupFollowField:ofObject: */ objOop = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -64979,13 +64234,13 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop = referent2; + objOop = referent1; } methodArray = objOop; assert(!(isForwarded(methodArray))); @@ -65106,7 +64361,6 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderContext, sqInt homeContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; - sqInt index; sqInt senderContext1; sqInt senderOop; char *startFP; @@ -65192,10 +64446,8 @@ findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderConte /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65244,13 +64496,9 @@ findSelectorOfMethod(sqInt meth) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin fetchPointer:ofObject: */ methodArray = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -65338,7 +64586,6 @@ findUnwindThroughContext(sqInt homeContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; sqInt ctxtOrNilOrZero; - sqInt index; sqInt onSamePage; sqInt senderContext; char *theFP; @@ -65398,10 +64645,8 @@ findUnwindThroughContext(sqInt homeContext) /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65435,6 +64680,32 @@ findUnwindThroughContext(sqInt homeContext) return ctxtOrNilOrZero; } + /* StackInterpreter>>#fireEphemeron: */ +static void NoDbgRegParms +fireEphemeron(sqInt ephemeron) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + queueMourner(ephemeron); + /* begin setFormatOf:to: */ + assert(((1 >= 0) && (1 <= (formatMask())))); + flag("endianness"); + longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift()))); + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + + /* StackInterpreter>>#fireFinalization: */ +static void NoDbgRegParms +fireFinalization(sqInt weakling) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (GIV(newFinalization)) { + queueMourner(weakling); + } + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + /* Like #stackFloatValue: but access method arguments left-to-right */ @@ -65886,7 +65157,6 @@ handleStackOverflow(void) sqInt callerContextOrNil; char *callerFP; char *callerFP1; - sqInt index; StackPage *lruOrFree; StackPage *newPage; sqInt overflowCount; @@ -65942,10 +65212,8 @@ handleStackOverflow(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65958,11 +65226,10 @@ handleStackOverflow(void) : (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP1))); longAt(callerFP1 + FoxThisContext); - goto l4; + goto l3; } marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l4: /* end ensureFrameIsMarried:SP: */; l3: /* end ensureCallerContext: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); @@ -66294,6 +65561,7 @@ isKindOfInteger(sqInt oop) sqInt isLargeIntegerObject(sqInt oop) { + /* begin isLargeIntegerInstance: */ return ((oop & (tagMask())) == 0) && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1); } @@ -66302,6 +65570,7 @@ isLargeIntegerObject(sqInt oop) sqInt isLargeNegativeIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargeNegativeInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargeNegativeIntegerCompactIndex); } @@ -66310,6 +65579,7 @@ isLargeNegativeIntegerObject(sqInt oop) sqInt isLargePositiveIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargePositiveInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargePositiveIntegerCompactIndex); } @@ -66351,7 +65621,7 @@ isNullExternalPrimitiveCall(sqInt aMethodObj) sqInt lit; if (!(((primitiveIndexOfMethodheader(aMethodObj, methodHeaderOf(aMethodObj))) == PrimNumberExternalCall) - && ((literalCountOfMethodHeader(methodHeaderOf(aMethodObj))) > 0))) { + && ((literalCountOf(aMethodObj)) > 0))) { return 0; } /* begin fetchPointer:ofObject: */ @@ -66450,7 +65720,6 @@ static sqInt NoDbgRegParms isWidowedContextDuringGC(sqInt aOnceMarriedContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; - sqInt index; char *maybeFrame; sqInt maybeFrameCtxt; sqInt referent; @@ -66468,10 +65737,8 @@ isWidowedContextDuringGC(sqInt aOnceMarriedContext) maybeFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) maybeFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(maybeFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) maybeFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(maybeFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((isFree(thePage)) || (maybeFrame < ((thePage->headFP))))) { @@ -66536,7 +65803,6 @@ static sqInt NoDbgRegParms isWidowedContext(sqInt aOnceMarriedContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; - sqInt index; sqInt senderOop; char *shouldBeFrameCallerField; char *theFrame; @@ -66552,10 +65818,8 @@ isWidowedContext(sqInt aOnceMarriedContext) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((isFree(thePage)) || (theFrame < ((thePage->headFP))))) { @@ -66616,6 +65880,7 @@ isKindOfClass(sqInt oop, sqInt aClass) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66645,6 +65910,7 @@ isKindOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66673,6 +65939,7 @@ isMemberOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66693,13 +65960,9 @@ lengthOfNameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { return lengthOfNameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord())))))); } @@ -66712,13 +65975,9 @@ lengthOfNameOfClass(sqInt classOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { return numSlots2; } @@ -66814,8 +66073,8 @@ longPrintOop(sqInt oop) sqInt n1; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt startIP; if ((oop & (tagMask())) @@ -66844,7 +66103,6 @@ longPrintOop(sqInt oop) printf("0x%lx", ((unsigned long) class)); print(")"); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); print(" format "); /* begin printHexnp: */ @@ -66860,14 +66118,10 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(oop + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(oop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { len = numSlots; goto l5; @@ -66974,38 +66228,34 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(oop + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(oop - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(oop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots11); if (fmt2 <= 5) { - lastIndex = numSlots1; - goto l7; + lastIndex = numSlots2; + goto l8; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - lastIndex = (numSlots1 << (shiftForWord())) - (fmt2 & 7); - goto l7; + lastIndex = (numSlots2 << (shiftForWord())) - (fmt2 & 7); + goto l8; } if (fmt2 >= (firstShortFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l8; } if (fmt2 >= (firstLongFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l8; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - lastIndex = ((usqInt) numSlots1) >> 1; - goto l7; + lastIndex = ((usqInt) numSlots2) >> 1; + goto l8; } lastIndex = 0; - l7: /* end lengthOf:format: */; + l8: /* end lengthOf:format: */; if ((lastIndex - startIP) > 100) { lastIndex = startIP + 100; } @@ -67129,6 +66379,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) sqInt tagBits; sqInt wrapAround; + /* begin fetchClassOf: */ receiverClass = (((tagBits = GIV(localAbsentReceiver) & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(GIV(localAbsentReceiver))); @@ -67146,13 +66397,9 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67177,19 +66424,19 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l15; + goto l16; } index += 1; } found = 0; - goto l15; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67200,13 +66447,13 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67215,7 +66462,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l15; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67223,12 +66470,12 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67237,20 +66484,20 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } GIV(newMethod) = objOop4; found = 1; - goto l15; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l15; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; -l15: /* end lookupMethodInDictionary: */; +l16: /* end lookupMethodInDictionary: */; if (found && ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate)) { return rule; @@ -67307,13 +66554,9 @@ lookupMethodInClass(sqInt class) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67338,12 +66581,12 @@ lookupMethodInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; goto l19; } @@ -67361,13 +66604,13 @@ lookupMethodInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67384,12 +66627,12 @@ lookupMethodInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67464,11 +66707,11 @@ lookupMNU(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; createActualMessageTo(GIV(lkupClass)); @@ -67486,13 +66729,9 @@ lookupMNU(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67517,19 +66756,19 @@ lookupMNU(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l18; + goto l16; } index += 1; } found = 0; - goto l18; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67540,13 +66779,13 @@ lookupMNU(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67555,7 +66794,7 @@ lookupMNU(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l18; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67563,12 +66802,12 @@ lookupMNU(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67577,30 +66816,30 @@ lookupMNU(void) } GIV(newMethod) = objOop4; found = 1; - goto l18; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l18; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; - l18: /* end lookupMethodInDictionary: */; + l16: /* end lookupMethodInDictionary: */; if (found) { return LookupRuleMNU; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } error("Recursive not understood error encountered"); return 0; @@ -67629,41 +66868,37 @@ lookupMNUInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67688,19 +66923,19 @@ lookupMNUInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67711,13 +66946,13 @@ lookupMNUInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67726,7 +66961,7 @@ lookupMNUInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67734,12 +66969,12 @@ lookupMNUInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67748,20 +66983,20 @@ lookupMNUInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { GIV(lkupClass) = class; addNewMethodToNSCache(LookupRuleMNU); @@ -67769,12 +67004,12 @@ lookupMNUInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -67803,41 +67038,37 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67862,19 +67093,19 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67885,13 +67116,13 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67900,7 +67131,7 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67908,12 +67139,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67922,20 +67153,20 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { addNewMethodToCache(class); @@ -67948,12 +67179,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -67986,11 +67217,11 @@ lookupOrdinarySend(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; assert(addressCouldBeClassObj(GIV(lkupClass))); @@ -68006,13 +67237,9 @@ lookupOrdinarySend(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -68037,19 +67264,19 @@ lookupOrdinarySend(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -68060,13 +67287,13 @@ lookupOrdinarySend(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -68075,7 +67302,7 @@ lookupOrdinarySend(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68083,12 +67310,12 @@ lookupOrdinarySend(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -68097,20 +67324,20 @@ lookupOrdinarySend(void) } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { return LookupRuleOrdinary; @@ -68120,12 +67347,12 @@ lookupOrdinarySend(void) } } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -68152,11 +67379,11 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -68171,13 +67398,9 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -68202,19 +67425,19 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -68225,13 +67448,13 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -68240,7 +67463,7 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68248,12 +67471,12 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -68262,31 +67485,31 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return rule; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -68311,8 +67534,8 @@ lookupSelectorinClass(sqInt selector, sqInt class) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; + sqInt objOop3; sqInt wrapAround; currentClass = class; @@ -68330,13 +67553,9 @@ lookupSelectorinClass(sqInt selector, sqInt class) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -68361,7 +67580,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { meth = null; - goto l11; + goto l9; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68376,36 +67595,36 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop11); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } - meth = objOop11; - goto l11; + meth = objOop1; + goto l9; } index += 1; if (index == length) { if (wrapAround) { meth = null; - goto l11; + goto l9; } wrapAround = 1; index = SelectorStart; } } meth = null; - l11: /* end lookupMethodFor:InDictionary: */; + l9: /* end lookupMethodFor:InDictionary: */; if (!(meth == null)) { return meth; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop3 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop3 & (tagMask())) == 0) + && (((longAt(objOop3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop3); } - currentClass = objOop1; + currentClass = objOop3; } return null; } @@ -68467,7 +67686,6 @@ makeContextSnapshotSafe(sqInt ctxt) sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -68483,8 +67701,7 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -68507,13 +67724,13 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l4: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)xValue << 1) | 1)); @@ -68689,13 +67906,11 @@ markAndTraceStackPages(sqInt fullGCFlag) sqInt callerContextOrNil; sqInt context; sqInt i; - sqInt index; - sqInt index1; void *pointer; sqInt senderOop; char *theFP; StackPage *thePage; - StackPage *thePage1; + StackPage *thePage2; if (!fullGCFlag) { for (i = 0; i < GIV(numStackPages); i += 1) { @@ -68717,11 +67932,9 @@ markAndTraceStackPages(sqInt fullGCFlag) theFP = (thePage->baseFP); assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); - callerContextOrNil = longAt((thePage1->baseAddress)); + thePage2 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); @@ -68737,10 +67950,8 @@ markAndTraceStackPages(sqInt fullGCFlag) pointer = pointerForOop(senderOop - 1); /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(!(isFree(thePage))); } } while(((thePage->trace)) < StackPageTraced); @@ -68782,7 +67993,6 @@ markAndTraceUntracedReachableStackPages(void) static sqInt NoDbgRegParms marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; char *rcvrOffset; sqInt senderOop; char *theFP; @@ -68799,10 +68009,8 @@ marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop } else { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); theSP = findSPOfon(theFP, thePage); } if ((anOop & 1)) { @@ -68933,6 +68141,7 @@ marryFrameSP(char *theFP, char *theSP) numArgs = (cogMethod->cmNumArgs); if (((cogMethod->cmType)) == CMMethod) { if (0) { + /* begin frameStackedReceiver:numArgs: */ closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())))); } else { @@ -68960,6 +68169,7 @@ marryFrameSP(char *theFP, char *theSP) ? LargeContextSlots : SmallContextSlots); if ((byteAt((theFP + FoxIFrameFlags) + 3)) != 0) { + /* begin frameStackedReceiver:numArgs: */ closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())))); } else { @@ -69080,7 +68290,7 @@ maybeSelectorOfMethod(sqInt methodObj) penultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset1 + LiteralStart)) << (shiftForWord()))))); if (((penultimateLiteral & (tagMask())) == 0) - && (isWordsOrBytesNonImm(penultimateLiteral))) { + && (isPureBitsFormat((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())))) { return ((fetchClassTagOfNonImm(penultimateLiteral)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand))) ? penultimateLiteral : 0); @@ -69091,7 +68301,7 @@ maybeSelectorOfMethod(sqInt methodObj) && (((longAt((penultimateLiteral + BaseHeaderSize) + (0U << (shiftForWord())))) == methodObj) && (((maybeSelector = longAt((penultimateLiteral + BaseHeaderSize) + (1U << (shiftForWord())))), (((maybeSelector & (tagMask())) == 0) - && (isWordsOrBytesNonImm(maybeSelector))) + && (isPureBitsFormat((((usqInt) (longAt(maybeSelector))) >> (formatShift())) & (formatMask())))) && ((fetchClassTagOfNonImm(maybeSelector)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand)))))))) ? maybeSelector : 0); @@ -69130,7 +68340,7 @@ methodClassAssociationOf(sqInt methodPointer) sqInt offset; /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -69152,7 +68362,7 @@ methodClassOf(sqInt methodPointer) sqInt offset; /* begin followLiteral:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin followField:ofObject: */ objOop2 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((objOop2 & (tagMask())) == 0) @@ -69218,7 +68428,8 @@ methodPrimitiveIndex(void) methodHeader = ((((CogMethod *) header))->methodHeader); } return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69294,13 +68505,9 @@ nameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { /* begin fetchPointer:ofObject: */ maybeThisClassOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))); @@ -69366,13 +68573,13 @@ noInlineSigned32BitIntegerGutsFor(sqInt integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l4: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l3: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong32:ofObject:withValue: */ valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(magnitude); long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); @@ -69433,7 +68640,7 @@ noMarkedContextsOnPage(StackPage *thePage) ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); - if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } } @@ -69522,7 +68729,7 @@ penultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 2; + offset = (literalCountOf(aMethodOop)) - 2; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -69581,7 +68788,7 @@ positiveMachineIntegerFor(usqIntptr_t value) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) value)) <= (MaxSmallInteger)) { resultObj = ((value << 1) | 1); - goto l7; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -69604,13 +68811,13 @@ positiveMachineIntegerFor(usqIntptr_t value) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -69621,10 +68828,9 @@ positiveMachineIntegerFor(usqIntptr_t value) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); resultObj = newLargeInteger; -l7: /* end maybeInlinePositive32BitIntegerFor: */; - goto l1; + goto l5; -l1: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; return resultObj; } @@ -69694,7 +68900,8 @@ primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader) sqInt firstBytecode; return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69719,7 +68926,8 @@ primitiveIndexOf(sqInt methodPointer) methodHeader = ((((CogMethod *) header))->methodHeader); } return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69746,13 +68954,9 @@ printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); i = SelectorStart; while (i < classDictSize) { if (aSelector == (longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { @@ -69919,11 +69123,11 @@ printAllStacks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -69947,9 +69151,9 @@ printAllStacks(void) sqInt tagBits; /* begin activeProcess */ - objOop11 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop4 = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - proc = longAt((objOop4 + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + proc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); printNameOfClasscount((((tagBits = proc & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(proc)), 5); @@ -69962,20 +69166,16 @@ printAllStacks(void) printf("\n"); printCallStackFP(GIV(framePointer)); /* begin fetchPointer:ofObject: */ - objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - schedLists = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + objOop3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop1 = longAt((objOop3 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + schedLists = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); if (GIV(highestRunnableProcessPriority) == 0) { /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -70008,47 +69208,43 @@ printAllStacks(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop3 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop3 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; - assert((long64At(objOop3)) != 0); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); /* begin classIndexOf: */ - classIdx = (longAt(objOop3)) & (classIndexMask()); + classIdx = (longAt(objOop11)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop3); + printProcsOnList(objOop11); } prevPrevObj1 = prevObj1; - prevObj1 = objOop3; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop3 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop3 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop3 = GIV(endOfMemory); - goto l10; + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop3 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l10: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -70058,92 +69254,84 @@ printAllStacks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots1 = byteAt(address + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop4 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { + while (oopisLessThan(objOop4, limit)) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(objOop4 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop4 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l5; + objOop4 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l5: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots2 = byteAt(address1 + 7); - objOop1 = (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop4 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { + while (oopisLessThan(objOop4, GIV(freeStart))) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots11 = byteAt(objOop4 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop4 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l6; + objOop4 = GIV(freeStart); + goto l22; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l6: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } } @@ -70217,8 +69405,6 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; sqInt ctxt; - sqInt index; - sqInt index1; sqInt referent; sqInt senderOop; char *theFP; @@ -70235,10 +69421,8 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) if (checkIsStillMarriedContextcurrentFP(ctxt, currFP)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (isFree(thePage)) { /* begin printHexPtr: */ printHex(oopForPointer(theFP)); @@ -70252,10 +69436,8 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -70403,8 +69585,7 @@ printContext(sqInt aContext) print("method "); /* begin printMethodFieldForPrintContext: */ meth = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); - if ((assert(isNonImmediate(meth)), - isCogMethodReference(longAt((meth + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(meth)) { /* begin printHexnp: */ n = ((sqInt) (cogMethodOf(meth))); printf("0x%lx", ((unsigned long) n)); @@ -70628,7 +69809,6 @@ printFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *aFrame; char *frameAbove; - sqInt index; char *prevFrame; char *startFrame; StackPage *thePage; @@ -70649,10 +69829,8 @@ printFrame(char *theFP) } else { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (isFree(thePage)) { /* begin printHexPtr: */ printHex(oopForPointer(theFP)); @@ -70674,7 +69852,7 @@ printFrame(char *theFP) assert(!(isFree(thePage))); if (startFrame == theFP) { frameAbove = null; - goto l3; + goto l2; } aFrame = startFrame; while (1) { @@ -70684,11 +69862,11 @@ printFrame(char *theFP) if (!(aFrame != 0)) break; if (theFP == aFrame) { frameAbove = prevFrame; - goto l3; + goto l2; } } frameAbove = null; - l3: /* end safeFindFrameAbove:on:startingFrom: */; + l2: /* end safeFindFrameAbove:on:startingFrom: */; theSP = (!(frameAbove == null) ? (assert(!(isBaseFrame(frameAbove))), (frameAbove + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(frameAbove + FoxMethod)))) < (startOfMemory()) @@ -70774,10 +69952,10 @@ printLikelyImplementorsOfSelector(sqInt selector) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -70805,23 +69983,23 @@ printLikelyImplementorsOfSelector(sqInt selector) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop11 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop12 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop11, limit)) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, limit)) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71015,53 +70193,49 @@ printLikelyImplementorsOfSelector(sqInt selector) prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop11 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop12 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop11 + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop12 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop11 = limit; + objOop12 = limit; goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop11 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop11 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop12 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop11, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71255,54 +70429,50 @@ printLikelyImplementorsOfSelector(sqInt selector) prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop11 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop12 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop11 + BaseHeaderSize) + slotBytes1; + followingWordAddress1 = (objOop12 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop11 = GIV(freeStart); - goto l22; + objOop12 = GIV(freeStart); + goto l23; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop11 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l22: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (isEnumerableObject(objOop12)) { - if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop12)) == selector)) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop12))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop11)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop12)); + printf("0x%lx", ((unsigned long) objOop11)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71497,34 +70667,30 @@ printLikelyImplementorsOfSelector(sqInt selector) } prevPrevObj1 = prevObj1; - prevObj1 = objOop12; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop12 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l25; + objOop11 = GIV(endOfMemory); + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l25: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } } @@ -71627,13 +70793,9 @@ printNameOfClasscount(sqInt classOop, sqInt cnt) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if ((numSlots == GIV(metaclassNumSlots)) && (GIV(metaclassNumSlots) > GIV(thisClassIndex))) { printNameOfClasscount(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))), cnt - 1); @@ -71915,7 +71077,6 @@ printOop(sqInt oop) /* begin cr */ printf("\n")); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt > 5) { print(" nbytes "); @@ -71984,13 +71145,9 @@ printOop(sqInt oop) fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { lastIndex = numSlots; goto l3; @@ -72408,7 +71565,6 @@ printStringOf(sqInt oop) if (!(addressCouldBeObj(oop))) { return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt < (firstByteFormat())) { return; @@ -72744,7 +71900,6 @@ EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt calloutContext; - sqInt index; sqInt senderOop; sqInt senderOop1; char *sp; @@ -72835,10 +71990,8 @@ reestablishContextPriorToCallback(sqInt callbackContext) theFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(thePage != GIV(stackPage)); GIV(stackPointer) = (findSPOfon(theFP, thePage)) - BytesPerWord; GIV(framePointer) = theFP; @@ -72938,7 +72091,7 @@ removeFirstLinkOfList(sqInt aList) static sqInt retryPrimitiveOnFailure(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - signed char accessorDepth; + sqInt accessorDepth; sqInt canRetry; sqInt firstBytecode; sqInt followDone; @@ -73002,6 +72155,7 @@ retryPrimitiveOnFailure(void) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -73089,7 +72243,6 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac sqInt aMethodObj; sqInt aMethodObj1; sqInt calloutMethodContext; - sqInt index; sqInt senderOop; sqInt senderOop1; char *sp; @@ -73194,10 +72347,8 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac theFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(thePage != GIV(stackPage)); GIV(stackPointer) = (((thePage->headFP)) == theFP ? (thePage->headSP) @@ -73304,7 +72455,7 @@ safeMethodClassOf(sqInt methodPointer) sqInt referent1; /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ literal = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((literal & (tagMask())) == 0) @@ -73488,7 +72639,6 @@ setSignalLowSpaceFlagAndSaveProcess(void) static void NoDbgRegParms setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; void *pointer; sqInt senderOop; StackPage *thePage; @@ -73501,10 +72651,8 @@ setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext) pointer = pointerForOop(senderOop - 1); /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(((((thePage->trace)) >= StackPageUnreached) && (((thePage->trace)) <= StackPageTraced))); if (((thePage->trace)) == StackPageUnreached) { (thePage->trace = StackPageReachedButUntraced); @@ -73670,7 +72818,6 @@ shortReversePrintFrameAndCallers(char *aFramePointer) sqInt caller; sqInt callerContextOrNil; char *callerFP; - sqInt index; sqInt referent; char *theFP; StackPage *thePage; @@ -73690,10 +72837,8 @@ shortReversePrintFrameAndCallers(char *aFramePointer) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -73791,7 +72936,7 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) oop = (oopForPointer(cPtr)) - BaseHeaderSize; if (!(((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)))) { + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; @@ -73802,13 +72947,9 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -74069,11 +73210,11 @@ snapshot(sqInt embedded) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l11; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l11: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -74265,13 +73406,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent11 & (tagMask())) == 0) - && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent21 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent21 & (tagMask())) == 0) + && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj1 = referent11; + obj1 = referent21; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74294,13 +73435,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent21 & (tagMask())) == 0) - && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent31 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent31 & (tagMask())) == 0) + && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj2 = referent21; + obj2 = referent31; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74323,13 +73464,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj3)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent31 & (tagMask())) == 0) - && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent4 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent4 & (tagMask())) == 0) + && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj3 = referent31; + obj3 = referent4; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74352,13 +73493,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj4)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent5 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent5 & (tagMask())) == 0) + && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj4 = referent4; + obj4 = referent5; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74411,13 +73552,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent5 & (tagMask())) == 0) - && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj = referent5; + obj = referent11; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(xArray))); if ((assert(isNonImmediate(xArray)), @@ -74442,37 +73583,37 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileProcess))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileProcess) = referent1; + GIV(profileProcess) = referent3; } if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileMethod))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileMethod) = referent2; + GIV(profileMethod) = referent1; } if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileSemaphore))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileSemaphore) = referent3; + GIV(profileSemaphore) = referent2; } } } @@ -74626,15 +73767,12 @@ stackPointerForMaybeMarriedContext(sqInt aContext) static sqInt NoDbgRegParms stackPointerIndexForFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; StackPage *thePage; char *theSP; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); theSP = findSPOfon(theFP, thePage); return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) ? (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs)) @@ -74747,7 +73885,7 @@ stackValue(sqInt offset) sqInt startPCOfMethod(sqInt aCompiledMethod) { - return ((literalCountOfMethodHeader(methodHeaderOf(aCompiledMethod))) + LiteralStart) * BytesPerOop; + return ((literalCountOf(aCompiledMethod)) + LiteralStart) * BytesPerOop; } @@ -74778,56 +73916,51 @@ stObjectat(sqInt array, sqInt index) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -74836,17 +73969,17 @@ stObjectat(sqInt array, sqInt index) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -74910,7 +74043,7 @@ stObjectat(sqInt array, sqInt index) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -74956,56 +74089,51 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -75014,17 +74142,17 @@ stObjectatput(sqInt array, sqInt index, sqInt value) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -75056,37 +74184,37 @@ stObjectatput(sqInt array, sqInt index, sqInt value) } } longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((array + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -75094,7 +74222,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong64:ofObject:withValue: */ long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value); @@ -75102,7 +74230,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong32:ofObject:withValue: */ long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -75149,8 +74277,6 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; char *callerFP; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; int onCurrentPage; @@ -75170,10 +74296,8 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -75186,17 +74310,14 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); longAt(callerFP + FoxThisContext); - goto l5; + goto l4; } marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l5: /* end ensureFrameIsMarried:SP: */; l4: /* end ensureCallerContext: */; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); if (!onCurrentPage) { @@ -75208,11 +74329,11 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l2: /* end newStackPage */; +l1: /* end newStackPage */; theMovedFP = moveFramesInthroughtoPage(thePage, theFP, newPage); if (onCurrentPage) { /* begin setStackPageAndLimit: */ @@ -75252,56 +74373,51 @@ stSizeOf(sqInt oop) /* begin baseHeader: */ hdr = long64At(oop); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l4; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l4; + goto l3; } totalLength = 0; -l4: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l6; + goto l4; } if (fmt < 2) { fixedFields = totalLength; - goto l6; + goto l4; } class = fetchClassOfNonImm(oop); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l6: /* end fixedFieldsOf:format:length: */; +l4: /* end fixedFieldsOf:format:length: */; if (fmt == (indexablePointersFormat())) { assert(!(isContextHeader(hdr))); } @@ -75364,7 +74480,7 @@ ultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 1; + offset = (literalCountOf(aMethodOop)) - 1; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -75377,7 +74493,6 @@ static sqInt NoDbgRegParms NeverInline unfollowatIndex(sqInt litVar, sqInt literalIndex) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt followed; - usqInt objOop; sqInt referent; /* begin followForwarded: */ @@ -75391,21 +74506,20 @@ unfollowatIndex(sqInt litVar, sqInt literalIndex) } followed = referent; /* begin literal:ofMethod:put: */ - objOop = GIV(method); - assert(!(isForwarded(objOop))); - if ((assert(isNonImmediate(objOop)), - oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) { + assert(!(isForwarded(GIV(method)))); + if ((assert(isNonImmediate(GIV(method))), + oopisGreaterThanOrEqualTo(GIV(method), GIV(oldSpaceStart)))) { /* most stores into young objects */ if (((followed & (tagMask())) == 0) && (oopisLessThan(followed, GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) { - remember(objOop); + if (!(((((usqInt) (longAt(GIV(method)))) >> (rememberedBitShift())) & 1) != 0)) { + remember(GIV(method)); } } } - longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((literalIndex + LiteralStart)) << (shiftForWord())))), followed); + longAtput((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((literalIndex + LiteralStart)) << (shiftForWord())))), followed); return followed; } @@ -75506,13 +74620,9 @@ wakeHighestPriority(void) /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -75584,7 +74694,6 @@ writeImageFileIO(void) } return null; } - /* begin imageSizeToWrite */ assert(newSpaceIsEmpty()); /* begin totalBytesInNonEmptySegments */ total = 0; @@ -75594,6 +74703,7 @@ writeImageFileIO(void) } } imageBytes = total; + headerStart = sqImageFileStartLocation(f, imageName, headerSize + imageBytes); /* Note: on Unix systems one could put an exec command here, padded to 512 bytes */; sqImageFileSeek(f, headerStart); @@ -75670,14 +74780,9 @@ cloneContext(sqInt aContext) /* begin numSlotsOf: */ assert((classIndexOf(aContext)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(aContext + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - sz = longAt(aContext - BaseHeaderSize); - } - else { - sz = numSlots; - } - /* begin eeInstantiateMethodContextSlots: */ + sz = (numSlots == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots); cloned = allocateNewSpaceSlotsformatclassIndex(sz, indexablePointersFormat(), ClassMethodContextCompactIndex); if (cloned != 0) { for (i = 0; i <= StackPointerIndex; i += 1) { @@ -75771,7 +74876,6 @@ fieldofFrame(sqInt index, char *theFP) char *callerFP; sqInt frameNumArgs; sqInt frameNumArgs1; - sqInt index1; sqInt numArgs; StackPage *thePage; @@ -75784,9 +74888,8 @@ fieldofFrame(sqInt index, char *theFP) ? (/* begin frameCallerContext: */ assert(isBaseFrame(theFP)), /* begin stackPageFor: */ - (assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), - (index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)))), - (thePage = stackPageAtpages(index1, GIV(pages))), + (thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages))), (callerContextOrNil = longAt((thePage->baseAddress))), assert(addressCouldBeObj(callerContextOrNil)), assert((callerContextOrNil == (nilObject())) @@ -75935,10 +75038,10 @@ primitiveContextAt(void) sqInt reasonCode; sqInt senderOop; char *sp; - char *sp1; + sqInt sp1; sqInt sp11; char *sp2; - sqInt sp3; + char *sp3; sqInt sp4; char *spouseFP; sqInt stSize; @@ -75966,17 +75069,12 @@ primitiveContextAt(void) /* might be an instance of a subclass */ /* begin stObject:at: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; goto l23; @@ -76024,23 +75122,23 @@ primitiveContextAt(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l16; + goto l20; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l16; + goto l20; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l16: /* end stackPointerForMaybeMarriedContext: */; + l20: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { value = noInlineTemporaryin(index - 1, frameOfMarriedContext(aContext)); - goto l25; + goto l30; } } else { @@ -76054,19 +75152,19 @@ primitiveContextAt(void) if (fmt1 <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord()))))); - goto l37; + goto l30; } if (fmt1 >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1))) << 1) | 1); - goto l37; + goto l30; } if (fmt1 >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))))))) << 1) | 1); - goto l37; + goto l30; } if (fmt1 == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))))); - goto l37; + goto l30; } /* begin positive32BitIntegerFor: */ @@ -76075,7 +75173,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { value = ((integerValue1 << 1) | 1); - goto l37; + goto l30; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -76098,13 +75196,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l32; + goto l29; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l32: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l29: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -76115,10 +75213,8 @@ primitiveContextAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger1; - goto l37; + goto l30; - l37: /* end subscript:with:format: */; - goto l25; } /* begin primitiveFailFor: */ reasonCode = (fmt1 <= 1 @@ -76126,7 +75222,7 @@ primitiveContextAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; value = 0; - l25: /* end stObject:at: */; + l30: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -76148,65 +75244,60 @@ primitiveContextAt(void) assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l9; + goto l12; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l12; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l12; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l12; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l9; + goto l12; } totalLength = 0; - l9: /* end lengthOf:format: */; + l12: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l13; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l13; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l15: /* end fixedFieldsOf:format:length: */; + l13: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ - sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); - if (!((sp3 & 1))) { + sp1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp1 & 1))) { stSize = 0; - goto l11; + goto l4; } - assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); - stSize = (sp3 >> 1); - l11: /* end fetchStackPointerOf: */; + assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(aContext))); + stSize = (sp1 >> 1); + l4: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -76216,19 +75307,19 @@ primitiveContextAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l31; + goto l18; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l31; + goto l18; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l31; + goto l18; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l31; + goto l18; } /* begin positive32BitIntegerFor: */ @@ -76237,7 +75328,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l31; + goto l18; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -76260,13 +75351,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l26; + goto l16; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l26: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l16: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -76277,12 +75368,12 @@ primitiveContextAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l31; + goto l18; - l31: /* end subscript:with:format: */; + l18: /* end subscript:with:format: */; /* begin pop:thenPush: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp1; + longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp2; return; } /* begin frameOfMarriedContext: */ @@ -76303,8 +75394,8 @@ primitiveContextAt(void) ? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - (index - 1)) * BytesPerWord)) : longAt(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (index - 1)) * BytesPerWord)))); /* begin pop:thenPush: */ - longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp2; + longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp3; } @@ -76338,10 +75429,10 @@ primitiveContextAtPut(void) sqInt signedValueToStore; sqInt signedValueToStore1; char *sp; - char *sp1; + sqInt sp1; sqInt sp11; char *sp2; - sqInt sp3; + char *sp3; sqInt sp4; char *spouseFP; sqInt stSize; @@ -76373,56 +75464,51 @@ primitiveContextAtPut(void) /* might be an instance of a subclass */ /* begin stObject:at:put: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l34; + goto l26; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l34; + goto l26; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l34; + goto l26; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l34; + goto l26; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l34; + goto l26; } totalLength1 = 0; - l34: /* end lengthOf:format: */; + l26: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l32; + goto l21; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l32; + goto l21; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l32: /* end fixedFieldsOf:format:length: */; + l21: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -76431,23 +75517,23 @@ primitiveContextAtPut(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l23; + goto l22; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l23; + goto l22; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l23: /* end stackPointerForMaybeMarriedContext: */; + l22: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(aContext), value); - goto l38; + goto l34; } } else { @@ -76474,37 +75560,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l26; + goto l33; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l26; + goto l33; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l26; + goto l33; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -76512,7 +75598,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l26; + goto l33; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -76520,7 +75606,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l26: /* end subscript:with:storing:format: */; + l33: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -76529,7 +75615,7 @@ primitiveContextAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } - l38: /* end stObject:at:put: */; + l34: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -76551,65 +75637,60 @@ primitiveContextAtPut(void) assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l10; + goto l13; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l10; + goto l13; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l10; + goto l13; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l10; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l10; + goto l13; } totalLength = 0; - l10: /* end lengthOf:format: */; + l13: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l22; + goto l14; } if (fmt < 2) { fixedFields = totalLength; - goto l22; + goto l14; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l22: /* end fixedFieldsOf:format:length: */; + l14: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ - sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); - if (!((sp3 & 1))) { + sp1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp1 & 1))) { stSize = 0; - goto l12; + goto l4; } - assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); - stSize = (sp3 >> 1); - l12: /* end fetchStackPointerOf: */; + assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(aContext))); + stSize = (sp1 >> 1); + l4: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -76632,37 +75713,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l17; + goto l20; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l17; + goto l20; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l17; + goto l20; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -76670,7 +75751,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l17; + goto l20; } unsignedValueToStore = positive32BitValueOf(value); @@ -76678,10 +75759,10 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l17: /* end subscript:with:storing:format: */; + l20: /* end subscript:with:storing:format: */; /* begin pop:thenPush: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp1; + longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp2; return; } /* begin frameOfMarriedContext: */ @@ -76708,8 +75789,8 @@ primitiveContextAtPut(void) } } /* begin pop:thenPush: */ - longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp2; + longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp3; } @@ -76738,56 +75819,51 @@ primitiveContextSize(void) rcvr = longAt(GIV(stackPointer)); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); @@ -76807,17 +75883,17 @@ primitiveContextSize(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); sz = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { sz = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); sz = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; } else { sz = totalLength - fixedFields; @@ -76874,6 +75950,7 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt argumentArray; usqInt arraySize; sqInt ccIndex; + sqInt classOop; sqInt firstBytecode; sqInt fmt; sqInt fmt1; @@ -76887,18 +75964,17 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt moduleLength; sqInt moduleName; sqInt nItems; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; + sqInt numSlots4; sqInt object; sqInt object1; sqInt object2; sqInt object3; sqInt object4; - sqInt objFormat; sqInt primRcvr; char *sp; char *sp1; @@ -76930,14 +76006,10 @@ primitiveDoNamedPrimitiveWithArgs(void) } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); - numSlots2 = byteAt(argumentArray + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots2; - } + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -2); @@ -76963,22 +76035,24 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin fetchPointer:ofObject: */ spec = longAt((methodArg + BaseHeaderSize) + (1U << (shiftForWord()))); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (spec & (tagMask())) { isArray = 0; - goto l24; + goto l22; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(spec))); /* begin classIndexOf: */ ccIndex = (longAt(spec)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex; - goto l24; + goto l22; -l24: /* end is:instanceOf:compactClassIndex: */; +l22: /* end is:instanceOf:compactClassIndex: */; if (!(isArray && (((numSlotsOf(spec)) == 4) && (((methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0)) == PrimNumberExternalCall)))) { /* begin primitiveFailFor: */ @@ -77009,38 +76083,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(moduleName + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots1 = byteAt(moduleName + 7); + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { - moduleLength = numSlots1; - goto l14; + moduleLength = numSlots2; + goto l17; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - moduleLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l14; + moduleLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l17; } if (fmt >= (firstShortFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l17; } if (fmt >= (firstLongFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l17; } if (fmt == (sixtyFourBitIndexableFormat())) { - moduleLength = ((usqInt) numSlots1) >> 1; - goto l14; + moduleLength = ((usqInt) numSlots2) >> 1; + goto l17; } moduleLength = 0; - l14: /* end lengthOf:format: */; + l17: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((spec + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -77057,38 +76127,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(functionName + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots3 = numSlots5; - } + numSlots11 = byteAt(functionName + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { functionLength = numSlots3; - goto l17; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ functionLength = (numSlots3 << (shiftForWord())) - (fmt1 & 7); - goto l17; + goto l24; } if (fmt1 >= (firstShortFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l17; + goto l24; } if (fmt1 >= (firstLongFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l17; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { functionLength = ((usqInt) numSlots3) >> 1; - goto l17; + goto l24; } functionLength = 0; -l17: /* end lengthOf:format: */; +l24: /* end lengthOf:format: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -3); @@ -77101,14 +76167,11 @@ primitiveDoNamedPrimitiveWithArgs(void) return; } /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; - numSlots = 5; - assert((numSlots >= 0) + numSlots4 = 5; + assert((numSlots4 >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots, objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots4, 2, ClassArrayCompactIndex); /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = (argumentArray = popStack()); assert(!(isOopForwarded(GIV(tempOop)))); @@ -77246,13 +76309,9 @@ primitiveDoPrimitiveWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -PrimErrLimitExceeded); @@ -77438,6 +76497,7 @@ primitiveExecuteMethod(void) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -77547,6 +76607,7 @@ primitiveExecuteMethodArgsArray(void) methodHeader = ((((CogMethod *) header2))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -77607,8 +76668,8 @@ primitiveExternalCall(void) sqInt moduleName; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt val; @@ -77619,7 +76680,7 @@ primitiveExternalCall(void) val = 0; if (!((((GIV(newMethod) & (tagMask())) == 0) && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) - && (((literalCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) > 0) + && (((literalCountOf(GIV(newMethod))) > 0) && (((lit = literalofMethod(0, GIV(newMethod))), (((lit & (tagMask())) == 0) && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) @@ -77689,38 +76750,34 @@ primitiveExternalCall(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(moduleName + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(moduleName + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { moduleLength = numSlots; - goto l12; + goto l14; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ moduleLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l14; } if (fmt >= (firstShortFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l14; } if (fmt >= (firstLongFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { moduleLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l14; } moduleLength = 0; - l12: /* end lengthOf:format: */; + l14: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((lit + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -77732,38 +76789,34 @@ primitiveExternalCall(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(functionName + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(functionName + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - functionLength = numSlots1; - goto l13; + functionLength = numSlots2; + goto l17; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - functionLength = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l13; + functionLength = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l17; } if (fmt1 >= (firstShortFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l13; + functionLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l17; } if (fmt1 >= (firstLongFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l13; + functionLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l17; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - functionLength = ((usqInt) numSlots1) >> 1; - goto l13; + functionLength = ((usqInt) numSlots2) >> 1; + goto l17; } functionLength = 0; -l13: /* end lengthOf:format: */; +l17: /* end lengthOf:format: */; addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&accessorDepth)); if (addr == 0) { index = -1; @@ -77865,7 +76918,6 @@ primitiveFindNextUnwindContext(void) sqInt calleeContext; sqInt callerContextOrNil; sqInt handlerOrNilOrZero; - sqInt index; sqInt senderContext; sqInt senderOop; char *sp; @@ -77961,10 +77013,8 @@ primitiveFindNextUnwindContext(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -78127,56 +77177,51 @@ primitiveInstVarAt(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l6; + goto l5; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l6; + goto l5; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l6; + goto l5; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l6; + goto l5; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l6; + goto l5; } totalLength = 0; -l6: /* end lengthOf:format: */; +l5: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l8; + goto l6; } if (fmt < 2) { fixedFields = totalLength; - goto l8; + goto l6; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l8: /* end fixedFieldsOf:format:length: */; +l6: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -78192,19 +77237,19 @@ primitiveInstVarAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))); - goto l14; + goto l11; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l14; + goto l11; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))))))) << 1) | 1); - goto l14; + goto l11; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))))); - goto l14; + goto l11; } /* begin positive32BitIntegerFor: */ @@ -78213,7 +77258,7 @@ primitiveInstVarAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l14; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -78242,7 +77287,7 @@ primitiveInstVarAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l9: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -78253,9 +77298,9 @@ primitiveInstVarAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l14; + goto l11; - l14: /* end subscript:with:format: */; + l11: /* end subscript:with:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -78303,7 +77348,8 @@ primitiveInstVarAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -78315,56 +77361,51 @@ primitiveInstVarAtPut(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l12; + goto l7; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l7; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l7; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l7; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l7; } totalLength = 0; -l12: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l8; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l8; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l15: /* end fixedFieldsOf:format:length: */; +l8: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -78393,37 +77434,37 @@ primitiveInstVarAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue); - goto l11; + goto l14; } if (fmt >= (firstByteFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index - 1), signedValueToStore); - goto l11; + goto l14; } if (fmt >= (firstShortFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), signedValueToStore); - goto l11; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(newValue); @@ -78431,7 +77472,7 @@ primitiveInstVarAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))), unsigned64BitValueToStore); } - goto l11; + goto l14; } unsignedValueToStore = positive32BitValueOf(newValue); @@ -78439,7 +77480,7 @@ primitiveInstVarAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))), unsignedValueToStore); } - l11: /* end subscript:with:storing:format: */; + l14: /* end subscript:with:storing:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue); @@ -78552,7 +77593,6 @@ primitiveObjectPointsTo(void) } /* begin baseHeader: */ header = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)header) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -78587,13 +77627,9 @@ primitiveObjectPointsTo(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); } } else { @@ -78728,12 +77764,12 @@ primitivePin(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - if (((((usqInt) (longAt(obj))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0) { /* begin trueObject */ wasPinned = GIV(trueObj); if (boolean != wasPinned) { /* begin setIsPinnedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << 30))); + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (pinnedBitShift())))); } } else { @@ -78988,20 +78024,15 @@ primitiveSlotAt(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ @@ -79060,8 +78091,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstShortFormat())) { - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPushInteger: */ integerVal1 = ((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1)))))); @@ -79074,7 +78104,6 @@ primitiveSlotAt(void) return; } if (fmt == (sixtyFourBitIndexableFormat())) { - /* begin num64BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ @@ -79088,8 +78117,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 2)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2)))); @@ -79097,7 +78125,7 @@ primitiveSlotAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop1 = ((integerValue << 1) | 1); - goto l18; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -79120,13 +78148,13 @@ primitiveSlotAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l13; + goto l9; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l13: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -79137,10 +78165,9 @@ primitiveSlotAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop1 = newLargeInteger; - l18: /* end maybeInlinePositive32BitIntegerFor: */; - goto l12; + goto l11; - l12: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop1); GIV(stackPointer) = sp4; return; @@ -79200,8 +78227,9 @@ primitiveSlotAtPut(void) } # if IMMUTABILITY + /* begin isOopImmutable: */ badRcvr = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); # else /* IMMUTABILITY */ /* begin isImmediate: */ @@ -79214,20 +78242,15 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { externalInstVarofContextput(index, rcvr, newValue); @@ -79267,10 +78290,10 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = null; - goto l21; + goto l16; } value = value1; - goto l21; + goto l16; } if (newValue & (tagMask())) { /* begin primitiveFail */ @@ -79278,23 +78301,23 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(newValue))); /* begin classIndexOf: */ ccIndex = (longAt(newValue)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l20; + goto l15; -l20: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l15: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin numBytesOfBytes: */ fmt2 = (((usqInt) (longAt(newValue))) >> (formatShift())) & (formatMask()); @@ -79306,18 +78329,18 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((newValue + BaseHeaderSize) + (0U << 3)))); - goto l21; + goto l16; } else { value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((newValue + BaseHeaderSize) + (0U << 2)))))); - goto l21; + goto l16; } -l21: /* end positiveMachineIntegerValueOf: */; +l16: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { GIV(primFailCode) = PrimErrBadArgument; return; @@ -79355,8 +78378,7 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value); @@ -79370,8 +78392,7 @@ primitiveSlotAtPut(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 2)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2))), value); @@ -79399,7 +78420,6 @@ primitiveStoreStackp(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ctxt; sqInt i; - sqInt index; sqInt integerPointer; sqInt newStackp; int onCurrentPage; @@ -79417,7 +78437,7 @@ primitiveStoreStackp(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { newStackp = (integerPointer >> 1); - goto l10; + goto l5; } else { /* begin primitiveFail */ @@ -79425,9 +78445,9 @@ primitiveStoreStackp(void) GIV(primFailCode) = 1; } newStackp = 0; - goto l10; + goto l5; } -l10: /* end stackIntegerValue: */; +l5: /* end stackIntegerValue: */; if (!((!GIV(primFailCode)) && (((newStackp >= 0) && (newStackp <= ((numSlotsOf(ctxt)) - CtxtTempFrameStart)))))) { /* begin primitiveFail */ @@ -79456,10 +78476,8 @@ primitiveStoreStackp(void) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (((onCurrentPage = thePage == GIV(stackPage))) && (theFP == GIV(framePointer))) { /* begin primitiveFail */ @@ -79482,11 +78500,11 @@ primitiveStoreStackp(void) sp = longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { stackp = 0; - goto l8; + goto l7; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(ctxt))); stackp = (sp >> 1); -l8: /* end fetchStackPointerOf: */; +l7: /* end fetchStackPointerOf: */; for (i = (stackp + 1); i <= newStackp; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = GIV(nilObj); @@ -80200,7 +79218,6 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); result = getDesiredCogCodeSize(); } if (arg == 48) { - /* begin getCogVMFlags */ result = (((usqInt)(((((GIV(flagInterpretedMethods) ? 2 : 0)) + ((GIV(preemptionYields) @@ -80252,7 +79269,6 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); result = getCodeCompactionMSecs(); } if (arg == 64) { - /* begin getCogMethodCount */ result = (((usqInt)(numMethodsOfType(CMMethod)) << 1) | 1); } if (arg == 65) { @@ -80419,12 +79435,12 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); /* begin setCogVMFlags: */ if ((((usqInt)arg)) > 0x1F) { GIV(primFailCode) = PrimErrUnsupported; - goto l71; + goto l64; } GIV(flagInterpretedMethods) = (arg & 2) != 0; GIV(preemptionYields) = (arg & 4) == 0; GIV(newFinalization) = (arg & 16) != 0; - l71: /* end setCogVMFlags: */; + l64: /* end setCogVMFlags: */; } } if (index == 49) { @@ -80447,14 +79463,14 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); if (isFloat) { fetchFloatAtinto(arg + BaseHeaderSize, result1); aDouble = result1; - goto l83; + goto l81; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } aDouble = 0.0; - l83: /* end floatValueOf: */; + l81: /* end floatValueOf: */; GIV(heapGrowthToSizeGCRatio) = aDouble; GIV(primFailCode) = 0; } @@ -80505,7 +79521,6 @@ pruneStackstackp(sqInt stack, sqInt stackp) char *fp; sqInt i; sqInt iLimiT; - sqInt index; sqInt objOrFP; sqInt oop; sqInt oop1; @@ -80551,26 +79566,24 @@ pruneStackstackp(sqInt stack, sqInt stackp) assert((objOrFP & 1)); theFP = pointerForOop(objOrFP - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findFrameAbove:inPage: */ fp = (thePage->headFP); if (fp == theFP) { theFPAbove = 0; - goto l10; + goto l6; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { theFPAbove = fp; - goto l10; + goto l6; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l10: /* end findFrameAbove:inPage: */; + l6: /* end findFrameAbove:inPage: */; /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 @@ -80625,10 +79638,10 @@ unmarkAfterPathTo(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -80649,7 +79662,7 @@ unmarkAfterPathTo(void) assert((objOop1 % (allocationUnit())) == 0); if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; assert((long64At(objOop1)) != 0); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop1, 0); } @@ -80663,32 +79676,28 @@ unmarkAfterPathTo(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -80698,13 +79707,13 @@ unmarkAfterPathTo(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop, limit)) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -80718,41 +79727,37 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -80766,32 +79771,28 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } diff --git a/nsspursrc/vm/cointerp.h b/nsspursrc/vm/cointerp.h index 6cfa5a09c2..ef8771d4c6 100644 --- a/nsspursrc/vm/cointerp.h +++ b/nsspursrc/vm/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ @@ -225,7 +225,6 @@ extern void longPrintInstancesWithClassIndex(sqInt classIndex); extern void longPrintReferencesTo(sqInt anOop); extern void NeverInline NeverInline markAndTrace(sqInt objOop); extern sqInt maybeSplObj(sqInt index); -extern usqInt nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); extern sqInt nilObject(void); extern sqInt nonIndexablePointerFormat(void); extern usqInt numBytesOf(sqInt objOop); @@ -239,6 +238,7 @@ extern sqInt popRemappableOop(void); extern sqInt primitiveErrorTable(void); extern void printActivationsOf(sqInt aMethodObj); extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); extern void printForwarders(void); extern void printFreeChunks(void); extern void printFreeChunk(sqInt freeChunk); @@ -249,6 +249,7 @@ extern void printHeaderOf(sqInt objOop); extern void printInstancesOf(sqInt aClassOop); extern void printInstancesWithClassIndex(sqInt classIndex); extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); extern void printMethodReferencesTo(sqInt anOop); extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); extern void printObjectsWithHash(sqInt hash); @@ -257,10 +258,8 @@ extern void printOopsFromto(sqInt startAddress, sqInt endAddress); extern void printReferencesTo(sqInt anOop); extern void pushRemappableOop(sqInt oop); extern sqInt rawHashBitsOf(sqInt objOop); -extern sqInt remapObj(sqInt objOop); extern sqInt removeGCRoot(sqInt *varLoc); extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); -extern sqInt shouldRemapObj(sqInt objOop); extern sqInt shouldRemapOop(sqInt oop); extern sqInt splObj(sqInt index); extern usqInt storeCheckBoundary(void); @@ -271,6 +270,10 @@ extern sqInt topRemappableOop(void); extern sqInt trueObject(void); extern sqInt validFreeTree(void); extern sqInt vmEndianness(void); +extern sqInt checkTraversableSortedFreeList(void); +extern void printSortedFreeList(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); extern sqInt activeProcess(void); extern sqInt argumentCountOfClosure(sqInt closurePointer); extern sqInt argumentCountOfMethodHeader(sqInt header); diff --git a/nsspursrc/vm/gcc3x-cointerp.c b/nsspursrc/vm/gcc3x-cointerp.c index 83b8ba5656..2047f056ed 100644 --- a/nsspursrc/vm/gcc3x-cointerp.c +++ b/nsspursrc/vm/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - CoInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CoInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -306,6 +306,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define RemapBufferSize 25 #define RememberedSetRootIndex 4099 #define ReturnToInterpreter 1 +#define ScavengeInProgress 1 #define SchedulerAssociation 3 #define SelectorAboutToReturn 48 #define SelectorAttemptToAssign 50 @@ -321,6 +322,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define ShouldNotJIT -8 #define SistaV1BytecodeSet 0 #define SistaVM 0 +#define SlidingCompactionInProgress 2 #define SmallContextSlots 22 #define SPURVM 1 #define SpecialSelectors 23 @@ -913,6 +915,8 @@ static void NeverInline computeRefCountToShrinkRT(void); static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner); static sqInt NoDbgRegParms copyAndForward(sqInt survivor); static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor); +static void fireEphemeronsInRememberedSet(void); +static void fireEphemeronsOnEphemeronList(void); static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList); static void growRememberedSet(void); static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop); @@ -966,7 +970,7 @@ extern usqInt characterValueOf(sqInt oop); static sqInt NoDbgRegParms cheapAddressCouldBeInHeap(sqInt address); extern sqInt checkedLongAt(sqInt byteAddress); static sqInt checkHeapFreeSpaceIntegrity(void); -static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); extern sqInt checkOkayOop(usqInt oop); extern sqInt checkOopHasOkayClass(usqInt obj); static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name); @@ -1026,6 +1030,7 @@ extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop); static sqInt findLargestFreeChunk(void); extern void findStringBeginningWith(char *aCString); extern void findString(char *aCString); +static void fireAllUnscannedEphemerons(void); static sqInt firstAccessibleObject(void); static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop); extern void * firstFixedField(sqInt objOop); @@ -1127,7 +1132,6 @@ static sqInt NoDbgRegParms isValidObjStack(sqInt objStack); static sqInt NoDbgRegParms isWeakFormat(sqInt format); static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop); extern sqInt isWeak(sqInt oop); -static sqInt NoDbgRegParms isWordsOrBytesNonImm(sqInt objOop); extern sqInt isWordsOrBytes(sqInt oop); extern sqInt isWords(sqInt oop); extern sqInt isYoungObject(sqInt objOop); @@ -1156,12 +1160,12 @@ static void NoDbgRegParms markAndTraceClassOf(sqInt objOop); static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents); extern void NeverInline markAndTrace(sqInt objOop); static sqInt markInactiveEphemerons(void); +static void NoDbgRegParms markLoopFrom(sqInt objOop); static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged); static void markWeaklingsAndMarkAndFireEphemerons(void); extern sqInt maybeSplObj(sqInt index); static sqInt newObjectHash(void); static sqInt newSpaceIsEmpty(void); -extern usqInt nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); extern sqInt nilObject(void); static void NeverInline nilUnmarkedWeaklingSlots(void); static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex); @@ -1182,6 +1186,7 @@ extern sqInt numStrongSlotsOfWeakling(sqInt objOop); extern sqInt objectAfter(sqInt objOop); extern sqInt objectBefore(sqInt objOop); static sqInt NoDbgRegParms objectStartingAt(sqInt address); +static sqInt NoDbgRegParms objectsReachableFromRoots(sqInt arrayOfRoots); extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop); static sqInt NoDbgRegParms okayOop(sqInt signedOop); static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); @@ -1192,6 +1197,7 @@ static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags); extern sqInt primitiveErrorTable(void); extern void printActivationsOf(sqInt aMethodObj); extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); extern void printForwarders(void); extern void printFreeChunks(void); extern void printFreeChunk(sqInt freeChunk); @@ -1205,6 +1211,7 @@ static void NoDbgRegParms printHeaderTypeOf(sqInt objOop); extern void printInstancesOf(sqInt aClassOop); extern void printInstancesWithClassIndex(sqInt classIndex); extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); extern void printMethodReferencesTo(sqInt anOop); extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); extern void printObjectsWithHash(sqInt hash); @@ -1218,17 +1225,15 @@ extern void pushRemappableOop(sqInt oop); static sqInt NoDbgRegParms pushonObjStack(sqInt objOop, sqInt objStack); static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray); extern sqInt rawHashBitsOf(sqInt objOop); -extern sqInt remapObj(sqInt objOop); extern sqInt removeGCRoot(sqInt *varLoc); static void NoDbgRegParms restoreObjectsInsavedHashes(sqInt objArray, sqInt savedHashes); static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes); static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes); -static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion); static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd); static sqInt NoDbgRegParms shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); -extern sqInt shouldRemapObj(sqInt objOop); extern sqInt shouldRemapOop(sqInt oop); static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack); extern sqInt slotSizeOf(sqInt oop); @@ -1255,11 +1260,15 @@ static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt pa static sqInt validObjStacks(void); extern sqInt vmEndianness(void); extern sqInt checkTraversableSortedFreeList(void); -static sqInt NeverInline compact(void); -static sqInt eliminateAndFreeForwardersForPigCompact(void); -static sqInt NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); +static void NeverInline compact(void); +static void eliminateAndFreeForwardersForPigCompact(void); +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); static sqInt NoDbgRegParms moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit); -static sqInt rebuildFreeListsForPigCompact(void); +static usqInt NoDbgRegParms nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); +extern void printSortedFreeList(void); +static void rebuildFreeListsForPigCompact(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit); static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount); static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift); @@ -1358,6 +1367,8 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt p extern sqInt findSelectorOfMethod(sqInt meth); static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage); static sqInt NoDbgRegParms findUnwindThroughContext(sqInt homeContext); +static void NoDbgRegParms fireEphemeron(sqInt ephemeron); +static void NoDbgRegParms fireFinalization(sqInt weakling); extern double floatArg(sqInt index); static void NoDbgRegParms followForwardedFrameContentsstackPointer(char *theFP, char *theSP); extern sqInt forceInterruptCheck(void); @@ -1639,11 +1650,11 @@ _iss usqInt newSpaceStart; _iss sqInt trueObj; _iss SpurSegmentInfo * segments; _iss sqInt falseObj; +_iss sqInt lkupClassTag; _iss sqInt hiddenRootsObj; _iss usqInt totalFreeOldSpace; _iss usqInt pastSpaceStart; _iss usqInt scavengeThreshold; -_iss sqInt lkupClassTag; _iss sqInt bytesPerPage; _iss sqInt numSegments; _iss sqInt localAbsentReceiver; @@ -1659,27 +1670,27 @@ _iss sqInt localAbsentReceiverOrZero; _iss usqInt freeListsMask; _iss StackPage * mostRecentlyUsedPage; _iss sqInt tempOop; +_iss usqInt firstFreeChunk; _iss sqInt remapBufferCount; _iss sqInt markStack; _iss SpurContiguousObjStack unscannedEphemerons; -_iss usqInt firstFreeChunk; -_iss sqInt numStackPages; _iss sqInt weaklingStack; +_iss sqInt numStackPages; _iss sqInt profileProcess; _iss SpurNewSpaceSpace pastSpace; _iss sqLong nextProfileTick; _iss sqInt profileSemaphore; -_iss sqInt numClassTablePages; _iss sqInt profileMethod; _iss sqInt longRunningPrimitiveCheckSemaphore; +_iss sqInt numClassTablePages; _iss sqInt futureSurvivorStart; _iss sqInt classTableIndex; _iss sqInt numRememberedEphemerons; _iss SpurNewSpaceSpace futureSpace; _iss sqInt jmpDepth; +_iss usqInt lastFreeChunk; _iss sqInt longRunningPrimitiveCheckMethod; _iss sqInt mournQueue; -_iss usqInt lastFreeChunk; _iss sqInt tempOop2; _iss sqInt becomeEffectsFlags; _iss SpurNewSpaceSpace eden; @@ -1695,10 +1706,9 @@ _iss sqInt previousRememberedSetSize; _iss sqInt tenureCriterion; _iss sqInt classNameIndex; _iss sqInt methodDictLinearSearchLimit; -_iss sqInt pendingFinalizationSignals; -_iss sqInt metaclassNumSlots; _iss sqInt lastCoggableInterpretedBlockMethod; _iss sqInt lastUncoggableInterpretedBlockMethod; +_iss sqInt metaclassNumSlots; _iss sqInt numSegInfos; _iss sqInt preemptionYields; _iss sqInt cogCompiledCodeCompactionCalledFor; @@ -1708,21 +1718,24 @@ _iss sqInt cogCodeSize; _iss sqInt highestRunnableProcessPriority; _iss usqLong longRunningPrimitiveStartUsecs; _iss usqLong longRunningPrimitiveStopUsecs; -_iss sqInt newFinalization; -_iss sqInt rememberedSetLimit; _iss usqLong statCheckForEvents; _iss usqLong statGCEndUsecs; _iss sqInt weakList; _iss sqInt externalPrimitiveTableFirstFreeIndex; _iss sqInt flagInterpretedMethods; _iss sqInt marking; +_iss sqInt newFinalization; _iss sqInt statSurvivorCount; _iss sqInt thisClassIndex; _iss sqInt firstSegmentSize; +_iss sqInt gcPhaseInProgress; _iss usqLong gcStartUsecs; _iss usqInt lowSpaceThreshold; +_iss sqInt pendingFinalizationSignals; +_iss sqInt rememberedSetLimit; _iss sqInt shrinkThreshold; _iss usqLong statIOProcessEvents; +_iss sqInt sweepIndex; _iss sqInt edenBytes; _iss sqInt imageHeaderFlags; _iss sqInt lastHash; @@ -1730,7 +1743,6 @@ _iss sqInt lastMethodCacheProbeWrite; _iss sqInt longRunningPrimitiveCheckSequenceNumber; _iss usqInt memory; _iss sqInt numCompactionPasses; -_iss sqInt scavengeInProgress; _iss sqInt fullScreenFlag; _iss float heapGrowthToSizeGCRatio; _iss usqInt heapSizeAtPreviousGC; @@ -2458,7 +2470,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */] }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.2041"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-rsf.2077"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -2521,15 +2533,20 @@ volatile int sendTrace; #define firstLongFormat() 10 #define firstShortFormat() 12 #define fixedFieldsFieldWidth() 16 +#define formatFieldWidthShift() 5 #define formatMask() 0x1F #define formatShift() 24 #define freeStart() GIV(freeStart) +#define greyBitShift() 31 #define identityHashFullWordShift() 32 #define identityHashHalfWordMask() 0x3FFFFF +#define immutableBitShift() 23 #define indexablePointersFormat() 3 #define isForwardedObjectClassIndexPun() 8 #define isFreeObjectClassIndexPun() 0 #define lastClassIndexPun() 31 +#define markedBitFullShift() 55 +#define markedBitHalfShift() 23 #define maxOldSpaceSize() maxOldSpaceSize #define memory() GIV(memory) #define newSpaceLimit() GIV(newSpaceLimit) @@ -2537,6 +2554,7 @@ volatile int sendTrace; #define numSlotsHalfShift() 24 #define numSlotsMask() 0xFF #define oldSpaceStart() GIV(oldSpaceStart) +#define pinnedBitShift() 30 #define remapBufferCount() GIV(remapBufferCount) #define rememberedBitShift() 29 #define rootTableCapacity() GIV(rememberedSetLimit) @@ -2588,6 +2606,7 @@ interpret(void) register char* localIP IP_REG; sqInt localReturnValue; register char* localSP SP_REG; + sqInt numExtB; sqInt stackPageBytes; usqIntptr_t stackPagesBytes; char *theStackMemory; @@ -2624,7 +2643,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* begin initExtensions */ - extA = (extB = 0); + extA = (numExtB = (extB = 0)); while (1) { bytecodeDispatchDebugHook(); @@ -4701,7 +4720,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -5031,11 +5050,6 @@ interpret(void) sqInt currentCtx; char *frameToReturnTo; sqInt home; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; StackPage *newPage; sqInt nextCntx; sqInt objOop; @@ -5048,16 +5062,10 @@ interpret(void) char *theFP; char *theFP1; char *theFP2; - char *theFP3; - char *theFP4; - char *theFP5; StackPage *thePage; StackPage *thePage1; StackPage *thePage2; StackPage *thePage3; - char *theSP; - char *theSP1; - char *theSP2; sqInt unwindContextOrNilOrZero; sqInt valuePointer; sqInt valuePointer1; @@ -5068,7 +5076,7 @@ interpret(void) frameToReturnTo = 0; if (!((byteAt((localFP + FoxIFrameFlags) + 3)) != 0)) { goto commonCallerReturn; - goto l726; + goto l673; } closure = longAt(localFP + (frameStackedReceiverOffset(localFP))); @@ -5111,17 +5119,15 @@ interpret(void) /* error: can't find home on chain; cannot return */ /* begin internalCannotReturn: */ - theFP3 = localFP; - theSP = localSP; - if (((((usqInt)(longAt(theFP3 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP3 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP3 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP3))); - ourContext = longAt(theFP3 + FoxThisContext); - goto l742; - } - ourContext = marryFrameSP(theFP3, theSP); - l742: /* end ensureFrameIsMarried:SP: */; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext = longAt(localFP + FoxThisContext); + goto l700; + } + ourContext = marryFrameSP(localFP, localSP); + l700: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -5130,21 +5136,19 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); GIV(argumentCount) = 1; goto normalSend; - goto l726; + goto l673; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ - theFP4 = localFP; - theSP1 = localSP; - if (((((usqInt)(longAt(theFP4 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP4 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP4 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP4))); - ourContext1 = longAt(theFP4 + FoxThisContext); - goto l739; - } - ourContext1 = marryFrameSP(theFP4, theSP1); - l739: /* end ensureFrameIsMarried:SP: */; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext1 = longAt(localFP + FoxThisContext); + goto l693; + } + ourContext1 = marryFrameSP(localFP, localSP); + l693: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -5155,7 +5159,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l726; + goto l673; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { @@ -5169,10 +5173,8 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -5204,17 +5206,15 @@ interpret(void) /* error: home's sender is dead; cannot return */ /* begin internalCannotReturn: */ - theFP5 = localFP; - theSP2 = localSP; - if (((((usqInt)(longAt(theFP5 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP5 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP5 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP5))); - ourContext2 = longAt(theFP5 + FoxThisContext); - goto l736; + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext2 = longAt(localFP + FoxThisContext); + goto l686; } - ourContext2 = marryFrameSP(theFP5, theSP2); - l736: /* end ensureFrameIsMarried:SP: */; + ourContext2 = marryFrameSP(localFP, localSP); + l686: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -5223,24 +5223,20 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); GIV(argumentCount) = 1; goto normalSend; - goto l726; + goto l673; } } assert(pageListIsWellFormed()); /* begin stackPageFor: */ - assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage)); - - newPage = stackPageAtpages(index4, GIV(pages)); + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (newPage != GIV(stackPage)) { /* begin frameCallerContext: */ theFP2 = (GIV(stackPage)->baseFP); assert(isBaseFrame(theFP2)); /* begin stackPageFor: */ - assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage3 = stackPageAtpages(index3, GIV(pages)); + thePage3 = stackPageAtpages((assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil2 = longAt((thePage3->baseAddress)); assert(addressCouldBeObj(callerContextOrNil2)); assert((callerContextOrNil2 == (nilObject())) @@ -5253,10 +5249,8 @@ interpret(void) && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFP != ((thePage->headFP))) { /* Since we've just deallocated a page we know that newStackPage won't deallocate an existing one. */ @@ -5266,10 +5260,8 @@ interpret(void) theFP1 = (thePage->baseFP); assert(isBaseFrame(theFP1)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index2, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -5336,11 +5328,11 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l744; + goto l683; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } - l744: /* end maybeReturnToMachineCodeFrame */; + l683: /* end maybeReturnToMachineCodeFrame */; /* begin setMethod: */ aMethodObj = longAt(localFP + FoxMethod); assert((((usqInt)aMethodObj)) >= (startOfMemory())); @@ -5355,7 +5347,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l726: /* end case */; + l673: /* end case */; BREAK; CASE(121) /* returnTrue */ @@ -5415,8 +5407,6 @@ interpret(void) sqInt contextToReturnTo; char *fp; char *frameAbove; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; sqInt retToContext; @@ -5440,10 +5430,8 @@ interpret(void) /* begin baseFrameReturn */ assert(isBaseFrame(localFP)); /* begin stackPageFor: */ - assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -5461,10 +5449,8 @@ interpret(void) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFP == ((thePage->headFP))) { theSP = (thePage->headSP); } @@ -5477,27 +5463,27 @@ interpret(void) fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l757; + goto l711; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l757; + goto l711; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l757: /* end findFrameAbove:inPage: */; + l711: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l759; + goto l706; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l759: /* end newStackPage */; + l706: /* end newStackPage */; assert(newPage == GIV(stackPage)); moveFramesInthroughtoPage(thePage, frameAbove, newPage); markStackPageMostRecentlyUsed(newPage); @@ -5520,7 +5506,7 @@ interpret(void) longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); GIV(stackPointer) = sp2; ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1); - goto l755; + goto l702; } GIV(instructionPointer) = 0; thePage = makeBaseFrameFor(contextToReturnTo); @@ -5556,15 +5542,15 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP)); /* begin setMethod: */ - aMethodObj1 = longAt(localFP + FoxMethod); - assert((((usqInt)aMethodObj1)) >= (startOfMemory())); - GIV(method) = aMethodObj1; + aMethodObj = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) ? 256 @@ -5574,7 +5560,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); localSP = localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) @@ -5599,14 +5585,14 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l755; + goto l702; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - assert((((usqInt)aMethodObj)) >= (startOfMemory())); - GIV(method) = aMethodObj; + aMethodObj1 = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj1)) >= (startOfMemory())); + GIV(method) = aMethodObj1; assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) ? 256 @@ -5617,7 +5603,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l755: /* end case */; + l702: /* end case */; BREAK; CASE(126) CASE(127) @@ -5651,10 +5637,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l765; + goto l712; } ourContext = marryFrameSP(theFP, theSP); - l765: /* end ensureFrameIsMarried:SP: */; + l712: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -5752,7 +5738,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5763,7 +5749,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l45; + goto l49; } # endif /* IMMUTABILITY */ @@ -5783,11 +5769,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l45: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l49: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l41; + goto l43; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5799,7 +5785,7 @@ interpret(void) else { longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l41; + goto l43; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5828,7 +5814,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5839,7 +5825,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l52; + goto l47; } # endif /* IMMUTABILITY */ @@ -5859,14 +5845,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l52: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l47: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l41; + goto l43; } error("illegal store"); - l41: /* end extendedStoreBytecodePop: */; + l43: /* end extendedStoreBytecodePop: */; } BREAK; CASE(130) @@ -5896,7 +5882,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5907,7 +5893,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l58; + goto l61; } # endif /* IMMUTABILITY */ @@ -5927,11 +5913,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l58: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l61: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l54; + goto l55; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5943,7 +5929,7 @@ interpret(void) else { longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l54; + goto l55; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5972,7 +5958,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5983,7 +5969,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l65; + goto l59; } # endif /* IMMUTABILITY */ @@ -6003,14 +5989,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l65: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l59: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l54; + goto l55; } error("illegal store"); - l54: /* end extendedStoreBytecodePop: */; + l55: /* end extendedStoreBytecodePop: */; } BREAK; CASE(131) @@ -6051,8 +6037,6 @@ interpret(void) usqInt aMethodObj; usqInt aMethodObj1; sqInt aValue; - sqInt classIndex; - sqInt classIndex1; sqInt classOrInteger; sqInt classTablePage; sqInt classTablePage1; @@ -6091,20 +6075,19 @@ interpret(void) sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (recordSendTrace()) { /* begin recordTrace:thing:source: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classOrInteger = null; - goto l783; + goto l730; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); classOrInteger = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l783: /* end classAtIndex: */; + l730: /* end classAtIndex: */; GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger; GIV(traceLog)[GIV(traceLogIndex) + 1] = GIV(messageSelector); GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; @@ -6125,7 +6108,7 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } /* second probe */ @@ -6135,7 +6118,7 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } probe = (((usqInt) hash) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) @@ -6143,30 +6126,30 @@ interpret(void) GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l769; + goto l714; } ok = 0; - l769: /* end inlineLookupInMethodCacheSel:classTag: */; + l714: /* end inlineLookupInMethodCacheSel:classTag: */; if (ok) { /* begin ifAppropriateCompileToNativeCode:selector: */ aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader2 & 1)) - || (((((usqInt)methodHeader2)) < (startOfMemory())) - && ((((usqInt)methodHeader2)) >= (minCogMethodAddress())))), - (methodHeader2 & 1) == 0)) { + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod = ((CogMethod *) methodHeader2); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, selector); } } else { - if (((assert((methodHeader2 & 1)), - ((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -6216,24 +6199,23 @@ interpret(void) maybeFlagMethodAsInterpreted(aMethodObj1); } } - goto l786; + goto l731; } } /* begin classAtIndex: */ - classIndex1 = GIV(lkupClassTag); - assert((classIndex1 <= (tagMask())) - || (classIndex1 >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex2 = ((usqInt) classIndex1) >> (classTableMajorIndexShift()); + fieldIndex2 = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord()))))); if (classTablePage1 == GIV(nilObj)) { GIV(lkupClass) = null; - goto l772; + goto l723; } /* begin fetchPointer:ofObject: */ - fieldIndex11 = classIndex1 & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex11 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord()))))); - l772: /* end classAtIndex: */; + l723: /* end classAtIndex: */; lookupOrdinarySend(); /* begin internalizeIPandSP */ @@ -6243,7 +6225,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); } - l786: /* end internalFindNewMethodOrdinary */; + l731: /* end internalFindNewMethodOrdinary */; /* begin internalExecuteNewMethod */ if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { @@ -6256,29 +6238,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l784; + goto l735; } if (localPrimIndex == 256) { - goto l784; + goto l735; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l784; + goto l735; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l784; + goto l735; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l784; + goto l735; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l784: /* end internalQuickPrimitiveResponse */; - goto l779; + goto l735; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -6340,7 +6321,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l779; + goto l735; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -6363,10 +6344,10 @@ interpret(void) } else { /* begin internalActivateNewMethod */ - methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert(!(isCogMethodReference(methodHeader))); - numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; - assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); + methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert(!(isCogMethodReference(methodHeader2))); + numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader2))); /* could new rcvr be set at point of send? */ rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); @@ -6381,8 +6362,8 @@ interpret(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader); - GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader2); + GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 ? 256 : 0); @@ -6390,8 +6371,8 @@ interpret(void) longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ object = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0)); + ? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0)); longAtPointerput((localSP -= BytesPerOop), object); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); @@ -6401,16 +6382,16 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); } - localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1); + localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), +((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1); if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader & AlternateHeaderHasPrimFlag)) { + methodHeader2 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ localIP += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(localIP + 1)) == (((((int) methodHeader)) < 0 + if ((byteAt(localIP + 1)) == (((((int) methodHeader2)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -6420,11 +6401,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l777; + goto l728; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l777: /* end getErrorObjectFromPrimFailCode */; + l728: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -6439,7 +6420,7 @@ interpret(void) GIV(instructionPointer) = oopForPointer(localIP); GIV(stackPointer) = localSP; GIV(framePointer) = localFP; - switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); + switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); returnToExecutivepostContextSwitch(1, switched); /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); @@ -6448,7 +6429,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l779: /* end internalExecuteNewMethod */; + l735: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6462,14 +6443,12 @@ interpret(void) sqInt byte3; sqInt callerContextOrNil; char *callerFP; - sqInt index; - sqInt index1; sqInt litVar; sqInt litVar1; sqInt obj; sqInt obj1; sqInt object; - sqInt object1; + sqInt object11; sqInt object2; sqInt object3; int onCurrentPage; @@ -6480,8 +6459,8 @@ interpret(void) sqInt senderOop1; char *spouseFP; char * theFP; - StackPage * thePage; - StackPage *thePage1; + StackPage *thePage; + StackPage * thePage1; sqInt top; sqInt value; @@ -6496,7 +6475,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto normalSend; - goto l68; + goto l66; } if (opType == 1) { assert(GIV(method) == (iframeMethod(localFP))); @@ -6505,7 +6484,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto superclassSend; - goto l68; + goto l66; } if (opType == 2) { /* begin fetchNextBytecode */ @@ -6547,17 +6526,17 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); value = result; } - object = value; - goto l75; + object3 = value; + goto l90; } if (isWidowedContext(obj)) { - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l75; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l90; } /* begin frameOfMarriedContext: */ - senderOop1 = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); - assert((senderOop1 & 1)); - spouseFP = pointerForOop(senderOop1 - 1); + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + spouseFP = pointerForOop(senderOop - 1); if (byte3 == SenderIndex) { /* begin ensureCallerContext: */ @@ -6568,49 +6547,47 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index, GIV(pages)); - callerContextOrNil = longAt((thePage1->baseAddress)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); - object = callerContextOrNil; - goto l75; + object3 = callerContextOrNil; + goto l90; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) ? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); - object = longAt(callerFP + FoxThisContext); - goto l75; + object3 = longAt(callerFP + FoxThisContext); + goto l90; } - object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l75; + goto l90; } if (byte3 == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); - object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l75; + object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l90; } if (byte3 == InstructionPointerIndex) { - object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l75; + object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l90; } error("bad index"); - object = 0; - l75: /* end instVar:ofContext: */; - longAtPointerput((localSP -= BytesPerOop), object); + object3 = 0; + l90: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object3); } else { /* begin internalPush: */ - object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object1); + object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object11); } - goto l68; + goto l66; } if (opType == 3) { /* begin fetchNextBytecode */ @@ -6619,10 +6596,10 @@ interpret(void) /* begin pushLiteralConstant: */ assert(GIV(method) == (iframeMethod(localFP))); /* begin fetchPointer:ofObject: */ - object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object2); - goto l68; + longAtPointerput((localSP -= BytesPerOop), object); + goto l66; } if (opType == 4) { /* begin fetchNextBytecode */ @@ -6642,10 +6619,10 @@ interpret(void) litVar = unfollowatIndex(litVar, byte3); } /* begin internalPush: */ - object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object3); + object2 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object2); - goto l68; + goto l66; } top = longAtPointer(localSP); if (opType == 7) { @@ -6675,7 +6652,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar1)))); - if (((((usqInt) (longAt(litVar1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar1); /* begin internalPush: */ @@ -6686,7 +6663,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l92; + goto l94; } # endif /* IMMUTABILITY */ @@ -6706,11 +6683,11 @@ interpret(void) } } longAtput((litVar1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), top); - l92: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l94: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l68; + goto l66; } if (opType == 6) { /* begin internalPop: */ @@ -6755,21 +6732,19 @@ interpret(void) if (byte3 == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1); } - goto l71; + goto l80; } /* begin frameOfMarriedContext: */ - senderOop = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); - assert((senderOop & 1)); - theFP = pointerForOop(senderOop - 1); + senderOop1 = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + theFP = pointerForOop(senderOop1 - 1); if (byte3 == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); - onCurrentPage = thePage == GIV(stackPage); + onCurrentPage = thePage1 == GIV(stackPage); storeSenderOfFramewithValue(theFP, top); if (onCurrentPage) { localFP = (GIV(stackPage)->headFP); @@ -6778,7 +6753,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l71; + goto l80; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -6811,14 +6786,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l71: /* end instVar:ofContext:put: */; + l80: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj1)))); - if (((((usqInt) (longAt(obj1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj1); /* begin internalPush: */ @@ -6829,7 +6804,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l94; + goto l93; } # endif /* IMMUTABILITY */ @@ -6849,13 +6824,13 @@ interpret(void) } } longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); - l94: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l93: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); } - l68: /* end case */; + l66: /* end case */; BREAK; CASE(133) /* singleExtendedSuperBytecode */ @@ -6989,10 +6964,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l107; + goto l104; } ourContext = marryFrameSP(theFP, theSP); - l107: /* end ensureFrameIsMarried:SP: */; + l104: /* end ensureFrameIsMarried:SP: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7007,7 +6982,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -7027,12 +7001,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -7050,13 +7021,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l108; + goto l105; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l108: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l105: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -7108,15 +7079,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l115; + goto l111; } else { goto respondToUnknownBytecode; - goto l115; + goto l111; } } - l115: /* end case */; + l111: /* end case */; BREAK; CASE(140) CASE(506) /*250*/ @@ -7151,7 +7122,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeRemoteTempLongBytecode); /* begin fetchByte */ @@ -7166,21 +7136,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); } BREAK; CASE(142) @@ -7191,7 +7160,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeAndPopRemoteTempLongBytecode); /* begin storeRemoteTempLongBytecode */ @@ -7206,21 +7174,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); /* begin internalPop: */ localSP += 1 * BytesPerOop; } @@ -7261,10 +7228,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l139; + goto l137; } context = marryFrameSP(theFP, theSP); - l139: /* end ensureFrameIsMarried:SP: */; + l137: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -7292,13 +7259,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l143; + goto l132; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l143: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l132: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -7479,7 +7446,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l150; + goto l145; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7487,7 +7454,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l150: /* end jumplfFalseBy: */; + l145: /* end jumplfFalseBy: */; } BREAK; CASE(160) @@ -7509,7 +7476,7 @@ interpret(void) localIP += offset; /* begin ifBackwardsCheckForEvents: */ if (offset >= 0) { - goto l153; + goto l148; } if (localSP < GIV(stackLimit)) { /* begin externalizeIPandSP */ @@ -7526,7 +7493,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); if (switched) { - goto l153; + goto l148; } } backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN @@ -7555,7 +7522,7 @@ interpret(void) byteAtput(localFP + ((VMBIGENDIAN ? (FoxIFrameFlags + BytesPerWord) - 1 : FoxIFrameFlags)), backwardJumpCountByte); - l153: /* end ifBackwardsCheckForEvents: */; + l148: /* end ifBackwardsCheckForEvents: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7587,7 +7554,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l156; + goto l151; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7595,7 +7562,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l156: /* end jumplfTrueBy: */; + l151: /* end jumplfTrueBy: */; } BREAK; CASE(172) @@ -7624,7 +7591,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l160; + goto l155; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7632,7 +7599,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l160: /* end jumplfFalseBy: */; + l155: /* end jumplfFalseBy: */; } BREAK; CASE(176) @@ -7661,7 +7628,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l162; + goto l157; } } else { @@ -7675,43 +7642,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l169; + goto l162; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l163; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l162; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l163: /* end floatValueOf: */; - l169: /* end loadFloatOrIntFrom: */; + l162: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l164; + goto l158; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l167; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l158; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l167: /* end floatValueOf: */; - l164: /* end loadFloatOrIntFrom: */; + l158: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -7726,7 +7691,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l162; + goto l157; } } /* begin fetchPointer:ofObject: */ @@ -7735,7 +7700,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l162: /* end case */; + l157: /* end case */; BREAK; CASE(177) /* bytecodePrimSubtract */ @@ -7763,7 +7728,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l171; + goto l164; } } else { @@ -7777,43 +7742,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l178; + goto l169; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l172; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l169; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l172: /* end floatValueOf: */; - l178: /* end loadFloatOrIntFrom: */; + l169: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l173; + goto l165; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l176; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l165; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l176: /* end floatValueOf: */; - l173: /* end loadFloatOrIntFrom: */; + l165: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -7828,7 +7791,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l171; + goto l164; } } /* begin fetchPointer:ofObject: */ @@ -7837,7 +7800,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l171: /* end case */; + l164: /* end case */; BREAK; CASE(178) /* bytecodePrimLessThan */ @@ -7867,14 +7830,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l180; + goto l171; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l183; + goto l173; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7882,19 +7845,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l185; + goto l173; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l185: /* end floatValueOf: */; - l183: /* end loadFloatOrIntFrom: */; + l173: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l187; + goto l176; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7902,15 +7864,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l181; + goto l176; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l181: /* end floatValueOf: */; - l187: /* end loadFloatOrIntFrom: */; + l176: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7920,7 +7881,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l180; + goto l171; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7928,7 +7889,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l180: /* end case */; + l171: /* end case */; booleanCheatTrue: /* booleanCheatTrue */ @@ -7950,7 +7911,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } if (bytecode == 172) { @@ -7959,7 +7920,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } if (bytecode > 167) { @@ -7969,7 +7930,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l799; + goto l744; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -7977,7 +7938,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l799: /* end case */; + l744: /* end case */; BREAK; CASE(179) /* bytecodePrimGreaterThan */ @@ -8007,14 +7968,14 @@ interpret(void) else { /* goto booleanCheatFalse */ } - goto l188; + goto l177; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l191; + goto l179; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8022,19 +7983,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l193; + goto l179; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l193: /* end floatValueOf: */; - l191: /* end loadFloatOrIntFrom: */; + l179: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l195; + goto l182; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8042,15 +8002,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l189; + goto l182; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l189: /* end floatValueOf: */; - l195: /* end loadFloatOrIntFrom: */; + l182: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8060,7 +8019,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l188; + goto l177; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8068,7 +8027,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l188: /* end case */; + l177: /* end case */; booleanCheatFalse: /* booleanCheatFalse */ @@ -8090,7 +8049,7 @@ interpret(void) localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l802; + goto l747; } if (bytecode == 172) { @@ -8100,14 +8059,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l802; + goto l747; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l802: /* end case */; + l747: /* end case */; BREAK; CASE(180) /* bytecodePrimLessOrEqual */ @@ -8137,14 +8096,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l196; + goto l183; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l199; + goto l185; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8152,19 +8111,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l201; + goto l185; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l201: /* end floatValueOf: */; - l199: /* end loadFloatOrIntFrom: */; + l185: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l203; + goto l188; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8172,15 +8130,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l197; + goto l188; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l197: /* end floatValueOf: */; - l203: /* end loadFloatOrIntFrom: */; + l188: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8190,7 +8147,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l196; + goto l183; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8198,7 +8155,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l196: /* end case */; + l183: /* end case */; BREAK; CASE(181) /* bytecodePrimGreaterOrEqual */ @@ -8228,14 +8185,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l204; + goto l189; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l207; + goto l191; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8243,19 +8200,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l209; + goto l191; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l209: /* end floatValueOf: */; - l207: /* end loadFloatOrIntFrom: */; + l191: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l211; + goto l194; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8263,15 +8219,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l205; + goto l194; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l205: /* end floatValueOf: */; - l211: /* end loadFloatOrIntFrom: */; + l194: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8281,7 +8236,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l204; + goto l189; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8289,7 +8244,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l204: /* end case */; + l189: /* end case */; BREAK; CASE(182) /* bytecodePrimEqual */ @@ -8316,14 +8271,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l212; + goto l195; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l215; + goto l197; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8331,19 +8286,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l217; + goto l197; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l217: /* end floatValueOf: */; - l215: /* end loadFloatOrIntFrom: */; + l197: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l219; + goto l200; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8351,15 +8305,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l213; + goto l200; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l213: /* end floatValueOf: */; - l219: /* end loadFloatOrIntFrom: */; + l200: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8369,7 +8322,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l212; + goto l195; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8377,7 +8330,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l212: /* end case */; + l195: /* end case */; BREAK; CASE(183) /* bytecodePrimNotEqual */ @@ -8404,14 +8357,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l220; + goto l201; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l223; + goto l203; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8419,19 +8372,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l225; + goto l203; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l225: /* end floatValueOf: */; - l223: /* end loadFloatOrIntFrom: */; + l203: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l227; + goto l206; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8439,15 +8391,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l221; + goto l206; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l221: /* end floatValueOf: */; - l227: /* end loadFloatOrIntFrom: */; + l206: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -8457,7 +8408,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l220; + goto l201; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8465,7 +8416,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l220: /* end case */; + l201: /* end case */; BREAK; CASE(184) /* bytecodePrimMultiply */ @@ -8506,7 +8457,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l228; + goto l207; } } else { @@ -8520,43 +8471,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l235; + goto l212; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l229; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l212; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l229: /* end floatValueOf: */; - l235: /* end loadFloatOrIntFrom: */; + l212: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l230; + goto l208; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l233; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l208; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l233: /* end floatValueOf: */; - l230: /* end loadFloatOrIntFrom: */; + l208: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -8571,7 +8520,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l228; + goto l207; } } /* begin fetchPointer:ofObject: */ @@ -8580,7 +8529,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l228: /* end case */; + l207: /* end case */; BREAK; CASE(185) /* bytecodePrimDivide */ @@ -8614,7 +8563,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l237; + goto l214; } } } @@ -8629,7 +8578,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l243; + goto l219; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8637,19 +8586,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l239; + goto l219; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l239: /* end floatValueOf: */; - l243: /* end loadFloatOrIntFrom: */; + l219: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l242; + goto l215; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8657,15 +8605,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l238; + goto l215; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l238: /* end floatValueOf: */; - l242: /* end loadFloatOrIntFrom: */; + l215: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -8688,7 +8635,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l237; + goto l214; } } /* begin fetchPointer:ofObject: */ @@ -8697,7 +8644,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l237: /* end case */; + l214: /* end case */; BREAK; CASE(186) /* bytecodePrimMod */ @@ -8715,7 +8662,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l246; + goto l221; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8723,7 +8670,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l246: /* end case */; + l221: /* end case */; BREAK; CASE(187) /* bytecodePrimMakePoint */ @@ -8748,7 +8695,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l250; + goto l225; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8756,7 +8703,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l250: /* end case */; + l225: /* end case */; BREAK; CASE(188) /* bytecodePrimBitShift */ @@ -8787,7 +8734,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -8801,7 +8748,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -8809,7 +8756,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } } else { @@ -8820,7 +8767,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l261; + goto l233; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -8829,7 +8776,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l259; + goto l237; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8852,13 +8799,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l255; + goto l231; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l255: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l231: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8869,16 +8816,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l259: /* end maybeInlinePositive32BitIntegerFor: */; - goto l258; + goto l237; - l258: /* end positive32BitIntegerFor: */; + l237: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l261: /* end primitiveBitShift */; + l233: /* end primitiveBitShift */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -8888,7 +8834,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l254; + goto l229; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8896,7 +8842,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l254: /* end case */; + l229: /* end case */; BREAK; CASE(189) /* bytecodePrimDiv */ @@ -8914,7 +8860,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l266; + goto l239; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8922,7 +8868,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l266: /* end case */; + l239: /* end case */; BREAK; CASE(190) /* bytecodePrimBitAnd */ @@ -8941,7 +8887,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l270; + goto l243; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8960,7 +8906,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l270; + goto l243; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8968,7 +8914,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l270: /* end case */; + l243: /* end case */; BREAK; CASE(191) /* bytecodePrimBitOr */ @@ -8987,7 +8933,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l275; + goto l248; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -9006,7 +8952,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l275; + goto l248; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9014,7 +8960,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l275: /* end case */; + l248: /* end case */; BREAK; CASE(192) CASE(352) /*96*/ @@ -9049,14 +8995,16 @@ interpret(void) { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -9069,114 +9017,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l289; + goto l266; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l289; + goto l266; - l289: /* end is:instanceOf:compactClassIndex: */; + l266: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l287; + goto l268; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l287; + goto l268; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l287; + goto l268; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l287; + goto l268; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l287; + goto l268; } sz = 0; - l287: /* end lengthOf:format: */; + l268: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l284; + goto l257; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l292; + goto l269; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l292; + goto l269; - l292: /* end is:instanceOf:compactClassIndex: */; + l269: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l295; + sz = numSlots2; + goto l267; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l295; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l267; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l295; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l267; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l295; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l267; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l295; + sz = ((usqInt) numSlots2) >> 1; + goto l267; } sz = 0; - l295: /* end lengthOf:format: */; + l267: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l284; + goto l257; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9184,7 +9126,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l284: /* end case */; + l257: /* end case */; BREAK; CASE(195) CASE(355) /*99*/ @@ -9308,6 +9250,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9316,18 +9259,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l309; + goto l280; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l309; + goto l280; - l309: /* end is:instanceOf:compactClassIndex: */; + l280: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -9346,7 +9290,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l305; + goto l278; } GIV(primFailCode) = 0; } @@ -9355,12 +9299,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l305: /* end case */; + l278: /* end case */; BREAK; CASE(202) /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9369,18 +9314,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l315; + goto l286; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l315; + goto l286; - l315: /* end is:instanceOf:compactClassIndex: */; + l286: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -9399,7 +9345,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l311; + goto l284; } GIV(primFailCode) = 0; } @@ -9408,7 +9354,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l311: /* end case */; + l284: /* end case */; BREAK; CASE(203) CASE(363) /*107*/ @@ -9469,9 +9415,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9487,7 +9433,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l323; + goto l296; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9496,7 +9442,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l323: /* end case */; + l296: /* end case */; BREAK; CASE(207) /* bytecodePrimPointY */ @@ -9515,9 +9461,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9533,7 +9479,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l330; + goto l304; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9542,7 +9488,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l330: /* end case */; + l304: /* end case */; BREAK; CASE(208) CASE(209) @@ -9721,7 +9667,7 @@ interpret(void) case 0: /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); - goto l353; + goto l328; break; case 1: @@ -9741,10 +9687,10 @@ interpret(void) : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l357; + goto l332; } context = marryFrameSP(localFP, localSP); - l357: /* end ensureFrameIsMarried:SP: */; + l332: /* end ensureFrameIsMarried:SP: */; thing = context; break; @@ -9757,10 +9703,11 @@ interpret(void) } extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), thing); } - l353: /* end case */; + l328: /* end case */; BREAK; CASE(336) /*80*/ /* bytecodePrimAdd */ @@ -9788,7 +9735,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l361; + goto l336; } } else { @@ -9802,43 +9749,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l368; + goto l341; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l362; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l341; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l362: /* end floatValueOf: */; - l368: /* end loadFloatOrIntFrom: */; + l341: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l363; + goto l337; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l366; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l337; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l366: /* end floatValueOf: */; - l363: /* end loadFloatOrIntFrom: */; + l337: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -9853,7 +9798,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l361; + goto l336; } } /* begin fetchPointer:ofObject: */ @@ -9862,7 +9807,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l361: /* end case */; + l336: /* end case */; BREAK; CASE(337) /*81*/ /* bytecodePrimSubtract */ @@ -9890,7 +9835,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l370; + goto l343; } } else { @@ -9904,43 +9849,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l377; + goto l348; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l371; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l348; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l371: /* end floatValueOf: */; - l377: /* end loadFloatOrIntFrom: */; + l348: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l372; + goto l344; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l375; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l344; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l375: /* end floatValueOf: */; - l372: /* end loadFloatOrIntFrom: */; + l344: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -9955,7 +9898,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l370; + goto l343; } } /* begin fetchPointer:ofObject: */ @@ -9964,7 +9907,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l370: /* end case */; + l343: /* end case */; BREAK; CASE(338) /*82*/ /* bytecodePrimLessThanV4 */ @@ -9994,14 +9937,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l379; + goto l350; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l382; + goto l352; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10009,19 +9952,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l384; + goto l352; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l384: /* end floatValueOf: */; - l382: /* end loadFloatOrIntFrom: */; + l352: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l386; + goto l355; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10029,15 +9971,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l380; + goto l355; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l380: /* end floatValueOf: */; - l386: /* end loadFloatOrIntFrom: */; + l355: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10047,7 +9988,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l379; + goto l350; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10055,7 +9996,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l379: /* end case */; + l350: /* end case */; booleanCheatTrueV4: /* booleanCheatTrueV4 */ @@ -10076,7 +10017,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } if (bytecode == 244) { @@ -10085,7 +10026,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } if (bytecode == 243) { @@ -10095,7 +10036,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l803; + goto l748; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -10103,7 +10044,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l803: /* end case */; + l748: /* end case */; BREAK; CASE(339) /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -10133,14 +10074,14 @@ interpret(void) else { /* goto booleanCheatFalseV4 */ } - goto l387; + goto l356; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l390; + goto l358; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10148,19 +10089,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l392; + goto l358; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l392: /* end floatValueOf: */; - l390: /* end loadFloatOrIntFrom: */; + l358: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l394; + goto l361; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10168,15 +10108,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l388; + goto l361; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l388: /* end floatValueOf: */; - l394: /* end loadFloatOrIntFrom: */; + l361: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10186,7 +10125,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l387; + goto l356; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10194,7 +10133,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l387: /* end case */; + l356: /* end case */; booleanCheatFalseV4: /* booleanCheatFalseV4 */ @@ -10216,7 +10155,7 @@ interpret(void) localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l806; + goto l751; } if (bytecode == 244) { @@ -10226,14 +10165,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l806; + goto l751; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l806: /* end case */; + l751: /* end case */; BREAK; CASE(340) /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -10263,14 +10202,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l395; + goto l362; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l398; + goto l364; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10278,19 +10217,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l400; + goto l364; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l400: /* end floatValueOf: */; - l398: /* end loadFloatOrIntFrom: */; + l364: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l402; + goto l367; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10298,15 +10236,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l396; + goto l367; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l396: /* end floatValueOf: */; - l402: /* end loadFloatOrIntFrom: */; + l367: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10316,7 +10253,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l395; + goto l362; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10324,7 +10261,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l395: /* end case */; + l362: /* end case */; BREAK; CASE(341) /*85*/ /* bytecodePrimGreaterOrEqualV4 */ @@ -10354,14 +10291,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l403; + goto l368; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l406; + goto l370; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10369,19 +10306,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l408; + goto l370; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l408: /* end floatValueOf: */; - l406: /* end loadFloatOrIntFrom: */; + l370: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l410; + goto l373; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10389,15 +10325,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l404; + goto l373; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l404: /* end floatValueOf: */; - l410: /* end loadFloatOrIntFrom: */; + l373: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10407,7 +10342,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l403; + goto l368; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10415,7 +10350,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l403: /* end case */; + l368: /* end case */; BREAK; CASE(342) /*86*/ /* bytecodePrimEqualV4 */ @@ -10442,14 +10377,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l411; + goto l374; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l414; + goto l376; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10457,19 +10392,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l416; + goto l376; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l416: /* end floatValueOf: */; - l414: /* end loadFloatOrIntFrom: */; + l376: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l418; + goto l379; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10477,15 +10411,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l412; + goto l379; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l412: /* end floatValueOf: */; - l418: /* end loadFloatOrIntFrom: */; + l379: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10495,7 +10428,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l411; + goto l374; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10503,7 +10436,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l411: /* end case */; + l374: /* end case */; BREAK; CASE(343) /*87*/ /* bytecodePrimNotEqualV4 */ @@ -10530,14 +10463,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l419; + goto l380; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l422; + goto l382; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10545,19 +10478,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l424; + goto l382; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l424: /* end floatValueOf: */; - l422: /* end loadFloatOrIntFrom: */; + l382: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l426; + goto l385; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10565,15 +10497,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l420; + goto l385; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l420: /* end floatValueOf: */; - l426: /* end loadFloatOrIntFrom: */; + l385: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10583,7 +10514,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l419; + goto l380; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10591,7 +10522,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l419: /* end case */; + l380: /* end case */; BREAK; CASE(344) /*88*/ /* bytecodePrimMultiply */ @@ -10632,7 +10563,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l427; + goto l386; } } else { @@ -10646,43 +10577,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l434; + goto l391; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l428; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l391; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l428: /* end floatValueOf: */; - l434: /* end loadFloatOrIntFrom: */; + l391: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l429; + goto l387; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l432; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l387; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l432: /* end floatValueOf: */; - l429: /* end loadFloatOrIntFrom: */; + l387: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -10697,7 +10626,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l427; + goto l386; } } /* begin fetchPointer:ofObject: */ @@ -10706,7 +10635,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l427: /* end case */; + l386: /* end case */; BREAK; CASE(345) /*89*/ /* bytecodePrimDivide */ @@ -10740,7 +10669,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l436; + goto l393; } } } @@ -10755,7 +10684,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l442; + goto l398; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10763,19 +10692,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l438; + goto l398; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l438: /* end floatValueOf: */; - l442: /* end loadFloatOrIntFrom: */; + l398: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l441; + goto l394; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10783,15 +10711,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l437; + goto l394; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l437: /* end floatValueOf: */; - l441: /* end loadFloatOrIntFrom: */; + l394: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -10814,7 +10741,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l436; + goto l393; } } /* begin fetchPointer:ofObject: */ @@ -10823,7 +10750,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l436: /* end case */; + l393: /* end case */; BREAK; CASE(346) /*90*/ /* bytecodePrimMod */ @@ -10841,7 +10768,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l445; + goto l400; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10849,7 +10776,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l445: /* end case */; + l400: /* end case */; BREAK; CASE(347) /*91*/ /* bytecodePrimMakePoint */ @@ -10874,7 +10801,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l449; + goto l404; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10882,7 +10809,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l449: /* end case */; + l404: /* end case */; BREAK; CASE(348) /*92*/ /* bytecodePrimBitShift */ @@ -10913,7 +10840,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -10927,7 +10854,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -10935,7 +10862,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } } else { @@ -10946,7 +10873,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l460; + goto l412; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -10955,7 +10882,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l458; + goto l416; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -10978,13 +10905,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l454; + goto l410; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l454: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l410: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -10995,16 +10922,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l458: /* end maybeInlinePositive32BitIntegerFor: */; - goto l457; + goto l416; - l457: /* end positive32BitIntegerFor: */; + l416: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l460: /* end primitiveBitShift */; + l412: /* end primitiveBitShift */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -11014,7 +10940,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l453; + goto l408; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11022,7 +10948,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l453: /* end case */; + l408: /* end case */; BREAK; CASE(349) /*93*/ /* bytecodePrimDiv */ @@ -11040,7 +10966,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l465; + goto l418; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11048,7 +10974,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l465: /* end case */; + l418: /* end case */; BREAK; CASE(350) /*94*/ /* bytecodePrimBitAnd */ @@ -11067,7 +10993,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l469; + goto l422; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11086,7 +11012,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l469; + goto l422; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11094,7 +11020,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l469: /* end case */; + l422: /* end case */; BREAK; CASE(351) /*95*/ /* bytecodePrimBitOr */ @@ -11113,7 +11039,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l474; + goto l427; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11132,7 +11058,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l474; + goto l427; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11140,21 +11066,23 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l474: /* end case */; + l427: /* end case */; BREAK; CASE(354) /*98*/ /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -11167,114 +11095,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l488; + goto l445; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l488; + goto l445; - l488: /* end is:instanceOf:compactClassIndex: */; + l445: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l486; + goto l447; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l486; + goto l447; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l486; + goto l447; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l486; + goto l447; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l486; + goto l447; } sz = 0; - l486: /* end lengthOf:format: */; + l447: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l483; + goto l436; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l491; + goto l448; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l491; + goto l448; - l491: /* end is:instanceOf:compactClassIndex: */; + l448: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l494; + sz = numSlots2; + goto l446; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l494; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l446; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l494; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l446; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l494; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l446; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l494; + sz = ((usqInt) numSlots2) >> 1; + goto l446; } sz = 0; - l494: /* end lengthOf:format: */; + l446: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l483; + goto l436; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11282,7 +11204,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l483: /* end case */; + l436: /* end case */; BREAK; CASE(358) /*102*/ /* bytecodePrimIdenticalV4 */ @@ -11340,6 +11262,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -11348,18 +11271,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l508; + goto l459; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l508; + goto l459; - l508: /* end is:instanceOf:compactClassIndex: */; + l459: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -11378,7 +11302,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l504; + goto l457; } GIV(primFailCode) = 0; } @@ -11387,12 +11311,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l504: /* end case */; + l457: /* end case */; BREAK; CASE(362) /*106*/ /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -11401,18 +11326,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l514; + goto l465; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l514; + goto l465; - l514: /* end is:instanceOf:compactClassIndex: */; + l465: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -11431,7 +11357,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l510; + goto l463; } GIV(primFailCode) = 0; } @@ -11440,7 +11366,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l510: /* end case */; + l463: /* end case */; BREAK; CASE(366) /*110*/ /* bytecodePrimPointX */ @@ -11459,9 +11385,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -11477,7 +11403,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l522; + goto l475; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -11486,7 +11412,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l522: /* end case */; + l475: /* end case */; BREAK; CASE(367) /*111*/ /* bytecodePrimPointY */ @@ -11505,9 +11431,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -11523,7 +11449,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l529; + goto l483; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -11532,7 +11458,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l529: /* end case */; + l483: /* end case */; BREAK; CASE(416) /*160*/ CASE(417) /*161*/ @@ -11587,7 +11513,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -11598,7 +11524,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l543; + goto l498; } # endif /* IMMUTABILITY */ @@ -11618,7 +11544,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); - l543: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l498: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11654,7 +11580,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l552; + goto l507; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11662,7 +11588,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l552: /* end jumplfTrueBy: */; + l507: /* end jumplfTrueBy: */; } BREAK; CASE(464) /*208*/ @@ -11695,7 +11621,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l556; + goto l511; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -11703,7 +11629,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l556: /* end jumplfFalseBy: */; + l511: /* end jumplfFalseBy: */; } BREAK; CASE(472) /*216*/ @@ -11722,12 +11648,12 @@ interpret(void) if (extA == 0) { localReturnValue = longAtPointer(localSP); goto commonCallerReturn; - goto l560; + goto l515; } error("shouldBeImplemented"); extA = 0; } - l560: /* end case */; + l515: /* end case */; BREAK; CASE(477) /*221*/ /* extNopBytecode */ @@ -11736,7 +11662,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extA = (extB = 0); + numExtB = (extA = (extB = 0)); } BREAK; CASE(478) /*222*/ @@ -11771,10 +11697,11 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte > 0x7F) ? byte - 256 : (((usqInt) extB << 8)) + byte); + numExtB += 1; } BREAK; CASE(482) /*226*/ @@ -11783,7 +11710,6 @@ interpret(void) sqInt callerContextOrNil; char *callerFP; sqInt index; - sqInt index1; sqInt obj; sqInt object; sqInt object1; @@ -11836,11 +11762,11 @@ interpret(void) value = result; } object = value; - goto l569; + goto l521; } if (isWidowedContext(obj)) { object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l569; + goto l521; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -11856,16 +11782,14 @@ interpret(void) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); object = callerContextOrNil; - goto l569; + goto l521; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) @@ -11873,24 +11797,24 @@ interpret(void) : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); object = longAt(callerFP + FoxThisContext); - goto l569; + goto l521; } object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l569; + goto l521; } if (index == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l569; + goto l521; } if (index == InstructionPointerIndex) { object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l569; + goto l521; } error("bad index"); object = 0; - l569: /* end instVar:ofContext: */; + l521: /* end instVar:ofContext: */; longAtPointerput((localSP -= BytesPerOop), object); } else { @@ -11963,6 +11887,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 1) | 1)); } @@ -11993,7 +11918,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -12013,12 +11937,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -12036,13 +11957,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l580; + goto l535; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l580: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l535: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -12072,7 +11993,6 @@ interpret(void) /* extStoreReceiverVariableBytecode */ { sqInt anObject; - sqInt index1; sqInt obj; int onCurrentPage; sqInt senderOop; @@ -12124,7 +12044,7 @@ interpret(void) if (variableIndex == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); } - goto l587; + goto l547; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12133,10 +12053,8 @@ interpret(void) if (variableIndex == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); storeSenderOfFramewithValue(theFP, anObject); @@ -12147,7 +12065,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l587; + goto l547; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -12180,14 +12098,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l587: /* end instVar:ofContext:put: */; + l547: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12198,7 +12116,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l590; + goto l549; } # endif /* IMMUTABILITY */ @@ -12218,7 +12136,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); - l590: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l549: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12263,7 +12181,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12274,7 +12192,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l600; + goto l550; } # endif /* IMMUTABILITY */ @@ -12294,7 +12212,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), anObject); - l600: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l550: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12323,7 +12241,6 @@ interpret(void) CASE(491) /*235*/ /* extStoreAndPopReceiverVariableBytecode */ { - sqInt index1; sqInt obj; int onCurrentPage; sqInt senderOop; @@ -12377,7 +12294,7 @@ interpret(void) if (variableIndex == StackPointerIndex) { ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); } - goto l606; + goto l565; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12386,10 +12303,8 @@ interpret(void) if (variableIndex == SenderIndex) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); storeSenderOfFramewithValue(theFP, value); @@ -12400,7 +12315,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l606; + goto l565; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -12433,14 +12348,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l606: /* end instVar:ofContext:put: */; + l565: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12451,7 +12366,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l609; + goto l567; } # endif /* IMMUTABILITY */ @@ -12471,7 +12386,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l609: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l567: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12518,7 +12433,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12529,7 +12444,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l619; + goto l568; } # endif /* IMMUTABILITY */ @@ -12549,7 +12464,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l619: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l568: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12594,6 +12509,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); GIV(lkupClassTag) = (((tagBits = rcvr & (tagMask()))) != 0 ? ((tagBits & 1) != 0 @@ -12617,9 +12533,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; goto superclassSend; } - l626: /* end case */; + l578: /* end case */; BREAK; CASE(496) /*240*/ /* extSendAbsentImplicitBytecode */ @@ -12635,6 +12552,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendImplicitReceiver */ } @@ -12646,7 +12564,6 @@ interpret(void) sqInt candidateMixin; sqInt candidateMixinApplication; sqInt candidateReceiver; - sqInt classIndex; sqInt classTablePage; sqInt dictionary; sqInt errorCode; @@ -12677,10 +12594,8 @@ interpret(void) sqInt objOop5; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -12694,9 +12609,7 @@ interpret(void) savedFramePointer = 0; savedStackPointer = 0; /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -12734,21 +12647,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l845; + goto l768; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l845: /* end classAtIndex: */; + l768: /* end classAtIndex: */; /* begin lookupImplicitReceiverSend */ GIV(messageSelector) = (((GIV(messageSelector) & (tagMask())) == 0) && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) @@ -12763,8 +12675,8 @@ interpret(void) while (1) { assert(!((isForwarded(candidateMixin)))); assert(!((isForwarded(candidateReceiver)))); - candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits2 = candidateReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits1 = candidateReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) : fetchClassOfNonImm(candidateReceiver))); assert(!((candidateMixinApplication == 0))); assert(!((candidateMixinApplication == (nilObject())))); @@ -12780,13 +12692,9 @@ interpret(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -12811,19 +12719,19 @@ interpret(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; - goto l809; + goto l759; } index += 1; } found = 0; - goto l809; + goto l759; } /* It is assumed that there are some nils in this dictionary, and search will @@ -12834,13 +12742,13 @@ interpret(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -12849,7 +12757,7 @@ interpret(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l809; + goto l759; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -12857,12 +12765,12 @@ interpret(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -12871,24 +12779,24 @@ interpret(void) } GIV(newMethod) = objOop4; found = 1; - goto l809; + goto l759; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l809; + goto l759; } wrapAround = 1; index = SelectorStart; } } found = 0; - l809: /* end lookupMethodInDictionary: */; + l759: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; actualLookupRule = lookupLexicalfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l825; + goto l777; } /* begin followObjField:ofObject: */ objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); @@ -12903,13 +12811,12 @@ interpret(void) } GIV(localAbsentReceiverOrZero) = 0; GIV(localAbsentReceiver) = methodReceiver; - - /* MNU lookup starts here. */ - GIV(lkupClass) = (((tagBits1 = methodReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) + /* begin fetchClassOf: */ + GIV(lkupClass) = (((tagBits2 = methodReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) : fetchClassOfNonImm(methodReceiver)); actualLookupRule = lookupProtectedstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l825: /* end lookupImplicitReceiverSend */; + l777: /* end lookupImplicitReceiverSend */; /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -12941,29 +12848,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l839; + goto l772; } if (localPrimIndex == 256) { - goto l839; + goto l772; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l839; + goto l772; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l839; + goto l772; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l839; + goto l772; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l839: /* end internalQuickPrimitiveResponse */; - goto l827; + goto l772; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13025,7 +12931,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l827; + goto l772; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13054,8 +12960,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13081,7 +12987,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13105,11 +13011,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l808; + goto l756; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l808: /* end getErrorObjectFromPrimFailCode */; + l756: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13133,7 +13039,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l827: /* end internalExecuteNewMethod */; + l772: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13153,6 +13059,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendDynamicSuper */ } @@ -13161,7 +13068,6 @@ interpret(void) { sqInt actualLookupRule; sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -13180,10 +13086,8 @@ interpret(void) sqInt oop; sqInt probe1; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -13195,9 +13099,7 @@ interpret(void) savedFramePointer = 0; savedStackPointer = 0; /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -13222,7 +13124,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } /* second probe */ @@ -13234,7 +13136,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } probe1 = (((usqInt) hash1) >> 2) & NSMethodCacheMask; if (((((GIV(nsMethodCache)[probe1 + NSMethodCacheSelector]) == GIV(messageSelector)) @@ -13244,7 +13146,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l870; + goto l803; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13263,20 +13165,19 @@ interpret(void) } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l862; + goto l806; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l862: /* end classAtIndex: */; + l806: /* end classForClassTag: */; /* begin lookupDynamicSuperSend */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13298,7 +13199,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToNSCache(actualLookupRule); - l870: ; + l803: ; /* begin shuffleArgumentsAndStoreAbsentReceiver: */ @@ -13324,29 +13225,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l864; + goto l808; } if (localPrimIndex == 256) { - goto l864; + goto l808; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l864; + goto l808; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l864; + goto l808; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l864; + goto l808; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l864: /* end internalQuickPrimitiveResponse */; - goto l861; + goto l808; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13408,7 +13308,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l861; + goto l808; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13437,8 +13337,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13464,7 +13364,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13488,11 +13388,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l855; + goto l799; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l855: /* end getErrorObjectFromPrimFailCode */; + l799: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13516,7 +13416,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l861: /* end internalExecuteNewMethod */; + l808: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13534,10 +13434,11 @@ interpret(void) byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; localIP += offset; /* begin ifBackwardsCheckForEvents: */ if (offset >= 0) { - goto l630; + goto l583; } if (localSP < GIV(stackLimit)) { /* begin externalizeIPandSP */ @@ -13554,7 +13455,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); if (switched) { - goto l630; + goto l583; } } backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN @@ -13583,7 +13484,7 @@ interpret(void) byteAtput(localFP + ((VMBIGENDIAN ? (FoxIFrameFlags + BytesPerWord) - 1 : FoxIFrameFlags)), backwardJumpCountByte); - l630: /* end ifBackwardsCheckForEvents: */; + l583: /* end ifBackwardsCheckForEvents: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13599,7 +13500,7 @@ interpret(void) VM_LABEL(extJumpIfTrue); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfTrueBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(trueObj)) { @@ -13614,7 +13515,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l634; + goto l586; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13622,7 +13523,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l634: /* end jumplfTrueBy: */; + l586: /* end jumplfTrueBy: */; } BREAK; CASE(500) /*244*/ @@ -13635,7 +13536,7 @@ interpret(void) VM_LABEL(extJumpIfFalse); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfFalseBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(falseObj)) { @@ -13650,7 +13551,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l638; + goto l590; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13658,7 +13559,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l638: /* end jumplfFalseBy: */; + l590: /* end jumplfFalseBy: */; } BREAK; CASE(501) /*245*/ @@ -13667,7 +13568,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt errorCode; @@ -13684,10 +13584,8 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -13707,10 +13605,9 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -13748,21 +13645,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l660; + goto l596; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l660: /* end classAtIndex: */; + l596: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13814,29 +13710,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l657; + goto l612; } if (localPrimIndex == 256) { - goto l657; + goto l612; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l657; + goto l612; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l657; + goto l612; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l657; + goto l612; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l657: /* end internalQuickPrimitiveResponse */; - goto l646; + goto l612; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -13898,7 +13793,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l646; + goto l612; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -13927,8 +13822,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13954,7 +13849,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13978,11 +13873,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l641; + goto l607; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l641: /* end getErrorObjectFromPrimFailCode */; + l607: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14006,7 +13901,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l646: /* end internalExecuteNewMethod */; + l612: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14038,15 +13933,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l667; + goto l617; } else { goto respondToUnknownBytecode; - goto l667; + goto l617; } } - l667: /* end case */; + l617: /* end case */; BREAK; CASE(509) /*253*/ /* extPushClosureBytecode */ @@ -14073,7 +13968,7 @@ interpret(void) numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8); extA = 0; blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); - extB = 0; + numExtB = (extB = 0); /* begin pushClosureNumArgs:copiedValues:blockSize: */ theFP = localFP; theSP = localSP + (numCopied * BytesPerOop); @@ -14082,10 +13977,10 @@ interpret(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l691; + goto l642; } context = marryFrameSP(theFP, theSP); - l691: /* end ensureFrameIsMarried:SP: */; + l642: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -14113,13 +14008,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l695; + goto l638; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l695: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l638: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -14164,7 +14059,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt depth; @@ -14182,10 +14076,8 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; char *savedFramePointer; char *savedStackPointer; - sqInt selector; sqInt succeeded; sqInt switched; sqInt table; @@ -14205,11 +14097,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byteAtPointer(++localIP); /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag))); /* begin cr */ @@ -14247,21 +14138,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l719; + goto l652; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l719: /* end classAtIndex: */; + l652: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14313,29 +14203,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l716; + goto l668; } if (localPrimIndex == 256) { - goto l716; + goto l668; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l716; + goto l668; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l716; + goto l668; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l716; + goto l668; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l716: /* end internalQuickPrimitiveResponse */; - goto l705; + goto l668; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -14397,7 +14286,7 @@ interpret(void) if (succeeded) { returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); - goto l705; + goto l668; } } if ((assert(isNonImmediate(GIV(newMethod))), @@ -14426,8 +14315,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14453,7 +14342,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), 0); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14477,11 +14366,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l700; + goto l663; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l700: /* end getErrorObjectFromPrimFailCode */; + l663: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14505,7 +14394,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); } } - l705: /* end internalExecuteNewMethod */; + l668: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14748,13 +14637,9 @@ stackPageAt(sqInt index) static StackPage * NoDbgRegParms stackPageFor(void *pointer) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; - /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - return stackPageAtpages(index, GIV(pages)); + return stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } /* CogStackPages>>#statAverageLivePagesWhenMapping */ @@ -14869,11 +14754,11 @@ activateCoggedNewMethod(sqInt inInterpreter) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -14999,11 +14884,11 @@ activateNewMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -15079,6 +14964,7 @@ addNewMethodToCache(sqInt classObj) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -15233,6 +15119,7 @@ assertValidMachineCodeFrame(sqInt instrPtr) assert(isMachineCodeFrame(GIV(framePointer))); /* begin mframeCogMethod: */ cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((cogMethod->cmType)) == CMMethod ? ((CogMethod *) cogMethod) : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))); @@ -15428,6 +15315,7 @@ attemptToSwitchToMachineCode(sqInt bcpc) assert(isMachineCodeFrame(GIV(framePointer))); /* begin mframeCogMethod: */ cogMethod1 = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((cogMethod1->cmType)) == CMMethod ? ((CogMethod *) cogMethod1) : ((CogMethod *) ((((usqInt)cogMethod1)) - ((cogMethod1->homeOffset))))); @@ -15660,7 +15548,6 @@ ceBaseFrameReturn(sqInt returnValue) sqInt contextToReturnTo; char *fp; char *frameAbove; - sqInt index; sqInt isAContext; StackPage *lruOrFree; StackPage *newPage; @@ -15669,7 +15556,6 @@ ceBaseFrameReturn(sqInt returnValue) char *sp1; char *sp2; char *sp3; - char *theFP; StackPage *thePage; assert((stackPageFor(GIV(stackPointer))) == GIV(stackPage)); @@ -15694,10 +15580,8 @@ ceBaseFrameReturn(sqInt returnValue) GIV(framePointer) = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (GIV(framePointer) == ((thePage->headFP))) { GIV(stackPointer) = (thePage->headSP); } @@ -15707,22 +15591,21 @@ ceBaseFrameReturn(sqInt returnValue) Move the frames above to another page (they may be in use, e.g. via coroutining). Make the interior frame the top frame. */ /* begin findFrameAbove:inPage: */ - theFP = GIV(framePointer); fp = (thePage->headFP); - if (fp == theFP) { + if (fp == GIV(framePointer)) { frameAbove = 0; - goto l3; + goto l2; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { - if (callerFP == theFP) { + if (callerFP == GIV(framePointer)) { frameAbove = fp; - goto l3; + goto l2; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l3: /* end findFrameAbove:inPage: */; + l2: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { @@ -16023,21 +15906,21 @@ ceDynamicSuperSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16078,10 +15961,10 @@ ceDynamicSuperSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -16155,11 +16038,11 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt selector; sqInt tagBits; sqInt tagBits1; @@ -16196,21 +16079,21 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16251,13 +16134,9 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -16282,19 +16161,19 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l26; + goto l17; } index += 1; } found = 0; - goto l26; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -16305,13 +16184,13 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -16320,7 +16199,7 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l26; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -16328,12 +16207,12 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -16342,32 +16221,32 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) } GIV(newMethod) = objOop4; found = 1; - goto l26; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l26; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l26: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; errSelIdx = lookupLexicalNoMNUfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l13; + goto l26; } /* begin followObjField:ofObject: */ - objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(EnclosingMixinIndex, candidateMixin, objOop1); + objOop6 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop6)); + if (((longAt(objOop6)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(EnclosingMixinIndex, candidateMixin, objOop6); } - candidateMixin = objOop1; + candidateMixin = objOop6; assert(!((isForwarded(candidateMixin)))); if (candidateMixin == GIV(nilObj)) break; GIV(localAbsentReceiverOrZero) = (candidateReceiver = followObjFieldofObject(EnclosingObjectIndex, candidateMixinApplication)); @@ -16382,7 +16261,7 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) GIV(lkupClass) = fetchClassOfNonImm(methodReceiver); } errSelIdx = lookupProtectedNoMNUstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l13: /* end lookupImplicitReceiverSendNoMNU: */; + l26: /* end lookupImplicitReceiverSendNoMNU: */; if (errSelIdx != 0) { assert(errSelIdx == SelectorDoesNotUnderstand); assert(GIV(localAbsentReceiver) == methodReceiver); @@ -16398,10 +16277,10 @@ ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -16478,6 +16357,7 @@ ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -16551,6 +16431,7 @@ ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -16585,11 +16466,6 @@ ceNonLocalReturn(sqInt returnValue) sqInt currentCtx; char *frameToReturnTo; sqInt home; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; StackPage *newPage; sqInt nextCntx; sqInt objOop; @@ -16606,8 +16482,8 @@ ceNonLocalReturn(sqInt returnValue) char *sp21; char *sp22; char *sp3; + char *sp31; char *sp4; - char *sp5; char *theFP; char *theFP1; char *theFP2; @@ -16670,17 +16546,17 @@ ceNonLocalReturn(sqInt returnValue) /* error: can't find home on chain; cannot return */ /* begin ensureFrameIsMarried:SP: */ - theFP3 = GIV(framePointer); + theFP1 = GIV(framePointer); theSP = GIV(stackPointer); - if (((((usqInt)(longAt(theFP3 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP3 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP3 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP3))); - ourContext = longAt(theFP3 + FoxThisContext); - goto l20; + if (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP1))); + ourContext = longAt(theFP1 + FoxThisContext); + goto l14; } - ourContext = marryFrameSP(theFP3, theSP); - l20: /* end ensureFrameIsMarried:SP: */; + ourContext = marryFrameSP(theFP1, theSP); + l14: /* end ensureFrameIsMarried:SP: */; /* begin externalCannotReturn:from: */ longAtput((sp = GIV(stackPointer) - BytesPerWord), ourContext); GIV(stackPointer) = sp; @@ -16709,14 +16585,14 @@ ceNonLocalReturn(sqInt returnValue) longAtput((sp4 = GIV(stackPointer) - BytesPerWord), ourContext1); GIV(stackPointer) = sp4; /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue); - GIV(stackPointer) = sp11; + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp12; /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero); - GIV(stackPointer) = sp21; + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero); + GIV(stackPointer) = sp22; /* begin push: */ - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp3; + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp31; return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))), ourContext1, 2); } contextToReturnTo = null; @@ -16731,10 +16607,8 @@ ceNonLocalReturn(sqInt returnValue) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index2, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -16765,44 +16639,40 @@ ceNonLocalReturn(sqInt returnValue) /* error: home's sender is dead; cannot return */ /* begin ensureFrameIsMarried:SP: */ - theFP4 = GIV(framePointer); + theFP2 = GIV(framePointer); theSP1 = GIV(stackPointer); - if (((((usqInt)(longAt(theFP4 + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP4 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP4 + FoxIFrameFlags) + 2)) != 0)) { - assert(isContext(frameContext(theFP4))); - ourContext = longAt(theFP4 + FoxThisContext); - goto l21; + if (((((usqInt)(longAt(theFP2 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP2 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP2 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP2))); + ourContext = longAt(theFP2 + FoxThisContext); + goto l17; } - ourContext = marryFrameSP(theFP4, theSP1); - l21: /* end ensureFrameIsMarried:SP: */; + ourContext = marryFrameSP(theFP2, theSP1); + l17: /* end ensureFrameIsMarried:SP: */; /* begin externalCannotReturn:from: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), ourContext); - GIV(stackPointer) = sp5; + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), ourContext); + GIV(stackPointer) = sp3; /* begin push: */ - longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue); - GIV(stackPointer) = sp12; + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp11; /* begin push: */ - longAtput((sp22 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp22; + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp21; return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1); } } assert(pageListIsWellFormed()); /* begin stackPageFor: */ - assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage)); - - newPage = stackPageAtpages(index1, GIV(pages)); + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (newPage != GIV(stackPage)) { /* begin frameCallerContext: */ - theFP2 = (GIV(stackPage)->baseFP); - assert(isBaseFrame(theFP2)); + theFP4 = (GIV(stackPage)->baseFP); + assert(isBaseFrame(theFP4)); /* begin stackPageFor: */ - assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage3 = stackPageAtpages(index4, GIV(pages)); + thePage3 = stackPageAtpages((assert((((((char *) theFP4)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP4)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP4, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil2 = longAt((thePage3->baseAddress)); assert(addressCouldBeObj(callerContextOrNil2)); assert((callerContextOrNil2 == (nilObject())) @@ -16816,18 +16686,14 @@ ceNonLocalReturn(sqInt returnValue) && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin frameCallerContext: */ - theFP1 = (thePage->baseFP); - assert(isBaseFrame(theFP1)); + theFP3 = (thePage->baseFP); + assert(isBaseFrame(theFP3)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index3, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP3)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP3)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP3, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -16930,21 +16796,21 @@ ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -16973,10 +16839,10 @@ ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -17100,21 +16966,21 @@ ceSelfSendreceiver(sqInt cacheAddress, sqInt methodReceiver) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -17140,10 +17006,10 @@ ceSelfSendreceiver(sqInt cacheAddress, sqInt methodReceiver) && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, GIV(messageSelector)); } @@ -17262,12 +17128,12 @@ ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l5; + goto l4; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l5: /* end classAtIndex: */; + l4: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); assert(0); @@ -17376,12 +17242,12 @@ ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l5; + goto l4; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l5: /* end classAtIndex: */; + l4: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); assert(0); @@ -17417,7 +17283,7 @@ ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize sqInt methodHeader; sqInt methodObj; sqInt oop; - sqInt p; + char *p; char *sp; unsigned short startBcpc; sqInt top; @@ -17434,7 +17300,7 @@ ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize else { methodHeader = ((((CogMethod *) cogMethod))->methodHeader); methodObj = ((((CogMethod *) cogMethod))->methodObject); - startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop; + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; } /* begin popStack */ top = longAt(GIV(stackPointer)); @@ -17580,21 +17446,21 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num /* begin ifAppropriateCompileToNativeCode:selector: */ aMethodObj = GIV(newMethod); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod1 = ((CogMethod *) methodHeader); + cogMethod1 = ((CogMethod *) methodHeader1); if (((cogMethod1->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -17620,12 +17486,12 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { classObj = null; - goto l9; + goto l8; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l9: /* end classAtIndex: */; + l8: /* end classAtIndex: */; if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { if ((errSelIdx == SelectorDoesNotUnderstand) && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) { @@ -17642,10 +17508,10 @@ ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt num && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { /* begin cogMethodOf: */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); if (((cogMethod->selector)) == GIV(nilObj)) { setSelectorOfto(cogMethod, selector); } @@ -17998,7 +17864,8 @@ checkStackIntegrity(void) theSP += BytesPerWord; } if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) : (/* begin iframeHasContext: */ (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) { oop = longAt(theFP + FoxThisContext); @@ -18775,12 +18642,12 @@ findNewMethodInClassTag(sqInt classTagArg) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l4; + goto l2; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l4: /* end classAtIndex: */; + l2: /* end classAtIndex: */; lookupOrdinarySend(); addNewMethodToCache(GIV(lkupClass)); @@ -19042,7 +18909,8 @@ followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) } } if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) : (/* begin iframeHasContext: */ (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) && (((longAt(longAt(theFP + FoxThisContext))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { @@ -19124,15 +18992,12 @@ static sqInt NoDbgRegParms frameCallerContext(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; - sqInt index; StackPage *thePage; assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -19499,7 +19364,6 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq { DECL_MAYBE_SQ_GLOBAL_STRUCT char *callerFP; char *fp; - sqInt index; char *theFPAbove; sqInt theIP; StackPage *thePage; @@ -19510,10 +19374,8 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq } else { /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findFrameAbove:inPage: */ fp = (thePage->headFP); if (fp == spouseFP) { @@ -19739,13 +19601,9 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -19770,12 +19628,12 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; goto l16; } @@ -19793,13 +19651,13 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -19816,12 +19674,12 @@ lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -20029,11 +19887,11 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -20048,13 +19906,9 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -20079,19 +19933,19 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -20102,13 +19956,13 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -20117,7 +19971,7 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -20125,12 +19979,12 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -20139,31 +19993,31 @@ lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return 0; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return SelectorDoesNotUnderstand; } @@ -20202,6 +20056,7 @@ makeBaseFrameFor(sqInt aContext) sqInt theMethod; char *value; sqInt valuePointer; + sqInt yetToCompact; /* theIP must be typed as signed because it is assigned ceCannotResumePC and so maybe implicitly typed as unsigned. */ @@ -20224,11 +20079,11 @@ makeBaseFrameFor(sqInt aContext) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { page = lruOrFree; - goto l3; + goto l1; } divorceFramesIn(lruOrFree); page = lruOrFree; -l3: /* end newStackPage */; +l1: /* end newStackPage */; longAtput((pointer = (page->baseAddress)), followObjFieldofObject(SenderIndex, aContext)); longAtput((pointer -= BytesPerWord), aContext); /* begin followField:ofObject: */ @@ -20282,26 +20137,35 @@ makeBaseFrameFor(sqInt aContext) /* Since we would have to generate a machine-code method to be able to map the native pc anyway we should create a native method and native frame. */ - /* begin ensureMethodIsCogged: */ + /* begin ensureMethodIsCogged:maybeClosure: */ rawHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((rawHeader & 1)) || (((((usqInt)rawHeader)) < (startOfMemory())) && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), (rawHeader & 1) == 0)) { cogMethod = ((CogMethod *) rawHeader); - goto l10; + goto l12; } - cogMethod1 = cogselector(theMethod, GIV(nilObj)); - if ((cogMethod1 == null) - && (GIV(cogCompiledCodeCompactionCalledFor))) { + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(1))) { + cogMethod1 = cogFullBlockMethodnumCopied(theMethod, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(theMethod, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; commenceCogCompiledCodeCompaction(); - cogMethod1 = cogselector(theMethod, GIV(nilObj)); } if (!(asserta(cogMethod1 != null))) { error("could not compile method that should have been compiled"); } cogMethod = cogMethod1; - l10: /* end ensureMethodIsCogged: */; + l12: /* end ensureMethodIsCogged:maybeClosure: */; theMethod = ((sqInt)cogMethod); if (maybeClosure != GIV(nilObj)) { if (1) { @@ -20497,9 +20361,10 @@ mapStackPages(void) && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxThisContext), ((futureSpace()).start), futureSurvivorStart()))))) { longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext))); } - assert((isMarriedOrWidowedContext(frameContext(theFP))) - && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); - + if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) { + assert((isMarriedOrWidowedContext(frameContext(theFP))) + && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); + } } if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) { if ((((longAt(longAt(theFP + FoxMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) @@ -20707,6 +20572,7 @@ markAndTraceStackPage(StackPage *thePage) if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { /* begin markAndTraceMachineCodeMethod: */ aCogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ homeMethod = (((aCogMethod->cmType)) == CMMethod ? ((CogMethod *) aCogMethod) : ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset))))); @@ -21098,13 +20964,9 @@ mnuMethodOrNilFor(sqInt rcvr) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -21129,7 +20991,7 @@ mnuMethodOrNilFor(sqInt rcvr) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { mnuMethod = null; - goto l13; + goto l11; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -21137,12 +20999,12 @@ mnuMethodOrNilFor(sqInt rcvr) } if (nextSelector == mnuSelector) { /* begin followObjField:ofObject: */ - objOop2 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop2)); - if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2); + objOop = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop); } - methodArray = objOop2; + methodArray = objOop; /* begin followField:ofObject: */ objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop1 & (tagMask())) == 0) @@ -21150,20 +21012,20 @@ mnuMethodOrNilFor(sqInt rcvr) objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } mnuMethod = objOop1; - goto l13; + goto l11; } index += 1; if (index == length) { if (wrapAround) { mnuMethod = null; - goto l13; + goto l11; } wrapAround = 1; index = SelectorStart; } } mnuMethod = null; - l13: /* end lookupMethodFor:InDictionary: */; + l11: /* end lookupMethodFor:InDictionary: */; if (!(mnuMethod == null)) { /* begin fetchPointer:ofObject: */ methodHeader = longAt((mnuMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); @@ -21179,12 +21041,12 @@ mnuMethodOrNilFor(sqInt rcvr) return mnuMethod; } /* begin followField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop & (tagMask())) == 0) - && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); + objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop2 & (tagMask())) == 0) + && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); } - currentClass = objOop; + currentClass = objOop2; } return null; } @@ -21312,6 +21174,7 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) sqInt methodObj; sqInt rawHeader; sqInt startBcpc; + sqInt yetToCompact; if (theIP == HasBeenReturnedFromMCPC) { return GIV(nilObj); @@ -21325,9 +21188,9 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) } else { assert((((signed)theIP >> 16)) == -1); - startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop; + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; } - /* begin ensureMethodIsCogged: */ + /* begin ensureMethodIsCogged:maybeClosure: */ rawHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((rawHeader & 1)) || (((((usqInt)rawHeader)) < (startOfMemory())) @@ -21336,17 +21199,26 @@ mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) cogMethod = ((CogMethod *) rawHeader); goto l3; } - cogMethod1 = cogselector(methodObj, GIV(nilObj)); - if ((cogMethod1 == null) - && (GIV(cogCompiledCodeCompactionCalledFor))) { + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(1))) { + cogMethod1 = cogFullBlockMethodnumCopied(methodObj, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(methodObj, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; commenceCogCompiledCodeCompaction(); - cogMethod1 = cogselector(methodObj, GIV(nilObj)); } if (!(asserta(cogMethod1 != null))) { error("could not compile method that should have been compiled"); } cogMethod = cogMethod1; -l3: /* end ensureMethodIsCogged: */; +l3: /* end ensureMethodIsCogged:maybeClosure: */; /* begin bytecodePCFor:cogMethod:startBcpc: */ assert(theIP < 0); if ((((signed)theIP >> 16)) < -1) { @@ -21479,13 +21351,13 @@ positive32BitIntegerFor(unsigned int integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21595,11 +21467,11 @@ positive64BitIntegerFor(usqLong integerValue) return (((((unsigned int) integerValue)) << 1) | 1); } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); assert(ClassLargePositiveIntegerCompactIndex != 0); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(1 < (numSlotsMask())); newObj = GIV(freeStart); @@ -21615,13 +21487,13 @@ positive64BitIntegerFor(usqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger1 = newObj; - l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21646,13 +21518,13 @@ positive64BitIntegerFor(usqLong integerValue) } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + objFormat1 = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); numSlots = 8 / BytesPerOop; assert((numSlots >= 0) && (ClassLargePositiveIntegerCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -21670,13 +21542,13 @@ positive64BitIntegerFor(usqLong integerValue) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue)); return newLargeInteger; } @@ -21919,6 +21791,7 @@ printCogMethod(CogMethod *cogMethod) theMethod = (cogMethod->methodObject); methodHeader = (cogMethod->methodHeader); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitive = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -22163,10 +22036,10 @@ printFrameWithSP(char *theFP, char *theSP) methodField = longAt(theFP + FoxMethod); if ((methodField & MFMethodFlagIsBlockFlag) != 0) { homeMethod = ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))); - goto l3; + goto l2; } homeMethod = ((CogMethod *) (methodField & MFMethodMask)); - l3: /* end mframeHomeMethod: */; + l2: /* end mframeHomeMethod: */; theMethod = ((sqInt)homeMethod); theMethodEnd = (((sqInt)homeMethod)) + ((homeMethod->blockSize)); numArgs = (cogMethod->cmNumArgs); @@ -22655,20 +22528,20 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea sqInt oop; sqInt seed; sqInt swapBytes; - int w; + sqInt w; int w1; - sqInt w10; + unsigned short w10; sqInt w11; sqInt w12; sqInt w13; - unsigned short w2; - int w3; - unsigned short w4; - unsigned short w5; - sqInt w6; - sqInt w7; - sqInt w8; - sqInt w9; + sqInt w2; + sqInt w3; + sqInt w4; + sqInt w5; + int w6; + unsigned short w7; + int w8; + unsigned short w9; /* guess Metaclass instSize */ @@ -22681,69 +22554,69 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* record header start position */ headerStart = (sqImageFilePosition(f)) - 4; /* begin getWord32FromFile:swap: */ - w = 0; - sqImageFileRead((&w), sizeof(int), 1, f); + w1 = 0; + sqImageFileRead((&w1), sizeof(int), 1, f); headerSize = (swapBytes - ? SQ_SWAP_4_BYTES(w) - : w); + ? SQ_SWAP_4_BYTES(w1) + : w1); /* begin getLongFromFile:swap: */ - w7 = 0; - sqImageFileRead((&w7), sizeof(w7), 1, f); + w2 = 0; + sqImageFileRead((&w2), sizeof(w2), 1, f); dataSize = ((sqInt) ((swapBytes ? (/* begin byteSwapped: */ - SQ_SWAP_4_BYTES(w7)) - : w7))); + SQ_SWAP_4_BYTES(w2)) + : w2))); /* begin getLongFromFile:swap: */ - w8 = 0; - sqImageFileRead((&w8), sizeof(w8), 1, f); + w3 = 0; + sqImageFileRead((&w3), sizeof(w3), 1, f); if (swapBytes) { /* begin byteSwapped: */ - oldBaseAddr = SQ_SWAP_4_BYTES(w8); + oldBaseAddr = SQ_SWAP_4_BYTES(w3); } else { - oldBaseAddr = w8; + oldBaseAddr = w3; } /* begin specialObjectsOop: */ - w9 = 0; - sqImageFileRead((&w9), sizeof(w9), 1, f); + w12 = 0; + sqImageFileRead((&w12), sizeof(w12), 1, f); if (swapBytes) { /* begin byteSwapped: */ - anObject = SQ_SWAP_4_BYTES(w9); + anObject = SQ_SWAP_4_BYTES(w12); } else { - anObject = w9; + anObject = w12; } GIV(specialObjectsOop) = anObject; /* begin lastHash: */ - w10 = 0; - sqImageFileRead((&w10), sizeof(w10), 1, f); + w13 = 0; + sqImageFileRead((&w13), sizeof(w13), 1, f); if (swapBytes) { /* begin byteSwapped: */ - seed = SQ_SWAP_4_BYTES(w10); + seed = SQ_SWAP_4_BYTES(w13); } else { - seed = w10; + seed = w13; } GIV(lastHash) = seed; /* begin getLongFromFile:swap: */ - w11 = 0; - sqImageFileRead((&w11), sizeof(w11), 1, f); + w4 = 0; + sqImageFileRead((&w4), sizeof(w4), 1, f); if (swapBytes) { /* begin byteSwapped: */ - GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w11); + GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w4); } else { - GIV(savedWindowSize) = w11; + GIV(savedWindowSize) = w4; } /* begin getLongFromFile:swap: */ - w12 = 0; - sqImageFileRead((&w12), sizeof(w12), 1, f); + w5 = 0; + sqImageFileRead((&w5), sizeof(w5), 1, f); if (swapBytes) { /* begin byteSwapped: */ - headerFlags = SQ_SWAP_4_BYTES(w12); + headerFlags = SQ_SWAP_4_BYTES(w5); } else { - headerFlags = w12; + headerFlags = w5; } /* begin setImageHeaderFlagsFrom: */ @@ -22757,17 +22630,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(preemptionYields) = (headerFlags & 16) == 0; GIV(newFinalization) = (headerFlags & 64) != 0; /* begin getWord32FromFile:swap: */ - w1 = 0; - sqImageFileRead((&w1), sizeof(int), 1, f); + w6 = 0; + sqImageFileRead((&w6), sizeof(int), 1, f); extraVMMemory = (swapBytes - ? SQ_SWAP_4_BYTES(w1) - : w1); + ? SQ_SWAP_4_BYTES(w6) + : w6); /* begin getShortFromFile:swap: */ - w2 = 0; - sqImageFileRead((&w2), sizeof(unsigned short), 1, f); + w7 = 0; + sqImageFileRead((&w7), sizeof(unsigned short), 1, f); hdrNumStackPages = (swapBytes - ? ((((usqInt) w2) >> 8) & 0xFF) | (((int)((usqInt)((w2 & 0xFF)) << 8))) - : w2); + ? ((((usqInt) w7) >> 8) & 0xFF) | (((int)((usqInt)((w7 & 0xFF)) << 8))) + : w7); GIV(numStackPages) = (desiredNumStackPages != 0 ? desiredNumStackPages : (hdrNumStackPages == 0 @@ -22783,11 +22656,11 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea ? defaultCogCodeSize() : hdrCogCodeSize)); /* begin getWord32FromFile:swap: */ - w3 = 0; - sqImageFileRead((&w3), sizeof(int), 1, f); + w8 = 0; + sqImageFileRead((&w8), sizeof(int), 1, f); hdrEdenBytes = (swapBytes - ? SQ_SWAP_4_BYTES(w3) - : w3); + ? SQ_SWAP_4_BYTES(w8) + : w8); /* begin edenBytes: */ bytes = (desiredEdenBytes != 0 ? desiredEdenBytes @@ -22797,31 +22670,31 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(edenBytes) = bytes; desiredEdenBytes = hdrEdenBytes; /* begin getShortFromFile:swap: */ - w4 = 0; - sqImageFileRead((&w4), sizeof(unsigned short), 1, f); + w9 = 0; + sqImageFileRead((&w9), sizeof(unsigned short), 1, f); hdrMaxExtSemTabSize = (swapBytes - ? ((((usqInt) w4) >> 8) & 0xFF) | (((int)((usqInt)((w4 & 0xFF)) << 8))) - : w4); + ? ((((usqInt) w9) >> 8) & 0xFF) | (((int)((usqInt)((w9 & 0xFF)) << 8))) + : w9); if (hdrMaxExtSemTabSize != 0) { /* begin setMaxExtSemSizeTo: */ GIV(maxExtSemTabSizeSet) = 1; ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize); } /* begin getShortFromFile:swap: */ - w5 = 0; - sqImageFileRead((&w5), sizeof(unsigned short), 1, f); + w10 = 0; + sqImageFileRead((&w10), sizeof(unsigned short), 1, f); GIV(the2ndUnknownShort) = (swapBytes - ? ((((usqInt) w5) >> 8) & 0xFF) | (((int)((usqInt)((w5 & 0xFF)) << 8))) - : w5); + ? ((((usqInt) w10) >> 8) & 0xFF) | (((int)((usqInt)((w10 & 0xFF)) << 8))) + : w10); /* begin getLongFromFile:swap: */ - w13 = 0; - sqImageFileRead((&w13), sizeof(w13), 1, f); + w11 = 0; + sqImageFileRead((&w11), sizeof(w11), 1, f); if (swapBytes) { /* begin byteSwapped: */ - firstSegSize = SQ_SWAP_4_BYTES(w13); + firstSegSize = SQ_SWAP_4_BYTES(w11); } else { - firstSegSize = w13; + firstSegSize = w11; } /* begin firstSegmentSize: */ GIV(firstSegmentSize) = firstSegSize; @@ -22830,14 +22703,14 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* no need to include the stackZone; this is alloca'ed */ minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + allocationReserve; /* begin getLongFromFile:swap: */ - w6 = 0; - sqImageFileRead((&w6), sizeof(w6), 1, f); + w = 0; + sqImageFileRead((&w), sizeof(w), 1, f); if (swapBytes) { /* begin byteSwapped: */ - freeOldSpaceInImage = SQ_SWAP_4_BYTES(w6); + freeOldSpaceInImage = SQ_SWAP_4_BYTES(w); } else { - freeOldSpaceInImage = w6; + freeOldSpaceInImage = w; } /* begin initialHeadroom:givenFreeOldSpaceInImage: */ headroom1 = (extraVMMemory == 0 @@ -22847,26 +22720,26 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea : extraVMMemory); if (freeOldSpaceInImage >= headroom1) { headroom = 0; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) { headroom = headroom1 / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) { headroom = headroom1 / 4; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) { headroom = (headroom1 * 3) / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= (headroom1 / 2)) { headroom = headroom1 / 2; - goto l1; + goto l2; } headroom = headroom1; -l1: /* end initialHeadroom:givenFreeOldSpaceInImage: */; +l2: /* end initialHeadroom:givenFreeOldSpaceInImage: */; /* begin roundUpHeapSize: */ heapSize1 = (((GIV(cogCodeSize) + dataSize) + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve ? 0 @@ -22942,13 +22815,9 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* begin numSlotsOf: */ assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classArrayClass + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(metaclassNumSlots) = longAt(classArrayClass - BaseHeaderSize); - } - else { - GIV(metaclassNumSlots) = numSlots; - } + GIV(metaclassNumSlots) = (numSlots == (numSlotsMask()) + ? longAt(classArrayClass - BaseHeaderSize) + : numSlots); /* default */ GIV(thisClassIndex) = 5; @@ -23193,8 +23062,7 @@ returntoExecutive(sqInt returnValue, sqInt inInterpreter) static void NoDbgRegParms rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void)) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if ((assert(isNonImmediate(GIV(newMethod))), - isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(GIV(newMethod))) { rewritePrimInvocationInto(cogMethodOf(GIV(newMethod)), (localPrimAddress == 0 ? ((void (*)(void)) primitiveFail) : localPrimAddress)); @@ -23343,21 +23211,21 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) aMethodObj = GIV(newMethod); selector = GIV(messageSelector); /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { /* makeBaseFrame: can create cog methods with nil selectors. */ - cogMethod = ((CogMethod *) methodHeader); - if (((cogMethod->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod, selector); + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); } } else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { cogselector(aMethodObj, selector); } else { @@ -23365,267 +23233,16 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) } } /* begin justActivateNewMethod */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (activateCogMethod = (methodHeader1 & 1) == 0))) { - cogMethod1 = ((CogMethod *) methodHeader1); - methodHeader1 = (cogMethod1->methodHeader); - } - numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; - - /* could new rcvr be set at point of send? */ - rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); - assert(!(isOopForwarded(rcvr))); - if (activateCogMethod - && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { - /* begin iframeSavedIP:put: */ - assert(!(isMachineCodeFrame(GIV(framePointer)))); - longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); - GIV(instructionPointer) = ceReturnToInterpreterPC(); - } - /* begin push: */ - longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); - GIV(stackPointer) = sp7; - /* begin push: */ - longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); - GIV(stackPointer) = sp8; - GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), -((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; - if (activateCogMethod) { - /* begin push: */ - object5 = ((usqInt)cogMethod1); - longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); - GIV(stackPointer) = sp10; - /* begin push: */ - longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp11; - GIV(instructionPointer) = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); - } - else { - /* begin push: */ - longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); - GIV(stackPointer) = sp21; - /* begin setMethod:methodHeader: */ - GIV(method) = GIV(newMethod); - assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader1); - GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 - ? 256 - : 0); - - /* begin push: */ - longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp31; - /* begin push: */ - object11 = (VMBIGENDIAN - ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) - : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); - longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); - GIV(stackPointer) = sp41; - /* begin push: */ - longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); - GIV(stackPointer) = sp5; - GIV(instructionPointer) = initialIP - 1; - } - /* begin push: */ - longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); - GIV(stackPointer) = sp9; - for (i = (numArgs + 1); i <= numTemps; i += 1) { - /* begin push: */ - longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); - GIV(stackPointer) = sp6; - } - if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader1 & AlternateHeaderHasPrimFlag)) { - - /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts - with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ - initialIP += 3; - if (!activateCogMethod) { - GIV(instructionPointer) = initialIP; - } - if (GIV(primFailCode) != 0) { - if ((byteAt(initialIP + 1)) == (((((int) methodHeader1)) < 0 - ? AltLongStoreBytecode - : LongStoreBytecode))) { - /* begin getErrorObjectFromPrimFailCode */ - if (GIV(primFailCode) > 0) { - /* begin splObj: */ - table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); - if (GIV(primFailCode) <= (numSlotsOf(table))) { - /* begin fetchPointer:ofObject: */ - errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; - } - } - errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; - longAtPointerput(GIV(stackPointer), errorCode); - } - GIV(primFailCode) = 0; - } - } - if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { - maybeFlagMethodAsInterpreted(GIV(newMethod)); - } - /* begin externalWriteBackHeadFramePointers */ - assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); - assert(GIV(stackPage) == (mostRecentlyUsedPage())); - /* begin setHeadFP:andSP:inPage: */ - assert(GIV(stackPointer) < GIV(framePointer)); - assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); - assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) - && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); - (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = GIV(stackPointer)); - assert(pageListIsWellFormed()); - /* begin checkForStackOverflow */ - if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { - handleStackOverflow(); - } - /* begin enterSmalltalkExecutiveFromCallback */ - enterSmalltalkExecutive(); - return 1; -} - - -/* Send the 4 argument callback message - invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied - args. The arguments are raw C addresses - and are converted to integer objects on the way. */ -/* Override to log and check stack alignment. Since this is an implicit send - we need to - log it explicitly. The return side is done via a primitive so that gets - logged normally. */ - - /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ -EXPORT(sqInt) -sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt activateCogMethod; - usqInt aMethodObj; - sqInt aSelectorOrImmediate; - sqInt classTag; - CogMethod *cogMethod; - CogMethod *cogMethod1; - sqInt errorCode; - sqInt i; - usqInt initialIP; - sqInt methodHeader; - sqInt methodHeader1; - sqInt numArgs; - sqInt numTemps; - sqInt obj; - sqInt object; - sqInt object1; - sqInt object11; - sqInt object2; - sqInt object3; - sqInt object4; - sqInt object5; - sqInt rcvr; - sqInt selector; - char *sp; - char *sp1; - char *sp10; - char *sp11; - char *sp2; - char *sp21; - char *sp3; - char *sp31; - char *sp4; - char *sp41; - char *sp5; - char *sp6; - char *sp7; - char *sp8; - char *sp9; - sqInt table; - - assertCStackWellAligned(); - if (recordPrimTrace()) { - /* begin fastLogPrim: */ - aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; - primTraceLogIndex(GIV(primTraceLogIndex) + 1); - } - /* begin fetchClassTagOfNonImm: */ - obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - /* begin classIndexOf: */ - classTag = (longAt(obj)) & (classIndexMask()); - /* begin fetchPointer:ofObject: */ - GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); - GIV(argumentCount) = 4; - if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { - if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { - return 0; - } - } - if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) - && (primitiveFunctionPointer == 0))) { - return 0; - } - /* begin push: */ - object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); - longAtput((sp = GIV(stackPointer) - BytesPerWord), object); - GIV(stackPointer) = sp; - /* begin push: */ - object1 = positiveMachineIntegerFor(thunkPtr); - longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); - GIV(stackPointer) = sp1; - /* begin push: */ - object2 = positiveMachineIntegerFor(stackPtr); - longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); - GIV(stackPointer) = sp2; - /* begin push: */ - object3 = positiveMachineIntegerFor(regsPtr); - longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); - GIV(stackPointer) = sp3; - /* begin push: */ - object4 = positiveMachineIntegerFor(jmpBufPtr); - longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); - GIV(stackPointer) = sp4; - /* begin ifAppropriateCompileToNativeCode:selector: */ - aMethodObj = GIV(newMethod); - selector = GIV(messageSelector); - /* begin fetchPointer:ofObject: */ - methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if ((assert(((methodHeader & 1)) || (((((usqInt)methodHeader)) < (startOfMemory())) && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (methodHeader & 1) == 0)) { - - /* makeBaseFrame: can create cog methods with nil selectors. */ + (activateCogMethod = (methodHeader & 1) == 0))) { cogMethod = ((CogMethod *) methodHeader); - if (((cogMethod->selector)) == GIV(nilObj)) { - setSelectorOfto(cogMethod, selector); - } - } - else { - if (((assert((methodHeader & 1)), - ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { - cogselector(aMethodObj, selector); - } - else { - maybeFlagMethodAsInterpreted(aMethodObj); - } - } - /* begin justActivateNewMethod */ - methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - if ((assert(((methodHeader1 & 1)) - || (((((usqInt)methodHeader1)) < (startOfMemory())) - && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), - (activateCogMethod = (methodHeader1 & 1) == 0))) { - cogMethod1 = ((CogMethod *) methodHeader1); - methodHeader1 = (cogMethod1->methodHeader); + methodHeader = (cogMethod->methodHeader); } - numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; - numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -23644,17 +23261,17 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); GIV(stackPointer) = sp8; GIV(framePointer) = GIV(stackPointer); - initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), -((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; if (activateCogMethod) { /* begin push: */ - object5 = ((usqInt)cogMethod1); + object5 = ((usqInt)cogMethod); longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); GIV(stackPointer) = sp10; /* begin push: */ longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp11; - GIV(instructionPointer) = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); } else { /* begin push: */ @@ -23663,8 +23280,8 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader1); - GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 ? 256 : 0); @@ -23691,7 +23308,7 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg GIV(stackPointer) = sp6; } if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader1 & AlternateHeaderHasPrimFlag)) { + methodHeader & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ @@ -23700,7 +23317,7 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg GIV(instructionPointer) = initialIP; } if (GIV(primFailCode) != 0) { - if ((byteAt(initialIP + 1)) == (((((int) methodHeader1)) < 0 + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -23710,11 +23327,262 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l5; + goto l4; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l5: /* end getErrorObjectFromPrimFailCode */; + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { + maybeFlagMethodAsInterpreted(GIV(newMethod)); + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + /* begin checkForStackOverflow */ + if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { + handleStackOverflow(); + } + /* begin enterSmalltalkExecutiveFromCallback */ + enterSmalltalkExecutive(); + return 1; +} + + +/* Send the 4 argument callback message + invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied + args. The arguments are raw C addresses + and are converted to integer objects on the way. */ +/* Override to log and check stack alignment. Since this is an implicit send + we need to + log it explicitly. The return side is done via a primitive so that gets + logged normally. */ + + /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ +EXPORT(sqInt) +sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activateCogMethod; + usqInt aMethodObj; + sqInt aSelectorOrImmediate; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt errorCode; + sqInt i; + usqInt initialIP; + sqInt methodHeader; + sqInt methodHeader1; + sqInt numArgs; + sqInt numTemps; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object2; + sqInt object3; + sqInt object4; + sqInt object5; + sqInt rcvr; + sqInt selector; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp2; + char *sp21; + char *sp3; + char *sp31; + char *sp4; + char *sp41; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt table; + + assertCStackWellAligned(); + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + /* begin fetchClassTagOfNonImm: */ + obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + /* begin classIndexOf: */ + classTag = (longAt(obj)) & (classIndexMask()); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(argumentCount) = 4; + if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { + if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { + return 0; + } + } + if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) + && (primitiveFunctionPointer == 0))) { + return 0; + } + /* begin push: */ + object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + object1 = positiveMachineIntegerFor(thunkPtr); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp1; + /* begin push: */ + object2 = positiveMachineIntegerFor(stackPtr); + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp2; + /* begin push: */ + object3 = positiveMachineIntegerFor(regsPtr); + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp3; + /* begin push: */ + object4 = positiveMachineIntegerFor(jmpBufPtr); + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); + GIV(stackPointer) = sp4; + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + /* begin justActivateNewMethod */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (activateCogMethod = (methodHeader & 1) == 0))) { + cogMethod = ((CogMethod *) methodHeader); + methodHeader = (cogMethod->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; + + /* could new rcvr be set at point of send? */ + rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); + assert(!(isOopForwarded(rcvr))); + if (activateCogMethod + && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp7; + /* begin push: */ + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp8; + GIV(framePointer) = GIV(stackPointer); + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + if (activateCogMethod) { + /* begin push: */ + object5 = ((usqInt)cogMethod); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); + GIV(stackPointer) = sp10; + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp11; + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + } + else { + /* begin push: */ + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp21; + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp31; + /* begin push: */ + object11 = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); + longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp41; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp5; + GIV(instructionPointer) = initialIP - 1; + } + /* begin push: */ + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp9; + for (i = (numArgs + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp6; + } + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + initialIP += 3; + if (!activateCogMethod) { + GIV(instructionPointer) = initialIP; + } + if (GIV(primFailCode) != 0) { + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -23899,13 +23767,13 @@ signed64BitIntegerFor(sqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude)); @@ -24337,7 +24205,6 @@ transferTofrom(sqInt newProc, sqInt sourceCode) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt activeContext; sqInt aMethodObj; - sqInt index; StackPage *lastUsedPage; StackPage *lruOrFree; sqInt newContext; @@ -24448,10 +24315,8 @@ transferTofrom(sqInt newProc, sqInt sourceCode) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (theFrame != ((thePage->headFP))) { /* explicit assignment of suspendedContext can cause switch to interior frame. */ @@ -24459,11 +24324,11 @@ transferTofrom(sqInt newProc, sqInt sourceCode) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l10; + goto l11; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l10: /* end newStackPage */; + l11: /* end newStackPage */; moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage); /* begin markStackPageLeastMostRecentlyUsed: */ assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage))); @@ -24472,7 +24337,7 @@ transferTofrom(sqInt newProc, sqInt sourceCode) lastUsedPage = (lastUsedPage->nextPage); } if (((lastUsedPage->nextPage)) == newPage) { - goto l13; + goto l14; } (((newPage->prevPage))->nextPage = (newPage->nextPage)); (((newPage->nextPage))->prevPage = (newPage->prevPage)); @@ -24481,7 +24346,7 @@ transferTofrom(sqInt newProc, sqInt sourceCode) (newPage->nextPage = lastUsedPage); (lastUsedPage->prevPage = newPage); assert(pageListIsWellFormed()); - l13: /* end markStackPageLeastMostRecentlyUsed: */; + l14: /* end markStackPageLeastMostRecentlyUsed: */; } assert(((thePage->headFP)) == theFrame); } @@ -24584,7 +24449,6 @@ updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP) assert(isContext(theContext)); assert((frameReceiver(theFP)) == (noFixupFollowFieldofObject(ReceiverIndex, theContext))); if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { - /* begin mframeNumArgs: */ tempIndex = ((mframeCogMethod(theFP))->cmNumArgs); pointer = (theFP + FoxMFReceiver) - BytesPerWord; } @@ -24655,7 +24519,6 @@ validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, usqInt theInstrPointer; if (instrPointer == (ceCannotResumePC())) { - /* begin isMachineCodeFrame: */ return (((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory()); } if (instrPointer == (ceReturnToInterpreterPC())) { @@ -24763,10 +24626,10 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -24792,14 +24655,13 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24814,42 +24676,37 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24864,32 +24721,28 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -24900,7 +24753,6 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -24916,20 +24768,16 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -24964,39 +24812,39 @@ whereIs(sqInt anOop) && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) { if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) { where = " is in eden"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) { where = " is in future space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) { where = " is in past space"; - goto l2; + goto l1; } where = " is in new space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) { if (!((segmentContainingObj(anOop)) == null)) { where = " is in old space"; - goto l2; + goto l1; } where = " is between old space segments"; - goto l2; + goto l1; } where = null; -l2: /* end whereIsMaybeHeapThing: */; +l1: /* end whereIsMaybeHeapThing: */; if (!(where == null)) { return where; } /* begin whereIsMaybeStackThing: */ if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackBasePlus1) - 1, GIV(pages))) { where = " is in the stack zone"; - goto l1; + goto l2; } where = null; -l1: /* end whereIsMaybeStackThing: */; +l2: /* end whereIsMaybeStackThing: */; if (!(where == null)) { return where; } @@ -25412,15 +25260,14 @@ primitiveMethodPCData(void) } methodReceiver = longAt(GIV(stackPointer)); data = 0; - if ((assert(isNonImmediate(methodReceiver)), - isCogMethodReference(longAt((methodReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(methodReceiver)) { /* begin pcDataFor: */ methodHeader = longAt((methodReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); assert((isNonImmediate(methodHeader)) && ((((usqInt)methodHeader)) < (startOfMemory()))); cogMethod = ((CogMethod *) methodHeader); cm = (cogMethod->methodObject); - nSlots = (((byteSizeOf(cm)) - (((literalCountOfMethodHeader(methodHeaderOf(cm))) + LiteralStart) * BytesPerOop)) * 2) + ((8 * 2) / BytesPerOop); + nSlots = (((byteSizeOf(cm)) - (((literalCountOf(cm)) + LiteralStart) * BytesPerOop)) * 2) + ((8 * 2) / BytesPerOop); data1 = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))), nSlots); if (!(data1)) { data = -1; @@ -25476,6 +25323,7 @@ primitiveMethodXray(void) char *sp; if (methodWithHeaderShouldBeCogged(methodHeaderOf(longAt(GIV(stackPointer))))) { + /* begin maybeMethodHasCogMethod: */ alreadyCogged = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))); @@ -25629,7 +25477,8 @@ primitiveObjectAtPut(void) thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(thisReceiver))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -26085,12 +25934,6 @@ primitiveTerminateTo(void) char *fp1; char *fp2; char *frameAbove; - sqInt index; - sqInt index1; - sqInt index2; - sqInt index3; - sqInt index4; - sqInt index5; char *newFP; char *newSP; sqInt nextCntx; @@ -26153,10 +25996,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26181,18 +26022,18 @@ primitiveTerminateTo(void) fp = (pageToStopOn->headFP); if (fp == contextsFP) { frameAbove = 0; - goto l16; + goto l5; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == contextsFP) { frameAbove = fp; - goto l16; + goto l5; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l16: /* end findFrameAbove:inPage: */; + l5: /* end findFrameAbove:inPage: */; contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)))); assert((((((usqInt)contextsIP)) >= (startOfMemory())) || (contextsIP == (ceReturnToInterpreterPC()))) == (!(isMachineCodeFrame(contextsFP)))); @@ -26238,10 +26079,8 @@ primitiveTerminateTo(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index2 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index2, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -26256,10 +26095,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index1, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26282,27 +26119,25 @@ primitiveTerminateTo(void) theFP = pointerForOop(senderOop4 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index5 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index5, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (thePage == GIV(stackPage)) { /* begin findFrameAbove:inPage: */ fp1 = (thePage->headFP); if (fp1 == theFP) { frameAbove = 0; - goto l23; + goto l19; } while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) { if (callerFP1 == theFP) { frameAbove = fp1; - goto l23; + goto l19; } fp1 = callerFP1; } error("did not find theFP in stack page"); frameAbove = 0; - l23: /* end findFrameAbove:inPage: */; + l19: /* end findFrameAbove:inPage: */; assert(frameAbove != 0); /* May cause a GC!! May also reclaim aContextOrNil's page, hence... */ @@ -26316,10 +26151,8 @@ primitiveTerminateTo(void) contextsFP = pointerForOop(senderOop3 - 1); /* begin stackPageFor: */ - assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))); - index3 = pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - pageToStopOn = stackPageAtpages(index3, GIV(pages)); + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); } else { pageToStopOn = 0; @@ -26335,18 +26168,18 @@ primitiveTerminateTo(void) fp2 = (thePage->headFP); if (fp2 == contextsFP) { frameAbove = 0; - goto l24; + goto l20; } while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) { if (callerFP2 == contextsFP) { frameAbove = fp2; - goto l24; + goto l20; } fp2 = callerFP2; } error("did not find theFP in stack page"); frameAbove = 0; - l24: /* end findFrameAbove:inPage: */; + l20: /* end findFrameAbove:inPage: */; if (frameAbove != 0) { contextsSP = ((assert(!(isBaseFrame(frameAbove))), (frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord)) - BytesPerWord; @@ -26369,10 +26202,8 @@ primitiveTerminateTo(void) theFP1 = (thePage->baseFP); assert(isBaseFrame(theFP1)); /* begin stackPageFor: */ - assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))); - index4 = pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage2 = stackPageAtpages(index4, GIV(pages)); + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil1 = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil1)); assert((callerContextOrNil1 == (nilObject())) @@ -26483,19 +26314,17 @@ primitiveVoidVMStateForMethod(void) sqInt hasCogMethod; sqInt i; sqInt i1; - sqInt index; usqInt limit; sqInt methodHeader; - sqInt methodHeader1; sqInt methodObj; usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt object; sqInt objOop; sqInt objOop1; @@ -26539,10 +26368,10 @@ primitiveVoidVMStateForMethod(void) : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); activeContext = longAt(theFP + FoxThisContext); - goto l11; + goto l6; } activeContext = marryFrameSP(theFP, theSP); -l11: /* end ensureFrameIsMarried:SP: */; +l6: /* end ensureFrameIsMarried:SP: */; /* begin ensurePushedInstructionPointer */ if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { @@ -26578,18 +26407,12 @@ primitiveVoidVMStateForMethod(void) (GIV(stackPage)->headFP = GIV(framePointer)); (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); - if ((assert(isNonImmediate(methodObj)), - /* begin isCogMethodReference: */ - (methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))), - assert(((methodHeader & 1)) - || (((((usqInt)methodHeader)) < (startOfMemory())) - && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), - (hasCogMethod = (methodHeader & 1) == 0))) { + if ((hasCogMethod = methodHasCogMethod(methodObj))) { /* begin divorceMachineCodeFramesWithMethod: */ - methodHeader1 = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - assert((isNonImmediate(methodHeader1)) - && ((((usqInt)methodHeader1)) < (startOfMemory()))); - cogMethod = ((CogMethod *) methodHeader1); + methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); do { if (GIV(stackPage) != 0) { @@ -26621,8 +26444,8 @@ primitiveVoidVMStateForMethod(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -26637,37 +26460,33 @@ primitiveVoidVMStateForMethod(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l14; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l14: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -26681,32 +26500,28 @@ primitiveVoidVMStateForMethod(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; + l21: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -26727,32 +26542,28 @@ primitiveVoidVMStateForMethod(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l23; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l23: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } if (hasCogMethod) { unlinkSendsToandFreeIf(methodObj, 1); @@ -26765,10 +26576,8 @@ primitiveVoidVMStateForMethod(void) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(((thePage->headFP)) == theFrame); /* begin setStackPageAndLimit: */ assert(thePage != 0); @@ -27084,16 +26893,16 @@ cStringOrNullFor(sqInt oop) classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (oop & (tagMask())) { isString = 0; - goto l3; + goto l2; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l3; + goto l2; -l3: /* end is:instanceOf:compactClassIndex: */; +l2: /* end is:instanceOf:compactClassIndex: */; if (!isString) { if (oop != GIV(nilObj)) { GIV(primFailCode) = PrimErrBadArgument; @@ -27104,37 +26913,33 @@ cStringOrNullFor(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { len = numSlots; - goto l1; + goto l4; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ len = (numSlots << (shiftForWord())) - (fmt & 7); - goto l1; + goto l4; } if (fmt >= (firstShortFormat())) { len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l1; + goto l4; } if (fmt >= (firstLongFormat())) { len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l1; + goto l4; } if (fmt == (sixtyFourBitIndexableFormat())) { len = ((usqInt) numSlots) >> 1; - goto l1; + goto l4; } len = 0; -l1: /* end lengthOf:format: */; +l4: /* end lengthOf:format: */; if (len == 0) { return 0; } @@ -27717,14 +27522,14 @@ primitiveArctan(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = atan(rcvr); @@ -27905,68 +27710,63 @@ primitiveAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27975,23 +27775,23 @@ primitiveAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l11; + goto l13; } } else { @@ -28005,19 +27805,19 @@ primitiveAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l17; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l17; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l17; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l17; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -28026,7 +27826,7 @@ primitiveAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l17; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -28049,13 +27849,13 @@ primitiveAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l10; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -28066,10 +27866,8 @@ primitiveAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l17; + goto l13; - l17: /* end subscript:with:format: */; - goto l11; } /* begin primitiveFailFor: */ reasonCode = (fmt <= 1 @@ -28077,13 +27875,13 @@ primitiveAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l11: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveAtPut */ @@ -28118,79 +27916,75 @@ primitiveAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(rcvr + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l29; + goto l21; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l29; + goto l21; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l29; + goto l21; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l29; + goto l21; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l29; + goto l21; } totalLength1 = 0; -l29: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l16; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l16; } class1 = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l27: /* end fixedFieldsOf:format:length: */; +l16: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -28199,23 +27993,23 @@ primitiveAtPut(void) sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(rcvr))); stSize1 = sp3; - goto l18; + goto l17; } /* begin fetchStackPointerOf: */ sp11 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l18; + goto l17; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr))); stSize1 = (sp11 >> 1); - l18: /* end stackPointerForMaybeMarriedContext: */; + l17: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value); - goto l33; + goto l29; } } else { @@ -28242,37 +28036,37 @@ primitiveAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l21; + goto l28; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -28280,7 +28074,7 @@ primitiveAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l21; + goto l28; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -28288,7 +28082,7 @@ primitiveAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l21: /* end subscript:with:storing:format: */; + l28: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -28297,14 +28091,14 @@ primitiveAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode1; } -l33: /* end stObject:at:put: */; +l29: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -28333,7 +28127,6 @@ primitiveBeCursor(void) sqInt successBoolean10; sqInt successBoolean11; sqInt successBoolean12; - sqInt successBoolean13; sqInt successBoolean2; sqInt successBoolean3; sqInt successBoolean4; @@ -28362,8 +28155,7 @@ primitiveBeCursor(void) maskObj = longAt(GIV(stackPointer)); } /* begin success: */ - successBoolean13 = GIV(argumentCount) < 2; - if (!successBoolean13) { + if (!(GIV(argumentCount) < 2)) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -28693,10 +28485,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -28704,7 +28496,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -28720,7 +28512,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -28732,18 +28524,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -28754,10 +28546,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -28765,23 +28557,23 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -28793,18 +28585,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue); @@ -28873,10 +28665,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -28884,7 +28676,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -28900,7 +28692,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -28912,18 +28704,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -28934,10 +28726,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -28945,23 +28737,23 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -28973,18 +28765,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue); @@ -29084,7 +28876,7 @@ primitiveBitShift(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29107,13 +28899,13 @@ primitiveBitShift(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l7; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29124,10 +28916,9 @@ primitiveBitShift(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - l6: /* end maybeInlinePositive32BitIntegerFor: */; - goto l1; + goto l5; - l1: /* end positive32BitIntegerFor: */; + l5: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); @@ -29254,10 +29045,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (integerArgument & (tagMask())) { /* begin primitiveFail */ @@ -29265,7 +29056,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerArgument))); @@ -29281,7 +29072,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask()); @@ -29293,18 +29084,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } - l5: /* end positiveMachineIntegerValueOf: */; + l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ if ((integerReceiver & 1)) { value1 = (integerReceiver >> 1); @@ -29314,10 +29105,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (integerReceiver & (tagMask())) { /* begin primitiveFail */ @@ -29325,23 +29116,23 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerReceiver))); /* begin classIndexOf: */ ccIndex1 = (longAt(integerReceiver)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask()); @@ -29353,18 +29144,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } - l10: /* end positiveMachineIntegerValueOf: */; + l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue); @@ -29610,7 +29401,7 @@ primitiveClipboardText(void) sqInt fmt; sqInt formatField; usqInt newObj; - usqInt numBytes; + usqInt numBytes1; sqInt numSlots; sqInt s; char *sp; @@ -29646,23 +29437,23 @@ primitiveClipboardText(void) formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? (/* begin allocationUnit */ 8) : (numSlots + (numSlots & 1)) * BytesPerOop)); } - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); - goto l6; + s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex); + goto l4; } if (numSlots >= (numSlotsMask())) { @@ -29675,11 +29466,11 @@ primitiveClipboardText(void) else { long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex); } - assert((numBytes % (allocationUnit())) == 0); + assert((numBytes1 % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); - GIV(freeStart) += numBytes; + GIV(freeStart) += numBytes1; s = newObj; - l6: /* end allocateSlots:format:classIndex: */; + l4: /* end allocateBytes:classIndex: */; if (!(s)) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -29772,7 +29563,7 @@ primitiveClockLogAddresses(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)usecs)))) <= (MaxSmallInteger)) { v1 = (((((usqInt)usecs)) << 1) | 1); - goto l11; + goto l9; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29795,13 +29586,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l18; + goto l7; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l18: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l7: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29812,16 +29603,15 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); v1 = newLargeInteger; -l11: /* end maybeInlinePositive32BitIntegerFor: */; - goto l3; + goto l9; -l3: /* end positive32BitIntegerFor: */; +l9: /* end positive32BitIntegerFor: */; /* begin positive32BitIntegerFor: */ /* begin maybeInlinePositive32BitIntegerFor: */ assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)msecs)))) <= (MaxSmallInteger)) { v2 = (((((usqInt)msecs)) << 1) | 1); - goto l16; + goto l14; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -29844,13 +29634,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l19; + goto l12; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; -l19: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l12: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -29861,10 +29651,9 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); v2 = newLargeInteger1; -l16: /* end maybeInlinePositive32BitIntegerFor: */; - goto l4; + goto l14; -l4: /* end positive32BitIntegerFor: */; +l14: /* end positive32BitIntegerFor: */; if (GIV(primFailCode)) { /* begin popRemappableOop */ oop = GIV(remapBuffer)[GIV(remapBufferCount)]; @@ -30054,7 +29843,7 @@ primitiveClosureValue(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30105,7 +29894,7 @@ primitiveClosureValue(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30181,7 +29970,7 @@ primitiveClosureValue(void) switched = handleStackOverflowOrEventAllowContextSwitch(1); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l12: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } @@ -30320,7 +30109,7 @@ primitiveClosureValueNoContextSwitch(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30371,7 +30160,7 @@ primitiveClosureValueNoContextSwitch(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l12; + goto l8; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30447,7 +30236,7 @@ primitiveClosureValueNoContextSwitch(void) switched = handleStackOverflowOrEventAllowContextSwitch(0); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l12: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } /* InterpreterPrimitives>>#primitiveClosureValueWithArgs */ @@ -30514,13 +30303,9 @@ primitiveClosureValueWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -30622,7 +30407,7 @@ primitiveClosureValueWithArgs(void) longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp31; ceCallCogCodePopReceiverReg(); - goto l14; + goto l10; } if (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { @@ -30673,7 +30458,7 @@ primitiveClosureValueWithArgs(void) longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); GIV(stackPointer) = sp32; ceCallCogCodePopReceiverReg(); - goto l14; + goto l10; } if (!GIV(cogCompiledCodeCompactionCalledFor)) { GIV(lastUncoggableInterpretedBlockMethod) = theMethod; @@ -30749,7 +30534,7 @@ primitiveClosureValueWithArgs(void) switched = handleStackOverflowOrEventAllowContextSwitch(1); } returnToExecutivepostContextSwitch(inInterpreter, switched); -l14: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +l10: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; } @@ -30803,73 +30588,63 @@ primitiveCompareBytes(void) /* begin byteSizeOf: */ if (arg1 & (tagMask())) { len1 = 0; - goto l1; + goto l2; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(arg1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(arg1 - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(arg1 - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len1 = numBytes - (fmt & 7); - goto l5; + goto l2; } if (fmt <= (sixtyFourBitIndexableFormat())) { len1 = numBytes; - goto l5; + goto l2; } if (fmt >= (firstShortFormat())) { len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l2; } len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l1: /* end byteSizeOf: */; +l2: /* end byteSizeOf: */; /* begin byteSizeOf: */ if (arg2 & (tagMask())) { len2 = 0; - goto l2; + goto l4; } /* begin numBytesOf: */ fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(arg2 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes1 = longAt(arg2 - BaseHeaderSize); - } - else { - numBytes1 = numSlots1; - } + numBytes1 = (numSlots1 == (numSlotsMask()) + ? longAt(arg2 - BaseHeaderSize) + : numSlots1); numBytes1 = numBytes1 << (shiftForWord()); if (fmt1 >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len2 = numBytes1 - (fmt1 & 7); - goto l8; + goto l4; } if (fmt1 <= (sixtyFourBitIndexableFormat())) { len2 = numBytes1; - goto l8; + goto l4; } if (fmt1 >= (firstShortFormat())) { len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); - goto l8; + goto l4; } len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); -l8: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l4: /* end byteSizeOf: */; if (!(len1 == len2)) { /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); @@ -30917,7 +30692,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } if (format >= (firstShortFormat())) { if (format >= (firstByteFormat())) { @@ -30927,7 +30702,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24); oddBytes = format & 7; @@ -30938,7 +30713,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 16; oddBytes = ((sqInt)((usqInt)((format & 3)) << 1)); @@ -30955,7 +30730,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 32; oddBytes = ((sqInt)((usqInt)((format & 1)) << 2)); @@ -30963,13 +30738,9 @@ primitiveConstantFill(void) } /* begin addressAfter: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30990,7 +30761,7 @@ primitiveConstantFill(void) } /* begin pop: */ GIV(stackPointer) += 1 * BytesPerWord; -l2: /* end primitiveConstantFillSpur */; +l5: /* end primitiveConstantFillSpur */; } @@ -31097,30 +30868,26 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots1; - } + numBytes = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ length = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { length = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask()))) && (length == (numBytesOf(arg))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -31136,13 +30903,9 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(rcvr - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); if (!((isAppropriateForCopyObject(arg)) && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -31191,11 +30954,11 @@ primitiveCrashVM(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { crashInThisThread = 1; - goto l2; + goto l1; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { crashInThisThread = 0; - goto l2; + goto l1; } /* begin success: */ @@ -31205,7 +30968,7 @@ primitiveCrashVM(void) } crashInThisThread = null; - l2: /* end booleanValueOf: */; + l1: /* end booleanValueOf: */; } if (GIV(primFailCode) || (GIV(argumentCount) != 1)) { @@ -31533,14 +31296,14 @@ primitiveExp(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = exp(rcvr); @@ -31580,14 +31343,14 @@ primitiveExponent(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { /* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */ @@ -31686,14 +31449,13 @@ primitiveFloatAdd(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -31706,14 +31468,13 @@ primitiveFloatAdd(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -31765,7 +31526,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l8; + goto l6; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -31788,13 +31549,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l16; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l16: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -31805,10 +31566,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - l8: /* end maybeInlinePositive32BitIntegerFor: */; - goto l2; + goto l6; - l2: /* end positive32BitIntegerFor: */; + l6: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -31824,7 +31584,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { result = ((integerValue1 << 1) | 1); - goto l14; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -31847,13 +31607,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l17; + goto l9; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l17: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -31864,10 +31624,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger1; - l14: /* end maybeInlinePositive32BitIntegerFor: */; - goto l3; + goto l11; - l3: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp1; @@ -31910,7 +31669,8 @@ primitiveFloatAtPut(void) index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -31976,14 +31736,13 @@ primitiveFloatDivide(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -31996,14 +31755,13 @@ primitiveFloatDivide(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg != 0.0)) { @@ -32026,57 +31784,50 @@ primitiveFloatEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -32094,57 +31845,50 @@ primitiveFloatGreaterOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreaterOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr >= arg; if (!GIV(primFailCode)) { @@ -32162,57 +31906,50 @@ primitiveFloatGreaterThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreater:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr > arg; if (!GIV(primFailCode)) { @@ -32230,57 +31967,50 @@ primitiveFloatLessOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLessOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr <= arg; if (!GIV(primFailCode)) { @@ -32298,57 +32028,50 @@ primitiveFloatLessThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLess:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr < arg; if (!GIV(primFailCode)) { @@ -32388,14 +32111,13 @@ primitiveFloatMultiply(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -32408,14 +32130,13 @@ primitiveFloatMultiply(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -32430,57 +32151,50 @@ primitiveFloatNotEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -32520,14 +32234,13 @@ primitiveFloatSubtract(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -32540,14 +32253,13 @@ primitiveFloatSubtract(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -32592,10 +32304,10 @@ primitiveFlushExternalPrimitives(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -32617,8 +32329,8 @@ primitiveFlushExternalPrimitives(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -32634,37 +32346,33 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -32679,32 +32387,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -32726,32 +32430,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } flushMethodCache(); /* begin flushExternalPrimitiveTable */ @@ -32807,11 +32507,11 @@ primitiveFormPrint(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { landscapeFlag = 1; - goto l5; + goto l2; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { landscapeFlag = 0; - goto l5; + goto l2; } /* begin success: */ @@ -32821,7 +32521,7 @@ primitiveFormPrint(void) } landscapeFlag = null; -l5: /* end booleanValueOf: */; +l2: /* end booleanValueOf: */; /* begin floatValueOf: */ oop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); isFloat = ((oop & (tagMask())) == 0) @@ -32829,14 +32529,14 @@ primitiveFormPrint(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); vScale = result; - goto l6; + goto l5; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } vScale = 0.0; -l6: /* end floatValueOf: */; +l5: /* end floatValueOf: */; /* begin floatValueOf: */ oop1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); isFloat1 = ((oop1 & (tagMask())) == 0) @@ -32844,14 +32544,14 @@ primitiveFormPrint(void) if (isFloat1) { fetchFloatAtinto(oop1 + BaseHeaderSize, result1); hScale = result1; - goto l7; + goto l6; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } hScale = 0.0; -l7: /* end floatValueOf: */; +l6: /* end floatValueOf: */; rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord)); if (!((((rcvr & (tagMask())) == 0) && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) @@ -32882,36 +32582,32 @@ primitiveFormPrint(void) pixelsPerWord = 32 / depth; wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord; if (((bitsArray & (tagMask())) == 0) - && (isWordsOrBytesNonImm(bitsArray))) { + && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) { /* begin numBytesOf: */ fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(bitsArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(bitsArray - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(bitsArray - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ bitsArraySize = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { bitsArraySize = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; /* begin success: */ if (!(bitsArraySize == ((wordsPerLine * h) * 4))) { @@ -32971,14 +32667,14 @@ primitiveFractionalPart(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { frac = modf(rcvr, (&trunc)); /* begin pushFloat: */ @@ -33048,7 +32744,7 @@ primitiveGetImmutability(void) rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin pop:thenPushBool: */ trueOrFalse = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); @@ -33260,7 +32956,6 @@ primitiveGetWindowLabel(void) EXPORT(sqInt) primitiveGetWindowSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt h; sqInt knownClassIndex; @@ -33284,8 +32979,7 @@ primitiveGetWindowSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -33308,13 +33002,13 @@ primitiveGetWindowSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l6; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l6: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 1) | 1)); @@ -33496,13 +33190,13 @@ primitiveHeartbeatFrequency(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -33664,13 +33358,13 @@ primitiveImageFormatVersion(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -33699,6 +33393,7 @@ primitiveImageFormatVersion(void) static void primitiveImageName(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOop; sqInt ok; sqInt okToRename; sqInt s; @@ -33723,11 +33418,13 @@ primitiveImageName(void) } s = longAt(GIV(stackPointer)); /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + /* begin isNonImmediate: */ ok = (s & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(s)); - ok = ((longAt(s)) & (classIndexMask())) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord())))))) + 4)) & (identityHashHalfWordMask())); - + ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); } /* begin success: */ if (!ok) { @@ -33901,37 +33598,33 @@ primitiveIntegerAt(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } sz = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -33981,7 +33674,7 @@ primitiveIntegerAtPut(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { index = (integerPointer >> 1); - goto l7; + goto l6; } else { /* begin primitiveFail */ @@ -33989,18 +33682,18 @@ primitiveIntegerAtPut(void) GIV(primFailCode) = 1; } index = 0; - goto l7; + goto l6; } -l7: /* end stackIntegerValue: */; +l6: /* end stackIntegerValue: */; /* begin signed32BitValueOf: */ if ((valueOop & 1)) { value = (valueOop >> 1); - goto l5; + goto l7; } value = noInlineSigned32BitValueGutsOf(valueOop); - goto l5; + goto l7; -l5: /* end signed32BitValueOf: */; +l7: /* end signed32BitValueOf: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -34015,7 +33708,8 @@ primitiveIntegerAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -34028,37 +33722,33 @@ primitiveIntegerAtPut(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l6; + goto l9; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l6; + goto l9; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l6; + goto l9; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l6; + goto l9; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l6; + goto l9; } sz = 0; -l6: /* end lengthOf:format: */; +l9: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -34155,7 +33845,6 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt objFormat; sqInt runArgs; sqInt runReceiver; char *sp; @@ -34168,13 +33857,10 @@ primitiveInvokeObjectAsMethod(void) sqInt valuePointer; /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2, ClassArrayCompactIndex); for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) { /* begin storePointerUnchecked:ofObject:withValue: */ @@ -34244,6 +33930,7 @@ primitiveIsPinned(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt obj; char *sp; + sqInt trueOrFalse; obj = longAt(GIV(stackPointer)); if ((obj & (tagMask())) @@ -34253,7 +33940,8 @@ primitiveIsPinned(void) return; } /* begin pop:thenPushBool: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((((usqInt) (longAt(obj))) >> 30) & 1) != 0 + trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); GIV(stackPointer) = sp; @@ -34666,14 +34354,14 @@ primitiveLogN(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = log(rcvr); @@ -34730,7 +34418,6 @@ primitiveLowSpaceSemaphore(void) static void primitiveMakePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -34758,8 +34445,7 @@ primitiveMakePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -34782,13 +34468,13 @@ primitiveMakePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pt = 0; - goto l3; + goto l2; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pt = newObj; -l3: /* end eeInstantiateSmallClass:numSlots: */; +l2: /* end eeInstantiateSmallClass:numSlots: */; assert(!(isOopForwarded(pt))); longAtput((pt + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), rcvr); @@ -34967,7 +34653,6 @@ primitiveMouseButtons(void) static void primitiveMousePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -35009,8 +34694,7 @@ primitiveMousePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -35033,13 +34717,13 @@ primitiveMousePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l7; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l7: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 1) | 1)); @@ -35196,12 +34880,13 @@ primitiveNew(void) less than lowSpaceThreshold bytes free. This *will not* cause a GC :-) */ /* begin instantiateClass: */ classObj1 = longAt(GIV(stackPointer)); + /* begin formatOfClass: */ classFormat = ((longAt((classObj1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); if (!((instSpec <= 1) || (instSpec == 5))) { obj = null; - goto l7; + goto l9; } assert(addressCouldBeClassObj(classObj1)); classIndex = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 @@ -35216,8 +34901,9 @@ primitiveNew(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l7; + goto l9; } + /* begin fixedFieldsOfClassFormat: */ numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); /* begin allocateSlots:format:classIndex: */ if (numSlots >= (numSlotsMask())) { @@ -35238,7 +34924,7 @@ primitiveNew(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -35255,7 +34941,7 @@ primitiveNew(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; -l4: /* end allocateSlots:format:classIndex: */; +l5: /* end allocateSlots:format:classIndex: */; if (!(newObj == null)) { /* begin fillObj:numSlots:with: */ assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj))); @@ -35265,7 +34951,7 @@ primitiveNew(void) } } obj = newObj; -l7: /* end instantiateClass: */; +l9: /* end instantiateClass: */; if (obj == null) { /* begin primitiveFailFor: */ reasonCode = (isFixedSizePointerFormat(instSpecOfClass(longAt(GIV(stackPointer)))) @@ -35451,7 +35137,6 @@ primitiveNewWithArg(void) usqInt bs; sqInt ccIndex; sqInt classFormat; - sqInt classPointer; sqInt fmt; sqInt instSpec; sqInt obj; @@ -35481,10 +35166,10 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l9; } size = value; - goto l10; + goto l9; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -35492,23 +35177,23 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); /* begin classIndexOf: */ ccIndex = (longAt(oop1)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; + goto l8; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l8: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -35520,18 +35205,18 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))); - goto l10; + goto l9; } else { size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))); - goto l10; + goto l9; } -l10: /* end positiveMachineIntegerValueOf: */; +l9: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -35542,9 +35227,7 @@ primitiveNewWithArg(void) obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); if (obj == null) { /* begin instSpecOfClass: */ - classPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); /* begin primitiveFailFor: */ reasonCode = (((instSpec >= 2) @@ -35600,42 +35283,38 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(actualObj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (actualObj + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { actualObj = GIV(freeStart); - goto l1; + goto l5; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); actualObj = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l5: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(freeStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } if (oopisGreaterThan(GIV(pastSpaceStart), ((pastSpace()).start))) { /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - actualObj = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + actualObj = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); } @@ -35647,13 +35326,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(actualObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -35664,18 +35339,18 @@ primitiveNextInstance(void) followingWordAddress1 = (actualObj + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { actualObj = GIV(pastSpaceStart); - goto l2; + goto l10; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); actualObj = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l10: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(pastSpaceStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } actualObj = GIV(nilObj); @@ -35683,13 +35358,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(actualObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -35700,22 +35371,22 @@ primitiveNextInstance(void) followingWordAddress2 = (actualObj + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { actualObj = GIV(endOfMemory); - goto l3; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); actualObj = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(endOfMemory)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } subsequentObject = null; - l5: /* end instanceAfter: */; + l15: /* end instanceAfter: */; if (!(subsequentObject == null)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), subsequentObject); @@ -35900,10 +35571,10 @@ primitivePathToUsing(void) sqInt next; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; sqInt path; char *sp; sqInt stack; @@ -35949,38 +35620,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(stack + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(stack - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots11 = byteAt(stack + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(stack - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - stackSize = numSlots1; - goto l4; + stackSize = numSlots2; + goto l7; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - stackSize = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l4; + stackSize = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l7; } if (fmt1 >= (firstShortFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l4; + stackSize = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l7; } if (fmt1 >= (firstLongFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l4; + stackSize = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l7; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - stackSize = ((usqInt) numSlots1) >> 1; - goto l4; + stackSize = ((usqInt) numSlots2) >> 1; + goto l7; } stackSize = 0; -l4: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin mark: */ setIsMarkedOfto(stack, 1); current = GIV(specialObjectsOop); @@ -35989,38 +35656,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(current))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(current + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(current - BaseHeaderSize); - } - else { - numSlots2 = numSlots5; - } + numSlots12 = byteAt(current + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(current - BaseHeaderSize) + : numSlots12); if (fmt2 <= 5) { - index = numSlots2; - goto l5; + index = numSlots3; + goto l9; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - index = (numSlots2 << (shiftForWord())) - (fmt2 & 7); - goto l5; + index = (numSlots3 << (shiftForWord())) - (fmt2 & 7); + goto l9; } if (fmt2 >= (firstShortFormat())) { - index = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l5; + index = (numSlots3 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l9; } if (fmt2 >= (firstLongFormat())) { - index = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l5; + index = (numSlots3 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l9; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - index = ((usqInt) numSlots2) >> 1; - goto l5; + index = ((usqInt) numSlots3) >> 1; + goto l9; } index = 0; -l5: /* end lengthOf:format: */; +l9: /* end lengthOf:format: */; stackp = 0; while(1) { while (((index -= 1)) >= -1) { @@ -36086,7 +35749,7 @@ primitivePathToUsing(void) && ((((((usqInt)next)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages)))))) ? !(frameIsMarked(next)) : (next >= heapBase) - && ((!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) + && ((!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) && (((((next & (tagMask())) == 0) && (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) <= 5)) || (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) @@ -36132,38 +35795,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(next + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(next - BaseHeaderSize); - } - else { - numSlots = numSlots3; - } + numSlots1 = byteAt(next + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(next - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { index = numSlots; - goto l3; + goto l5; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ index = (numSlots << (shiftForWord())) - (fmt & 7); - goto l3; + goto l5; } if (fmt >= (firstShortFormat())) { index = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l3; + goto l5; } if (fmt >= (firstLongFormat())) { index = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l3; + goto l5; } if (fmt == (sixtyFourBitIndexableFormat())) { index = ((usqInt) numSlots) >> 1; - goto l3; + goto l5; } index = 0; - l3: /* end lengthOf:format: */; + l5: /* end lengthOf:format: */; } } current = next; @@ -36263,22 +35922,18 @@ primitivePerformInSuperclass(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l10; + goto l11; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l10; + goto l11; } /* Push newMethod to save it in case of failure, @@ -36302,9 +35957,10 @@ primitivePerformInSuperclass(void) sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), rcvr); if (printOnTrace()) { printActivationNameForSelectorstartClass(GIV(messageSelector), (lookupClass == null - ? (((tagBits2 = rcvr & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) - : fetchClassOfNonImm(rcvr)) + ? (/* begin fetchClassOf: */ + (((tagBits2 = rcvr & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + : fetchClassOfNonImm(rcvr))) : lookupClass)); /* begin cr */ printf("\n"); @@ -36345,7 +36001,7 @@ primitivePerformInSuperclass(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l10; + goto l11; } /* +2 = receiver + saved newMethod */ @@ -36358,7 +36014,7 @@ primitivePerformInSuperclass(void) executeNewMethod(); /* begin initPrimCall */ GIV(primFailCode) = 0; -l10: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l11: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } /* InterpreterPrimitives>>#primitivePerformWithArgs */ @@ -36391,22 +36047,18 @@ primitivePerformWithArgs(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l6; + goto l7; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l6; + goto l7; } /* Push newMethod to save it in case of failure, @@ -36429,9 +36081,10 @@ primitivePerformWithArgs(void) selector1 = GIV(messageSelector); sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), actualReceiver); if (printOnTrace()) { - printActivationNameForSelectorstartClass(GIV(messageSelector), (((tagBits = actualReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) - : fetchClassOfNonImm(actualReceiver))); + printActivationNameForSelectorstartClass(GIV(messageSelector), (/* begin fetchClassOf: */ + (((tagBits = actualReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) + : fetchClassOfNonImm(actualReceiver)))); /* begin cr */ printf("\n"); } @@ -36461,7 +36114,7 @@ primitivePerformWithArgs(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l6; + goto l7; } /* +2 = receiver + saved newMethod */ @@ -36474,7 +36127,7 @@ primitivePerformWithArgs(void) executeNewMethod(); /* begin initPrimCall */ GIV(primFailCode) = 0; -l6: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l7: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } @@ -37156,7 +36809,6 @@ primitiveScreenScaleFactor(void) static void primitiveScreenSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -37176,8 +36828,7 @@ primitiveScreenSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -37200,13 +36851,13 @@ primitiveScreenSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l5; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l5: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)((((usqInt) pointWord) >> 16) & 0xFFFF) << 1) | 1)); @@ -37263,13 +36914,13 @@ primitiveSecondsClock(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l6; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -37433,7 +37084,8 @@ primitiveSetImmutability(void) } wasImmutable = # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -37445,12 +37097,12 @@ primitiveSetImmutability(void) return; } /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) | (1U << 23)); + longAtput(rcvr, (longAt(rcvr)) | (1U << (immutableBitShift()))); } else { if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << 23))); + longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << (immutableBitShift())))); } else { /* begin primitiveFailFor: */ @@ -37530,38 +37182,33 @@ primitiveSetLogDirectory(void) /* begin byteSizeOf: */ if (stringOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(stringOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(stringOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(stringOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(stringOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetLogDirectoryOfSize(firstIndexableField(stringOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -37589,10 +37236,10 @@ primitiveSetOrHasIdentityHash(void) hasHash = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask())); /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (GIV(argumentCount) == 2) { @@ -37627,7 +37274,7 @@ primitiveSetOrHasIdentityHash(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { hash = (integerPointer >> 1); - goto l4; + goto l3; } else { /* begin primitiveFail */ @@ -37635,9 +37282,9 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } hash = 0; - goto l4; + goto l3; } -l4: /* end stackIntegerValue: */; +l3: /* end stackIntegerValue: */; /* begin stackObjectValue: */ oop = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); if (oop & (tagMask())) { @@ -37646,10 +37293,10 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } thisReceiver = null; - goto l5; + goto l4; } thisReceiver = oop; -l5: /* end stackObjectValue: */; +l4: /* end stackObjectValue: */; if (!GIV(primFailCode)) { /* begin hashBitsOf: */ hash1 = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask()); @@ -37674,8 +37321,8 @@ primitiveSetOrHasIdentityHash(void) allInstancesOf(thisReceiver); } /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); + GIV(stackPointer) = sp1; } } @@ -37707,38 +37354,33 @@ primitiveSetWindowLabel(void) /* begin byteSizeOf: */ if (labelOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(labelOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(labelOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(labelOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(labelOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetWindowLabelOfSize(firstIndexableField(labelOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -37822,7 +37464,7 @@ primitiveShortAt(void) } rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; @@ -37870,14 +37512,15 @@ primitiveShortAtPut(void) } rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -38045,14 +37688,14 @@ primitiveSine(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = sin(rcvr); @@ -38099,37 +37742,33 @@ primitiveSize(void) } /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l2; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l2; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l2; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l2; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l2; + goto l3; } totalLength = 0; -l2: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { @@ -38376,14 +38015,14 @@ primitiveSquareRoot(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; /* begin success: */ if (!(rcvr >= 0.0)) { @@ -38513,68 +38152,63 @@ primitiveStringAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -38583,23 +38217,23 @@ primitiveStringAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l11; + goto l13; } } else { @@ -38613,19 +38247,19 @@ primitiveStringAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l17; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l17; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l17; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l17; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -38634,7 +38268,7 @@ primitiveStringAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l17; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -38657,13 +38291,13 @@ primitiveStringAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l10; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -38674,10 +38308,8 @@ primitiveStringAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l17; + goto l13; - l17: /* end subscript:with:format: */; - goto l11; } /* begin primitiveFailFor: */ reasonCode = (fmt <= 1 @@ -38685,14 +38317,14 @@ primitiveStringAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l11: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { if (!(((result >= 0) && (result <= ((1U << 30) - 1))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l1; + goto l14; } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (((sqInt)((usqInt)(((result >> 1))) << (numTagBits())))) + (characterTag()); @@ -38700,7 +38332,7 @@ primitiveStringAt(void) longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveStringAtPut */ @@ -38736,81 +38368,77 @@ primitiveStringAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ value1 = asciiOfCharacter(value); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -38819,23 +38447,23 @@ primitiveStringAtPut(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value1); - goto l17; + goto l15; } } else { @@ -38862,37 +38490,37 @@ primitiveStringAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value1); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value1); @@ -38900,7 +38528,7 @@ primitiveStringAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value1); @@ -38908,7 +38536,7 @@ primitiveStringAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -38917,14 +38545,14 @@ primitiveStringAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } -l17: /* end stObject:at:put: */; +l15: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -38952,8 +38580,8 @@ primitiveStringReplace(void) sqInt integerPointer2; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt repl; usqLong replFmt; sqInt replInstSize; @@ -38970,7 +38598,7 @@ primitiveStringReplace(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { start = (integerPointer >> 1); - goto l15; + goto l12; } else { /* begin primitiveFail */ @@ -38978,15 +38606,15 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } start = 0; - goto l15; + goto l12; } -l15: /* end stackIntegerValue: */; +l12: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { stop = (integerPointer1 >> 1); - goto l16; + goto l13; } else { /* begin primitiveFail */ @@ -38994,16 +38622,16 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } stop = 0; - goto l16; + goto l13; } -l16: /* end stackIntegerValue: */; +l13: /* end stackIntegerValue: */; repl = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { replStart = (integerPointer2 >> 1); - goto l17; + goto l14; } else { /* begin primitiveFail */ @@ -39011,9 +38639,9 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } replStart = 0; - goto l17; + goto l14; } -l17: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -39029,7 +38657,8 @@ primitiveStringReplace(void) if ((stop >= start) && ( # if IMMUTABILITY - ((((usqInt) (longAt(array))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(array))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -39041,38 +38670,34 @@ primitiveStringReplace(void) hdr = long64At(array); arrayFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots2 = byteAt(array + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(array + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (arrayFmt <= 5) { totalLength = numSlots; - goto l12; + goto l18; } if (arrayFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (arrayFmt & 7); - goto l12; + goto l18; } if (arrayFmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (arrayFmt & 3); - goto l12; + goto l18; } if (arrayFmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (arrayFmt & 1); - goto l12; + goto l18; } if (arrayFmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l18; } totalLength = 0; -l12: /* end lengthOf:format: */; +l18: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((arrayFmt >= (sixtyFourBitIndexableFormat())) || (arrayFmt == 2)) { @@ -39098,53 +38723,49 @@ primitiveStringReplace(void) hdr = long64At(repl); replFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots3 = byteAt(repl + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(repl - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(repl + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(repl - BaseHeaderSize) + : numSlots11); if (replFmt <= 5) { - totalLength = numSlots1; - goto l13; + totalLength = numSlots2; + goto l21; } if (replFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (replFmt & 7); - goto l13; + totalLength = (numSlots2 << (shiftForWord())) - (replFmt & 7); + goto l21; } if (replFmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (replFmt & 3); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (replFmt & 3); + goto l21; } if (replFmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (replFmt & 1); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (replFmt & 1); + goto l21; } if (replFmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l13; + totalLength = ((usqInt) numSlots2) >> 1; + goto l21; } totalLength = 0; -l13: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((replFmt >= (sixtyFourBitIndexableFormat())) || (replFmt == 2)) { replInstSize = 0; - goto l21; + goto l22; } if (replFmt < 2) { replInstSize = totalLength; - goto l21; + goto l22; } class1 = fetchClassOfNonImm(repl); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); replInstSize = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l21: /* end fixedFieldsOf:format:length: */; +l22: /* end fixedFieldsOf:format:length: */; if (!((replStart >= 1) && ((((stop - start) + replStart) + replInstSize) <= totalLength))) { /* begin primitiveFailFor: */ @@ -39482,14 +39103,14 @@ primitiveTruncated(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { modf(rcvr, (&trunc)); /* begin success: */ @@ -39538,10 +39159,10 @@ primitiveUnloadModule(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -39593,8 +39214,8 @@ primitiveUnloadModule(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -39610,37 +39231,33 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -39655,32 +39272,28 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -39702,20 +39315,16 @@ primitiveUnloadModule(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -39931,10 +39540,10 @@ primitiveVMProfileSamplesInto(void) ioNewProfileStatus((&running), (&bufferSize)); if (GIV(argumentCount) == 0) { /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (!(GIV(argumentCount) == 1)) { @@ -39952,8 +39561,8 @@ primitiveVMProfileSamplesInto(void) } numSamples = ioNewProfileSamplesInto(firstFixedField(sampleBuffer)); /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); + GIV(stackPointer) = sp1; } @@ -40042,13 +39651,9 @@ signedMachineIntegerValueOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -40115,7 +39720,6 @@ sizeOfAlienData(sqInt oop) GIV(primFailCode) = PrimErrBadArgument; return 0; } - /* begin sizeFieldOfAlien: */ size = longAt(oop + BaseHeaderSize); return SQABS(size); } @@ -40194,10 +39798,10 @@ clearLeakMapAndMapAccessibleObjects(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -40220,8 +39824,8 @@ clearLeakMapAndMapAccessibleObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -40233,37 +39837,33 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -40274,32 +39874,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -40317,32 +39913,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } addCogMethodsToHeapMap(); } @@ -40458,7 +40050,7 @@ methodHeaderOf(sqInt methodObj) sqLong nullHeaderForMachineCodeMethod(void) { - return ((((sqInt)((usqInt)((firstLongFormat())) << (formatShift())))) + (1ULL << 55)) + ClassBitmapCompactIndex; + return ((((sqInt)((usqInt)((firstLongFormat())) << (formatShift())))) + (1ULL << (markedBitFullShift()))) + ClassBitmapCompactIndex; } /* Spur32BitCoMemoryManager>>#scavengeThresholdAddress */ @@ -40517,13 +40109,9 @@ addressAfter(sqInt objOop) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -40808,18 +40396,10 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to l16: /* end allocateOldSpaceChunkOfBytes:suchThat: */; if (!(chunk)) { chunk = allocateOldSpaceChunkOfBytes(totalBytes); - if (!(chunk == null)) { - ((segmentContainingObj(chunk))->containsPinned = 1); + if (!(chunk)) { + return null; } - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - if (!(chunk)) { - return null; + ((segmentContainingObj(chunk))->containsPinned = 1); } if (numSlots >= (numSlotsMask())) { @@ -40827,10 +40407,22 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to flag("endianness"); longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << 30)); + long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } - long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << 30)); + long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -40846,12 +40438,6 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt chunk; chunk = allocateOldSpaceChunkOfBytes(totalBytes); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } if (!(chunk)) { return null; } @@ -40862,9 +40448,21 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(chunk + BaseHeaderSize, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } long64Atput(chunk, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -40892,7 +40490,6 @@ bytesInObject(sqInt objOop) headerNumSlots = byteAt(objOop + 7); if (headerNumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ numSlots = longAt(objOop - BaseHeaderSize); } else { @@ -40934,7 +40531,8 @@ changeClassOfto(sqInt rcvr, sqInt argClass) if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -40948,16 +40546,16 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin classFormatForInstanceFormat: */ if (instFormat < (firstLongFormat())) { normalizedInstFormat = instFormat; - goto l2; + goto l5; } if (instFormat >= (firstByteFormat())) { normalizedInstFormat = instFormat & -8; - goto l2; + goto l5; } normalizedInstFormat = (instFormat >= (firstShortFormat()) ? instFormat & -4 : instFormat & -2); -l2: /* end classFormatForInstanceFormat: */; +l5: /* end classFormatForInstanceFormat: */; if (((assert(addressCouldBeClassObj(argClass)), (classIndex = (((hash = (long32At(argClass + 4)) & (identityHashHalfWordMask()))) != 0 ? hash @@ -40993,13 +40591,9 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -41192,13 +40786,13 @@ floatObjectOf(double aFloat) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newFloatObj = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFloatCompactIndex); GIV(freeStart) += numBytes; newFloatObj = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; storeFloatAtfrom(newFloatObj + BaseHeaderSize, aFloat); return newFloatObj; } @@ -41293,16 +40887,16 @@ initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address) if (numSlots == 0) { /* short bridge for adjacent segments */ - longAtput(address, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 4, 1U << 23); + longAtput(address, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 4, 1U << (markedBitHalfShift())); } else { /* long bridge */ longAtput(address, numSlots); longAtput(address + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - longAtput(address + 8, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << 23)); + longAtput(address + 8, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << (markedBitHalfShift()))); } } @@ -41511,7 +41105,7 @@ sqInt isMarked(sqInt objOop) { flag("endianness"); - return ((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0; + return ((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0; } @@ -41528,13 +41122,9 @@ lengthOfformat(sqInt objOop, sqInt fmt) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -41584,7 +41174,7 @@ numFreeLists(void) /* Object parsing. 1. all objects have at least a word following the header, for a forwarding - pointer. 2. objects with an overflow size have a preceeing word with a + pointer. 2. objects with an overflow size have a preceding word with a saturated numSlots. If the word following an object doesn't have a saturated numSlots field it must be a single-header object. @@ -41603,13 +41193,9 @@ objectAfterlimit(sqInt objOop, sqInt limit) /* begin addressAfter: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -41635,8 +41221,8 @@ setIsMarkedOfto(sqInt objOop, sqInt aBoolean) assert(!(isFreeObject(objOop))); flag("endianness"); longAtput(objOop + 4, (aBoolean - ? (longAt(objOop + 4)) | (1U << 23) - : (longAt(objOop + 4)) & ((unsigned int)~(1U << 23)))); + ? (longAt(objOop + 4)) | (1U << (markedBitHalfShift())) + : (longAt(objOop + 4)) & ((unsigned int)~(1U << (markedBitHalfShift()))))); } @@ -41686,7 +41272,7 @@ addToEphemeronList(sqInt ephemeronCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) ephemeronListOffset) >> 5; + hash = ((usqInt) ephemeronListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(ephemeronCorpse + 4, ((((long32At(ephemeronCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -41723,7 +41309,7 @@ addToWeakList(sqInt weakCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) weakListOffset) >> 5; + hash = ((usqInt) weakListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(weakCorpse + 4, ((((long32At(weakCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -41785,13 +41371,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -41802,14 +41384,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); @@ -41828,13 +41410,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -41845,14 +41423,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 1; } @@ -41878,8 +41456,8 @@ allWeakSurvivorsOnWeakList(void) prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = (GIV(futureSpace).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(futureSurvivorStart); @@ -41894,31 +41472,27 @@ allWeakSurvivorsOnWeakList(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -42048,7 +41622,6 @@ copyAndForwardMourner(sqInt mourner) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -42098,11 +41671,10 @@ copyAndForwardMourner(sqInt mourner) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(mourner); } @@ -42122,7 +41694,6 @@ copyAndForward(sqInt survivor) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -42188,11 +41759,10 @@ copyAndForward(sqInt survivor) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(survivor); } @@ -42278,10 +41848,134 @@ copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSur return newOop; } + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Leave it to scavengeLoop + to remove any scavenged ephemerons that no longer have + new referents. */ + + /* SpurGenerationScavenger>>#fireEphemeronsInRememberedSet */ +static void +fireEphemeronsInRememberedSet(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt i; + sqInt key; + sqInt valuePointer; + + assert(noUnfiredEphemeronsAtEndOfRememberedSet()); + i = 0; + while (i < GIV(numRememberedEphemerons)) { + ephemeron = GIV(rememberedSet)[i]; + assert(isEphemeron(ephemeron)); + assert((isNonImmediate(ephemeron)) + && (isObjEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + if (scavengeReferentsOf(ephemeron)) { + + /* keep in set */ + i += 1; + } + else { + /* begin setIsRememberedOf:to: */ + longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(numRememberedEphemerons) -= 1; + GIV(previousRememberedSetSize) -= 1; + + /* First overwrite with last firable ephemeron (could be a noop if this is the last one). + Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). + Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); + GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + GIV(numRememberedEphemerons) = 0; +} + + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Be careful since copyAndForward: + can remember ephemerons (ephemerons pointing to ephemerons). */ +/* old ones for debugging */ + + /* SpurGenerationScavenger>>#fireEphemeronsOnEphemeronList */ +static void +fireEphemeronsOnEphemeronList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + usqInt ephemeronCorpse; + sqInt key; + sqInt listOffset; + sqInt oldCorpse; + sqInt oldList; + sqInt referent; + sqInt valuePointer; + + if (!(GIV(ephemeronList))) { + return; + } + oldCorpse = null; + /* begin corpseForCorpseOffset: */ + ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); + oldList = GIV(ephemeronList); + GIV(ephemeronList) = null; + while (ephemeronCorpse != null) { + assert((isYoung(ephemeronCorpse)) + && (isForwarded(ephemeronCorpse))); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(ephemeronCorpse)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + ephemeron = referent; + assert((isNonImmediate(ephemeron)) + && (isMaybeFiredEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + ((void) (scavengeReferentsOf(ephemeron))); + oldCorpse = ephemeronCorpse; + /* begin nextCorpseOrNil: */ + assert(isYoung(ephemeronCorpse)); + listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + ephemeronCorpse = (listOffset != 0 + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) + : 0); + } +} + /* SpurGenerationScavenger>>#firstCorpse: */ static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList) { DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin corpseForCorpseOffset: */ return (((sqInt)((usqInt)((headOfCorpseList - 1)) << 3))) + GIV(newSpaceStart); } @@ -42311,13 +42005,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(obj - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); assert(numSlots >= 1024); /* begin allocatePinnedSlots: */ nSlots1 = numSlots * 2; @@ -42365,7 +42055,7 @@ growRememberedSet(void) for (i = 0; i < GIV(rememberedSetSize); i += 1) { base[i] = (GIV(rememberedSet)[i]); } - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { setIsMarkedOfto(newObj, 1); setIsMarkedOfto(obj, 0); } @@ -42374,13 +42064,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(newObj)) > (isForwardedObjectClassIndexPun())); numSlots2 = byteAt(newObj + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(newObj - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots2; - } + GIV(rememberedSetLimit) = (numSlots2 == (numSlotsMask()) + ? longAt(newObj - BaseHeaderSize) + : numSlots2); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -42436,7 +42122,7 @@ isMaybeOldScavengeSurvivor(sqInt oop) return ((assert(isNonImmediate(target)), oopisGreaterThanOrEqualTo(target, GIV(oldSpaceStart))) ? (GIV(tenureCriterion) != MarkOnTenure) - || (((((usqInt) (longAt(target + 4))) >> 23) & 1) != 0) + || (((((usqInt) (longAt(target + 4))) >> (markedBitHalfShift())) & 1) != 0) : oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart())); } @@ -42490,6 +42176,7 @@ isonWeaklingList(sqInt oop, sqInt listHead) usqInt corpse; sqInt listOffset; + /* begin firstCorpse: */ corpse = (((sqInt)((usqInt)((listHead - 1)) << 3))) + GIV(newSpaceStart); while (corpse != null) { if (oop == (followForwarded(corpse))) { @@ -42497,9 +42184,10 @@ isonWeaklingList(sqInt oop, sqInt listHead) } /* begin nextCorpseOrNil: */ assert(isYoung(corpse)); - listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); corpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } return 0; @@ -42571,31 +42259,17 @@ printRememberedSet(void) static void processEphemerons(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt ephemeron1; - usqInt ephemeronCorpse; - sqInt format; - sqInt format1; sqInt hasNewReferents; sqInt i; - sqInt i1; - sqInt key; - sqInt key1; - sqInt listOffset; - sqInt oldCorpse; - sqInt oldList; - sqInt referent; sqInt referrer; sqInt unfiredEphemeronsScavenged; sqInt unfiredEphemeronsScavenged1; - sqInt valuePointer; - sqInt valuePointer1; /* begin scavengeUnfiredEphemeronsInRememberedSet */ unfiredEphemeronsScavenged1 = 0; - i1 = 0; - while (i1 < GIV(numRememberedEphemerons)) { - referrer = GIV(rememberedSet)[i1]; + i = 0; + while (i < GIV(numRememberedEphemerons)) { + referrer = GIV(rememberedSet)[i]; assert(isEphemeron(referrer)); if (isScavengeSurvivor((assert((isNonImmediate(referrer)) && (isObjEphemeron(referrer))), @@ -42606,7 +42280,7 @@ processEphemerons(void) /* remove from unscanned ephemerons in set by swapping with last ephemeron */ hasNewReferents = scavengeReferentsOf(referrer); GIV(numRememberedEphemerons) -= 1; - GIV(rememberedSet)[i1] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); if (hasNewReferents) { /* keep in set */ @@ -42624,7 +42298,7 @@ processEphemerons(void) } } else { - i1 += 1; + i += 1; } } unfiredEphemeronsScavenged = unfiredEphemeronsScavenged1; @@ -42632,111 +42306,8 @@ processEphemerons(void) unfiredEphemeronsScavenged = 1; } if (!unfiredEphemeronsScavenged) { - /* begin fireEphemeronsInRememberedSet */ - assert(noUnfiredEphemeronsAtEndOfRememberedSet()); - i = 0; - while (i < GIV(numRememberedEphemerons)) { - ephemeron = GIV(rememberedSet)[i]; - assert(isEphemeron(ephemeron)); - assert((isNonImmediate(ephemeron)) - && (isObjEphemeron(ephemeron))); - /* begin fetchPointer:ofObject: */ - key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer = copyAndForward(key); - assert(!(isOopForwarded(ephemeron))); - longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); - } - assert(!(((isScavengeSurvivor(key)) - && (isEphemeron(ephemeron))))); - if (scavengeReferentsOf(ephemeron)) { - - /* keep in set */ - i += 1; - } - else { - /* begin setIsRememberedOf:to: */ - longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(numRememberedEphemerons) -= 1; - GIV(previousRememberedSetSize) -= 1; - - /* First overwrite with last firable ephemeron (could be a noop if this is the last one). - Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). - Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); - GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); - GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - GIV(numRememberedEphemerons) = 0; - /* begin fireEphemeronsOnEphemeronList */ - if (!(GIV(ephemeronList))) { - goto l12; - } - oldCorpse = null; - /* begin corpseForCorpseOffset: */ - ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); - oldList = GIV(ephemeronList); - GIV(ephemeronList) = null; - while (ephemeronCorpse != null) { - assert((isYoung(ephemeronCorpse)) - && (isForwarded(ephemeronCorpse))); - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(ephemeronCorpse)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - ephemeron1 = referent; - assert((isNonImmediate(ephemeron1)) - && (isMaybeFiredEphemeron(ephemeron1))); - /* begin fetchPointer:ofObject: */ - key1 = longAt((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key1))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron1); - /* begin setFormatOf:to: */ - format1 = 1; - assert(((format1 >= 0) && (format1 <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron1, ((longAt(ephemeron1)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format1) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer1 = copyAndForward(key1); - assert(!(isOopForwarded(ephemeron1))); - longAtput((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1); - } - assert(!(((isScavengeSurvivor(key1)) - && (isEphemeron(ephemeron1))))); - ((void) (scavengeReferentsOf(ephemeron1))); - oldCorpse = ephemeronCorpse; - /* begin nextCorpseOrNil: */ - assert(isYoung(ephemeronCorpse)); - listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); - ephemeronCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) - : 0); - } - l12: /* end fireEphemeronsOnEphemeronList */; + fireEphemeronsInRememberedSet(); + fireEphemeronsOnEphemeronList(); } } @@ -42780,6 +42351,7 @@ processWeaklings(void) } } if (!(GIV(weakList) == null)) { + /* begin firstCorpse: */ weakCorpse = (((sqInt)((usqInt)((GIV(weakList) - 1)) << 3))) + GIV(newSpaceStart); while (weakCorpse != null) { assert(isForwarded(weakCorpse)); @@ -42801,9 +42373,10 @@ processWeaklings(void) } /* begin nextCorpseOrNil: */ assert(isYoung(weakCorpse)); - listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); weakCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } GIV(weakList) = null; @@ -42882,13 +42455,7 @@ processWeakSurvivor(sqInt weakObj) } } if (weakObjShouldMourn) { - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakObj); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakObj); } return hasYoungReferents; } @@ -42943,13 +42510,9 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress) : ptr); /* begin addressAfter: */ numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(obj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43125,16 +42688,12 @@ scavengeReferentsOf(sqInt referrer) /* begin numSlotsOf: */ assert((classIndexOf(referrer)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(referrer + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(referrer - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(referrer - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (indexablePointersFormat())) { if (((longAt(referrer)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -43149,10 +42708,10 @@ scavengeReferentsOf(sqInt referrer) contextSize = (sp >> 1); l4: /* end fetchStackPointerOf: */; numSlots = CtxtTempFrameStart + contextSize; - goto l8; + goto l9; } numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -43160,21 +42719,21 @@ scavengeReferentsOf(sqInt referrer) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l8; + goto l9; } assert(fmt == (ephemeronFormat())); numSlots = (isScavengeSurvivor((keyOfEphemeron(referrer))) ? numSlots2 : 0); - goto l8; + goto l9; } if (fmt == 7) { numSlots = 1; - goto l8; + goto l9; } if (fmt < (firstCompiledMethodFormat())) { numSlots = 0; - goto l8; + goto l9; } /* begin methodHeaderOf: */ assert(isCompiledMethod(referrer)); @@ -43187,11 +42746,11 @@ scavengeReferentsOf(sqInt referrer) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numSlots = numLiterals + LiteralStart; -l8: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; +l9: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; for (i = 0; i < numSlots; i += 1) { referent = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { @@ -43330,6 +42889,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) unfiredEphemeronsScavenged = 0; corpseOffset = GIV(ephemeronList); while (corpseOffset != 0) { + /* begin corpseForCorpseOffset: */ ephemeronCorpse = (((sqInt)((usqInt)((corpseOffset - 1)) << 3))) + GIV(newSpaceStart); assert(isForwarded(ephemeronCorpse)); /* begin followForwarded: */ @@ -43342,7 +42902,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); } ephemeron = referent; - nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); if (isScavengeSurvivor((assert((isNonImmediate(ephemeron)) && (isObjEphemeron(ephemeron))), /* begin fetchPointer:ofObject: */ @@ -43359,7 +42919,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) nextCorpseOffset) >> 5; + hash = ((usqInt) nextCorpseOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(previousCorpse + 4, ((((long32At(previousCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -43428,31 +42988,27 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objAfter + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objAfter + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { objAfter = GIV(freeStart); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objAfter = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(freeStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -43463,8 +43019,8 @@ accessibleObjectAfter(sqInt objOop) } /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objAfter = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objAfter = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { @@ -43474,13 +43030,9 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objAfter + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -43491,14 +43043,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress1 = (objAfter + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { objAfter = GIV(pastSpaceStart); - goto l2; + goto l9; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objAfter = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l9: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(pastSpaceStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -43509,13 +43061,9 @@ accessibleObjectAfter(sqInt objOop) while(1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(objAfter + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -43526,14 +43074,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress2 = (objAfter + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objAfter = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objAfter = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; if (objAfter == GIV(endOfMemory)) { return null; } @@ -43559,7 +43107,7 @@ activeAndDeferredScan(sqInt anEphemeron) && (isObjEphemeron(anEphemeron))), /* begin fetchPointer:ofObject: */ (key = longAt((anEphemeron + BaseHeaderSize) + (0U << (shiftForWord()))))))) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } return pushOnUnscannedEphemeronsStack(anEphemeron); @@ -43654,7 +43202,7 @@ addressCouldBeObj(sqInt address) && ((oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))))); } @@ -43833,7 +43381,6 @@ allInstancesOf(sqInt aClass) usqInt followingWordAddress2; usqInt followingWordAddress21; usqInt followingWordAddress3; - sqInt format; sqInt freeChunk; sqInt i; sqInt i1; @@ -43854,9 +43401,7 @@ allInstancesOf(sqInt aClass) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots131; usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; @@ -43864,7 +43409,9 @@ allInstancesOf(sqInt aClass) usqInt numSlots4; usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; + usqInt numSlots7; sqInt obj; sqInt obj1; sqInt objOop; @@ -43908,7 +43455,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } freeChunk = allocateSlotsInOldSpacebytesformatclassIndex(0, numBytes, 2, ClassArrayCompactIndex); - goto l5; + goto l6; } long64Atput(newObj, (((((usqLong) 0)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); @@ -43916,20 +43463,16 @@ allInstancesOf(sqInt aClass) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; freeChunk = newObj; - l5: /* end allocateSlots:format:classIndex: */; + l6: /* end allocateSlots:format:classIndex: */; return freeChunk; } freeChunk = allocateLargestFreeChunk(); start = freeChunk + BaseHeaderSize; /* begin addressAfter: */ numSlots1 = byteAt(freeChunk + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43969,32 +43512,28 @@ allInstancesOf(sqInt aClass) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l20; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l20: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44004,8 +43543,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots5 = byteAt(address + 7); - objOop = (numSlots5 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -44029,37 +43568,33 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l17; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop = (numSlots14 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44082,32 +43617,28 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l23; + goto l20; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l23: /* end objectAfter:limit: */; + l20: /* end objectAfter:limit: */; } count = count1; ptr = ptr1; @@ -44152,32 +43683,28 @@ allInstancesOf(sqInt aClass) prevPrevObj11 = prevObj11; prevObj11 = objOop11; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots121 = byteAt(objOop11 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes4 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes4; + followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes21; if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l31; + goto l36; } flag("endianness"); followingWord21 = longAt(followingWordAddress21 + 4); objOop11 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress21 + BaseHeaderSize : followingWordAddress21); - l31: /* end objectAfter:limit: */; + l36: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44187,8 +43714,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots6 = byteAt(address2 + 7); - objOop2 = (numSlots6 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit11 = GIV(pastSpaceStart); @@ -44219,37 +43746,33 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop2 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots14 = byteAt(objOop2 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes11; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit11)) { objOop2 = limit11; - goto l27; + goto l24; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l27: /* end objectAfter:limit: */; + l24: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots15 = byteAt(address11 + 7); - objOop2 = (numSlots15 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop2 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop2, GIV(freeStart))) { @@ -44279,32 +43802,28 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots131 = byteAt(objOop2 + 7); - if (numSlots131 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots41 = numSlots131; - } - if (numSlots41 == 0) { + numSlots111 = byteAt(objOop2 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ - slotBytes21 = ((sqInt) 8); + slotBytes11 = ((sqInt) 8); } else { - slotBytes21 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } - followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes21; + followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { objOop2 = GIV(freeStart); - goto l36; + goto l32; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop2 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l36: /* end objectAfter:limit: */; + l32: /* end objectAfter:limit: */; } /* begin purgeDuplicateClassTableEntriesFor: */ expectedIndex1 = (long32At(aClass + 4)) & (identityHashHalfWordMask()); @@ -44363,7 +43882,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } smallObj = allocateSlotsInOldSpacebytesformatclassIndex(count, numBytes1, 2, ClassArrayCompactIndex); - goto l7; + goto l8; } if (count >= (numSlotsMask())) { @@ -44380,7 +43899,7 @@ allInstancesOf(sqInt aClass) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; smallObj = newObj1; - l7: /* end allocateSlots:format:classIndex: */; + l8: /* end allocateSlots:format:classIndex: */; for (i = 0; i < count; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(smallObj))); @@ -44398,21 +43917,18 @@ allInstancesOf(sqInt aClass) } return smallObj; } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -44448,7 +43964,6 @@ allObjects(void) usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress2; - sqInt format; sqInt freeChunk; usqInt limit; usqInt limit1; @@ -44457,11 +43972,11 @@ allObjects(void) usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; - usqInt numSlots14; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44479,22 +43994,18 @@ allObjects(void) freeChunk = allocateLargestFreeChunk(); ptr = (start = freeChunk + BaseHeaderSize); /* begin addressAfter: */ - numSlots13 = byteAt(freeChunk + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - limit = (freeChunk + BaseHeaderSize) + slotBytes2; + limit = (freeChunk + BaseHeaderSize) + slotBytes; count = 0; /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -44521,32 +44032,28 @@ allObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop1 + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots14; - } + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l16; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l16: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44556,8 +44063,8 @@ allObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -44579,37 +44086,33 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44630,32 +44133,28 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); @@ -44677,21 +44176,18 @@ allObjects(void) } return (((usqInt)count << 1) | 1); } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -44723,10 +44219,10 @@ allObjectsUnmarked(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -44748,14 +44244,14 @@ allObjectsUnmarked(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44763,42 +44259,38 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44806,32 +44298,28 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44842,7 +44330,7 @@ allObjectsUnmarked(void) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -44851,32 +44339,28 @@ allObjectsUnmarked(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return 1; } @@ -44904,7 +44388,7 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; assert((long64At(objOop)) != 0); if ((isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()))) - && (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) { + && (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { if (!(isonObjStack(objOop, GIV(weaklingStack)))) { return 0; } @@ -44914,13 +44398,9 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -44931,14 +44411,14 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -44998,7 +44478,6 @@ allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt c if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - /* begin largeObjectBytesForSlots: */ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { @@ -45266,7 +44745,7 @@ allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling) classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) { referent = longAt((aWeakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -45288,7 +44767,7 @@ allUnscannedEphemeronsAreActive(void) key = longAt(((longAt(p)) + BaseHeaderSize) + (0U << (shiftForWord()))); if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -45354,7 +44833,6 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt errCode; sqInt fieldOffset; sqInt fmt; - sqInt format; sqInt hash; sqInt header; sqInt header1; @@ -45372,18 +44850,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt obj21; sqInt objOop; sqInt objOop1; + sqInt objOop11; sqInt objOop2; + sqInt objOop21; sqInt objOop3; sqInt objOop4; - sqInt objOop5; - sqInt objOop6; sqInt oop1; sqInt oop2; sqInt referent; sqInt referent1; + sqInt referent11; sqInt referent2; sqInt referent3; - sqInt referent4; sqInt size; sqInt sp; @@ -45410,20 +44888,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sp = longAt((array1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l35; + goto l27; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array1))); contextSize = (sp >> 1); - l35: /* end fetchStackPointerOf: */; + l27: /* end fetchStackPointerOf: */; fieldOffset = (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l23; } fieldOffset = (((numSlotsOf(array1)) - 1) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l23; } if (fmt < (firstCompiledMethodFormat())) { fieldOffset = 0; - goto l40; + goto l23; } /* begin methodHeaderOf: */ assert(isCompiledMethod(array1)); @@ -45439,7 +44917,7 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop fieldOffset = (((((assert((header & 1)), /* begin literalCountOfAlternateHeader: */ ((header >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize; -l40: /* end lastPointerOf: */; +l23: /* end lastPointerOf: */; /* array1 is known to be the same size as array2 */ effectsFlags = (size = 0); @@ -45450,41 +44928,42 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop1 = referent1; + oop1 = referent3; longAtput(array1 + fieldOffset, oop1); } /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop1 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l34; - goto l27; + goto l32; } - if (((((usqInt) (longAt(oop1))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l34; - goto l27; + goto l32; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop1))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop1))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l34; - goto l27; + goto l32; } - l27: /* end ifOopInvalidForBecome:errorCodeInto: */; + l32: /* end ifOopInvalidForBecome:errorCodeInto: */; effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop1)); oop2 = longAt(array2 + fieldOffset); if (((oop2 & (tagMask())) == 0) @@ -45492,42 +44971,43 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop2 = referent2; + oop2 = referent11; longAtput(array2 + fieldOffset, oop2); } if (twoWayFlag) { /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop2 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l34; - goto l26; + goto l29; } - if (((((usqInt) (longAt(oop2))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l34; - goto l26; + goto l29; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop2))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l34; - goto l26; + goto l29; } - l26: /* end ifOopInvalidForBecome:errorCodeInto: */; + l29: /* end ifOopInvalidForBecome:errorCodeInto: */; size = (size + (bytesInObject(oop1))) + (bytesInObject(oop2)); effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop2)); } @@ -45535,18 +45015,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop if (copyHashFlag && (oop2 & (tagMask()))) { ec = PrimErrInappropriate; - goto l19; + goto l34; } } fieldOffset -= BytesPerOop; } if (size >= (GIV(totalFreeOldSpace) + (GIV(scavengeThreshold) - GIV(freeStart)))) { ec = PrimErrNoMemory; - goto l19; + goto l34; } GIV(becomeEffectsFlags) = effectsFlags; ec = 0; -l19: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; +l34: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; if (ec != 0) { GIV(becomeEffectsFlags) = 0; return ec; @@ -45606,11 +45086,11 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop && ((o1ClassIndex == 0) && (o2ClassIndex == 0))) { inPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); - goto l1; + goto l15; } outOfPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); if (copyHashFlag) { - goto l1; + goto l15; } if (o1ClassIndex != 0) { if (o2ClassIndex != 0) { @@ -45623,13 +45103,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj2 = referent3; + newObj2 = referent2; assert((rawHashBitsOf(newObj2)) == 0); /* begin setHashBitsOf:to: */ assert(((o1ClassIndex >= 0) && (o1ClassIndex <= (identityHashHalfWordMask())))); @@ -45643,20 +45123,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj1 = referent4; + newObj1 = referent1; assert((rawHashBitsOf(newObj1)) == 0); /* begin setHashBitsOf:to: */ assert(((o2ClassIndex >= 0) && (o2ClassIndex <= (identityHashHalfWordMask())))); long32Atput(newObj1 + 4, ((((long32At(newObj1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o2ClassIndex); } } - l1: /* end doBecome:and:copyHash: */; + l15: /* end doBecome:and:copyHash: */; /* begin followField:ofObject: */ objOop = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if (((objOop & (tagMask())) == 0) @@ -45682,31 +45162,30 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop appear in the other array. So the enumeration could encounter an object already becommed earlier in the same enumeration. */ /* begin followField:ofObject: */ - objOop5 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop5 & (tagMask())) == 0) - && (((longAt(objOop5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop5 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop5); + objOop11 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop11); } - obj11 = objOop5; + obj11 = objOop11; /* begin followField:ofObject: */ - objOop6 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop6 & (tagMask())) == 0) - && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop6 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop6); + objOop21 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop21 & (tagMask())) == 0) + && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop21 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop21); } - obj21 = objOop6; + obj21 = objOop21; if (obj11 != obj21) { /* begin doBecome:to:copyHash: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << 23))); + longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -45848,13 +45327,9 @@ byteSizeOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -45949,10 +45424,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45964,8 +45439,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; + usqInt total; ok = 1; + total = 0; for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { if ((GIV(freeLists)[i]) != 0) { if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) == 0) { @@ -45987,8 +45464,8 @@ checkHeapFreeSpaceIntegrity(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46024,37 +45501,33 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -46089,32 +45562,28 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -46164,6 +45633,7 @@ checkHeapFreeSpaceIntegrity(void) } } } + total += bytesInObject(objOop1); } else { for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { @@ -46188,32 +45658,37 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; + } + if (total != GIV(totalFreeOldSpace)) { + print("incorrect totalFreeOldSpace; expected "); + printNum(GIV(totalFreeOldSpace)); + print(" found "); + printNum(total); + /* begin cr */ + printf("\n"); + ok = 0; } return ok; } @@ -46231,7 +45706,7 @@ checkHeapFreeSpaceIntegrity(void) /* SpurMemoryManager>>#checkHeapIntegrity:classIndicesShouldBeValid: */ static sqInt NoDbgRegParms -checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; sqInt address1; @@ -46270,10 +45745,10 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -46312,8 +45787,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46327,8 +45802,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -46403,37 +45878,33 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -46446,8 +45917,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -46522,32 +45993,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -46599,98 +46066,101 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } } else { - containsYoung = 0; - if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { - numRememberedObjectsInHeap += 1; - if (!(isInRememberedSet(objOop1))) { - print("remembered object "); - printHex(objOop1); - print(" is not in remembered table"); - /* begin cr */ - printf("\n"); - ok = 0; - } - } - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in forwarder "); - printHex(objOop1); - print(" to unmapped "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - (oopisLessThan(fieldOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { - containsYoung = 1; - } - } - else { - /* begin classOrNilAtIndex: */ - classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); - assert((classIndex3 <= (tagMask())) - || (classIndex3 >= (arrayClassIndexPun()))); - /* begin fetchPointer:ofObject: */ - fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); - classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); - if (classTablePage2 == GIV(nilObj)) { - classOop = GIV(nilObj); - goto l27; + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { + containsYoung = 0; + if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { + numRememberedObjectsInHeap += 1; + if (!(isInRememberedSet(objOop1))) { + print("remembered object "); + printHex(objOop1); + print(" is not in remembered table"); + /* begin cr */ + printf("\n"); + ok = 0; + } } - /* begin fetchPointer:ofObject: */ - fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); - classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); - l27: /* end classOrNilAtIndex: */; - if (classIndicesShouldBeValid - && ((classOop == GIV(nilObj)) - && (classIndex > (lastClassIndexPun())))) { - print("object leak in "); - printHex(objOop1); - print(" invalid class index "); - printHex(classIndex); - print(" -> "); - print((classOop == null - ? "nil" - : "nilObj")); - /* begin cr */ - printf("\n"); - ok = 0; + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in forwarder "); + printHex(objOop1); + print(" to unmapped "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + (oopisLessThan(fieldOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { + containsYoung = 1; + } } - for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); - if ((fieldOop & (tagMask())) == 0) { - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in "); - printHex(objOop1); - print(" @ "); - printNum(fi); - print(" = "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - (oopisLessThan(fieldOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { - containsYoung = 1; + else { + /* begin classOrNilAtIndex: */ + classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); + assert((classIndex3 <= (tagMask())) + || (classIndex3 >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); + classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); + if (classTablePage2 == GIV(nilObj)) { + classOop = GIV(nilObj); + goto l27; + } + /* begin fetchPointer:ofObject: */ + fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); + classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + l27: /* end classOrNilAtIndex: */; + if (classIndicesShouldBeValid + && ((classOop == GIV(nilObj)) + && (classIndex > (lastClassIndexPun())))) { + print("object leak in "); + printHex(objOop1); + print(" invalid class index "); + printHex(classIndex); + print(" -> "); + print((classOop == null + ? "nil" + : "nilObj")); + /* begin cr */ + printf("\n"); + ok = 0; + } + for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); + if ((fieldOop & (tagMask())) == 0) { + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in "); + printHex(objOop1); + print(" @ "); + printNum(fi); + print(" = "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + (oopisLessThan(fieldOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) { + containsYoung = 1; + } } } } - } - if (containsYoung) { - if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { - print("unremembered object "); - printHex(objOop1); - print(" contains young oop(s)"); - /* begin cr */ - printf("\n"); - ok = 0; + if (containsYoung) { + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + print("unremembered object "); + printHex(objOop1); + print(" contains young oop(s)"); + /* begin cr */ + printf("\n"); + ok = 0; + } } } } @@ -46698,32 +46168,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l23; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } if (numRememberedObjectsInHeap != (rememberedSetSize())) { print("root count mismatch. #heap roots "); @@ -46773,7 +46239,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } /* begin objStack:do: */ if (GIV(mournQueue) == GIV(nilObj)) { - goto l9; + goto l14; } eassert(isValidObjStack(GIV(mournQueue))); objStackPage = GIV(mournQueue); @@ -46794,10 +46260,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!(excludeUnmarkedNewSpaceObjs - && ((((obj & (tagMask())) == 0) - && (oopisLessThan(obj, GIV(newSpaceLimit)))) - && (!(((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0))))) { + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { if ((heapMapAtWord(pointerForOop(obj))) == 0) { print("object leak in mournQueue @ "); printNum(i2); @@ -46816,7 +46280,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s /* begin fetchPointer:ofObject: */ objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } -l9: /* end objStack:do: */; +l14: /* end objStack:do: */; for (ri = 1; ri <= GIV(remapBufferCount); ri += 1) { obj = GIV(remapBuffer)[ri]; if ((obj & (BytesPerWord - 1)) != 0) { @@ -46930,7 +46394,7 @@ checkOkayOop(usqInt oop) print(" has some unused header bits set; should be zero"); return 0; } - unusedBitsInYoungObjects = (1U << 0x1F) | ((1U << 30) | (1U << (rememberedBitShift()))); + unusedBitsInYoungObjects = (1U << (greyBitShift())) | ((1U << (pinnedBitShift())) | (1U << (rememberedBitShift()))); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { print("oop "); printHex(oop); @@ -46990,7 +46454,6 @@ checkOopHasOkayClass(usqInt obj) objFormat = ((((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) | 7) - 7); } else { - /* begin formatOf: */ objFormat = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask()); } if ((instSpecOfClassFormat(((longAt((objClass + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) != objFormat) { @@ -47405,13 +46868,9 @@ clearLeakMapAndMapAccessibleFreeSpace(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -47422,14 +46881,14 @@ clearLeakMapAndMapAccessibleFreeSpace(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } } @@ -47451,13 +46910,9 @@ cloneInOldSpaceForPinning(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); newObj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(numSlots, ((numSlots == 0 ? 8 @@ -47552,13 +47007,9 @@ clone(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { /* begin allocateSlotsInOldSpace:format:classIndex: */ @@ -47590,7 +47041,7 @@ clone(sqInt objOop) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, fmt, classIndex1); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -47607,7 +47058,7 @@ clone(sqInt objOop) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l4: /* end allocateSlots:format:classIndex: */; + l5: /* end allocateSlots:format:classIndex: */; } if (!(newObj)) { return 0; @@ -47808,10 +47259,10 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -47834,14 +47285,14 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -47858,42 +47309,38 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -47910,32 +47357,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -47946,7 +47389,7 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop11); @@ -47964,32 +47407,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } print("n marked: "); printNum(nm); @@ -48148,7 +47587,7 @@ doScavenge(sqInt tenuringCriterion) sqInt p; SpurNewSpaceSpace temp; - GIV(scavengeInProgress) = 1; + GIV(gcPhaseInProgress) = ScavengeInProgress; /* begin scavenge: */ GIV(statSurvivorCount) = 0; GIV(tenureCriterion) = tenuringCriterion; @@ -48186,7 +47625,7 @@ doScavenge(sqInt tenuringCriterion) } } } - GIV(scavengeInProgress) = 0; + GIV(gcPhaseInProgress) = 0; } @@ -48491,9 +47930,9 @@ existInstancesInNewSpaceOf(sqInt classObj) usqInt numSlots; usqInt numSlots1; usqInt numSlots11; - usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt obj; sqInt objOop; sqInt objOop1; @@ -48511,8 +47950,8 @@ existInstancesInNewSpaceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -48526,37 +47965,33 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -48569,32 +48004,28 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 0; } @@ -48774,10 +48205,10 @@ findStringBeginningWith(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -48800,8 +48231,8 @@ findStringBeginningWith(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -48825,37 +48256,33 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -48878,32 +48305,28 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -48933,32 +48356,28 @@ findStringBeginningWith(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -48985,10 +48404,10 @@ findString(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -49011,8 +48430,8 @@ findString(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -49033,37 +48452,33 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -49083,32 +48498,28 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -49135,34 +48546,43 @@ findString(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; + } } + + /* SpurMemoryManager>>#fireAllUnscannedEphemerons */ +static void +fireAllUnscannedEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt p; + + assert(!(noUnscannedEphemerons())); + assert(allUnscannedEphemeronsAreActive()); + for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { + fireEphemeron(longAt(p)); } +} /* SpurMemoryManager>>#firstAccessibleObject */ static sqInt @@ -49746,6 +49166,10 @@ freeObject(sqInt objOop) usqLong NeverInline fullGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt index; + sqInt obj; + GIV(needGCFlag) = 0; GIV(gcStartUsecs) = ioUTCMicrosecondsNow(); GIV(statMarkCount) = 0; @@ -49755,10 +49179,38 @@ fullGC(void) assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); markObjects(1); - /* begin freeUnmarkedObjectsAndPrepareFreeSpace */ - freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); - runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin forgetUnmarkedRememberedObjects */ + index = 0; + while (index < GIV(rememberedSetSize)) { + obj = GIV(rememberedSet)[index]; + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { + index += 1; + } + else { + + /* unmarked; remove by overwriting with last element. */ + /* begin setIsRememberedOf:to: */ + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + assert(GIV(rememberedSetSize) >= 0); + doScavenge(MarkOnTenure); + runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin prepareForGlobalSweep */ + GIV(sweepIndex) = 0; + for (i = 0; i < GIV(numSegments); i += 1) { + ((GIV(segments)[i]).containsPinned = 0); + } + setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); compact(); + /* begin attemptToShrink */ + if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) + && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { + GIV(statShrinkMemory) += 1; + shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); + } /* begin setHeapSizeAtPreviousGC */ GIV(heapSizeAtPreviousGC) = (GIV(endOfMemory) - GIV(nilObj)) - GIV(totalFreeOldSpace); assert(validObjStacks()); @@ -49766,12 +49218,6 @@ fullGC(void) assert(isEmptyObjStack(GIV(weaklingStack))); assert(allObjectsUnmarked()); runLeakCheckerFor(GCModeFull); - /* begin attemptToShrink */ - if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) - && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { - GIV(statShrinkMemory) += 1; - shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); - } postGCAction(GCModeFull); GIV(statFullGCs) += 1; GIV(statGCEndUsecs) = ioUTCMicrosecondsNow(); @@ -49798,13 +49244,9 @@ goodContextSize(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); return (numSlots == SmallContextSlots) || (numSlots == LargeContextSlots); } @@ -49990,7 +49432,7 @@ imageSegmentVersion(void) sqInt immutableBitMask(void) { - return 1U << 23; + return 1U << (immutableBitShift()); } #endif /* IMMUTABILITY */ @@ -50084,10 +49526,10 @@ initialInstanceOf(sqInt classObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -50125,8 +49567,8 @@ initialInstanceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -50140,37 +49582,33 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -50183,32 +49621,28 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -50228,20 +49662,16 @@ initialInstanceOf(sqInt classObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -50346,21 +49776,17 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(classTableRoot)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classTableRoot + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(numClassTablePages) = longAt(classTableRoot - BaseHeaderSize); - } - else { - GIV(numClassTablePages) = numSlots1; - } + GIV(numClassTablePages) = (numSlots1 == (numSlotsMask()) + ? longAt(classTableRoot - BaseHeaderSize) + : numSlots1); assert(GIV(numClassTablePages) == ((classTableRootSlots()) + (hiddenRootSlots()))); for (i1 = 2; i1 < GIV(numClassTablePages); i1 += 1) { if ((longAt((classTableRoot + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))))) == nilObjPreSwizzle) { GIV(numClassTablePages) = i1; - goto l11; + goto l8; } } -l11: /* end countNumClassPagesPreSwizzle: */; +l8: /* end countNumClassPagesPreSwizzle: */; if ((bytesToShift != 0) || ((numSegments()) > 1)) { /* begin objectStartingAt: */ @@ -50436,16 +49862,17 @@ initializeObjectMemory(sqInt bytesToShift) flag("endianness"); longAtput(GIV(classTableFirstPage), ((longAt(GIV(classTableFirstPage))) & ((unsigned int)~(classIndexMask()))) + classIndex1); } + /* begin classTableRootSlots */ GIV(numClassTablePages) = 1U << (22 - (classTableMajorIndexShift())); for (i2 = 2; i2 < GIV(numClassTablePages); i2 += 1) { if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))))) == GIV(nilObj)) { GIV(numClassTablePages) = i2; GIV(classTableIndex) = ((sqInt)((usqInt)(((((GIV(numClassTablePages) - 1) < 1) ? 1 : (GIV(numClassTablePages) - 1)))) << (classTableMajorIndexShift()))); - goto l13; + goto l14; } } GIV(classTableIndex) = 1U << (classTableMajorIndexShift()); -l13: /* end setHiddenRootsObj: */; +l14: /* end setHiddenRootsObj: */; GIV(markStack) = swizzleObjStackAt(MarkStackRootIndex); GIV(weaklingStack) = swizzleObjStackAt(WeaklingStackRootIndex); GIV(mournQueue) = swizzleObjStackAt(MournQueueRootIndex); @@ -50513,13 +49940,9 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(obj2)) > (isForwardedObjectClassIndexPun())); numSlots3 = byteAt(obj2 + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(obj2 - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots3; - } + GIV(rememberedSetLimit) = (numSlots3 == (numSlotsMask()) + ? longAt(obj2 - BaseHeaderSize) + : numSlots3); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -50634,7 +50057,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o1HasYoung && ((assert(isNonImmediate(obj1)), oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj1))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -50647,7 +50069,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o2HasYoung && ((assert(isNonImmediate(obj2)), oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj2))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -50749,7 +50170,6 @@ isBytes(sqInt oop) sqInt isCharacterObject(sqInt oop) { - /* begin isImmediateCharacter: */ return (oop & (tagMask())) == (characterTag()); } @@ -50968,7 +50388,6 @@ isIndexable(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); return (fmt >= 2) && ((fmt <= (weakArrayFormat())) @@ -51002,7 +50421,7 @@ isInMemory(sqInt address) && (oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))) { return (oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))); } /* begin isInSegments: */ @@ -51075,7 +50494,8 @@ isObjImmutable(sqInt anOop) { return # if IMMUTABILITY - ((((usqInt) (longAt(anOop))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(anOop))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -51117,7 +50537,7 @@ sqInt isOopImmutable(sqInt oop) { return (oop & (tagMask())) - || (((((usqInt) (longAt(oop))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0); } /* SpurMemoryManager>>#isOopMutable: */ @@ -51125,14 +50545,14 @@ sqInt isOopMutable(sqInt oop) { return ((oop & (tagMask())) == 0) - && (!(((((usqInt) (longAt(oop))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0)); } /* SpurMemoryManager>>#isPinned: */ sqInt isPinned(sqInt objOop) { - return ((((usqInt) (longAt(objOop))) >> 30) & 1) != 0; + return ((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0; } @@ -51307,7 +50727,7 @@ isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx) return 0; } if (GIV(marking) - && (!(((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0))) { + && (!(((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0))) { GIV(objStackInvalidBecause) = "marking but page is unmarked"; GIV(invalidObjStackPage) = objStackPage; return 0; @@ -51436,25 +50856,7 @@ sqInt isWeak(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWeakNonImm(oop)); -} - - -/* Answer if the contains only indexable words or bytes (no oops). See - comment in formatOf: - */ -/* Note: Excludes CompiledMethods. */ - - /* SpurMemoryManager>>#isWordsOrBytesNonImm: */ -static sqInt NoDbgRegParms -isWordsOrBytesNonImm(sqInt objOop) -{ - sqInt format; - - /* begin isPureBitsFormat: */ - format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); - return (format >= (sixtyFourBitIndexableFormat())) - && (format < (firstCompiledMethodFormat())); + && (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -51468,7 +50870,7 @@ sqInt isWordsOrBytes(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)); + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -51599,7 +51001,6 @@ lastPointerOfWhileSwizzling(sqInt objOop) sqInt header; sqInt header1; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -51638,7 +51039,6 @@ lastPointerOf(sqInt objOop) sqInt header1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -51650,11 +51050,11 @@ lastPointerOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l2; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l2: /* end fetchStackPointerOf: */; return (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; } return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize; @@ -51724,13 +51124,9 @@ lengthOfMaybeImmediate(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -51768,13 +51164,9 @@ lengthOf(sqInt objOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -51862,8 +51254,6 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) usqInt followingWordAddress1; usqInt followingWordAddress2; usqInt followingWordAddress3; - sqInt format; - sqInt format1; sqInt hash; sqInt i; sqInt iLimiT; @@ -51874,24 +51264,23 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt numLoadedObjects; usqInt numOutPointers; sqInt numSegObjs; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots10; usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; usqInt numSlots14; usqInt numSlots15; - usqInt numSlots16; usqInt numSlots2; usqInt numSlots21; + usqInt numSlots22; usqInt numSlots3; + usqInt numSlots31; usqInt numSlots4; usqInt numSlots5; usqInt numSlots6; usqInt numSlots7; usqInt numSlots8; - usqInt numSlots9; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -51912,14 +51301,10 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin numSlotsOf: */ assert((classIndexOf(segmentWordArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(segmentWordArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - segmentLimit = longAt(segmentWordArray - BaseHeaderSize); - } - else { - segmentLimit = numSlots1; - } + numSlots = byteAt(segmentWordArray + 7); + segmentLimit = (numSlots == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots); if ((((segmentLimit == 0 ? 8 : (segmentLimit + (segmentLimit & 1)) << (shiftForWord()))) + ((segmentLimit >= (numSlotsMask()) @@ -51936,22 +51321,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots12 = byteAt(segmentWordArray + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots13 = byteAt(segmentWordArray + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes1; + stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes3; addr1 = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr1, stopAddr1)) { long32Atput(addr1, SQ_SWAP_4_BYTES((long32At(addr1)))); @@ -51963,22 +51344,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(segmentWordArray + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes; + stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes2; addr = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr, stopAddr)) { long32Atput(addr, SQ_SWAP_4_BYTES((long32At(addr)))); @@ -52003,53 +51380,49 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } /* begin mapOopsAndValidateClassRefsFrom:to:outPointers: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots8 = byteAt(outPointerArray + 7); - if (numSlots8 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numOutPointers = longAt(outPointerArray - BaseHeaderSize); - } - else { - numOutPointers = numSlots8; - } + numSlots21 = byteAt(outPointerArray + 7); + numOutPointers = (numSlots21 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots21); numSegObjs = 0; /* begin objectStartingAt: */ - numSlots9 = byteAt(segmentStart + 7); - objOop1 = (numSlots9 == (numSlotsMask()) + numSlots31 = byteAt(segmentStart + 7); + objOop1 = (numSlots31 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); while (objOop1 < segmentLimit) { numSegObjs += 1; - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } /* validate the class ref, but don't update it until any internal classes have been added to the class table. */ - classIndex = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); - if (classIndex & TopHashBit) { - if ((classIndex - TopHashBit) >= numOutPointers) { + classIndex1 = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); + if (classIndex1 & TopHashBit) { + if ((classIndex1 - TopHashBit) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } /* begin fetchPointer:ofObject: */ - mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex - TopHashBit)) << (shiftForWord()))))); + mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex1 - TopHashBit)) << (shiftForWord()))))); hash = (long32At(mappedOop + 4)) & (identityHashHalfWordMask()); if (!((hash > (lastClassIndexPun())) && ((classOrNilAtIndex(hash)) == mappedOop))) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } } else { /* The class is contained within the segment. */ - if (((oop1 = (classIndex * 8) + segmentStart)) >= segmentLimit) { + if (((oop1 = (classIndex1 * 8) + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } if (((long32At(oop1 + 4)) & (identityHashHalfWordMask())) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } } for (i = 0, iLimiT = ((numPointerSlotsOf(objOop1)) - 1); i <= iLimiT; i += 1) { @@ -52059,7 +51432,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) if (oop1 & TopOopBit) { if (((oop1 = (oop1 - TopOopBit) / BytesPerOop)) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } /* begin fetchPointer:ofObject: */ mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(oop1) << (shiftForWord()))))); @@ -52067,11 +51440,11 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) else { if ((oop1 & (8 - 1)) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l31; } if (((mappedOop = oop1 + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l31; } } assert(!(isOopForwarded(objOop1))); @@ -52079,35 +51452,31 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } } /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots14 = byteAt(objOop1 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { objOop1 = segmentLimit; - goto l9; + goto l22; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l9: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } errorCode = -numSegObjs; -l11: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; +l31: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; if (errorCode > 0) { return errorCode; } @@ -52131,7 +51500,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) forceInterruptCheck(); } loadedObjectsArray = allocateSlotsInOldSpacebytesformatclassIndex(numLoadedObjects, numBytes, 2, ClassArrayCompactIndex); - goto l13; + goto l14; } if (numLoadedObjects >= (numSlotsMask())) { @@ -52148,7 +51517,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; loadedObjectsArray = newObj; -l13: /* end allocateSlots:format:classIndex: */; +l14: /* end allocateSlots:format:classIndex: */; if (!(loadedObjectsArray)) { return PrimErrNoMemory; } @@ -52164,72 +51533,64 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) while (objOop < oop) { expungeFromClassTable(objOop); /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots6 = numSlots14; - } - if (numSlots6 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots3 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segmentLimit)) { objOop = segmentLimit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } errorCode = errorCode1; - goto l5; + goto l12; } /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots7 = numSlots15; - } - if (numSlots7 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes4; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, segmentLimit)) { objOop = segmentLimit; - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } errorCode = 0; -l5: /* end enterClassesIntoClassTableFrom:to: */; +l12: /* end enterClassesIntoClassTableFrom:to: */; if (errorCode != 0) { return errorCode; } /* begin assignClassIndicesAndPinFrom:to:outPointers:filling: */ - numSlots10 = byteAt(segmentStart + 7); - objOop2 = (numSlots10 == (numSlotsMask()) + numSlots22 = byteAt(segmentStart + 7); + objOop2 = (numSlots22 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); fillIdx = 0; @@ -52258,22 +51619,21 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~(classIndexMask()))) + classIndex2); if (((oopisLessThan(objOop2, GIV(newSpaceLimit))) && (oopisGreaterThanOrEqualTo(objOop2, GIV(newSpaceStart)))) - && (((((usqInt) (longAt(objOop2))) >> 30) & 1) != 0)) { + && (((((usqInt) (longAt(objOop2))) >> (pinnedBitShift())) & 1) != 0)) { oldClone = cloneInOldSpaceForPinning(objOop2); if (oldClone != 0) { /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex11 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex11 >= 0) && (classIndex11 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << 23))); + longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -52299,53 +51659,47 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } } /* begin objectAfter:limit: */ - numSlots16 = byteAt(objOop2 + 7); - if (numSlots16 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots21 = numSlots16; - } - if (numSlots21 == 0) { + numSlots15 = byteAt(objOop2 + 7); + numSlots8 = (numSlots15 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots15); + if (numSlots8 == 0) { /* begin allocationUnit */ slotBytes5 = ((sqInt) 8); } else { - slotBytes5 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes5 = (numSlots8 + (numSlots8 & 1)) << (shiftForWord()); } followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { objOop2 = segmentLimit; - goto l35; + goto l33; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l35: /* end objectAfter:limit: */; + l33: /* end objectAfter:limit: */; } if ((byteAt(segmentWordArray + 7)) == (numSlotsMask())) { /* begin rawOverflowSlotsOf:put: */ - numSlots = 8 / BytesPerOop; - longAtput(segmentWordArray - BaseHeaderSize, numSlots); + longAtput(segmentWordArray - BaseHeaderSize, 8 / BytesPerOop); } else { /* begin rawNumSlotsOf:put: */ byteAtput(segmentWordArray + 7, 8 / BytesPerOop); } /* begin forward:to: */ - classIndex1 = isForwardedObjectClassIndexPun(); - format = 7; - assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + classIndex = isForwardedObjectClassIndexPun(); + assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << 23))); + longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -52370,8 +51724,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } runLeakCheckerFor(GCModeImageSegment); /* begin objectStartingAt: */ - numSlots2 = byteAt(segmentStart + 7); - return (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(segmentStart + 7); + return (numSlots4 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); } @@ -52415,10 +51769,10 @@ longPrintInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -52447,32 +51801,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -52482,8 +51832,8 @@ longPrintInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -52497,37 +51847,33 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -52540,32 +51886,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -52592,11 +51934,11 @@ longPrintReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -52620,8 +51962,8 @@ longPrintReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -52630,7 +51972,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52640,13 +51982,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52670,37 +52008,33 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -52708,7 +52042,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52718,13 +52052,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52748,32 +52078,28 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -52787,7 +52113,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart; + i = (literalCountOf(objOop11)) + LiteralStart; } else { if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -52797,13 +52123,9 @@ longPrintReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -52828,14 +52150,10 @@ longPrintReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -52931,11 +52249,11 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe sqInt hash2; sqInt i; sqInt iLimiT; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots11; - usqInt numSlots2; + sqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt objOop; sqInt oop; sqInt outIndex; @@ -52948,27 +52266,23 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe outIndex = 0; /* begin fillObj:numSlots:with: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(outPointerArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(outPointerArray - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(outPointerArray))); - for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { + numSlots4 = byteAt(outPointerArray + 7); + numSlots2 = (numSlots4 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots4); + assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1, addressAfter(outPointerArray))); + for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1))); p += 8) { longAtput(p, GIV(nilObj)); longAtput(p + 4, GIV(nilObj)); } /* begin objectStartingAt: */ - numSlots2 = byteAt(segStart + 7); - objOop = (numSlots2 == (numSlotsMask()) + numSlots3 = byteAt(segStart + 7); + objOop = (numSlots3 == (numSlotsMask()) ? segStart + BaseHeaderSize : segStart); while (objOop < segAddr) { oop = fetchClassOfNonImm(objOop); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -52976,7 +52290,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l7; + goto l11; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -53002,7 +52316,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1); setIsMarkedOfto(oop, 1); outIndex += 1; - l7: /* end newOutPointer:at:in:hashes: */; + l11: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -53019,7 +52333,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* begin fetchPointer:ofObject: */ oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -53027,7 +52341,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l9; + goto l14; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -53053,7 +52367,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2); setIsMarkedOfto(oop, 1); outIndex += 1; - l9: /* end newOutPointer:at:in:hashes: */; + l14: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -53071,32 +52385,28 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe } } /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segAddr)) { objOop = segAddr; - goto l2; + goto l6; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l2: /* end objectAfter:limit: */; + l6: /* end objectAfter:limit: */; } return outIndex; } @@ -53147,7 +52457,7 @@ markAndTraceClassOf(sqInt objOop) flag("endianness"); longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~(classIndexMask()))) + realClassIndex); } - if (!(((((usqInt) (longAt(classObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(classObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { setIsMarkedOfto(classObj, 1); markAndTraceClassOf(classObj); pushonObjStack(classObj, GIV(markStack)); @@ -53215,25 +52525,8 @@ markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents) void NeverInline markAndTrace(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; - sqInt contextSize; - sqInt field; - sqInt fmt; sqInt format1; - sqInt format11; - sqInt header; - sqInt header1; - sqInt index; - sqInt numLiterals; - usqInt numSlots; - usqInt numSlots1; - sqInt numStrongSlots; - sqInt objOop1; - sqInt objToScan; - sqInt scanLargeObject; - sqInt sp; - numStrongSlots = 0; /* inline markAndShouldScan: */ if (objOop & (tagMask())) { @@ -53241,12 +52534,11 @@ markAndTrace(sqInt objOop) } assert(!(isForwarded(objOop))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { return; } setIsMarkedOfto(objOop, 1); - /* begin formatOf: */ format1 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if ((format1 >= (sixtyFourBitIndexableFormat())) && (format1 < (firstCompiledMethodFormat()))) { @@ -53272,7 +52564,89 @@ markAndTrace(sqInt objOop) } - /* begin markLoopFrom: */ + markLoopFrom(objOop); +} + + +/* Go through the unscanned ephemerons, marking the inactive ones, and + removing them from the unscanned ephemerons. Answer if any inactive + ones were found. We cannot fire the ephemerons until all are found to + be active since scan-marking an inactive ephemeron later in the set may + render a previously-observed active ephemeron as inactive. */ + + /* SpurMemoryManager>>#markInactiveEphemerons */ +static sqInt +markInactiveEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt foundInactive; + sqInt key; + sqInt objOop; + sqInt oop; + usqInt ptr; + + foundInactive = 0; + ptr = (GIV(unscannedEphemerons).start); + while (ptr < ((GIV(unscannedEphemerons).top))) { + /* begin followedKeyOfEphemeron: */ + objOop = (ephemeron = longAt(ptr)); + assert((isNonImmediate(objOop)) + && (isEphemeron(objOop))); + /* begin followOopField:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); + } + key = oop; + if ((key & (tagMask())) + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + + /* Now remove the inactive ephemeron from the set, and scan-mark it. + Scan-marking it may add more ephemerons to the set. */ + foundInactive = 1; + (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); + if (((GIV(unscannedEphemerons).top)) > ptr) { + longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); + } + markAndTrace(ephemeron); + } + else { + ptr += BytesPerOop; + } + } + return foundInactive; +} + + +/* Scan objOop and all objects on the mark stack, until the mark stack is + empty. N.B. When the incremental GC is written this will probably be + refactored as + markLoopFrom: objOop while: aBlock */ +/* Now scan the object, and any remaining objects on the mark stack. */ + + /* SpurMemoryManager>>#markLoopFrom: */ +static void NoDbgRegParms +markLoopFrom(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt contextSize; + sqInt field; + sqInt fmt; + sqInt format1; + sqInt header; + sqInt header1; + sqInt index; + sqInt numLiterals; + usqInt numSlots; + usqInt numSlots1; + sqInt numStrongSlots; + sqInt objOop1; + sqInt objToScan; + sqInt scanLargeObject; + sqInt sp; + + numStrongSlots = 0; /* To avoid overflowing the mark stack when we encounter large objects, we push the obj, then its numStrongSlots, and then index the object from the stack. */ @@ -53290,16 +52664,12 @@ markAndTrace(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objToScan)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objToScan + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objToScan - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objToScan - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (indexablePointersFormat())) { if (((longAt(objToScan)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -53308,16 +52678,16 @@ markAndTrace(sqInt objOop) sp = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l7; + goto l8; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objToScan))); contextSize = (sp >> 1); - l7: /* end fetchStackPointerOf: */; + l8: /* end fetchStackPointerOf: */; numStrongSlots = CtxtTempFrameStart + contextSize; - goto l12; + goto l10; } numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -53325,16 +52695,16 @@ markAndTrace(sqInt objOop) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l12; + goto l10; } } if (fmt == 7) { numStrongSlots = 1; - goto l12; + goto l10; } if (fmt < (firstCompiledMethodFormat())) { numStrongSlots = 0; - goto l12; + goto l10; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objToScan)); @@ -53347,11 +52717,11 @@ markAndTrace(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numStrongSlots = numLiterals + LiteralStart; - l12: /* end numStrongSlotsOfInephemeral: */; + l10: /* end numStrongSlotsOfInephemeral: */; scanLargeObject = numStrongSlots > 64; } if (scanLargeObject) { @@ -53379,14 +52749,13 @@ markAndTrace(sqInt objOop) goto l3; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l3; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -53395,13 +52764,13 @@ markAndTrace(sqInt objOop) } goto l3; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l3; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l3; } @@ -53445,14 +52814,13 @@ markAndTrace(sqInt objOop) goto l4; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l4; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -53461,13 +52829,13 @@ markAndTrace(sqInt objOop) } goto l4; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l4; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l4; } @@ -53486,57 +52854,6 @@ markAndTrace(sqInt objOop) } -/* Go through the unscanned ephemerons, marking the inactive ones, and - removing them from the unscanned ephemerons. Answer if any inactive - ones were found. We cannot fire the ephemerons until all are found to - be active since scan-marking an inactive ephemeron later in the set may - render a previously-observed active ephemeron as inactive. */ - - /* SpurMemoryManager>>#markInactiveEphemerons */ -static sqInt -markInactiveEphemerons(void) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt foundInactive; - sqInt key; - sqInt objOop; - sqInt oop; - usqInt ptr; - - foundInactive = 0; - ptr = (GIV(unscannedEphemerons).start); - while (ptr < ((GIV(unscannedEphemerons).top))) { - /* begin followedKeyOfEphemeron: */ - objOop = (ephemeron = longAt(ptr)); - assert((isNonImmediate(objOop)) - && (isEphemeron(objOop))); - /* begin followOopField:ofObject: */ - oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - if (((oop & (tagMask())) == 0) - && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); - } - key = oop; - if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { - - /* Now remove the inactive ephemeron from the set, and scan-mark it. - Scan-marking it may add more ephemerons to the set. */ - foundInactive = 1; - (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); - if (((GIV(unscannedEphemerons).top)) > ptr) { - longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); - } - markAndTrace(ephemeron); - } - else { - ptr += BytesPerOop; - } - } - return foundInactive; -} - - /* for profiling */ /* Mark all accessible objects. objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged is true if all @@ -53614,9 +52931,9 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } - for (i4 = 0; i4 < GIV(numStackPages); i4 += 1) { + for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { /* begin stackPageAt: */ - thePage = stackPageAtpages(i4, GIV(pages)); + thePage = stackPageAtpages(i1, GIV(pages)); (thePage->trace = StackPageUnreached); } /* begin markAndTraceHiddenRoots */ @@ -53626,20 +52943,20 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((int)((usqInt)(RememberedSetRootIndex) << (shiftForWord()))))), 1); setIsMarkedOfto((assert((firstIndexableField(objectAfter(GIV(trueObj)))) == GIV(freeLists)), objectAfter(GIV(trueObj))), 1); - if (isWeakNonImm(GIV(classTableFirstPage))) { + if (isWeakFormat((((usqInt) (longAt(GIV(classTableFirstPage)))) >> (formatShift())) & (formatMask()))) { markAndTrace(GIV(hiddenRootsObj)); - goto l1; + goto l2; } setIsMarkedOfto(GIV(hiddenRootsObj), 1); markAndTrace(GIV(classTableFirstPage)); for (i2 = 1; i2 < GIV(numClassTablePages); i2 += 1) { setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))), 1); } -l1: /* end markAndTraceHiddenRoots */; +l2: /* end markAndTraceHiddenRoots */; /* begin markAndTraceExtraRoots */ assert(GIV(remapBufferCount) == 0); - for (i = 1; i <= GIV(extraRootCount); i += 1) { - oop = (GIV(extraRoots)[i])[0]; + for (i4 = 1; i4 <= GIV(extraRootCount); i4 += 1) { + oop = (GIV(extraRoots)[i4])[0]; if (!((oop & (tagMask())) || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { markAndTrace(oop); @@ -53757,13 +53074,13 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) markWeaklingsAndMarkAndFireEphemerons(); assert(validObjStacks()); /* begin expungeDuplicateAndUnmarkedClasses: */ - for (i1 = 1; i1 < GIV(numClassTablePages); i1 += 1) { + for (i = 1; i < GIV(numClassTablePages); i += 1) { /* Avoid expunging the puns by not scanning the 0th page. */ - classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) { classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord()))))); - classIndex = (((sqInt)((usqInt)(i1) << (classTableMajorIndexShift())))) + j; + classIndex = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j; assert((classOrNil == GIV(nilObj)) || (addressCouldBeClassObj(classOrNil))); if (classOrNil == GIV(nilObj)) { @@ -53773,7 +53090,7 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) } else { if ((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged - && (!(((((usqInt) (longAt(classOrNil + 4))) >> 23) & 1) != 0))) + && (!(((((usqInt) (longAt(classOrNil + 4))) >> (markedBitHalfShift())) & 1) != 0))) || (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) != classIndex)) { assert(!(isOopForwarded(classTablePage))); longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj)); @@ -53807,7 +53124,6 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt classFormat; sqInt ephemeron; sqInt field; - sqInt format; sqInt i; sqInt i1; sqInt iLimiT; @@ -53818,11 +53134,9 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt numToEnumerateOnThisPage; sqInt numTracedWeaklings; sqInt objOop; - sqInt objStack; sqInt objStackPage; sqInt oop; sqInt oop1; - sqInt p; sqInt size; sqInt topIndex; sqInt weakling; @@ -53833,12 +53147,11 @@ markWeaklingsAndMarkAndFireEphemerons(void) markAndTraceMachineCodeOfMarkedMethods(); do { /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -53846,7 +53159,7 @@ markWeaklingsAndMarkAndFireEphemerons(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size - numTracedWeaklings; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); @@ -53871,7 +53184,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += } field = oop; if (!((field & (tagMask())) - || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0))) { markAndTrace(field); } } @@ -53891,21 +53204,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += return; } if (!(markInactiveEphemerons())) { - /* begin fireAllUnscannedEphemerons */ - assert(!(noUnscannedEphemerons())); - assert(allUnscannedEphemeronsAreActive()); - for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { - /* begin fireEphemeron: */ - queueMourner(longAt(p)); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(longAt(p), ((longAt(longAt(p))) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - } + fireAllUnscannedEphemerons(); } /* begin markAllUnscannedEphemerons */ assert(!(noUnscannedEphemerons())); @@ -53917,7 +53216,6 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += longAtput((GIV(unscannedEphemerons).start), longAt(lastptr)); } (GIV(unscannedEphemerons).top = lastptr); - /* begin followedKeyOfMaybeFiredEphemeron: */ assert((isNonImmediate(ephemeron)) && (isMaybeFiredEphemeron(ephemeron))); /* begin followOopField:ofObject: */ @@ -53927,6 +53225,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += oop1 = fixFollowedFieldofObjectwithInitialValue(0, ephemeron, oop1); } key = oop1; + setIsMarkedOfto(ephemeron, 0); markAndTrace(key); markAndTrace(ephemeron); @@ -53976,20 +53275,6 @@ newSpaceIsEmpty(void) && (GIV(pastSpaceStart) == (((pastSpace()).start))); } - -/* Answer the next free free chunk using the xor trick to use only one field, - see e.g. - The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 - `Circular Lists', exercise. 18 - http://en.wikipedia.org/wiki/XOR_linked_list. */ - - /* SpurMemoryManager>>#nextInSortedFreeListLink:given: */ -usqInt -nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) -{ - return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); -} - /* SpurMemoryManager>>#nilObject */ sqInt nilObject(void) @@ -54015,7 +53300,6 @@ nilUnmarkedWeaklingSlots(void) sqInt numOnThisPage; sqInt numToEnumerate; sqInt numToEnumerateOnThisPage; - sqInt objStack; sqInt objStackPage; sqInt referent; sqInt size; @@ -54027,12 +53311,11 @@ nilUnmarkedWeaklingSlots(void) return; } /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -54040,30 +53323,30 @@ nilUnmarkedWeaklingSlots(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage); topIndex = (numOnThisPage + ObjStackFixedSlots) - 1; - for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) { - assert(isWeak(fetchPointerofObject(i1, objStackPage))); - weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + for (i = topIndex; i >= ((topIndex - numToEnumerateOnThisPage) + 1); i += -1) { + assert(isWeak(fetchPointerofObject(i, objStackPage))); + weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); /* begin nilUnmarkedWeaklingSlotsIn: */ anyUnmarked1 = 0; assert(allStrongSlotsOfWeaklingAreMarked(weakling)); - for (i = ((assert((formatOf(weakling)) == (weakArrayFormat())), -fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i <= iLimiT; i += 1) { + for (i1 = ((assert((formatOf(weakling)) == (weakArrayFormat())), +fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i1 <= iLimiT; i1 += 1) { /* begin fetchPointer:ofObject: */ - referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { if (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - referent = fixFollowedFieldofObjectwithInitialValue(i, weakling, referent); + referent = fixFollowedFieldofObjectwithInitialValue(i1, weakling, referent); } if (!((referent & (tagMask())) - || (((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0))) { assert(!(isOopForwarded(weakling))); - longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); + longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); anyUnmarked1 = 1; } @@ -54075,13 +53358,7 @@ fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakli /* fireFinalization: could grow the mournQueue and if so, additional pages must be marked to avoid being GC'ed. */ assert(GIV(marking)); - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakling); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakling); } } @@ -54207,13 +53484,9 @@ noInlineObjectAfterlimit(sqInt objOop, sqInt limit) /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -54257,7 +53530,6 @@ numBytesOfBytes(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt >= (firstByteFormat())); return ((numSlotsOf(objOop)) << (shiftForWord())) - (fmt & 7); @@ -54275,18 +53547,13 @@ numBytesOf(sqInt objOop) usqInt numBytes; usqInt numSlots; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(objOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -54320,10 +53587,10 @@ numberOfForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -54351,32 +53618,28 @@ numberOfForwarders(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -54386,8 +53649,8 @@ numberOfForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -54399,37 +53662,33 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -54440,32 +53699,28 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return n; } @@ -54486,7 +53741,6 @@ numPointerSlotsOf(sqInt objOop) usqInt numSlots; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -54497,19 +53751,18 @@ numPointerSlotsOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l4; + goto l3; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l4: /* end fetchStackPointerOf: */; + l3: /* end fetchStackPointerOf: */; return CtxtTempFrameStart + contextSize; } /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } if (fmt == 7) { @@ -54529,9 +53782,9 @@ numPointerSlotsOf(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -54548,8 +53801,7 @@ numSlotsOfAny(sqInt objOop) numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -54563,8 +53815,7 @@ numSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -54588,7 +53839,6 @@ numStrongSlotsOfInephemeral(sqInt objOop) sqInt objOop1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert((fmt != (ephemeronFormat())) || (isMarked(keyOfEphemeron(objOop)))); @@ -54596,13 +53846,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { return numSlots; } @@ -54613,11 +53859,11 @@ numStrongSlotsOfInephemeral(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l4; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l4: /* end fetchStackPointerOf: */; return CtxtTempFrameStart + contextSize; } return numSlots; @@ -54647,9 +53893,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -54710,13 +53956,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart))) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -54737,13 +53979,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((pastSpace()).start), GIV(pastSpaceStart))) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -54765,13 +54003,9 @@ objectAfter(sqInt objOop) limit = futureSurvivorStart(); /* begin addressAfter: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -54791,13 +54025,9 @@ objectAfter(sqInt objOop) } /* begin objectAfter:limit: */ numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } + numSlots4 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); @@ -54833,10 +54063,10 @@ objectBefore(sqInt objOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop1; sqInt objOop2; @@ -54859,8 +54089,8 @@ objectBefore(sqInt objOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -54873,37 +54103,33 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -54915,32 +54141,28 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return prev; } @@ -54960,32 +54182,28 @@ objectBefore(sqInt objOop) prevPrevObj1 = prevObj1; prevObj1 = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop2 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop2 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop2 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return prev; } @@ -55008,6 +54226,335 @@ objectStartingAt(sqInt address) } +/* This is part of storeImageSegmentInto:outPointers:roots:. + Answer an Array of all the objects only reachable from the argument, an + Array of root objects, + starting with arrayOfRoots. If there is no space, answer a SmallInteger + whose value is the + number of slots required. This is used to collect the objects to include + in an image segment + on Spur, separate from creating the segment, hence simplifying the + implementation. Thanks to Igor Stasenko for this idea. */ + + /* SpurMemoryManager>>#objectsReachableFromRoots: */ +static sqInt NoDbgRegParms +objectsReachableFromRoots(sqInt arrayOfRoots) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt count; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt freeChunk; + sqInt i; + sqInt i1; + sqInt iLimiT; + sqInt iLimiT1; + usqInt limit; + usqInt limit1; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots13; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + usqInt numSlots6; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oop; + sqInt oop1; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + sqInt ptr; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + usqInt slotBytes3; + sqInt start; + + assert(isArray(arrayOfRoots)); + assert(allObjectsUnmarked()); + /* begin markObjectsIn: */ + setIsMarkedOfto(arrayOfRoots, 1); + for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { + /* begin followField:ofObject: */ + objOop1 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop1); + } + oop1 = objOop1; + if ((oop1 & (tagMask())) == 0) { + setIsMarkedOfto(oop1, 1); + } + } + markObjects(0); + assert(isEmptyObjStack(GIV(markStack))); + assert(isEmptyObjStack(GIV(weaklingStack))); + assert(noUnscannedEphemerons()); + freeChunk = allocateLargestFreeChunk(); + ptr = (start = freeChunk + BaseHeaderSize); + /* begin addressAfter: */ + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + limit = (freeChunk + BaseHeaderSize) + slotBytes; + + /* First put the arrayOfRoots; order is important. */ + count = 0; + count += 1; + if (ptr < limit) { + longAtput(ptr, arrayOfRoots); + ptr += BytesPerOop; + } + for (i = 0, iLimiT = ((numSlotsOf(arrayOfRoots)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if ((oop & (tagMask())) == 0) { + pushonObjStack(oop, GIV(markStack)); + } + } + while (!(isEmptyObjStack(GIV(markStack)))) { + objOop = popObjStack(GIV(markStack)); + count += 1; + if (ptr < limit) { + longAtput(ptr, objOop); + ptr += BytesPerOop; + } + oop = fetchClassOfNonImm(objOop); + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + if ((((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((((longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(objOop))))) { + + /* widow now, before the loop */ + for (i = 0, iLimiT = ((numSlotsOfMarriedContext(objOop)) - 1); i <= iLimiT; i += 1) { + oop = fetchPointerofMarriedContext(i, objOop); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + else { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + } + /* begin unmarkAllObjects */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop11, 0); + } + else { + if (!(((longAt(objOop11)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop11, 0); + } + } + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + /* begin allNewSpaceEntitiesDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit1 = GIV(pastSpaceStart); + while (oopisLessThan(objOop2, limit1)) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots13 = byteAt(objOop2 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); + } + else { + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { + objOop2 = limit1; + goto l16; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l16: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop2 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + + /* Now try and allocate the result */ + GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); + if ((count > ((ptr - start) / BytesPerOop)) + || ((limit != ptr) + && ((limit - ptr) <= 8))) { + + /* can't split a single word */ + freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) + ? freeChunk - BaseHeaderSize + : freeChunk)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + return (((usqInt)count << 1) | 1); + } + /* begin setFormatOf:to: */ + assert(((2 >= 0) && (2 <= (formatMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (2U << (formatShift()))); + /* begin setClassIndexOf:to: */ + assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); + shortentoIndexableSize(freeChunk, count); + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { + remember(freeChunk); + } + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + runLeakCheckerFor(GCModeImageSegment); + return freeChunk; +} + + /* This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code @@ -55059,7 +54606,6 @@ okayOop(sqInt signedOop) error("oop header has overflow header word, but overflow word does not have a saturated numSlots field"); return 0; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if ((fmt == 6) || (fmt == 8)) { error("oop has an unknown format type"); @@ -55074,7 +54620,7 @@ okayOop(sqInt signedOop) error("some unused header bits are set; should be zero"); return 0; } - unusedBitsInYoungObjects = ((1U << 0x1F) | (1U << 30)) | (1U << (rememberedBitShift())); + unusedBitsInYoungObjects = ((1U << (greyBitShift())) | (1U << (pinnedBitShift()))) | (1U << (rememberedBitShift())); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { error("some header bits unused in young objects are set; should be zero"); return 0; @@ -55096,8 +54642,6 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) sqInt classIndex1; sqInt clone1; sqInt clone2; - sqInt format; - sqInt format1; sqInt hash; sqInt hash1; sqInt hash2; @@ -55131,15 +54675,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << 23))); + longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55164,15 +54707,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << 23))); + longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55215,7 +54757,6 @@ sqInt pinObject(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt format; sqInt i; sqInt oldClone; sqInt referent; @@ -55236,12 +54777,12 @@ pinObject(sqInt objOop) l1: /* end segmentContainingObj: */; if ((seg->containsPinned)) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); return objOop; } if (!(someSegmentContainsPinned())) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); (seg->containsPinned = 1); return objOop; } @@ -55250,18 +54791,17 @@ pinObject(sqInt objOop) if (oldClone != 0) { GIV(becomeEffectsFlags) = becomeEffectFlagsFor(objOop); /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 23))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -55508,10 +55048,10 @@ printActivationsOf(sqInt aMethodObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -55533,8 +55073,8 @@ printActivationsOf(sqInt aMethodObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -55556,37 +55096,33 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -55607,32 +55143,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -55660,32 +55192,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -55712,10 +55240,10 @@ printContextReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -55737,8 +55265,8 @@ printContextReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -55767,90 +55295,82 @@ printContextReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { - /* begin allocationUnit */ - slotBytes = ((sqInt) 8); - } - else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l1: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop1)); - if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { - i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); - while (((i -= 1)) >= 0) { - if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { - printHex(objOop1); - print(" @ "); - printNum(i); - /* begin space */ - putchar(' '); - printOopShort(objOop1); - print(" pc "); - printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); - /* begin cr */ - printf("\n"); - i = 0; - } - } - } - - - prevPrevObj = prevObj; - prevObj = objOop1; - /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); } else { - numSlots3 = numSlots12; + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - if (numSlots3 == 0) { + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { + i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); + while (((i -= 1)) >= 0) { + if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { + printHex(objOop1); + print(" @ "); + printNum(i); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + print(" pc "); + printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); + /* begin cr */ + printf("\n"); + i = 0; + } + } + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -55885,35 +55405,92 @@ printContextReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#printEntity: */ +void +printEntity(sqInt oop) +{ + sqInt isObj; + sqInt n; + + isObj = 0; + printHex(oop); + /* begin space */ + putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + return; + } + print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) + ? "free" + : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) + ? "bridge" + : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 + ? "forwarder" + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } + /* begin cr */ + printf("\n"); +} + /* SpurMemoryManager>>#printForwarders */ void printForwarders(void) @@ -55931,10 +55508,10 @@ printForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -55949,46 +55526,42 @@ printForwarders(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop2 = GIV(nilObj); + objOop1 = GIV(nilObj); while (1) { - assert((objOop2 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break; - assert((long64At(objOop2)) != 0); - if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop2); + assert((objOop1 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; + assert((long64At(objOop1)) != 0); + if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop1); /* begin cr */ printf("\n"); } prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop2 = GIV(endOfMemory); - goto l3; + objOop1 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -55998,90 +55571,82 @@ printForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, limit)) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop2 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; + objOop2 = limit; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l2; + objOop2 = GIV(freeStart); + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -56107,10 +55672,10 @@ printFreeChunks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -56132,8 +55697,8 @@ printFreeChunks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -56152,37 +55717,33 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -56200,32 +55761,28 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -56243,32 +55800,28 @@ printFreeChunks(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -56428,13 +55981,9 @@ printHeaderOf(sqInt objOop) print(" hdr16 slotf "); /* begin printHexnp: */ numSlots = byteAt((objOop - 8) + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n = longAt((objOop - 8) - BaseHeaderSize); - } - else { - n = numSlots; - } + n = (numSlots == (numSlotsMask()) + ? longAt((objOop - 8) - BaseHeaderSize) + : numSlots); printf("0x%lx", ((unsigned long) n)); print(" slotc "); /* begin printHexnp: */ @@ -56446,29 +55995,25 @@ printHeaderOf(sqInt objOop) print(" hdr8 slots "); /* begin printHexnp: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n1 = longAt(objOop - BaseHeaderSize); - } - else { - n1 = numSlots1; - } + n1 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); printf("0x%lx", ((unsigned long) n1)); } /* begin space */ putchar(' '); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'M' : 'm'); putchar(aByte); /* begin printChar: */ - aByte1 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte1 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'G' : 'g'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'P' : 'p'); putchar(aByte2); @@ -56478,7 +56023,7 @@ printHeaderOf(sqInt objOop) : 'r'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'I' : 'i'); putchar(aByte4); @@ -56512,7 +56057,7 @@ printHeaderTypeOf(sqInt objOop) ? " hdr16 " : " hdr8 ")); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'i' : '.'); putchar(aByte); @@ -56522,17 +56067,17 @@ printHeaderTypeOf(sqInt objOop) : '.'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'p' : '.'); putchar(aByte2); /* begin printChar: */ - aByte3 = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte3 = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'm' : '.'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'g' : '.'); putchar(aByte4); @@ -56577,10 +56122,10 @@ printInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -56609,32 +56154,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -56644,8 +56185,8 @@ printInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -56659,37 +56200,33 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -56702,32 +56239,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -56781,6 +56314,191 @@ printInvalidClassTableEntries(void) } +/* Scan the heap printing the oops of any and all methods that implement + anOop + */ + + /* SpurMemoryManager>>#printMethodImplementorsOf: */ +void +printMethodImplementorsOf(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + /* begin allObjectsDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == anOop)) { + printHex(objOop11); + /* begin space */ + putchar(' '); + printOopShort(objOop11); + /* begin cr */ + printf("\n"); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + } + + /* Scan the heap printing the oops of any and all methods that refer to anOop */ /* SpurMemoryManager>>#printMethodReferencesTo: */ @@ -56801,10 +56519,10 @@ printMethodReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -56826,15 +56544,15 @@ printMethodReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -56854,43 +56572,39 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -56910,32 +56624,28 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -56947,7 +56657,7 @@ printMethodReferencesTo(sqInt anOop) assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart) - 1; + i = ((literalCountOf(objOop11)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -56968,32 +56678,28 @@ printMethodReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -57040,10 +56746,10 @@ printObjectsWithHash(sqInt hash) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -57072,32 +56778,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -57107,8 +56809,8 @@ printObjectsWithHash(sqInt hash) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -57122,37 +56824,33 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -57165,32 +56863,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -57277,7 +56971,7 @@ printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType) printNum(longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackMyx) << (shiftForWord())))))); print(" ("); printNum(myx); - print((((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0 + print((((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0 ? ") mkd" : ") unmkd")); /* begin cr */ @@ -57302,7 +56996,9 @@ printObjStack(sqInt objStack) void printOopsFromto(sqInt startAddress, sqInt endAddress) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt isObj; sqInt limit; + sqInt n; sqInt oop; oop = objectBefore(startAddress); @@ -57313,20 +57009,60 @@ printOopsFromto(sqInt startAddress, sqInt endAddress) ? startAddress : oop)); while (oopisLessThan(oop, limit)) { + /* begin printEntity: */ + isObj = 0; printHex(oop); - print("/"); - printNum(oop); /* begin space */ putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + goto l1; + } print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) ? "free" : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) ? "bridge" : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 ? "forwarder" - : "object")))); + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } /* begin cr */ printf("\n"); + l1: /* end printEntity: */; oop = objectAfter(oop); } } @@ -57357,11 +57093,11 @@ printReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -57384,8 +57120,8 @@ printReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -57413,13 +57149,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); goto l20; } if (fmt == 7) { @@ -57441,9 +57173,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l20: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57464,37 +57196,33 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l12; + goto l15; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l12: /* end objectAfter:limit: */; + l15: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -57521,13 +57249,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); goto l22; } if (fmt == 7) { @@ -57549,9 +57273,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l22: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57572,32 +57296,28 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l15; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l15: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -57630,13 +57350,9 @@ printReferencesTo(sqInt anOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); goto l24; } if (fmt == 7) { @@ -57658,9 +57374,9 @@ printReferencesTo(sqInt anOop) assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); header = ((((CogMethod *) header1))->methodHeader); } + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; l24: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { @@ -57682,14 +57398,10 @@ printReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -57700,14 +57412,14 @@ printReferencesTo(sqInt anOop) followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l17; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l17: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -57800,46 +57512,6 @@ rawHashBitsOf(sqInt objOop) } -/* Scavenge or simply follow objOop. Answer the new location of objOop. - The send should have been guarded by a send of shouldRemapOop:. - The method is called remapObj: for compatibility with ObjectMemory. */ - - /* SpurMemoryManager>>#remapObj: */ -sqInt -remapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt referent; - sqInt resolvedObj; - - assert(shouldRemapOop(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(objOop)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - resolvedObj = referent; - } - else { - assert(!((isInFutureSpace(objOop)))); - resolvedObj = objOop; - } - if (GIV(scavengeInProgress) - && ((((resolvedObj & (tagMask())) == 0) - && ((assert(isNonImmediate(resolvedObj)), - (oopisLessThan(resolvedObj, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(resolvedObj, GIV(newSpaceStart)))))) - && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { - return copyAndForward(resolvedObj); - } - return resolvedObj; -} - - /* Remove the given variable location to the extra roots table. */ /* SpurMemoryManager>>#removeGCRoot: */ @@ -57911,7 +57583,7 @@ runLeakCheckerForFreeSpace(sqInt gcModes) static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -57921,18 +57593,18 @@ runLeakCheckerFor(sqInt gcModes) } clearLeakMapAndMapAccessibleObjects(); asserta(checkHeapIntegrityclassIndicesShouldBeValid(0, 1)); - asserta(checkInterpreterIntegrity()); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } return; } - /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ static void NoDbgRegParms -runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -57941,8 +57613,8 @@ runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcMo reverseDisplayFromto(8, 15); } clearLeakMapAndMapAccessibleObjects(); - asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedNewSpaceObjs, classIndicesShouldBeValid)); - asserta(checkInterpreterIntegrity()); + asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedObjs, classIndicesShouldBeValid)); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } @@ -58142,7 +57814,6 @@ shortentoIndexableSize(sqInt objOop, sqInt indexableSize) } bytesBefore = bytesInObject(objOop); if ((byteAt(objOop + 7)) == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ longAtput(objOop - BaseHeaderSize, numSlots); } else { @@ -58200,26 +57871,6 @@ shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress) } -/* Answer if the obj should be scavenged (or simply followed). The method is - called shouldRemapObj: for compatibility with ObjectMemory. We test for - being already - scavenged because mapStackPages via mapInterpreterOops may be applied - twice in the context of a global GC where a scavenge, followed by a - scan-mark-free, and - final compaction passes may result in scvenged fields being visited twice. */ - - /* SpurMemoryManager>>#shouldRemapObj: */ -sqInt -shouldRemapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) - || (((assert(isNonImmediate(objOop)), - (oopisLessThan(objOop, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart))))) - && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); -} - - /* Answer if the oop should be scavenged.. The method is called shouldRemapOop: for compatibility with ObjectMemory. */ @@ -58280,13 +57931,9 @@ slotSizeOf(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -58378,35 +58025,18 @@ storeCheckBoundary(void) static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt address; - sqInt address1; sqInt arrayOfObjects; sqInt classIndex; sqInt classIndex1; - sqInt count; usqInt endSeg; sqInt fillValue; - sqInt followingWord; - sqInt followingWord1; - sqInt followingWord2; - usqInt followingWordAddress; - usqInt followingWordAddress1; - usqInt followingWordAddress2; - sqInt format; sqInt formatField; sqInt formatField1; - sqInt freeChunk; sqInt hash; sqInt here; sqInt hereLimiT; sqInt i; - sqInt i1; - sqInt i2; sqInt iLimiT; - sqInt iLimiT1; - sqInt iLimiT2; - usqInt limit; - usqInt limit1; usqInt newObj; usqInt newObj1; sqInt newSegAddrOrError; @@ -58417,360 +58047,46 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr sqInt numSlots; sqInt numSlots1; usqInt numSlots11; - usqInt numSlots111; - usqInt numSlots12; - usqInt numSlots121; - usqInt numSlots13; - usqInt numSlots14; - sqInt numSlots2; - usqInt numSlots21; + usqInt numSlots2; sqInt numSlots3; - usqInt numSlots31; - usqInt numSlots4; - usqInt numSlots41; + sqInt numSlots4; usqInt numSlots5; usqInt numSlots6; - usqInt numSlots7; - usqInt numSlots8; - sqInt obj; sqInt objOop; sqInt objOop1; - sqInt objOop11; - sqInt objOop12; - sqInt objOop2; - sqInt objOop3; - sqInt oop; - sqInt oop1; sqInt outIndex; usqInt p; usqInt p1; - sqInt prevObj; - sqInt prevObj1; - sqInt prevPrevObj; - sqInt prevPrevObj1; - sqInt ptr; sqInt savedInHashes; sqInt savedOutHashes; sqInt segAddr; sqInt segStart; usqInt slotBytes; - usqInt slotBytes1; - usqInt slotBytes11; - usqInt slotBytes2; - usqInt slotBytes3; - sqInt start; sqInt tempObjOop; sqInt there; sqInt valueWord; runLeakCheckerFor(GCModeImageSegment); - /* begin objectsReachableFromRoots: */ - assert(isArray(arrayOfRoots)); - assert(allObjectsUnmarked()); - /* begin markObjectsIn: */ - setIsMarkedOfto(arrayOfRoots, 1); - for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { - /* begin followField:ofObject: */ - objOop11 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop11); - } - oop1 = objOop11; - if ((oop1 & (tagMask())) == 0) { - setIsMarkedOfto(oop1, 1); - } - } - markObjects(0); - assert(isEmptyObjStack(GIV(markStack))); - assert(isEmptyObjStack(GIV(weaklingStack))); - assert(noUnscannedEphemerons()); - freeChunk = allocateLargestFreeChunk(); - ptr = (start = freeChunk + BaseHeaderSize); - /* begin addressAfter: */ - numSlots12 = byteAt(freeChunk + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots7 = numSlots12; - } - if (numSlots7 == 0) { - /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); - } - else { - slotBytes1 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); - } - limit = (freeChunk + BaseHeaderSize) + slotBytes1; - - /* First put the arrayOfRoots; order is important. */ - count = 0; - count += 1; - if (ptr < limit) { - longAtput(ptr, arrayOfRoots); - ptr += BytesPerOop; - } - for (i2 = 0, iLimiT2 = ((numSlotsOf(arrayOfRoots)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if ((oop & (tagMask())) == 0) { - pushonObjStack(oop, GIV(markStack)); - } - } - while (!(isEmptyObjStack(GIV(markStack)))) { - objOop2 = popObjStack(GIV(markStack)); - count += 1; - if (ptr < limit) { - longAtput(ptr, objOop2); - ptr += BytesPerOop; - } - oop = fetchClassOfNonImm(objOop2); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - if ((((longAt(objOop2)) & (classIndexMask())) == ClassMethodContextCompactIndex) - && ((((longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) - && (!(isWidowedContext(objOop2))))) { - - /* widow now, before the loop */ - for (i2 = 0, iLimiT2 = ((numSlotsOfMarriedContext(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - oop = fetchPointerofMarriedContext(i2, objOop2); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - else { - for (i2 = 0, iLimiT2 = ((numPointerSlotsOf(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - } - /* begin unmarkAllObjects */ - assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); - while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (((((usqInt) (longAt(objOop12 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop12)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop12, 0); - } - else { - if (!(((longAt(objOop12)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop12, 0); - } - } - } - - prevPrevObj1 = prevObj1; - prevObj1 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l30; - } - flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l30: /* end objectAfter:limit: */; - } - /* begin allNewSpaceEntitiesDo: */ - - /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are - in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ - prevPrevObj = (prevObj = null); - assert((((pastSpace()).start)) < (((eden()).start))); - /* begin objectStartingAt: */ - address = ((pastSpace()).start); - numSlots8 = byteAt(address + 7); - objOop3 = (numSlots8 == (numSlotsMask()) - ? address + BaseHeaderSize - : address); - limit1 = GIV(pastSpaceStart); - while (oopisLessThan(objOop3, limit1)) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop3 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { - /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); - } - else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop3 + BaseHeaderSize) + slotBytes11; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { - objOop3 = limit1; - goto l26; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop3 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l26: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop3 = (numSlots14 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop3, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop3 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots41 = numSlots13; - } - if (numSlots41 == 0) { - /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); - } - else { - slotBytes2 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); - } - followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop3 = GIV(freeStart); - goto l35; - } - flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l35: /* end objectAfter:limit: */; - } - - /* Now try and allocate the result */ - GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); - if ((count > ((ptr - start) / BytesPerOop)) - || ((limit != ptr) - && ((limit - ptr) <= 8))) { - - /* can't split a single word */ - freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) - ? freeChunk - BaseHeaderSize - : freeChunk)); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - arrayOfObjects = (((usqInt)count << 1) | 1); - goto l23; - } - /* begin setFormatOf:to: */ - format = 2; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin setClassIndexOf:to: */ - assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); - shortentoIndexableSize(freeChunk, count); - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { - remember(freeChunk); - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - runLeakCheckerFor(GCModeImageSegment); - arrayOfObjects = freeChunk; -l23: /* end objectsReachableFromRoots: */; + arrayOfObjects = objectsReachableFromRoots(arrayOfRoots); if (!(arrayOfObjects)) { return PrimErrNoMemory; } assert(allObjectsUnmarked()); /* begin allocateSlots:format:classIndex: */ numBytes2 = (numSlotsOf(arrayOfObjects)) * 4; - numSlots2 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; + numSlots3 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; formatField = firstLongFormat(); classIndex = thirtyTwoBitLongsClassIndexPun(); - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots2 + (numSlots2 & 1)) * BytesPerOop); + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots2 <= 1 + numBytes = BaseHeaderSize + ((numSlots3 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots2 + (numSlots2 & 1)) * BytesPerOop)); + : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -58778,40 +58094,40 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots2, numBytes, formatField, classIndex); - goto l6; + savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes, formatField, classIndex); + goto l9; } - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots2); + longAtput(GIV(freeStart), numSlots3); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); } else { - long64Atput(newObj, (((((usqLong) numSlots2)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + long64Atput(newObj, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); } assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; savedInHashes = newObj; -l6: /* end allocateSlots:format:classIndex: */; +l9: /* end allocateSlots:format:classIndex: */; /* begin allocateSlots:format:classIndex: */ numBytes3 = (numSlotsOf(outPointerArray)) * 4; - numSlots3 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; + numSlots4 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; formatField1 = firstLongFormat(); classIndex1 = thirtyTwoBitLongsClassIndexPun(); - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { newObj1 = GIV(freeStart) + BaseHeaderSize; - numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots4 + (numSlots4 & 1)) * BytesPerOop); } else { newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + ((numSlots3 <= 1 + numBytes1 = BaseHeaderSize + ((numSlots4 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); + : (numSlots4 + (numSlots4 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -58819,25 +58135,25 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes1, formatField1, classIndex1); - goto l8; + savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots4, numBytes1, formatField1, classIndex1); + goto l11; } - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots3); + longAtput(GIV(freeStart), numSlots4); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), formatField1, classIndex1)); } else { - long64Atput(newObj1, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); + long64Atput(newObj1, (((((usqLong) numSlots4)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); } assert((numBytes1 % (allocationUnit())) == 0); assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; savedOutHashes = newObj1; -l8: /* end allocateSlots:format:classIndex: */; +l11: /* end allocateSlots:format:classIndex: */; if ((savedInHashes == null) || (savedOutHashes == null)) { freeObject(arrayOfObjects); @@ -58846,14 +58162,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr fillValue = (identityHashHalfWordMask()) + 1; /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedInHashes)) > (isForwardedObjectClassIndexPun())); - numSlots4 = byteAt(savedInHashes + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(savedInHashes - BaseHeaderSize); - } - else { - numSlots = numSlots4; - } + numSlots5 = byteAt(savedInHashes + 7); + numSlots = (numSlots5 == (numSlotsMask()) + ? longAt(savedInHashes - BaseHeaderSize) + : numSlots5); assert(oopisLessThan(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(savedInHashes))); for (p = (((usqInt)(savedInHashes + BaseHeaderSize))); p <= (((usqInt)(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { longAtput(p, fillValue); @@ -58861,14 +58173,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr } /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedOutHashes)) > (isForwardedObjectClassIndexPun())); - numSlots5 = byteAt(savedOutHashes + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(savedOutHashes - BaseHeaderSize); - } - else { - numSlots1 = numSlots5; - } + numSlots6 = byteAt(savedOutHashes + 7); + numSlots1 = (numSlots6 == (numSlotsMask()) + ? longAt(savedOutHashes - BaseHeaderSize) + : numSlots6); assert(oopisLessThan(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(savedOutHashes))); for (p1 = (((usqInt)(savedOutHashes + BaseHeaderSize))); p1 <= (((usqInt)(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p1 += 8) { longAtput(p1, fillValue); @@ -58907,19 +58215,15 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr segAddr = segmentWordArray + BaseHeaderSize; /* begin addressAfter: */ numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots6 = numSlots11; - } - if (numSlots6 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } endSeg = (segmentWordArray + BaseHeaderSize) + slotBytes; if (segAddr >= endSeg) { @@ -59439,7 +58743,7 @@ unpinObject(sqInt objOop) { assert(isNonImmediate(objOop)); /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 30))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (pinnedBitShift())))); return 0; } @@ -59638,13 +58942,9 @@ checkTraversableSortedFreeList(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -59655,14 +58955,14 @@ checkTraversableSortedFreeList(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } assert(prevFree == GIV(lastFreeChunk)); assert((nextInSortedFreeListLinkgiven(GIV(lastFreeChunk), 0)) == prevPrevFree); @@ -59677,7 +58977,7 @@ checkTraversableSortedFreeList(void) /* for profiling */ /* SpurPigCompactor>>#compact */ -static sqInt NeverInline +static void NeverInline compact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; @@ -59692,6 +58992,7 @@ compact(void) usqInt scanAddress; usqInt slotBytes; + freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); /* begin statCompactPassCount: */ anInteger = GIV(statCompactPassCount) + 1; GIV(statCompactPassCount) = anInteger; @@ -59705,18 +59006,15 @@ compact(void) while (free != 0) { high = (prevFree == 0 ? (endOfMemory()) - (2 * BaseHeaderSize) - : ((byteAt(prevFree + 7)) == (numSlotsMask()) - ? prevFree - BaseHeaderSize - : prevFree)); + : (/* begin startOfObject: */ + ((byteAt(prevFree + 7)) == (numSlotsMask()) + ? prevFree - BaseHeaderSize + : prevFree))); /* begin addressAfter: */ numSlots1 = byteAt(free + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(free - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(free - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -59728,7 +59026,7 @@ compact(void) while (oopisLessThan(scanAddress, high)) { scanAddress = moveARunOfObjectsStartingAtupTo(scanAddress, high); if (scanAddress == 0) { - goto l2; + goto l6; } } @@ -59753,12 +59051,11 @@ compact(void) } } assert(checkTraversableSortedFreeList()); - l2: /* end pigCompact */; + l6: /* end pigCompact */; eliminateAndFreeForwardersForPigCompact(); } assert(freeListHeadsEmpty()); rebuildFreeListsForPigCompact(); - return 0; } @@ -59766,7 +59063,7 @@ compact(void) forwarders, then free forwarders, coalescing with free space as we go. */ /* SpurPigCompactor>>#eliminateAndFreeForwardersForPigCompact */ -static sqInt +static void eliminateAndFreeForwardersForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; @@ -59891,50 +59188,46 @@ eliminateAndFreeForwardersForPigCompact(void) index += 1; } } - /* begin unmarkSurvivingObjectsForPigCompact */ - prevPrevObj1 = (prevObj1 = null); + /* begin unmarkSurvivingObjectsForCompact */ + prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots3 = byteAt(address + 7); - objOop2 = (numSlots3 == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop1 = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); - while (oopisLessThan(objOop2, GIV(pastSpaceStart))) { - assert(isEnumerableObjectNoAssert(objOop2)); - if (((((usqInt) (longAt(objOop2 + 4))) >> 23) & 1) != 0) { - setIsMarkedOfto(objOop2, 0); + while (oopisLessThan(objOop1, GIV(pastSpaceStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + setIsMarkedOfto(objOop1, 0); } - prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevPrevObj = prevObj; + prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { - objOop2 = GIV(pastSpaceStart); - goto l18; + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(pastSpaceStart))) { + objOop1 = GIV(pastSpaceStart); + goto l4; } flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l18: /* end objectAfter:limit: */; + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; } /* begin sweepToFollowForwardersForPigCompact */ assert(((freeStart()) == (((eden()).start))) @@ -59943,8 +59236,8 @@ eliminateAndFreeForwardersForPigCompact(void) prevPrevObj2 = (prevObj2 = null); /* begin objectStartingAt: */ address1 = ((pastSpace()).start); - numSlots4 = byteAt(address1 + 7); - objOop12 = (numSlots4 == (numSlotsMask()) + numSlots21 = byteAt(address1 + 7); + objOop12 = (numSlots21 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop12, GIV(pastSpaceStart))) { @@ -59977,31 +59270,27 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj2 = objOop12; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop12 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots12; - } - if (numSlots21 == 0) { + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots12); + if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(pastSpaceStart))) { objOop12 = GIV(pastSpaceStart); - goto l31; + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l31: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } lowestForwarder1 = 0; /* begin allOldSpaceObjectsDo: */ @@ -60059,13 +59348,9 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj11 = objOop11; /* begin objectAfter:limit: */ numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots31 = numSlots111; - } + numSlots31 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots111); if (numSlots31 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); @@ -60076,14 +59361,14 @@ eliminateAndFreeForwardersForPigCompact(void) followingWordAddress11 = (objOop11 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l38; + goto l37; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop11 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l38: /* end objectAfter:limit: */; + l37: /* end objectAfter:limit: */; } lowestForwarder = lowestForwarder1; /* begin sweepToCoallesceFreeSpaceForPigCompactFrom: */ @@ -60099,28 +59384,29 @@ eliminateAndFreeForwardersForPigCompact(void) firstOfFreeRun = (prevPrevFree = (prevFree = 0)); /* begin allOldSpaceEntitiesFrom:do: */ assert(isOldObject(lowest)); - prevPrevObj = (prevObj = null); - objOop = lowest; + prevPrevObj1 = (prevObj1 = null); + objOop3 = lowest; while (1) { - assert((objOop % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; - assert((long64At(objOop)) != 0); - if ((((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) - || (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + assert((objOop3 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; + assert((long64At(objOop3)) != 0); + if ((((longAt(objOop3)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) + || (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { if (firstOfFreeRun == 0) { /* begin setObjectFree: */ - if ((byteAt(objOop + 7)) == 0) { + if ((byteAt(objOop3 + 7)) == 0) { /* begin rawNumSlotsOf:put: */ - byteAtput(objOop + 7, 1); + byteAtput(objOop3 + 7, 1); } /* begin setFree: */ - long32Atput(objOop, 0); - firstOfFreeRun = objOop; - startOfFreeRun = ((byteAt(objOop + 7)) == (numSlotsMask()) - ? objOop - BaseHeaderSize - : objOop); + long32Atput(objOop3, 0); + firstOfFreeRun = objOop3; + /* begin startOfObject: */ + startOfFreeRun = ((byteAt(objOop3 + 7)) == (numSlotsMask()) + ? objOop3 - BaseHeaderSize + : objOop3); } - endOfFreeRun = objOop; + endOfFreeRun = objOop3; } else { if (firstOfFreeRun != 0) { @@ -60132,9 +59418,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex1 = 0; + fieldIndex = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -60142,35 +59428,31 @@ eliminateAndFreeForwardersForPigCompact(void) } } - prevPrevObj = prevObj; - prevObj = objOop; + prevPrevObj1 = prevObj1; + prevObj1 = objOop3; /* begin objectAfter:limit: */ - numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - if (numSlots == 0) { + numSlots11 = byteAt(objOop3 + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop3 - BaseHeaderSize) + : numSlots11); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { - objOop = GIV(endOfMemory); - goto l7; + followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { + objOop3 = GIV(endOfMemory); + goto l15; } flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l7: /* end objectAfter:limit: */; + followingWord1 = longAt(followingWordAddress1 + 4); + objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l15: /* end objectAfter:limit: */; } if (firstOfFreeRun != 0) { bytes = (addressAfter(endOfFreeRun)) - startOfFreeRun; @@ -60181,9 +59463,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex2 = 0; + fieldIndex1 = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -60191,11 +59473,11 @@ eliminateAndFreeForwardersForPigCompact(void) } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ - fieldIndex = 0; + fieldIndex2 = 0; assert(isFreeObject(prevFree)); assert((prevPrevFree == 0) || (isFreeObject(prevPrevFree))); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree); } GIV(lastFreeChunk) = prevFree; /* begin inSortedFreeListLink:to:given: */ @@ -60210,7 +59492,6 @@ eliminateAndFreeForwardersForPigCompact(void) } assert(checkTraversableSortedFreeList()); assert((numberOfForwarders()) == 0); - return 0; } @@ -60230,7 +59511,7 @@ eliminateAndFreeForwardersForPigCompact(void) */ /* SpurPigCompactor>>#freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact */ -static sqInt NeverInline +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt fieldIndex; @@ -60247,20 +59528,16 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) sqInt here; sqInt here1; sqInt i; - sqInt i1; sqInt iLimiT; - sqInt index; usqInt newNumSlots; sqInt next; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt o; - sqInt obj; usqInt obj2slots; sqInt objOop; sqInt prevFree; @@ -60272,7 +59549,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; - sqInt sweepIndex; /* for profiling */ @@ -60282,30 +59558,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - /* begin forgetUnmarkedRememberedObjects */ - index = 0; - while (index < GIV(rememberedSetSize)) { - obj = GIV(rememberedSet)[index]; - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { - index += 1; - } - else { - - /* unmarked; remove by overwriting with last element. */ - /* begin setIsRememberedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - assert(GIV(rememberedSetSize) >= 0); - doScavenge(MarkOnTenure); - /* begin prepareForGlobalSweep */ - sweepIndex = 0; - for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { - ((GIV(segments)[i1]).containsPinned = 0); - } - setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); /* begin resetFreeListHeads */ for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { GIV(freeLists)[i] = 0; @@ -60321,22 +59573,22 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) rawNumSlots = byteAt(objOop + 7); assert((GIV(firstFreeChunk) == 0) || (isFreeObject(GIV(firstFreeChunk)))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { /* forwarders should have been followed in markAndTrace: */ assert(!(isForwarded(objOop))); setIsMarkedOfto(objOop, 0); - if (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) { /* begin notePinned: */ assert(isPinned(objOop)); if (((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun())) { setIsMarkedOfto(objOop, 1); } else { - while (((((GIV(segments)[sweepIndex]).segSize)) + (((GIV(segments)[sweepIndex]).segStart))) < objOop) { - sweepIndex += 1; + while (((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart))) < objOop) { + GIV(sweepIndex) += 1; } - ((GIV(segments)[sweepIndex]).containsPinned = 1); + ((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1); } } } @@ -60350,32 +59602,28 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) assert(isMarked(lastBridge())); /* begin objectAfter:limit: */ numSlots11 = byteAt(here1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (here1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); next = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; - while (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) { + l21: /* end objectAfter:limit: */; + while (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* coalescing; rare case */ assert(!(isRemembered(next))); @@ -60393,11 +59641,9 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) obj2slots += obj2slots & 1; assert((obj2slots * BytesPerWord) == (bytesInObject(next))); if (header1NumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ - numSlots = obj2slots + (longAt(here1 - BaseHeaderSize)); - longAtput(here1 - BaseHeaderSize, numSlots); + longAtput(here1 - BaseHeaderSize, obj2slots + (longAt(here1 - BaseHeaderSize))); here1 = here1; - goto l21; + goto l20; } header1NumSlots = (header1NumSlots == 0 ? 2 @@ -60409,7 +59655,7 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (newNumSlots < (numSlotsMask())) { byteAtput(here1 + 7, newNumSlots); here1 = here1; - goto l21; + goto l20; } newNumSlots -= BaseHeaderSize / BytesPerWord; longAtput(here1 + BaseHeaderSize, longAt(here1)); @@ -60417,34 +59663,30 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput(here1, newNumSlots); longAtput(here1 + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); here1 += BaseHeaderSize; - l21: /* end coalesce:and: */; + l20: /* end coalesce:and: */; /* begin objectAfter:limit: */ numSlots1 = byteAt(here1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (here1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l22; + goto l19; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); next = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l22: /* end objectAfter:limit: */; + l19: /* end objectAfter:limit: */; } here = here1; /* begin setObjectFree: */ @@ -60479,31 +59721,27 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); + if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l6; + goto l16; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ @@ -60525,7 +59763,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput((GIV(lastFreeChunk) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ 0); } assert(checkTraversableSortedFreeList()); - return 0; } @@ -60566,8 +59803,6 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) sqInt fieldIndex4; sqInt fieldIndex41; sqInt fieldIndex5; - sqInt format; - sqInt format1; usqInt freeBytes; usqInt freeChunk; usqInt here; @@ -60616,17 +59851,13 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (thisFreeChunk != 0) { /* skip any initial immobile objects */ - while (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + while (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { /* begin addressAfter: */ numSlots11 = byteAt(hereObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots11; - } + numSlots4 = (numSlots11 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots11); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -60652,6 +59883,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) && (isFreeObject(thisFreeChunk))); freeBytes = bytesInObject(thisFreeChunk); nextFree = ((usqInt)((longAt((thisFreeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFreeChunk)); + /* begin startOfObject: */ destination = ((byteAt(thisFreeChunk + 7)) == (numSlotsMask()) ? thisFreeChunk - BaseHeaderSize : thisFreeChunk); @@ -60663,13 +59895,9 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (1) { /* begin addressAfter: */ numSlots12 = byteAt(hereObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots5 = numSlots12; - } + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -60678,7 +59906,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) slotBytes1 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } there = (hereObj + BaseHeaderSize) + slotBytes1; - if (!(((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!(((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun()))) && ((freeBytes > ((there - here) + 8)) || (freeBytes == (there - here))))) break; @@ -60693,11 +59921,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); destination += there - here; freeBytes -= there - here; /* begin objectStartingAt: */ @@ -60790,7 +60017,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) prevFreeChunk = thisFreeChunk; thisFreeChunk = nextFree; } - if (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { return (maxFreeChunk >= startAddress ? 0 @@ -60806,6 +60033,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while ((freeChunk != 0) && (freeChunk < hereObj)) { next = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + /* begin startOfObject: */ dest = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); @@ -60824,11 +60052,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); if (next != 0) { nextNext = ((usqInt)((longAt((next + BaseHeaderSize) + (0U << (shiftForWord())))) ^ freeChunk)); } @@ -60894,14 +60121,14 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } } usedChunk = freeChunk; - goto l25; + goto l27; } prevPrevFree = prevFree; prevFree = freeChunk; freeChunk = next; } usedChunk = 0; - l25: /* end tryToMovePig:at:end: */; + l27: /* end tryToMovePig:at:end: */; /* begin objectStartingAt: */ numSlots2 = byteAt(there + 7); hereObj = (numSlots2 == (numSlotsMask()) @@ -60931,10 +60158,59 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } +/* Answer the next free free chunk using the xor trick to use only one field, + see e.g. + The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 + `Circular Lists', exercise. 18 + http://en.wikipedia.org/wiki/XOR_linked_list. */ + + /* SpurPigCompactor>>#nextInSortedFreeListLink:given: */ +static usqInt NoDbgRegParms +nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) +{ + return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); +} + + /* SpurPigCompactor>>#printSortedFreeList */ +void +printSortedFreeList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt freeChunk; + usqInt nextFree; + sqInt prevFree; + + if (!((GIV(firstFreeChunk) > 0) + && (GIV(lastFreeChunk) > GIV(firstFreeChunk)))) { + print("sorted free list empty or corrupt"); + /* begin cr */ + printf("\n"); + return; + } + freeChunk = GIV(firstFreeChunk); + prevFree = 0; + while (1) { + if (!((addressCouldBeObj(freeChunk)) + && (((longAt(freeChunk)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) freeChunk)); + print(" is not a free chunk!"); + /* begin cr */ + printf("\n"); + return; + } + printFreeChunkprintAsTreeNode(freeChunk, 0); + if (!(freeChunk != GIV(lastFreeChunk))) break; + nextFree = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + prevFree = freeChunk; + freeChunk = nextFree; + } +} + + /* Rebuild the free lists from the doubly-linked free list. */ /* SpurPigCompactor>>#rebuildFreeListsForPigCompact */ -static sqInt +static void rebuildFreeListsForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt bytes; @@ -60960,6 +60236,7 @@ rebuildFreeListsForPigCompact(void) assert((prevFree == 0) || (prevFree < free)); bytes = bytesInObject(free); + /* begin startOfObject: */ start = ((byteAt(free + 7)) == (numSlotsMask()) ? free - BaseHeaderSize : free); @@ -60977,7 +60254,66 @@ rebuildFreeListsForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - return 0; +} + + +/* Scavenge or simply follow objOop. Answer the new location of objOop. + The send should have been guarded by a send of shouldRemapOop:. + The method is called remapObj: for compatibility with ObjectMemory. */ + + /* SpurPigCompactor>>#remapObj: */ +sqInt +remapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt referent; + sqInt resolvedObj; + + /* begin vanillaRemapObj: */ + assert(shouldRemapOop(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(objOop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + resolvedObj = referent; + } + else { + assert(!((isInFutureSpace(objOop)))); + resolvedObj = objOop; + } + if ((GIV(gcPhaseInProgress) == ScavengeInProgress) + && ((((resolvedObj & (tagMask())) == 0) + && ((assert(isNonImmediate(resolvedObj)), + (oopisLessThan(resolvedObj, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(resolvedObj, GIV(newSpaceStart)))))) + && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { + return copyAndForward(resolvedObj); + } + return resolvedObj; +} + + +/* Answer if the obj should be scavenged (or simply followed). The method is + called shouldRemapObj: for compatibility with ObjectMemory. Defer to the + compactor to choose the actual test, there being a difference between the + vanilla test and + that used with a sliding compactor where objects are not marked as + forwarded. */ + + /* SpurPigCompactor>>#shouldRemapObj: */ +sqInt +shouldRemapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(objOop)), + (oopisLessThan(objOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); } /* SpurSegmentInfo>>#segLimit */ @@ -61075,19 +60411,22 @@ static sqInt allBridgesMarked(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; + SpurSegmentInfo *aSegment; sqInt bridgeObj; sqInt i; usqInt numSlots; for (i = 0; i < GIV(numSegments); i += 1) { + /* begin bridgeFor: */ + aSegment = ((SpurSegmentInfo *) ((&(GIV(segments)[i])))); /* begin objectStartingAt: */ - address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * BaseHeaderSize); + address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize); numSlots = byteAt(address + 7); bridgeObj = (numSlots == (numSlotsMask()) ? address + BaseHeaderSize : address); assert(isValidSegmentBridge(bridgeObj)); - if (!(((((usqInt) (longAt(bridgeObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(bridgeObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -61159,7 +60498,6 @@ bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil) sqInt clifton; usqInt segEnd; - /* begin segLimit */ segEnd = ((aSegment->segSize)) + ((aSegment->segStart)); /* clifton is where the Avon bridge begins... */ @@ -61339,7 +60677,7 @@ nextNonEmptySegmentAfter(sqInt i) static void postSnapshot(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - usqInt address; + sqInt address; sqInt bytes; usqInt freeChunk; sqInt i; @@ -61423,7 +60761,7 @@ prepareForSnapshot(void) /* begin freeTreeNodesDo: */ treeNode = GIV(freeLists)[0]; if (treeNode == 0) { - goto l7; + goto l5; } cameFrom = -1; do { @@ -61451,13 +60789,9 @@ prepareForSnapshot(void) limit = endOfMemory(); /* begin addressAfter: */ numSlots1 = byteAt(node + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(node - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(node - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -61514,7 +60848,7 @@ prepareForSnapshot(void) cameFrom = -1; } } while(treeNode != 0); -l7: /* end freeTreeNodesDo: */; +l5: /* end freeTreeNodesDo: */; for (i = 0; i < GIV(numSegments); i += 1) { freeChunk = ((GIV(segments)[i]).lastFreeObject); if (!(freeChunk == null)) { @@ -61628,14 +60962,14 @@ shrinkObjectMemory(usqInt delta) SpurSegmentInfo *segInfo; usqInt shrinkage; - i2 = 0; + i = 0; shrinkage = delta; while (1) { /* begin findEmptySegNearestInSizeTo: */ best = null; delta1 = shrinkage; - for (i = 0; i < GIV(numSegments); i += 1) { - seg = (&(GIV(segments)[i])); + for (i2 = 0; i2 < GIV(numSegments); i2 += 1) { + seg = (&(GIV(segments)[i2])); if (isEmptySegment(seg)) { if (best == null) { best = seg; @@ -61659,20 +60993,20 @@ shrinkObjectMemory(usqInt delta) /* begin removeSegment: */ for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { if (((emptySeg->segStart)) == (((GIV(segments)[i1]).segStart))) { - i2 = i1; - goto l2; + i = i1; + goto l1; } } error("segment not found"); - l2: /* end indexOfSegment: */; - assert(i2 > 0); + l1: /* end indexOfSegment: */; + assert(i > 0); sqDeallocateMemorySegmentAtOfSize(((void *)((emptySeg->segStart))), (emptySeg->segSize)); - for (j = i2; j < GIV(numSegments); j += 1) { + for (j = i; j < GIV(numSegments); j += 1) { GIV(segments)[j] = (GIV(segments)[j + 1]); } GIV(numSegments) -= 1; - bridgeFromto((&(GIV(segments)[i2 - 1])), (i2 <= (GIV(numSegments) - 1) - ? (&(GIV(segments)[i2])) + bridgeFromto((&(GIV(segments)[i - 1])), (i <= (GIV(numSegments) - 1) + ? (&(GIV(segments)[i])) : 0)); /* begin setLastSegment: */ segInfo = ((SpurSegmentInfo *) ((&(GIV(segments)[GIV(numSegments) - 1])))); @@ -61762,8 +61096,8 @@ writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSeg { usqLong firstSavedBridgeWord; sqInt nWritten; - usqInt pier1; - usqInt pier2; + sqInt pier1; + sqInt pier2; usqLong secondSavedBridgeWord; pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize); @@ -61935,6 +61269,7 @@ addNewMethodToNSCache(sqInt rule) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -62055,7 +61390,7 @@ void * arrayValueOf(sqInt arrayOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -62072,7 +61407,7 @@ arrayValueOf(sqInt arrayOop) static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if (isCharacterObject(characterObj)) { + if ((characterObj & (tagMask())) == (characterTag())) { return (/* begin integerObjectOfCharacterObject: */ ((usqInt) (((usqInt) characterObj))) >> 1); } @@ -62197,8 +61532,7 @@ canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader) sqInt characterForAscii(sqInt ascii) { - return (/* begin characterObjectOf: */ - (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag())); + return (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag()); } @@ -62221,10 +61555,10 @@ checkAllAccessibleObjectsOkay(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -62248,8 +61582,8 @@ checkAllAccessibleObjectsOkay(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -62261,37 +61595,33 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -62302,32 +61632,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -62345,32 +61671,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return ok; } @@ -62629,58 +61951,58 @@ checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset) /* Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccessibleObjects has set a bit at each object's header. Check that all oops in the interpreter's state - points to a header. Answer if all checks pass. */ + points to a header. Answer 0 if all checks pass. */ /* StackInterpreter>>#checkInterpreterIntegrity */ static sqInt checkInterpreterIntegrity(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt flags; sqInt i; - sqInt ok; - ok = 1; + flags = 0; if (!(checkOopIntegritynamed(GIV(specialObjectsOop), "specialObjectsOop"))) { - ok = 0; + flags = 1; } if (!(checkOopIntegritynamed(GIV(newMethod), "newMethod"))) { - ok = 0; + flags += 2; } if (!(checkOopIntegritynamed(GIV(profileProcess), "profileProcess"))) { - ok = 0; + flags += 4; } if (!(checkOopIntegritynamed(GIV(profileMethod), "profileMethod"))) { - ok = 0; + flags += 8; } if (!(checkOopIntegritynamed(GIV(profileSemaphore), "profileSemaphore"))) { - ok = 0; + flags += 16; } if (!(GIV(tempOop) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop), "tempOop"))) { - ok = 0; + flags += 32; } } if (!(GIV(tempOop2) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop2), "tempOop2"))) { - ok = 0; + flags += 64; } } if (!(GIV(tempOop3) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop3), "tempOop3"))) { - ok = 0; + flags += 128; } } for (i = 1; i <= GIV(jmpDepth); i += 1) { if (!(checkOopIntegritynamedindex(GIV(suspendedCallbacks)[i], "suspendedCallbacks", i))) { - ok = 0; + flags += 256; } if (!(checkOopIntegritynamedindex(GIV(suspendedMethods)[i], "suspendedMethods", i))) { - ok = 0; + flags += 512; } } if (!(checkLogIntegrity())) { - ok = 0; + flags += 1024; } - return ok; + return flags; } @@ -62691,7 +62013,6 @@ checkInterpreterIntegrity(void) static sqInt NoDbgRegParms checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; char *limitFP; char *maybeFP; sqInt maybeFrameCtxt; @@ -62710,10 +62031,8 @@ checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP) maybeFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) maybeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(maybeFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) maybeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(maybeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); limitFP = ((thePage == GIV(stackPage)) && (currentFP != null) ? currentFP @@ -62966,7 +62285,6 @@ static sqInt NoDbgRegParms checkStackPointerIndexForFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *aFrame; - sqInt index; char *prevFrame; char *startFrame; StackPage *thePage; @@ -62978,10 +62296,8 @@ checkStackPointerIndexForFrame(char *theFP) : (((usqInt) ((theFP + FoxIFReceiver) - GIV(stackPointer))) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1))); } /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findSPOrNilOf:on:startingFrom: */ startFrame = (thePage == GIV(stackPage) ? GIV(framePointer) @@ -63197,10 +62513,6 @@ createActualMessageTo(sqInt lookupClass) usqInt numBytes; usqInt numBytes1; sqInt numSlots; - sqInt numSlots1; - sqInt objFormat; - sqInt objFormat1; - sqInt selector; char *sp; @@ -63208,22 +62520,17 @@ createActualMessageTo(sqInt lookupClass) assert((isImmediate(GIV(messageSelector))) || (addressCouldBeObj(GIV(messageSelector)))); /* begin mnuBreakpoint:receiver: */ - selector = GIV(messageSelector); - mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null); + mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), null); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - numSlots1 = GIV(argumentCount); - assert(numSlots1 < (numSlotsMask())); + assert(GIV(argumentCount) < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots1 <= 1 + numBytes = BaseHeaderSize + ((GIV(argumentCount) <= 1 ? 8 - : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); + : (GIV(argumentCount) + (GIV(argumentCount) & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -63235,21 +62542,18 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); argumentArray = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) GIV(argumentCount))) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; argumentArray = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = 1; numSlots = MessageLookupClassIndex + 1; assert((numSlots >= 0) && (ClassMessageCompactIndex != 0)); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); + assert((1) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -63267,13 +62571,13 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); message = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassMessageCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + ClassMessageCompactIndex); GIV(freeStart) += numBytes1; message = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) { longAtput((argumentArray + BaseHeaderSize) + i, popStack()); @@ -63473,7 +62777,6 @@ divorceFramesIn(StackPage *aStackPage) sqInt calleeContext; char *calleeFP; sqInt callerContextOrNil; - sqInt index; sqInt theContext; char *theFP; sqInt theIP; @@ -63538,10 +62841,8 @@ divorceFramesIn(StackPage *aStackPage) /* begin storePointer:ofObject:withValue: */ assert(isBaseFrame(calleeFP)); /* begin stackPageFor: */ - assert((((((char *) calleeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) calleeFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(calleeFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) calleeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) calleeFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(calleeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -63576,6 +62877,7 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) int posArg; int posRcvr; sqInt result; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -63624,7 +62926,8 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -63641,6 +62944,7 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) sqInt integerArg; sqInt integerRcvr; sqInt integerResult; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -63679,7 +62983,8 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -63802,7 +63107,6 @@ ensureCallerContext(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; char *callerFP; - sqInt index; StackPage *thePage; callerFP = pointerForOop(longAt(theFP + FoxSavedFP)); @@ -63812,10 +63116,8 @@ ensureCallerContext(char *theFP) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -63851,14 +63153,14 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) sqInt followingWord1; sqInt followingWord11; sqInt followingWord2; + sqInt followingWord21; sqInt followingWord3; - sqInt followingWord4; usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress11; usqInt followingWordAddress2; + usqInt followingWordAddress21; usqInt followingWordAddress3; - usqInt followingWordAddress4; usqInt limit; usqInt limit1; sqInt methodHeader; @@ -63869,39 +63171,39 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; usqInt numSlots31; usqInt numSlots4; + usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; sqInt objOop11; + sqInt objOop111; sqInt objOop12; - sqInt objOop13; sqInt objOop2; + sqInt objOop21; sqInt objOop3; - sqInt objOop4; sqInt oop; sqInt prevObj; sqInt prevObj1; + sqInt prevObj11; sqInt prevObj2; - sqInt prevObj3; sqInt prevPrevObj; sqInt prevPrevObj1; + sqInt prevPrevObj11; sqInt prevPrevObj2; - sqInt prevPrevObj3; usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes11; usqInt slotBytes2; + usqInt slotBytes21; usqInt slotBytes3; - usqInt slotBytes4; sqInt stopAddr; int swapFloatWords; int temp; @@ -63926,14 +63228,13 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots5 = byteAt(address2 + 7); - objOop12 = (numSlots5 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop12 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit1 = GIV(pastSpaceStart); while (oopisLessThan(objOop12, limit1)) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -63971,20 +63272,16 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots13 = byteAt(objOop12 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); } else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { @@ -64000,13 +63297,12 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots14 = byteAt(address11 + 7); - objOop12 = (numSlots14 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop12 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop12, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -64044,20 +63340,16 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop12 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots111 = byteAt(objOop12 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } followingWordAddress11 = (objOop12 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { @@ -64073,28 +63365,27 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop11 = GIV(nilObj); + prevPrevObj11 = (prevObj11 = null); + objOop111 = GIV(nilObj); while (1) { - assert((objOop11 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; - assert((long64At(objOop11)) != 0); - if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); + assert((objOop111 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop111, GIV(endOfMemory)))) break; + assert((long64At(objOop111)) != 0); + if (isEnumerableObject(objOop111)) { + fmt = (((usqInt) (longAt(objOop111))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { /* oop contains bytes */ - wordAddr = objOop11 + BaseHeaderSize; + wordAddr = objOop111 + BaseHeaderSize; if (fmt >= (firstCompiledMethodFormat())) { /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop11 + BaseHeaderSize); + methodHeader = longAt(objOop111 + BaseHeaderSize); wordAddr += (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; } /* begin reverseBytesFrom:to: */ - stopAddr = objOop11 + (((numSlotsOf(objOop11)) << (shiftForWord())) + BaseHeaderSize); + stopAddr = objOop111 + (((numSlotsOf(objOop111)) << (shiftForWord())) + BaseHeaderSize); addr1 = wordAddr; while (oopisLessThan(addr1, stopAddr)) { longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); @@ -64105,10 +63396,10 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) /* Bitmap, Float etc */ if (swapFloatWords - && ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop11 + BaseHeaderSize); - longAtput(objOop11 + BaseHeaderSize, longAt((objOop11 + BaseHeaderSize) + 4)); - longAtput((objOop11 + BaseHeaderSize) + 4, temp1); + && ((compactClassIndexOf(objOop111)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop111 + BaseHeaderSize); + longAtput(objOop111 + BaseHeaderSize, longAt((objOop111 + BaseHeaderSize) + 4)); + longAtput((objOop111 + BaseHeaderSize) + 4, temp1); } else { } @@ -64116,41 +63407,37 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } - prevPrevObj1 = prevObj1; - prevObj1 = objOop11; + prevPrevObj11 = prevObj11; + prevObj11 = objOop111; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots121 = byteAt(objOop111 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop111 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop11 = GIV(endOfMemory); - goto l18; + followingWordAddress21 = (objOop111 + BaseHeaderSize) + slotBytes21; + if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { + objOop111 = GIV(endOfMemory); + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l18: /* end objectAfter:limit: */; + followingWord21 = longAt(followingWordAddress21 + 4); + objOop111 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress21 + BaseHeaderSize + : followingWordAddress21); + l29: /* end objectAfter:limit: */; } } else { /* begin convertFloatsToPlatformOrder */ if (VMBIGENDIAN == GIV(imageFloatsBigEndian)) { - goto l1; + goto l15; } assert(ClassFloatCompactIndex != 0); /* begin allObjectsDo: */ @@ -64161,8 +63448,8 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -64178,37 +63465,33 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -64223,81 +63506,73 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj3 = (prevObj3 = null); - objOop13 = GIV(nilObj); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); while (1) { - assert((objOop13 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop13, GIV(endOfMemory)))) break; - assert((long64At(objOop13)) != 0); - if (isEnumerableObject(objOop13)) { - if ((compactClassIndexOf(objOop13)) == ClassFloatCompactIndex) { - temp = long32At(objOop13 + BaseHeaderSize); - long32Atput(objOop13 + BaseHeaderSize, long32At((objOop13 + BaseHeaderSize) + 4)); - long32Atput((objOop13 + BaseHeaderSize) + 4, temp); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex) { + temp = long32At(objOop11 + BaseHeaderSize); + long32Atput(objOop11 + BaseHeaderSize, long32At((objOop11 + BaseHeaderSize) + 4)); + long32Atput((objOop11 + BaseHeaderSize) + 4, temp); } } - prevPrevObj3 = prevObj3; - prevObj3 = objOop13; + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop13 + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop13 - BaseHeaderSize); - } - else { - numSlots6 = numSlots15; - } - if (numSlots6 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes4 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress4 = (objOop13 + BaseHeaderSize) + slotBytes4; - if (oopisGreaterThanOrEqualTo(followingWordAddress4, GIV(endOfMemory))) { - objOop13 = GIV(endOfMemory); - goto l28; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); - followingWord4 = longAt(followingWordAddress4 + 4); - objOop13 = ((((usqInt) followingWord4) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress4 + BaseHeaderSize - : followingWordAddress4); - l28: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; } - l1: /* end convertFloatsToPlatformOrder */; + l15: /* end convertFloatsToPlatformOrder */; } } @@ -64346,8 +63621,6 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) sqInt callerIP; char *callerSP; char *frameAbove; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; int onCurrent; @@ -64362,10 +63635,8 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) assert((GIV(stackPage) == 0) || (GIV(stackPage) == (mostRecentlyUsedPage()))); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((onCurrent = thePage == GIV(stackPage)))) { markStackPageNextMostRecentlyUsed(thePage); } @@ -64379,16 +63650,14 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); callerCtx = callerContextOrNil; - goto l5; + goto l6; } /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(callerFP1 + FoxMethod)))) < (startOfMemory()) @@ -64396,12 +63665,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) : (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP1))); callerCtx = longAt(callerFP1 + FoxThisContext); - goto l7; + goto l6; } callerCtx = marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l7: /* end ensureFrameIsMarried:SP: */; -l5: /* end ensureCallerContext: */; +l6: /* end ensureCallerContext: */; if (((frameAbove = findFrameAboveinPage(theFP, thePage))) == 0) { /* If we're divorcing the top frame we can simply peel it off. */ @@ -64414,11 +63682,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l2: /* end newStackPage */; + l1: /* end newStackPage */; theIP = oopForPointer(pointerForOop(longAt(frameAbove + FoxCallerSavedIP))); frameAbove = moveFramesInthroughtoPage(thePage, frameAbove, newPage); if (onCurrent) { @@ -64486,7 +63754,6 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) static char * NoDbgRegParms externalEnsureIsBaseFrame(char *aFramePtr) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; int onCurrent; char *theFP; StackPage *thePage; @@ -64496,10 +63763,8 @@ externalEnsureIsBaseFrame(char *aFramePtr) } theFP = aFramePtr; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* Storing the frame's sender with its caller's context has the side effect of making theFP a base frame. */ @@ -64522,7 +63787,6 @@ externalEnsureIsBaseFrame(char *aFramePtr) static sqInt NoDbgRegParms externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index1; int onCurrentPage; sqInt senderOop; char *theFP; @@ -64570,10 +63834,8 @@ externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index1, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); if (index == SenderIndex) { @@ -64695,7 +63957,7 @@ fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer) arrayOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); /* begin arrayValueOf: */ if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -64774,7 +64036,6 @@ fetchPointerofMarriedContext(sqInt offset, sqInt aContext) char *callerFP; sqInt frameNumArgs; sqInt frameNumArgs1; - sqInt index; sqInt senderOop; sqInt senderOop1; char *spouseFP; @@ -64803,10 +64064,8 @@ fetchPointerofMarriedContext(sqInt offset, sqInt aContext) /* begin frameCallerContext: */ assert(isBaseFrame(spouseFP)); /* begin stackPageFor: */ - assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -64960,26 +64219,22 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop1 = referent1; + objOop1 = referent2; } classDict = objOop1; assert(!(isForwarded(classDict))); /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin noFixupFollowField:ofObject: */ objOop = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -64988,13 +64243,13 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop = referent2; + objOop = referent1; } methodArray = objOop; assert(!(isForwarded(methodArray))); @@ -65115,7 +64370,6 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderContext, sqInt homeContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; - sqInt index; sqInt senderContext1; sqInt senderOop; char *startFP; @@ -65201,10 +64455,8 @@ findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderConte /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65253,13 +64505,9 @@ findSelectorOfMethod(sqInt meth) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin fetchPointer:ofObject: */ methodArray = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -65347,7 +64595,6 @@ findUnwindThroughContext(sqInt homeContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; sqInt ctxtOrNilOrZero; - sqInt index; sqInt onSamePage; sqInt senderContext; char *theFP; @@ -65407,10 +64654,8 @@ findUnwindThroughContext(sqInt homeContext) /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65444,6 +64689,32 @@ findUnwindThroughContext(sqInt homeContext) return ctxtOrNilOrZero; } + /* StackInterpreter>>#fireEphemeron: */ +static void NoDbgRegParms +fireEphemeron(sqInt ephemeron) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + queueMourner(ephemeron); + /* begin setFormatOf:to: */ + assert(((1 >= 0) && (1 <= (formatMask())))); + flag("endianness"); + longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift()))); + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + + /* StackInterpreter>>#fireFinalization: */ +static void NoDbgRegParms +fireFinalization(sqInt weakling) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (GIV(newFinalization)) { + queueMourner(weakling); + } + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + /* Like #stackFloatValue: but access method arguments left-to-right */ @@ -65895,7 +65166,6 @@ handleStackOverflow(void) sqInt callerContextOrNil; char *callerFP; char *callerFP1; - sqInt index; StackPage *lruOrFree; StackPage *newPage; sqInt overflowCount; @@ -65951,10 +65221,8 @@ handleStackOverflow(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -65967,11 +65235,10 @@ handleStackOverflow(void) : (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP1))); longAt(callerFP1 + FoxThisContext); - goto l4; + goto l3; } marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l4: /* end ensureFrameIsMarried:SP: */; l3: /* end ensureCallerContext: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); @@ -66303,6 +65570,7 @@ isKindOfInteger(sqInt oop) sqInt isLargeIntegerObject(sqInt oop) { + /* begin isLargeIntegerInstance: */ return ((oop & (tagMask())) == 0) && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1); } @@ -66311,6 +65579,7 @@ isLargeIntegerObject(sqInt oop) sqInt isLargeNegativeIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargeNegativeInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargeNegativeIntegerCompactIndex); } @@ -66319,6 +65588,7 @@ isLargeNegativeIntegerObject(sqInt oop) sqInt isLargePositiveIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargePositiveInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargePositiveIntegerCompactIndex); } @@ -66360,7 +65630,7 @@ isNullExternalPrimitiveCall(sqInt aMethodObj) sqInt lit; if (!(((primitiveIndexOfMethodheader(aMethodObj, methodHeaderOf(aMethodObj))) == PrimNumberExternalCall) - && ((literalCountOfMethodHeader(methodHeaderOf(aMethodObj))) > 0))) { + && ((literalCountOf(aMethodObj)) > 0))) { return 0; } /* begin fetchPointer:ofObject: */ @@ -66459,7 +65729,6 @@ static sqInt NoDbgRegParms isWidowedContextDuringGC(sqInt aOnceMarriedContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; - sqInt index; char *maybeFrame; sqInt maybeFrameCtxt; sqInt referent; @@ -66477,10 +65746,8 @@ isWidowedContextDuringGC(sqInt aOnceMarriedContext) maybeFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) maybeFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(maybeFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) maybeFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(maybeFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((isFree(thePage)) || (maybeFrame < ((thePage->headFP))))) { @@ -66545,7 +65812,6 @@ static sqInt NoDbgRegParms isWidowedContext(sqInt aOnceMarriedContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; - sqInt index; sqInt senderOop; char *shouldBeFrameCallerField; char *theFrame; @@ -66561,10 +65827,8 @@ isWidowedContext(sqInt aOnceMarriedContext) theFrame = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (!((isFree(thePage)) || (theFrame < ((thePage->headFP))))) { @@ -66625,6 +65889,7 @@ isKindOfClass(sqInt oop, sqInt aClass) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66654,6 +65919,7 @@ isKindOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66682,6 +65948,7 @@ isMemberOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -66702,13 +65969,9 @@ lengthOfNameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { return lengthOfNameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord())))))); } @@ -66721,13 +65984,9 @@ lengthOfNameOfClass(sqInt classOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { return numSlots2; } @@ -66823,8 +66082,8 @@ longPrintOop(sqInt oop) sqInt n1; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt startIP; if ((oop & (tagMask())) @@ -66853,7 +66112,6 @@ longPrintOop(sqInt oop) printf("0x%lx", ((unsigned long) class)); print(")"); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); print(" format "); /* begin printHexnp: */ @@ -66869,14 +66127,10 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(oop + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(oop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { len = numSlots; goto l5; @@ -66983,38 +66237,34 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(oop + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(oop - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(oop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots11); if (fmt2 <= 5) { - lastIndex = numSlots1; - goto l7; + lastIndex = numSlots2; + goto l8; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - lastIndex = (numSlots1 << (shiftForWord())) - (fmt2 & 7); - goto l7; + lastIndex = (numSlots2 << (shiftForWord())) - (fmt2 & 7); + goto l8; } if (fmt2 >= (firstShortFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l8; } if (fmt2 >= (firstLongFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l8; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - lastIndex = ((usqInt) numSlots1) >> 1; - goto l7; + lastIndex = ((usqInt) numSlots2) >> 1; + goto l8; } lastIndex = 0; - l7: /* end lengthOf:format: */; + l8: /* end lengthOf:format: */; if ((lastIndex - startIP) > 100) { lastIndex = startIP + 100; } @@ -67138,6 +66388,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) sqInt tagBits; sqInt wrapAround; + /* begin fetchClassOf: */ receiverClass = (((tagBits = GIV(localAbsentReceiver) & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(GIV(localAbsentReceiver))); @@ -67155,13 +66406,9 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67186,19 +66433,19 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l15; + goto l16; } index += 1; } found = 0; - goto l15; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67209,13 +66456,13 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67224,7 +66471,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l15; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67232,12 +66479,12 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67246,20 +66493,20 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } GIV(newMethod) = objOop4; found = 1; - goto l15; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l15; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; -l15: /* end lookupMethodInDictionary: */; +l16: /* end lookupMethodInDictionary: */; if (found && ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate)) { return rule; @@ -67316,13 +66563,9 @@ lookupMethodInClass(sqInt class) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67347,12 +66590,12 @@ lookupMethodInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; goto l19; } @@ -67370,13 +66613,13 @@ lookupMethodInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67393,12 +66636,12 @@ lookupMethodInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67473,11 +66716,11 @@ lookupMNU(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; createActualMessageTo(GIV(lkupClass)); @@ -67495,13 +66738,9 @@ lookupMNU(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67526,19 +66765,19 @@ lookupMNU(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l18; + goto l16; } index += 1; } found = 0; - goto l18; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67549,13 +66788,13 @@ lookupMNU(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67564,7 +66803,7 @@ lookupMNU(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l18; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67572,12 +66811,12 @@ lookupMNU(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67586,30 +66825,30 @@ lookupMNU(void) } GIV(newMethod) = objOop4; found = 1; - goto l18; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l18; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; - l18: /* end lookupMethodInDictionary: */; + l16: /* end lookupMethodInDictionary: */; if (found) { return LookupRuleMNU; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } error("Recursive not understood error encountered"); return 0; @@ -67638,41 +66877,37 @@ lookupMNUInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67697,19 +66932,19 @@ lookupMNUInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67720,13 +66955,13 @@ lookupMNUInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67735,7 +66970,7 @@ lookupMNUInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67743,12 +66978,12 @@ lookupMNUInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67757,20 +66992,20 @@ lookupMNUInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { GIV(lkupClass) = class; addNewMethodToNSCache(LookupRuleMNU); @@ -67778,12 +67013,12 @@ lookupMNUInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -67812,41 +67047,37 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -67871,19 +67102,19 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -67894,13 +67125,13 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -67909,7 +67140,7 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -67917,12 +67148,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -67931,20 +67162,20 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { addNewMethodToCache(class); @@ -67957,12 +67188,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -67995,11 +67226,11 @@ lookupOrdinarySend(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; assert(addressCouldBeClassObj(GIV(lkupClass))); @@ -68015,13 +67246,9 @@ lookupOrdinarySend(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -68046,19 +67273,19 @@ lookupOrdinarySend(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -68069,13 +67296,13 @@ lookupOrdinarySend(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -68084,7 +67311,7 @@ lookupOrdinarySend(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68092,12 +67319,12 @@ lookupOrdinarySend(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -68106,20 +67333,20 @@ lookupOrdinarySend(void) } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { return LookupRuleOrdinary; @@ -68129,12 +67356,12 @@ lookupOrdinarySend(void) } } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -68161,11 +67388,11 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -68180,13 +67407,9 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -68211,19 +67434,19 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -68234,13 +67457,13 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -68249,7 +67472,7 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68257,12 +67480,12 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -68271,31 +67494,31 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return rule; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -68320,8 +67543,8 @@ lookupSelectorinClass(sqInt selector, sqInt class) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; + sqInt objOop3; sqInt wrapAround; currentClass = class; @@ -68339,13 +67562,9 @@ lookupSelectorinClass(sqInt selector, sqInt class) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -68370,7 +67589,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { meth = null; - goto l11; + goto l9; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -68385,36 +67604,36 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop11); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } - meth = objOop11; - goto l11; + meth = objOop1; + goto l9; } index += 1; if (index == length) { if (wrapAround) { meth = null; - goto l11; + goto l9; } wrapAround = 1; index = SelectorStart; } } meth = null; - l11: /* end lookupMethodFor:InDictionary: */; + l9: /* end lookupMethodFor:InDictionary: */; if (!(meth == null)) { return meth; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop3 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop3 & (tagMask())) == 0) + && (((longAt(objOop3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop3); } - currentClass = objOop1; + currentClass = objOop3; } return null; } @@ -68476,7 +67695,6 @@ makeContextSnapshotSafe(sqInt ctxt) sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -68492,8 +67710,7 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -68516,13 +67733,13 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l4: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)xValue << 1) | 1)); @@ -68698,13 +67915,11 @@ markAndTraceStackPages(sqInt fullGCFlag) sqInt callerContextOrNil; sqInt context; sqInt i; - sqInt index; - sqInt index1; void *pointer; sqInt senderOop; char *theFP; StackPage *thePage; - StackPage *thePage1; + StackPage *thePage2; if (!fullGCFlag) { for (i = 0; i < GIV(numStackPages); i += 1) { @@ -68726,11 +67941,9 @@ markAndTraceStackPages(sqInt fullGCFlag) theFP = (thePage->baseFP); assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); - callerContextOrNil = longAt((thePage1->baseAddress)); + thePage2 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage2->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) || (isContext(callerContextOrNil))); @@ -68746,10 +67959,8 @@ markAndTraceStackPages(sqInt fullGCFlag) pointer = pointerForOop(senderOop - 1); /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(!(isFree(thePage))); } } while(((thePage->trace)) < StackPageTraced); @@ -68791,7 +68002,6 @@ markAndTraceUntracedReachableStackPages(void) static sqInt NoDbgRegParms marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; char *rcvrOffset; sqInt senderOop; char *theFP; @@ -68808,10 +68018,8 @@ marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop } else { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); theSP = findSPOfon(theFP, thePage); } if ((anOop & 1)) { @@ -68942,6 +68150,7 @@ marryFrameSP(char *theFP, char *theSP) numArgs = (cogMethod->cmNumArgs); if (((cogMethod->cmType)) == CMMethod) { if (0) { + /* begin frameStackedReceiver:numArgs: */ closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())))); } else { @@ -68969,6 +68178,7 @@ marryFrameSP(char *theFP, char *theSP) ? LargeContextSlots : SmallContextSlots); if ((byteAt((theFP + FoxIFrameFlags) + 3)) != 0) { + /* begin frameStackedReceiver:numArgs: */ closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())))); } else { @@ -69089,7 +68299,7 @@ maybeSelectorOfMethod(sqInt methodObj) penultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset1 + LiteralStart)) << (shiftForWord()))))); if (((penultimateLiteral & (tagMask())) == 0) - && (isWordsOrBytesNonImm(penultimateLiteral))) { + && (isPureBitsFormat((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())))) { return ((fetchClassTagOfNonImm(penultimateLiteral)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand))) ? penultimateLiteral : 0); @@ -69100,7 +68310,7 @@ maybeSelectorOfMethod(sqInt methodObj) && (((longAt((penultimateLiteral + BaseHeaderSize) + (0U << (shiftForWord())))) == methodObj) && (((maybeSelector = longAt((penultimateLiteral + BaseHeaderSize) + (1U << (shiftForWord())))), (((maybeSelector & (tagMask())) == 0) - && (isWordsOrBytesNonImm(maybeSelector))) + && (isPureBitsFormat((((usqInt) (longAt(maybeSelector))) >> (formatShift())) & (formatMask())))) && ((fetchClassTagOfNonImm(maybeSelector)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand)))))))) ? maybeSelector : 0); @@ -69139,7 +68349,7 @@ methodClassAssociationOf(sqInt methodPointer) sqInt offset; /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -69161,7 +68371,7 @@ methodClassOf(sqInt methodPointer) sqInt offset; /* begin followLiteral:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin followField:ofObject: */ objOop2 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((objOop2 & (tagMask())) == 0) @@ -69227,7 +68437,8 @@ methodPrimitiveIndex(void) methodHeader = ((((CogMethod *) header))->methodHeader); } return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69303,13 +68514,9 @@ nameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { /* begin fetchPointer:ofObject: */ maybeThisClassOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))); @@ -69375,13 +68582,13 @@ noInlineSigned32BitIntegerGutsFor(sqInt integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l4: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l3: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong32:ofObject:withValue: */ valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(magnitude); long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); @@ -69442,7 +68649,7 @@ noMarkedContextsOnPage(StackPage *thePage) ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); - if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } } @@ -69531,7 +68738,7 @@ penultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 2; + offset = (literalCountOf(aMethodOop)) - 2; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -69590,7 +68797,7 @@ positiveMachineIntegerFor(usqIntptr_t value) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) value)) <= (MaxSmallInteger)) { resultObj = ((value << 1) | 1); - goto l7; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -69613,13 +68820,13 @@ positiveMachineIntegerFor(usqIntptr_t value) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -69630,10 +68837,9 @@ positiveMachineIntegerFor(usqIntptr_t value) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); resultObj = newLargeInteger; -l7: /* end maybeInlinePositive32BitIntegerFor: */; - goto l1; + goto l5; -l1: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; return resultObj; } @@ -69703,7 +68909,8 @@ primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader) sqInt firstBytecode; return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69728,7 +68935,8 @@ primitiveIndexOf(sqInt methodPointer) methodHeader = ((((CogMethod *) header))->methodHeader); } return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -69755,13 +68963,9 @@ printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); i = SelectorStart; while (i < classDictSize) { if (aSelector == (longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { @@ -69928,11 +69132,11 @@ printAllStacks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -69956,9 +69160,9 @@ printAllStacks(void) sqInt tagBits; /* begin activeProcess */ - objOop11 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop4 = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - proc = longAt((objOop4 + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + proc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); printNameOfClasscount((((tagBits = proc & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(proc)), 5); @@ -69971,20 +69175,16 @@ printAllStacks(void) printf("\n"); printCallStackFP(GIV(framePointer)); /* begin fetchPointer:ofObject: */ - objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - schedLists = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + objOop3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop1 = longAt((objOop3 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + schedLists = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); if (GIV(highestRunnableProcessPriority) == 0) { /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -70017,47 +69217,43 @@ printAllStacks(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop3 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop3 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; - assert((long64At(objOop3)) != 0); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); /* begin classIndexOf: */ - classIdx = (longAt(objOop3)) & (classIndexMask()); + classIdx = (longAt(objOop11)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop3); + printProcsOnList(objOop11); } prevPrevObj1 = prevObj1; - prevObj1 = objOop3; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop3 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop3 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop3 = GIV(endOfMemory); - goto l10; + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop3 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l10: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -70067,92 +69263,84 @@ printAllStacks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots1 = byteAt(address + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop4 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { + while (oopisLessThan(objOop4, limit)) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(objOop4 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop4 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l5; + objOop4 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l5: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots2 = byteAt(address1 + 7); - objOop1 = (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop4 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { + while (oopisLessThan(objOop4, GIV(freeStart))) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots11 = byteAt(objOop4 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop4 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l6; + objOop4 = GIV(freeStart); + goto l22; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l6: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } } @@ -70226,8 +69414,6 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; sqInt ctxt; - sqInt index; - sqInt index1; sqInt referent; sqInt senderOop; char *theFP; @@ -70244,10 +69430,8 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) if (checkIsStillMarriedContextcurrentFP(ctxt, currFP)) { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (isFree(thePage)) { /* begin printHexPtr: */ printHex(oopForPointer(theFP)); @@ -70261,10 +69445,8 @@ printCallStackOfcurrentFP(sqInt aContext, char *currFP) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -70412,8 +69594,7 @@ printContext(sqInt aContext) print("method "); /* begin printMethodFieldForPrintContext: */ meth = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); - if ((assert(isNonImmediate(meth)), - isCogMethodReference(longAt((meth + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + if (methodHasCogMethod(meth)) { /* begin printHexnp: */ n = ((sqInt) (cogMethodOf(meth))); printf("0x%lx", ((unsigned long) n)); @@ -70637,7 +69818,6 @@ printFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *aFrame; char *frameAbove; - sqInt index; char *prevFrame; char *startFrame; StackPage *thePage; @@ -70658,10 +69838,8 @@ printFrame(char *theFP) } else { /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (isFree(thePage)) { /* begin printHexPtr: */ printHex(oopForPointer(theFP)); @@ -70683,7 +69861,7 @@ printFrame(char *theFP) assert(!(isFree(thePage))); if (startFrame == theFP) { frameAbove = null; - goto l3; + goto l2; } aFrame = startFrame; while (1) { @@ -70693,11 +69871,11 @@ printFrame(char *theFP) if (!(aFrame != 0)) break; if (theFP == aFrame) { frameAbove = prevFrame; - goto l3; + goto l2; } } frameAbove = null; - l3: /* end safeFindFrameAbove:on:startingFrom: */; + l2: /* end safeFindFrameAbove:on:startingFrom: */; theSP = (!(frameAbove == null) ? (assert(!(isBaseFrame(frameAbove))), (frameAbove + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(frameAbove + FoxMethod)))) < (startOfMemory()) @@ -70783,10 +69961,10 @@ printLikelyImplementorsOfSelector(sqInt selector) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -70814,23 +69992,23 @@ printLikelyImplementorsOfSelector(sqInt selector) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop11 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop12 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop11, limit)) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, limit)) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71024,53 +70202,49 @@ printLikelyImplementorsOfSelector(sqInt selector) prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop11 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop12 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop11 + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop12 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop11 = limit; + objOop12 = limit; goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop11 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop11 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop12 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop11, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71264,54 +70438,50 @@ printLikelyImplementorsOfSelector(sqInt selector) prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop11 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop12 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop11 + BaseHeaderSize) + slotBytes1; + followingWordAddress1 = (objOop12 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop11 = GIV(freeStart); - goto l22; + objOop12 = GIV(freeStart); + goto l23; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop11 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l22: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (isEnumerableObject(objOop12)) { - if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop12)) == selector)) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(objOop12))) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop11)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop12)); + printf("0x%lx", ((unsigned long) objOop11)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -71506,34 +70676,30 @@ printLikelyImplementorsOfSelector(sqInt selector) } prevPrevObj1 = prevObj1; - prevObj1 = objOop12; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop12 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l25; + objOop11 = GIV(endOfMemory); + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l25: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } } @@ -71636,13 +70802,9 @@ printNameOfClasscount(sqInt classOop, sqInt cnt) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if ((numSlots == GIV(metaclassNumSlots)) && (GIV(metaclassNumSlots) > GIV(thisClassIndex))) { printNameOfClasscount(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))), cnt - 1); @@ -71924,7 +71086,6 @@ printOop(sqInt oop) /* begin cr */ printf("\n")); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt > 5) { print(" nbytes "); @@ -71993,13 +71154,9 @@ printOop(sqInt oop) fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { lastIndex = numSlots; goto l3; @@ -72417,7 +71574,6 @@ printStringOf(sqInt oop) if (!(addressCouldBeObj(oop))) { return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt < (firstByteFormat())) { return; @@ -72753,7 +71909,6 @@ EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt calloutContext; - sqInt index; sqInt senderOop; sqInt senderOop1; char *sp; @@ -72844,10 +71999,8 @@ reestablishContextPriorToCallback(sqInt callbackContext) theFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(thePage != GIV(stackPage)); GIV(stackPointer) = (findSPOfon(theFP, thePage)) - BytesPerWord; GIV(framePointer) = theFP; @@ -72947,7 +72100,7 @@ removeFirstLinkOfList(sqInt aList) static sqInt retryPrimitiveOnFailure(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - signed char accessorDepth; + sqInt accessorDepth; sqInt canRetry; sqInt firstBytecode; sqInt followDone; @@ -73011,6 +72164,7 @@ retryPrimitiveOnFailure(void) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -73098,7 +72252,6 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac sqInt aMethodObj; sqInt aMethodObj1; sqInt calloutMethodContext; - sqInt index; sqInt senderOop; sqInt senderOop1; char *sp; @@ -73203,10 +72356,8 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac theFP = pointerForOop(senderOop1 - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(thePage != GIV(stackPage)); GIV(stackPointer) = (((thePage->headFP)) == theFP ? (thePage->headSP) @@ -73313,7 +72464,7 @@ safeMethodClassOf(sqInt methodPointer) sqInt referent1; /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ literal = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((literal & (tagMask())) == 0) @@ -73497,7 +72648,6 @@ setSignalLowSpaceFlagAndSaveProcess(void) static void NoDbgRegParms setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; void *pointer; sqInt senderOop; StackPage *thePage; @@ -73510,10 +72660,8 @@ setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext) pointer = pointerForOop(senderOop - 1); /* begin stackPageAt: */ - assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(((((thePage->trace)) >= StackPageUnreached) && (((thePage->trace)) <= StackPageTraced))); if (((thePage->trace)) == StackPageUnreached) { (thePage->trace = StackPageReachedButUntraced); @@ -73679,7 +72827,6 @@ shortReversePrintFrameAndCallers(char *aFramePointer) sqInt caller; sqInt callerContextOrNil; char *callerFP; - sqInt index; sqInt referent; char *theFP; StackPage *thePage; @@ -73699,10 +72846,8 @@ shortReversePrintFrameAndCallers(char *aFramePointer) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -73800,7 +72945,7 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) oop = (oopForPointer(cPtr)) - BaseHeaderSize; if (!(((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)))) { + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; @@ -73811,13 +72956,9 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -74078,11 +73219,11 @@ snapshot(sqInt embedded) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l11; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l11: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -74274,13 +73415,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent11 & (tagMask())) == 0) - && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent21 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent21 & (tagMask())) == 0) + && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj1 = referent11; + obj1 = referent21; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74303,13 +73444,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent21 & (tagMask())) == 0) - && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent31 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent31 & (tagMask())) == 0) + && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj2 = referent21; + obj2 = referent31; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74332,13 +73473,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj3)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent31 & (tagMask())) == 0) - && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent4 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent4 & (tagMask())) == 0) + && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj3 = referent31; + obj3 = referent4; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74361,13 +73502,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj4)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent5 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent5 & (tagMask())) == 0) + && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj4 = referent4; + obj4 = referent5; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -74420,13 +73561,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent5 & (tagMask())) == 0) - && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj = referent5; + obj = referent11; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(xArray))); if ((assert(isNonImmediate(xArray)), @@ -74451,37 +73592,37 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileProcess))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileProcess) = referent1; + GIV(profileProcess) = referent3; } if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileMethod))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileMethod) = referent2; + GIV(profileMethod) = referent1; } if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileSemaphore))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileSemaphore) = referent3; + GIV(profileSemaphore) = referent2; } } } @@ -74635,15 +73776,12 @@ stackPointerForMaybeMarriedContext(sqInt aContext) static sqInt NoDbgRegParms stackPointerIndexForFrame(char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt index; StackPage *thePage; char *theSP; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); theSP = findSPOfon(theFP, thePage); return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) ? (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs)) @@ -74756,7 +73894,7 @@ stackValue(sqInt offset) sqInt startPCOfMethod(sqInt aCompiledMethod) { - return ((literalCountOfMethodHeader(methodHeaderOf(aCompiledMethod))) + LiteralStart) * BytesPerOop; + return ((literalCountOf(aCompiledMethod)) + LiteralStart) * BytesPerOop; } @@ -74787,56 +73925,51 @@ stObjectat(sqInt array, sqInt index) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -74845,17 +73978,17 @@ stObjectat(sqInt array, sqInt index) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -74919,7 +74052,7 @@ stObjectat(sqInt array, sqInt index) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -74965,56 +74098,51 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -75023,17 +74151,17 @@ stObjectatput(sqInt array, sqInt index, sqInt value) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -75065,37 +74193,37 @@ stObjectatput(sqInt array, sqInt index, sqInt value) } } longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((array + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -75103,7 +74231,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong64:ofObject:withValue: */ long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value); @@ -75111,7 +74239,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong32:ofObject:withValue: */ long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -75158,8 +74286,6 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt callerContextOrNil; char *callerFP; - sqInt index; - sqInt index1; StackPage *lruOrFree; StackPage *newPage; int onCurrentPage; @@ -75179,10 +74305,8 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) /* begin frameCallerContext: */ assert(isBaseFrame(theFP)); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage1 = stackPageAtpages(index1, GIV(pages)); + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage1->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -75195,17 +74319,14 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(callerFP))); longAt(callerFP + FoxThisContext); - goto l5; + goto l4; } marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l5: /* end ensureFrameIsMarried:SP: */; l4: /* end ensureCallerContext: */; /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); onCurrentPage = thePage == GIV(stackPage); if (!onCurrentPage) { @@ -75217,11 +74338,11 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l2: /* end newStackPage */; +l1: /* end newStackPage */; theMovedFP = moveFramesInthroughtoPage(thePage, theFP, newPage); if (onCurrentPage) { /* begin setStackPageAndLimit: */ @@ -75261,56 +74382,51 @@ stSizeOf(sqInt oop) /* begin baseHeader: */ hdr = long64At(oop); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l4; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l4; + goto l3; } totalLength = 0; -l4: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l6; + goto l4; } if (fmt < 2) { fixedFields = totalLength; - goto l6; + goto l4; } class = fetchClassOfNonImm(oop); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l6: /* end fixedFieldsOf:format:length: */; +l4: /* end fixedFieldsOf:format:length: */; if (fmt == (indexablePointersFormat())) { assert(!(isContextHeader(hdr))); } @@ -75373,7 +74489,7 @@ ultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 1; + offset = (literalCountOf(aMethodOop)) - 1; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -75386,7 +74502,6 @@ static sqInt NoDbgRegParms NeverInline unfollowatIndex(sqInt litVar, sqInt literalIndex) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt followed; - usqInt objOop; sqInt referent; /* begin followForwarded: */ @@ -75400,21 +74515,20 @@ unfollowatIndex(sqInt litVar, sqInt literalIndex) } followed = referent; /* begin literal:ofMethod:put: */ - objOop = GIV(method); - assert(!(isForwarded(objOop))); - if ((assert(isNonImmediate(objOop)), - oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) { + assert(!(isForwarded(GIV(method)))); + if ((assert(isNonImmediate(GIV(method))), + oopisGreaterThanOrEqualTo(GIV(method), GIV(oldSpaceStart)))) { /* most stores into young objects */ if (((followed & (tagMask())) == 0) && (oopisLessThan(followed, GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) { - remember(objOop); + if (!(((((usqInt) (longAt(GIV(method)))) >> (rememberedBitShift())) & 1) != 0)) { + remember(GIV(method)); } } } - longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((literalIndex + LiteralStart)) << (shiftForWord())))), followed); + longAtput((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((literalIndex + LiteralStart)) << (shiftForWord())))), followed); return followed; } @@ -75515,13 +74629,9 @@ wakeHighestPriority(void) /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -75593,7 +74703,6 @@ writeImageFileIO(void) } return null; } - /* begin imageSizeToWrite */ assert(newSpaceIsEmpty()); /* begin totalBytesInNonEmptySegments */ total = 0; @@ -75603,6 +74712,7 @@ writeImageFileIO(void) } } imageBytes = total; + headerStart = sqImageFileStartLocation(f, imageName, headerSize + imageBytes); /* Note: on Unix systems one could put an exec command here, padded to 512 bytes */; sqImageFileSeek(f, headerStart); @@ -75679,14 +74789,9 @@ cloneContext(sqInt aContext) /* begin numSlotsOf: */ assert((classIndexOf(aContext)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(aContext + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - sz = longAt(aContext - BaseHeaderSize); - } - else { - sz = numSlots; - } - /* begin eeInstantiateMethodContextSlots: */ + sz = (numSlots == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots); cloned = allocateNewSpaceSlotsformatclassIndex(sz, indexablePointersFormat(), ClassMethodContextCompactIndex); if (cloned != 0) { for (i = 0; i <= StackPointerIndex; i += 1) { @@ -75780,7 +74885,6 @@ fieldofFrame(sqInt index, char *theFP) char *callerFP; sqInt frameNumArgs; sqInt frameNumArgs1; - sqInt index1; sqInt numArgs; StackPage *thePage; @@ -75793,9 +74897,8 @@ fieldofFrame(sqInt index, char *theFP) ? (/* begin frameCallerContext: */ assert(isBaseFrame(theFP)), /* begin stackPageFor: */ - (assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), - (index1 = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)))), - (thePage = stackPageAtpages(index1, GIV(pages))), + (thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages))), (callerContextOrNil = longAt((thePage->baseAddress))), assert(addressCouldBeObj(callerContextOrNil)), assert((callerContextOrNil == (nilObject())) @@ -75944,10 +75047,10 @@ primitiveContextAt(void) sqInt reasonCode; sqInt senderOop; char *sp; - char *sp1; + sqInt sp1; sqInt sp11; char *sp2; - sqInt sp3; + char *sp3; sqInt sp4; char *spouseFP; sqInt stSize; @@ -75975,17 +75078,12 @@ primitiveContextAt(void) /* might be an instance of a subclass */ /* begin stObject:at: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; goto l23; @@ -76033,23 +75131,23 @@ primitiveContextAt(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l16; + goto l20; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l16; + goto l20; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l16: /* end stackPointerForMaybeMarriedContext: */; + l20: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { value = noInlineTemporaryin(index - 1, frameOfMarriedContext(aContext)); - goto l25; + goto l30; } } else { @@ -76063,19 +75161,19 @@ primitiveContextAt(void) if (fmt1 <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord()))))); - goto l37; + goto l30; } if (fmt1 >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1))) << 1) | 1); - goto l37; + goto l30; } if (fmt1 >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))))))) << 1) | 1); - goto l37; + goto l30; } if (fmt1 == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))))); - goto l37; + goto l30; } /* begin positive32BitIntegerFor: */ @@ -76084,7 +75182,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { value = ((integerValue1 << 1) | 1); - goto l37; + goto l30; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -76107,13 +75205,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l32; + goto l29; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l32: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l29: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -76124,10 +75222,8 @@ primitiveContextAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger1; - goto l37; + goto l30; - l37: /* end subscript:with:format: */; - goto l25; } /* begin primitiveFailFor: */ reasonCode = (fmt1 <= 1 @@ -76135,7 +75231,7 @@ primitiveContextAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; value = 0; - l25: /* end stObject:at: */; + l30: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -76157,65 +75253,60 @@ primitiveContextAt(void) assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l9; + goto l12; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l12; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l12; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l12; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l9; + goto l12; } totalLength = 0; - l9: /* end lengthOf:format: */; + l12: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l13; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l13; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l15: /* end fixedFieldsOf:format:length: */; + l13: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ - sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); - if (!((sp3 & 1))) { + sp1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp1 & 1))) { stSize = 0; - goto l11; + goto l4; } - assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); - stSize = (sp3 >> 1); - l11: /* end fetchStackPointerOf: */; + assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(aContext))); + stSize = (sp1 >> 1); + l4: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -76225,19 +75316,19 @@ primitiveContextAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l31; + goto l18; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l31; + goto l18; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l31; + goto l18; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l31; + goto l18; } /* begin positive32BitIntegerFor: */ @@ -76246,7 +75337,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l31; + goto l18; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -76269,13 +75360,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l26; + goto l16; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l26: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l16: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -76286,12 +75377,12 @@ primitiveContextAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l31; + goto l18; - l31: /* end subscript:with:format: */; + l18: /* end subscript:with:format: */; /* begin pop:thenPush: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp1; + longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp2; return; } /* begin frameOfMarriedContext: */ @@ -76312,8 +75403,8 @@ primitiveContextAt(void) ? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - (index - 1)) * BytesPerWord)) : longAt(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (index - 1)) * BytesPerWord)))); /* begin pop:thenPush: */ - longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp2; + longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp3; } @@ -76347,10 +75438,10 @@ primitiveContextAtPut(void) sqInt signedValueToStore; sqInt signedValueToStore1; char *sp; - char *sp1; + sqInt sp1; sqInt sp11; char *sp2; - sqInt sp3; + char *sp3; sqInt sp4; char *spouseFP; sqInt stSize; @@ -76382,56 +75473,51 @@ primitiveContextAtPut(void) /* might be an instance of a subclass */ /* begin stObject:at:put: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l34; + goto l26; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l34; + goto l26; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l34; + goto l26; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l34; + goto l26; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l34; + goto l26; } totalLength1 = 0; - l34: /* end lengthOf:format: */; + l26: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l32; + goto l21; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l32; + goto l21; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l32: /* end fixedFieldsOf:format:length: */; + l21: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -76440,23 +75526,23 @@ primitiveContextAtPut(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l23; + goto l22; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l23; + goto l22; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l23: /* end stackPointerForMaybeMarriedContext: */; + l22: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(aContext), value); - goto l38; + goto l34; } } else { @@ -76483,37 +75569,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l26; + goto l33; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l26; + goto l33; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l33; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l26; + goto l33; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -76521,7 +75607,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l26; + goto l33; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -76529,7 +75615,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l26: /* end subscript:with:storing:format: */; + l33: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -76538,7 +75624,7 @@ primitiveContextAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } - l38: /* end stObject:at:put: */; + l34: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -76560,65 +75646,60 @@ primitiveContextAtPut(void) assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l10; + goto l13; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l10; + goto l13; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l10; + goto l13; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l10; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l10; + goto l13; } totalLength = 0; - l10: /* end lengthOf:format: */; + l13: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l22; + goto l14; } if (fmt < 2) { fixedFields = totalLength; - goto l22; + goto l14; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l22: /* end fixedFieldsOf:format:length: */; + l14: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ - sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); - if (!((sp3 & 1))) { + sp1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp1 & 1))) { stSize = 0; - goto l12; + goto l4; } - assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); - stSize = (sp3 >> 1); - l12: /* end fetchStackPointerOf: */; + assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(aContext))); + stSize = (sp1 >> 1); + l4: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -76641,37 +75722,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l17; + goto l20; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l17; + goto l20; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l20; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l17; + goto l20; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -76679,7 +75760,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l17; + goto l20; } unsignedValueToStore = positive32BitValueOf(value); @@ -76687,10 +75768,10 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l17: /* end subscript:with:storing:format: */; + l20: /* end subscript:with:storing:format: */; /* begin pop:thenPush: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp1; + longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp2; return; } /* begin frameOfMarriedContext: */ @@ -76717,8 +75798,8 @@ primitiveContextAtPut(void) } } /* begin pop:thenPush: */ - longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); - GIV(stackPointer) = sp2; + longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp3; } @@ -76747,56 +75828,51 @@ primitiveContextSize(void) rcvr = longAt(GIV(stackPointer)); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); @@ -76816,17 +75892,17 @@ primitiveContextSize(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); sz = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { sz = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); sz = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; } else { sz = totalLength - fixedFields; @@ -76883,6 +75959,7 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt argumentArray; usqInt arraySize; sqInt ccIndex; + sqInt classOop; sqInt firstBytecode; sqInt fmt; sqInt fmt1; @@ -76896,18 +75973,17 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt moduleLength; sqInt moduleName; sqInt nItems; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; + sqInt numSlots4; sqInt object; sqInt object1; sqInt object2; sqInt object3; sqInt object4; - sqInt objFormat; sqInt primRcvr; char *sp; char *sp1; @@ -76939,14 +76015,10 @@ primitiveDoNamedPrimitiveWithArgs(void) } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); - numSlots2 = byteAt(argumentArray + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots2; - } + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -2); @@ -76972,22 +76044,24 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin fetchPointer:ofObject: */ spec = longAt((methodArg + BaseHeaderSize) + (1U << (shiftForWord()))); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (spec & (tagMask())) { isArray = 0; - goto l24; + goto l22; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(spec))); /* begin classIndexOf: */ ccIndex = (longAt(spec)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex; - goto l24; + goto l22; -l24: /* end is:instanceOf:compactClassIndex: */; +l22: /* end is:instanceOf:compactClassIndex: */; if (!(isArray && (((numSlotsOf(spec)) == 4) && (((methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0)) == PrimNumberExternalCall)))) { /* begin primitiveFailFor: */ @@ -77018,38 +76092,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(moduleName + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots1 = byteAt(moduleName + 7); + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { - moduleLength = numSlots1; - goto l14; + moduleLength = numSlots2; + goto l17; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - moduleLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l14; + moduleLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l17; } if (fmt >= (firstShortFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l17; } if (fmt >= (firstLongFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l17; } if (fmt == (sixtyFourBitIndexableFormat())) { - moduleLength = ((usqInt) numSlots1) >> 1; - goto l14; + moduleLength = ((usqInt) numSlots2) >> 1; + goto l17; } moduleLength = 0; - l14: /* end lengthOf:format: */; + l17: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((spec + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -77066,38 +76136,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(functionName + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots3 = numSlots5; - } + numSlots11 = byteAt(functionName + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { functionLength = numSlots3; - goto l17; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ functionLength = (numSlots3 << (shiftForWord())) - (fmt1 & 7); - goto l17; + goto l24; } if (fmt1 >= (firstShortFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l17; + goto l24; } if (fmt1 >= (firstLongFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l17; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { functionLength = ((usqInt) numSlots3) >> 1; - goto l17; + goto l24; } functionLength = 0; -l17: /* end lengthOf:format: */; +l24: /* end lengthOf:format: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -3); @@ -77110,14 +76176,11 @@ primitiveDoNamedPrimitiveWithArgs(void) return; } /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; - numSlots = 5; - assert((numSlots >= 0) + numSlots4 = 5; + assert((numSlots4 >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots, objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots4, 2, ClassArrayCompactIndex); /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = (argumentArray = popStack()); assert(!(isOopForwarded(GIV(tempOop)))); @@ -77255,13 +76318,9 @@ primitiveDoPrimitiveWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -PrimErrLimitExceeded); @@ -77447,6 +76506,7 @@ primitiveExecuteMethod(void) methodHeader = ((((CogMethod *) header))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -77556,6 +76616,7 @@ primitiveExecuteMethodArgsArray(void) methodHeader = ((((CogMethod *) header2))->methodHeader); } if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -77616,8 +76677,8 @@ primitiveExternalCall(void) sqInt moduleName; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt val; @@ -77628,7 +76689,7 @@ primitiveExternalCall(void) val = 0; if (!((((GIV(newMethod) & (tagMask())) == 0) && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) - && (((literalCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) > 0) + && (((literalCountOf(GIV(newMethod))) > 0) && (((lit = literalofMethod(0, GIV(newMethod))), (((lit & (tagMask())) == 0) && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) @@ -77698,38 +76759,34 @@ primitiveExternalCall(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(moduleName + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(moduleName + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { moduleLength = numSlots; - goto l12; + goto l14; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ moduleLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l14; } if (fmt >= (firstShortFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l14; } if (fmt >= (firstLongFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { moduleLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l14; } moduleLength = 0; - l12: /* end lengthOf:format: */; + l14: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((lit + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -77741,38 +76798,34 @@ primitiveExternalCall(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(functionName + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(functionName + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - functionLength = numSlots1; - goto l13; + functionLength = numSlots2; + goto l17; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - functionLength = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l13; + functionLength = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l17; } if (fmt1 >= (firstShortFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l13; + functionLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l17; } if (fmt1 >= (firstLongFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l13; + functionLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l17; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - functionLength = ((usqInt) numSlots1) >> 1; - goto l13; + functionLength = ((usqInt) numSlots2) >> 1; + goto l17; } functionLength = 0; -l13: /* end lengthOf:format: */; +l17: /* end lengthOf:format: */; addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&accessorDepth)); if (addr == 0) { index = -1; @@ -77874,7 +76927,6 @@ primitiveFindNextUnwindContext(void) sqInt calleeContext; sqInt callerContextOrNil; sqInt handlerOrNilOrZero; - sqInt index; sqInt senderContext; sqInt senderOop; char *sp; @@ -77970,10 +77022,8 @@ primitiveFindNextUnwindContext(void) /* begin frameCallerContext: */ assert(isBaseFrame(theFPAbove)); /* begin stackPageFor: */ - assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); callerContextOrNil = longAt((thePage->baseAddress)); assert(addressCouldBeObj(callerContextOrNil)); assert((callerContextOrNil == (nilObject())) @@ -78136,56 +77186,51 @@ primitiveInstVarAt(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l6; + goto l5; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l6; + goto l5; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l6; + goto l5; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l6; + goto l5; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l6; + goto l5; } totalLength = 0; -l6: /* end lengthOf:format: */; +l5: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l8; + goto l6; } if (fmt < 2) { fixedFields = totalLength; - goto l8; + goto l6; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l8: /* end fixedFieldsOf:format:length: */; +l6: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -78201,19 +77246,19 @@ primitiveInstVarAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))); - goto l14; + goto l11; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l14; + goto l11; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))))))) << 1) | 1); - goto l14; + goto l11; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))))); - goto l14; + goto l11; } /* begin positive32BitIntegerFor: */ @@ -78222,7 +77267,7 @@ primitiveInstVarAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l14; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -78251,7 +77296,7 @@ primitiveInstVarAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l9: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -78262,9 +77307,9 @@ primitiveInstVarAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l14; + goto l11; - l14: /* end subscript:with:format: */; + l11: /* end subscript:with:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -78312,7 +77357,8 @@ primitiveInstVarAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -78324,56 +77370,51 @@ primitiveInstVarAtPut(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l12; + goto l7; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l7; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l7; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l7; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l7; } totalLength = 0; -l12: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l8; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l8; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l15: /* end fixedFieldsOf:format:length: */; +l8: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -78402,37 +77443,37 @@ primitiveInstVarAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue); - goto l11; + goto l14; } if (fmt >= (firstByteFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index - 1), signedValueToStore); - goto l11; + goto l14; } if (fmt >= (firstShortFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), signedValueToStore); - goto l11; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(newValue); @@ -78440,7 +77481,7 @@ primitiveInstVarAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))), unsigned64BitValueToStore); } - goto l11; + goto l14; } unsignedValueToStore = positive32BitValueOf(newValue); @@ -78448,7 +77489,7 @@ primitiveInstVarAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))), unsignedValueToStore); } - l11: /* end subscript:with:storing:format: */; + l14: /* end subscript:with:storing:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue); @@ -78561,7 +77602,6 @@ primitiveObjectPointsTo(void) } /* begin baseHeader: */ header = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)header) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -78596,13 +77636,9 @@ primitiveObjectPointsTo(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); } } else { @@ -78737,12 +77773,12 @@ primitivePin(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - if (((((usqInt) (longAt(obj))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0) { /* begin trueObject */ wasPinned = GIV(trueObj); if (boolean != wasPinned) { /* begin setIsPinnedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << 30))); + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (pinnedBitShift())))); } } else { @@ -78997,20 +78033,15 @@ primitiveSlotAt(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ @@ -79069,8 +78100,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstShortFormat())) { - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPushInteger: */ integerVal1 = ((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1)))))); @@ -79083,7 +78113,6 @@ primitiveSlotAt(void) return; } if (fmt == (sixtyFourBitIndexableFormat())) { - /* begin num64BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ @@ -79097,8 +78126,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 2)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2)))); @@ -79106,7 +78134,7 @@ primitiveSlotAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop1 = ((integerValue << 1) | 1); - goto l18; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -79129,13 +78157,13 @@ primitiveSlotAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l13; + goto l9; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l13: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -79146,10 +78174,9 @@ primitiveSlotAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop1 = newLargeInteger; - l18: /* end maybeInlinePositive32BitIntegerFor: */; - goto l12; + goto l11; - l12: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop1); GIV(stackPointer) = sp4; return; @@ -79209,8 +78236,9 @@ primitiveSlotAtPut(void) } # if IMMUTABILITY + /* begin isOopImmutable: */ badRcvr = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); # else /* IMMUTABILITY */ /* begin isImmediate: */ @@ -79223,20 +78251,15 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { externalInstVarofContextput(index, rcvr, newValue); @@ -79276,10 +78299,10 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = null; - goto l21; + goto l16; } value = value1; - goto l21; + goto l16; } if (newValue & (tagMask())) { /* begin primitiveFail */ @@ -79287,23 +78310,23 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(newValue))); /* begin classIndexOf: */ ccIndex = (longAt(newValue)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l20; + goto l15; -l20: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l15: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin numBytesOfBytes: */ fmt2 = (((usqInt) (longAt(newValue))) >> (formatShift())) & (formatMask()); @@ -79315,18 +78338,18 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((newValue + BaseHeaderSize) + (0U << 3)))); - goto l21; + goto l16; } else { value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((newValue + BaseHeaderSize) + (0U << 2)))))); - goto l21; + goto l16; } -l21: /* end positiveMachineIntegerValueOf: */; +l16: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { GIV(primFailCode) = PrimErrBadArgument; return; @@ -79364,8 +78387,7 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value); @@ -79379,8 +78401,7 @@ primitiveSlotAtPut(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 2)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2))), value); @@ -79408,7 +78429,6 @@ primitiveStoreStackp(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ctxt; sqInt i; - sqInt index; sqInt integerPointer; sqInt newStackp; int onCurrentPage; @@ -79426,7 +78446,7 @@ primitiveStoreStackp(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { newStackp = (integerPointer >> 1); - goto l10; + goto l5; } else { /* begin primitiveFail */ @@ -79434,9 +78454,9 @@ primitiveStoreStackp(void) GIV(primFailCode) = 1; } newStackp = 0; - goto l10; + goto l5; } -l10: /* end stackIntegerValue: */; +l5: /* end stackIntegerValue: */; if (!((!GIV(primFailCode)) && (((newStackp >= 0) && (newStackp <= ((numSlotsOf(ctxt)) - CtxtTempFrameStart)))))) { /* begin primitiveFail */ @@ -79465,10 +78485,8 @@ primitiveStoreStackp(void) theFP = pointerForOop(senderOop - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); if (((onCurrentPage = thePage == GIV(stackPage))) && (theFP == GIV(framePointer))) { /* begin primitiveFail */ @@ -79491,11 +78509,11 @@ primitiveStoreStackp(void) sp = longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { stackp = 0; - goto l8; + goto l7; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(ctxt))); stackp = (sp >> 1); -l8: /* end fetchStackPointerOf: */; +l7: /* end fetchStackPointerOf: */; for (i = (stackp + 1); i <= newStackp; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = GIV(nilObj); @@ -80209,7 +79227,6 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); result = getDesiredCogCodeSize(); } if (arg == 48) { - /* begin getCogVMFlags */ result = (((usqInt)(((((GIV(flagInterpretedMethods) ? 2 : 0)) + ((GIV(preemptionYields) @@ -80261,7 +79278,6 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); result = getCodeCompactionMSecs(); } if (arg == 64) { - /* begin getCogMethodCount */ result = (((usqInt)(numMethodsOfType(CMMethod)) << 1) | 1); } if (arg == 65) { @@ -80428,12 +79444,12 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); /* begin setCogVMFlags: */ if ((((usqInt)arg)) > 0x1F) { GIV(primFailCode) = PrimErrUnsupported; - goto l71; + goto l64; } GIV(flagInterpretedMethods) = (arg & 2) != 0; GIV(preemptionYields) = (arg & 4) == 0; GIV(newFinalization) = (arg & 16) != 0; - l71: /* end setCogVMFlags: */; + l64: /* end setCogVMFlags: */; } } if (index == 49) { @@ -80456,14 +79472,14 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); if (isFloat) { fetchFloatAtinto(arg + BaseHeaderSize, result1); aDouble = result1; - goto l83; + goto l81; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } aDouble = 0.0; - l83: /* end floatValueOf: */; + l81: /* end floatValueOf: */; GIV(heapGrowthToSizeGCRatio) = aDouble; GIV(primFailCode) = 0; } @@ -80514,7 +79530,6 @@ pruneStackstackp(sqInt stack, sqInt stackp) char *fp; sqInt i; sqInt iLimiT; - sqInt index; sqInt objOrFP; sqInt oop; sqInt oop1; @@ -80560,26 +79575,24 @@ pruneStackstackp(sqInt stack, sqInt stackp) assert((objOrFP & 1)); theFP = pointerForOop(objOrFP - 1); /* begin stackPageFor: */ - assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))); - index = pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage)); - - thePage = stackPageAtpages(index, GIV(pages)); + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); /* begin findFrameAbove:inPage: */ fp = (thePage->headFP); if (fp == theFP) { theFPAbove = 0; - goto l10; + goto l6; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { theFPAbove = fp; - goto l10; + goto l6; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l10: /* end findFrameAbove:inPage: */; + l6: /* end findFrameAbove:inPage: */; /* begin ensureFrameIsMarried:SP: */ if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 @@ -80634,10 +79647,10 @@ unmarkAfterPathTo(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -80658,7 +79671,7 @@ unmarkAfterPathTo(void) assert((objOop1 % (allocationUnit())) == 0); if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; assert((long64At(objOop1)) != 0); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop1, 0); } @@ -80672,32 +79685,28 @@ unmarkAfterPathTo(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -80707,13 +79716,13 @@ unmarkAfterPathTo(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop, limit)) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -80727,41 +79736,37 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -80775,32 +79780,28 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } diff --git a/nsspursrc/vm/interp.h b/nsspursrc/vm/interp.h index 5139ecb29a..01b3f47611 100644 --- a/nsspursrc/vm/interp.h +++ b/nsspursrc/vm/interp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1992 uuid: 6feb3008-c996-4d53-b572-55c31a5b58dc + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ #define VM_PROXY_MAJOR 1 @@ -43,4 +43,4 @@ # define COGMTVM 0 #endif -#define DisownVMLockOutFullGC 1 +#define DisownVMLockOutFullGC nil diff --git a/nsspursrc/vm/nssendcache.h b/nsspursrc/vm/nssendcache.h index a17383250e..2e2a7252c3 100644 --- a/nsspursrc/vm/nssendcache.h +++ b/nsspursrc/vm/nssendcache.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1178 uuid: bb034bb1-371f-44a6-a66f-bbcfaff35456 + CCodeGenerator VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ typedef struct { diff --git a/nsspursrc/vm/vmCallback.h b/nsspursrc/vm/vmCallback.h index 48d07f100f..c8ed21d69e 100644 --- a/nsspursrc/vm/vmCallback.h +++ b/nsspursrc/vm/vmCallback.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1992 uuid: 6feb3008-c996-4d53-b572-55c31a5b58dc + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ #define VM_CALLBACK_INC 1 diff --git a/nsspurstacksrc/vm/gcc3x-interp.c b/nsspurstacksrc/vm/gcc3x-interp.c index 5edbd5de99..8d7f6294fc 100644 --- a/nsspurstacksrc/vm/gcc3x-interp.c +++ b/nsspurstacksrc/vm/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - StackInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + StackInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -272,6 +272,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define ReceiverIndex 5 #define RemapBufferSize 25 #define RememberedSetRootIndex 4099 +#define ScavengeInProgress 1 #define SchedulerAssociation 3 #define SelectorAboutToReturn 48 #define SelectorAttemptToAssign 50 @@ -285,6 +286,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define SelectorUnknownBytecode 57 #define SenderIndex 0 #define SistaVM 0 +#define SlidingCompactionInProgress 2 #define SmallContextSlots 22 #define SPURVM 1 #define SpecialSelectors 23 @@ -645,6 +647,8 @@ static void NeverInline computeRefCountToShrinkRT(void); static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner); static sqInt NoDbgRegParms copyAndForward(sqInt survivor); static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor); +static void fireEphemeronsInRememberedSet(void); +static void fireEphemeronsOnEphemeronList(void); static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList); static void growRememberedSet(void); static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop); @@ -697,7 +701,7 @@ extern void characterTable(void); extern usqInt characterValueOf(sqInt oop); extern sqInt checkedLongAt(sqInt byteAddress); static sqInt checkHeapFreeSpaceIntegrity(void); -static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); extern sqInt checkOkayOop(usqInt oop); extern sqInt checkOopHasOkayClass(usqInt obj); static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name); @@ -758,6 +762,7 @@ extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop); static sqInt findLargestFreeChunk(void); extern void findStringBeginningWith(char *aCString); extern void findString(char *aCString); +static void fireAllUnscannedEphemerons(void); static sqInt firstAccessibleObject(void); static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop); extern void * firstFixedField(sqInt objOop); @@ -860,7 +865,6 @@ static sqInt NoDbgRegParms isValidObjStack(sqInt objStack); static sqInt NoDbgRegParms isWeakFormat(sqInt format); static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop); extern sqInt isWeak(sqInt oop); -static sqInt NoDbgRegParms isWordsOrBytesNonImm(sqInt objOop); extern sqInt isWordsOrBytes(sqInt oop); extern sqInt isWords(sqInt oop); extern sqInt isYoungObject(sqInt objOop); @@ -889,13 +893,13 @@ static void NoDbgRegParms markAndTraceClassOf(sqInt objOop); static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents); extern void NeverInline markAndTrace(sqInt objOop); static sqInt markInactiveEphemerons(void); +static void NoDbgRegParms markLoopFrom(sqInt objOop); static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged); static void markWeaklingsAndMarkAndFireEphemerons(void); extern sqInt maybeSplObj(sqInt index); static sqInt NoDbgRegParms methodHeaderOf(sqInt methodObj); static sqInt newObjectHash(void); static sqInt newSpaceIsEmpty(void); -extern usqInt nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); extern sqInt nilObject(void); static void NeverInline nilUnmarkedWeaklingSlots(void); static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex); @@ -916,6 +920,7 @@ extern sqInt numStrongSlotsOfWeakling(sqInt objOop); extern sqInt objectAfter(sqInt objOop); extern sqInt objectBefore(sqInt objOop); static sqInt NoDbgRegParms objectStartingAt(sqInt address); +static sqInt NoDbgRegParms objectsReachableFromRoots(sqInt arrayOfRoots); extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop); static sqInt NoDbgRegParms okayOop(sqInt signedOop); static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); @@ -926,6 +931,7 @@ static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags); extern sqInt primitiveErrorTable(void); extern void printActivationsOf(sqInt aMethodObj); extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); extern void printForwarders(void); extern void printFreeChunks(void); extern void printFreeChunk(sqInt freeChunk); @@ -939,6 +945,7 @@ static void NoDbgRegParms printHeaderTypeOf(sqInt objOop); extern void printInstancesOf(sqInt aClassOop); extern void printInstancesWithClassIndex(sqInt classIndex); extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); extern void printMethodReferencesTo(sqInt anOop); extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); extern void printObjectsWithHash(sqInt hash); @@ -952,17 +959,15 @@ extern void pushRemappableOop(sqInt oop); static sqInt NoDbgRegParms pushonObjStack(sqInt objOop, sqInt objStack); static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray); extern sqInt rawHashBitsOf(sqInt objOop); -extern sqInt remapObj(sqInt objOop); extern sqInt removeGCRoot(sqInt *varLoc); static void NoDbgRegParms restoreObjectsInsavedHashes(sqInt objArray, sqInt savedHashes); static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes); static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes); -static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion); static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd); static sqInt NoDbgRegParms shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); -extern sqInt shouldRemapObj(sqInt objOop); extern sqInt shouldRemapOop(sqInt oop); static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack); extern sqInt slotSizeOf(sqInt oop); @@ -989,11 +994,15 @@ static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt pa static sqInt validObjStacks(void); extern sqInt vmEndianness(void); extern sqInt checkTraversableSortedFreeList(void); -static sqInt NeverInline compact(void); -static sqInt eliminateAndFreeForwardersForPigCompact(void); -static sqInt NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); +static void NeverInline compact(void); +static void eliminateAndFreeForwardersForPigCompact(void); +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); static sqInt NoDbgRegParms moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit); -static sqInt rebuildFreeListsForPigCompact(void); +static usqInt NoDbgRegParms nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); +extern void printSortedFreeList(void); +static void rebuildFreeListsForPigCompact(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit); static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount); static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift); @@ -1097,6 +1106,8 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt p static sqInt NoDbgRegParms findNewMethodInClassTag(sqInt classTagArg); extern sqInt findSelectorOfMethod(sqInt meth); static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage); +static void NoDbgRegParms fireEphemeron(sqInt ephemeron); +static void NoDbgRegParms fireFinalization(sqInt weakling); extern double floatArg(sqInt index); static sqInt NoDbgRegParms flushExternalPrimitiveOf(sqInt methodObj); static void flushMethodCache(void); @@ -1418,10 +1429,10 @@ _iss usqInt oldSpaceStart; _iss sqInt needGCFlag; _iss sqInt trueObj; _iss SpurSegmentInfo * segments; +_iss sqInt lkupClassTag; _iss sqInt falseObj; _iss sqInt hiddenRootsObj; _iss usqInt scavengeThreshold; -_iss sqInt lkupClassTag; _iss usqInt totalFreeOldSpace; _iss usqInt pastSpaceStart; _iss StackPage * pages; @@ -1436,18 +1447,18 @@ _iss sqInt bytesPerPage; _iss sqInt localAbsentReceiver; _iss usqInt freeListsMask; _iss StackPage * mostRecentlyUsedPage; +_iss usqInt firstFreeChunk; _iss sqInt remapBufferCount; _iss sqInt tempOop; _iss sqInt markStack; _iss SpurContiguousObjStack unscannedEphemerons; -_iss usqInt firstFreeChunk; +_iss sqInt weaklingStack; _iss sqInt lkupClass; _iss usqInt newSpaceStart; -_iss sqInt weaklingStack; _iss SpurNewSpaceSpace pastSpace; _iss sqInt profileProcess; -_iss sqInt numClassTablePages; _iss sqInt numStackPages; +_iss sqInt numClassTablePages; _iss sqInt profileMethod; _iss sqInt classTableIndex; _iss sqInt futureSurvivorStart; @@ -1456,11 +1467,11 @@ _iss sqLong nextProfileTick; _iss sqInt numRememberedEphemerons; _iss SpurNewSpaceSpace futureSpace; _iss sqInt jmpDepth; +_iss usqInt lastFreeChunk; _iss sqInt longRunningPrimitiveCheckMethod; _iss sqInt longRunningPrimitiveCheckSemaphore; _iss sqInt mournQueue; _iss sqInt profileSemaphore; -_iss usqInt lastFreeChunk; _iss SpurNewSpaceSpace eden; _iss char * objStackInvalidBecause; _iss sqInt tempOop2; @@ -1475,7 +1486,6 @@ _iss sqInt invalidObjStackPage; _iss sqInt previousRememberedSetSize; _iss sqInt tenureCriterion; _iss sqInt classNameIndex; -_iss sqInt pendingFinalizationSignals; _iss sqInt metaclassNumSlots; _iss sqInt numSegInfos; _iss sqInt preemptionYields; @@ -1484,20 +1494,23 @@ _iss sqInt highestRunnableProcessPriority; _iss usqLong longRunningPrimitiveStartUsecs; _iss usqLong longRunningPrimitiveStopUsecs; _iss sqInt methodDictLinearSearchLimit; -_iss sqInt newFinalization; -_iss sqInt rememberedSetLimit; _iss usqLong statCheckForEvents; _iss usqLong statGCEndUsecs; _iss sqInt weakList; _iss sqInt externalPrimitiveTableFirstFreeIndex; _iss sqInt marking; +_iss sqInt newFinalization; _iss sqInt statSurvivorCount; _iss sqInt thisClassIndex; _iss sqInt firstSegmentSize; +_iss sqInt gcPhaseInProgress; _iss usqLong gcStartUsecs; _iss usqInt lowSpaceThreshold; +_iss sqInt pendingFinalizationSignals; +_iss sqInt rememberedSetLimit; _iss sqInt shrinkThreshold; _iss usqLong statIOProcessEvents; +_iss sqInt sweepIndex; _iss sqInt edenBytes; _iss sqInt imageHeaderFlags; _iss sqInt lastHash; @@ -1505,7 +1518,6 @@ _iss sqInt lastMethodCacheProbeWrite; _iss sqInt longRunningPrimitiveCheckSequenceNumber; _iss usqInt memory; _iss sqInt numCompactionPasses; -_iss sqInt scavengeInProgress; _iss sqInt fullScreenFlag; _iss float heapGrowthToSizeGCRatio; _iss usqInt heapSizeAtPreviousGC; @@ -2192,7 +2204,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.2041"; +const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-rsf.2077"; volatile int sendTrace; sqInt suppressHeartbeatFlag; @@ -2226,15 +2238,20 @@ sqInt suppressHeartbeatFlag; #define firstLongFormat() 10 #define firstShortFormat() 12 #define fixedFieldsFieldWidth() 16 +#define formatFieldWidthShift() 5 #define formatMask() 0x1F #define formatShift() 24 #define freeStart() GIV(freeStart) +#define greyBitShift() 31 #define identityHashFullWordShift() 32 #define identityHashHalfWordMask() 0x3FFFFF +#define immutableBitShift() 23 #define indexablePointersFormat() 3 #define isForwardedObjectClassIndexPun() 8 #define isFreeObjectClassIndexPun() 0 #define lastClassIndexPun() 31 +#define markedBitFullShift() 55 +#define markedBitHalfShift() 23 #define maxOldSpaceSize() maxOldSpaceSize #define memory() GIV(memory) #define newSpaceLimit() GIV(newSpaceLimit) @@ -2242,6 +2259,7 @@ sqInt suppressHeartbeatFlag; #define numSlotsHalfShift() 24 #define numSlotsMask() 0xFF #define oldSpaceStart() GIV(oldSpaceStart) +#define pinnedBitShift() 30 #define remapBufferCount() GIV(remapBufferCount) #define rememberedBitShift() 29 #define rootTableCapacity() GIV(rememberedSetLimit) @@ -2294,6 +2312,7 @@ interpret(void) register char* localIP IP_REG; sqInt localReturnValue; register char* localSP SP_REG; + sqInt numExtB; sqInt stackPageBytes; usqIntptr_t stackPagesBytes; void *theStackMemory; @@ -2326,7 +2345,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* begin initExtensions */ - extA = (extB = 0); + extA = (numExtB = (extB = 0)); while (1) { bytecodeDispatchDebugHook(); @@ -4403,7 +4422,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -4450,6 +4469,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (0 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP)); } @@ -4470,6 +4490,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (1 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4490,6 +4511,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (2 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4510,6 +4532,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (3 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4530,6 +4553,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (4 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4550,6 +4574,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (5 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4570,6 +4595,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (6 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4590,6 +4616,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (7 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4715,7 +4742,6 @@ interpret(void) commonReturn: /* commonReturn */ { - sqInt aMethodObj; char *callerFP; sqInt closure; sqInt contextToReturnTo; @@ -4756,7 +4782,7 @@ interpret(void) frameToReturnTo = 0; if (!((byteAt((localFP + FoxFrameFlags) + 3)) != 0)) { goto commonCallerReturn; - goto l849; + goto l778; } closure = longAt(localFP + (frameStackedReceiverOffset(localFP))); @@ -4805,7 +4831,7 @@ interpret(void) if (((byteAt((theFP2 + FoxFrameFlags) + 2)) != 0) && (home == (longAt(theFP2 + FoxThisContext)))) { ctxtOrNilOrZero = 0; - goto l856; + goto l785; } if (!((byteAt((theFP2 + FoxFrameFlags) + 3)) != 0)) { theMethod1 = longAt(theFP2 + FoxMethod); @@ -4822,10 +4848,10 @@ interpret(void) if ((byteAt((theFP2 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP2))); ctxtOrNilOrZero = longAt(theFP2 + FoxThisContext); - goto l856; + goto l785; } ctxtOrNilOrZero = marryFrameSP(theFP2, theSP); - goto l856; + goto l785; } } theFPAbove = theFP2; @@ -4836,10 +4862,10 @@ interpret(void) && (((longAt(senderContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { /* begin nilObject */ ctxtOrNilOrZero = GIV(nilObj); - goto l856; + goto l785; } ctxtOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, home); - l856: /* end findMethodWithPrimitive:FromFP:UpToContext: */; + l785: /* end findMethodWithPrimitive:FromFP:UpToContext: */; assert(!((onSamePage && (ctxtOrNilOrZero == (nilObject()))))); if (ctxtOrNilOrZero == 0) { @@ -4847,21 +4873,21 @@ interpret(void) theMethod = longAt((home + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { unwindContextOrNilOrZero = home; - goto l876; + goto l805; } unwindContextOrNilOrZero = 0; - goto l876; + goto l805; } if (!(onSamePage || (ctxtOrNilOrZero == GIV(nilObj)))) { if ((findMethodWithPrimitiveFromContextUpToContext(0, ctxtOrNilOrZero, home)) == GIV(nilObj)) { /* begin nilObject */ unwindContextOrNilOrZero = GIV(nilObj); - goto l876; + goto l805; } } unwindContextOrNilOrZero = ctxtOrNilOrZero; - l876: /* end findUnwindThroughContext: */; + l805: /* end findUnwindThroughContext: */; if (unwindContextOrNilOrZero == GIV(nilObj)) { /* error: can't find home on chain; cannot return */ @@ -4869,10 +4895,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l862; + goto l806; } ourContext = marryFrameSP(localFP, localSP); - l862: /* end ensureFrameIsMarried:SP: */; + l806: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -4882,17 +4908,17 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l849; + goto l778; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext1 = longAt(localFP + FoxThisContext); - goto l853; + goto l788; } ourContext1 = marryFrameSP(localFP, localSP); - l853: /* end ensureFrameIsMarried:SP: */; + l788: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -4904,7 +4930,7 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; /* return self */ - goto l849; + goto l778; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { @@ -4941,30 +4967,30 @@ interpret(void) if (!(((contextToReturnTo & (tagMask())) == 0) && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { frameToReturnTo = 0; - goto l863; + goto l792; } if (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { if (isWidowedContext(contextToReturnTo)) { /* error: home's sender is dead; cannot return */ frameToReturnTo = 0; - goto l863; + goto l792; } /* begin frameOfMarriedContext: */ senderOop2 = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); assert((senderOop2 & 1)); frameToReturnTo = pointerForOop(senderOop2 - 1); - goto l863; + goto l792; } if (!(((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))) & 1))) { frameToReturnTo = 0; - goto l863; + goto l792; } thePage1 = makeBaseFrameFor(contextToReturnTo); markStackPageMostRecentlyUsed(thePage1); frameToReturnTo = (thePage1->baseFP); - l863: /* end establishFrameForContextToReturnTo: */; + l792: /* end establishFrameForContextToReturnTo: */; if (frameToReturnTo == 0) { /* error: home's sender is dead; cannot return */ @@ -4972,10 +4998,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext2 = longAt(localFP + FoxThisContext); - goto l855; + goto l807; } ourContext2 = marryFrameSP(localFP, localSP); - l855: /* end ensureFrameIsMarried:SP: */; + l807: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -4985,7 +5011,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l849; + goto l778; } } assert(pageListIsWellFormed()); @@ -5054,8 +5080,7 @@ interpret(void) (callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord)) - BytesPerWord; } /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5066,7 +5091,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l849: /* end case */; + l778: /* end case */; BREAK; CASE(121) /* returnTrue */ @@ -5117,8 +5142,6 @@ interpret(void) commonCallerReturn: /* commonCallerReturn */ { - sqInt aMethodObj; - sqInt aMethodObj1; char *callerFP; char *callersFPOrNull; sqInt contextToReturnTo; @@ -5142,6 +5165,7 @@ interpret(void) assert(localFP == ((GIV(stackPage)->baseFP))); /* begin baseFrameReturn */ contextToReturnTo = longAt(localFP + FoxCallerContext); + /* begin isContext: */ isAContext = ((contextToReturnTo & (tagMask())) == 0) && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex); if (isAContext @@ -5168,18 +5192,18 @@ interpret(void) fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l886; + goto l819; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l886; + goto l819; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l886: /* end findFrameAbove:inPage: */; + l819: /* end findFrameAbove:inPage: */; moveFramesInthroughtoPage(thePage, frameAbove, GIV(stackPage)); theFP = (thePage->headFP); theSP = (thePage->headSP); @@ -5192,10 +5216,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l885; + goto l810; } ourContext = marryFrameSP(localFP, localSP); - l885: /* end ensureFrameIsMarried:SP: */; + l810: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -5205,7 +5229,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l890; + goto l816; } thePage = makeBaseFrameFor(contextToReturnTo); theFP = (thePage->headFP); @@ -5223,8 +5247,7 @@ interpret(void) localSP = theSP; localFP = theFP; /* begin setMethod: */ - aMethodObj1 = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj1; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5237,15 +5260,14 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* return self */ - l890: /* end baseFrameReturn */; - goto l880; + l816: /* end baseFrameReturn */; + goto l809; } localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); localSP = localFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((localFP + FoxFrameFlags) + 1))) << (shiftForWord()))))); localFP = callersFPOrNull; /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5256,7 +5278,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l880: /* end case */; + l809: /* end case */; BREAK; CASE(126) CASE(127) @@ -5284,10 +5306,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l891; + goto l821; } ourContext = marryFrameSP(localFP, localSP); - l891: /* end ensureFrameIsMarried:SP: */; + l821: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -5319,7 +5341,7 @@ interpret(void) /* begin pushReceiverVariable: */ object = longAt(((longAt(localFP + FoxReceiver)) + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object); - goto l32; + goto l33; } if (variableType == 1) { /* begin pushTemporaryVariable: */ @@ -5327,7 +5349,7 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord))); longAtPointerput((localSP -= BytesPerOop), object1); - goto l32; + goto l33; } if (variableType == 2) { /* begin pushLiteralConstant: */ @@ -5336,7 +5358,7 @@ interpret(void) object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object2); - goto l32; + goto l33; } if (variableType == 3) { /* begin pushLiteralVariable: */ @@ -5356,10 +5378,10 @@ interpret(void) object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object3); - goto l32; + goto l33; } } - l32: /* end case */; + l33: /* end case */; BREAK; CASE(129) /* extendedStoreBytecode */ @@ -5385,7 +5407,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5396,7 +5418,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l44; + goto l49; } # endif /* IMMUTABILITY */ @@ -5416,11 +5438,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l44: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l49: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l40; + goto l43; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5432,7 +5454,7 @@ interpret(void) else { longAtput(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l40; + goto l43; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5461,7 +5483,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5472,7 +5494,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l42; + goto l47; } # endif /* IMMUTABILITY */ @@ -5492,14 +5514,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l42: /* end storeLiteralVariable:withValue: */; + l47: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l40; + goto l43; } error("illegal store"); - l40: /* end extendedStoreBytecodePop: */; + l43: /* end extendedStoreBytecodePop: */; } BREAK; CASE(130) @@ -5529,7 +5551,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5540,7 +5562,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l56; + goto l61; } # endif /* IMMUTABILITY */ @@ -5560,11 +5582,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l56: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l61: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l52; + goto l55; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5576,7 +5598,7 @@ interpret(void) else { longAtput(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l52; + goto l55; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5605,7 +5627,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5616,7 +5638,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l54; + goto l59; } # endif /* IMMUTABILITY */ @@ -5636,14 +5658,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l54: /* end storeLiteralVariable:withValue: */; + l59: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l52; + goto l55; } error("illegal store"); - l52: /* end extendedStoreBytecodePop: */; + l55: /* end extendedStoreBytecodePop: */; } BREAK; CASE(131) @@ -5682,7 +5704,6 @@ interpret(void) /* commonSendOrdinary */ { sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -5695,16 +5716,12 @@ interpret(void) sqInt object; sqInt probe1; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; VM_LABEL(commonSendOrdinary); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOrdinary */ hash1 = GIV(messageSelector) ^ (((sqInt)((usqInt)(GIV(lkupClassTag)) << 2))); @@ -5714,7 +5731,7 @@ interpret(void) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } /* second probe */ @@ -5723,14 +5740,14 @@ interpret(void) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } probe1 = (((usqInt) hash1) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe1 + MethodCacheSelector]) == GIV(messageSelector)) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -5747,24 +5764,23 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } if (lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag))) { - goto l895; + goto l827; } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l908; + goto l832; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l908: /* end classAtIndex: */; + l832: /* end classForClassTag: */; lookupOrdinarySend(); /* begin internalizeIPandSP */ @@ -5772,8 +5788,8 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); - l905: ; - l895: /* end internalFindNewMethodOrdinary */; + l836: ; + l827: /* end internalFindNewMethodOrdinary */; /* begin internalExecuteNewMethod */ if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { @@ -5786,29 +5802,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l897; + goto l835; } if (localPrimIndex == 256) { - goto l897; + goto l835; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l897; + goto l835; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l897; + goto l835; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l897; + goto l835; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l897: /* end internalQuickPrimitiveResponse */; - goto l910; + goto l835; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -5844,7 +5859,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l910; + goto l835; } } /* begin internalActivateNewMethod */ @@ -5855,8 +5870,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -5880,7 +5895,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i = (GIV(argumentCount) + 1); i <= numTemps; i += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -5904,11 +5919,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l894; + goto l834; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l894: /* end getErrorObjectFromPrimFailCode */; + l834: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -5928,7 +5943,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l910: /* end internalExecuteNewMethod */; + l835: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -5947,7 +5962,7 @@ interpret(void) sqInt obj; sqInt obj1; sqInt object; - sqInt object1; + sqInt object11; sqInt object2; sqInt object3; int onCurrentPage; @@ -5971,7 +5986,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto normalSend; - goto l65; + goto l66; } if (opType == 1) { assert(GIV(method) == (iframeMethod(localFP))); @@ -5980,7 +5995,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto superclassSend; - goto l65; + goto l66; } if (opType == 2) { /* begin fetchNextBytecode */ @@ -5995,8 +6010,8 @@ interpret(void) assert(isContext(obj)); if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { /* begin fetchPointer:ofObject: */ - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l74; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l85; } /* begin writeBackHeadFramePointers */ assert(GIV(stackPage) == (mostRecentlyUsedPage())); @@ -6011,8 +6026,8 @@ interpret(void) assert(pageListIsWellFormed()); if (isWidowedContext(obj)) { /* begin fetchPointer:ofObject: */ - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l74; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l85; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -6025,39 +6040,39 @@ interpret(void) if (callerFP == 0) { /* base frame, context in saved ip slot (or base of stack in Cog) */ - object = longAt(spouseFP + FoxCallerContext); - goto l74; + object3 = longAt(spouseFP + FoxCallerContext); + goto l85; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); - object = longAt(callerFP + FoxThisContext); - goto l74; + object3 = longAt(callerFP + FoxThisContext); + goto l85; } - object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l74; + goto l85; } if (byte3 == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); - object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l74; + object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l85; } if (byte3 == InstructionPointerIndex) { - object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l74; + object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l85; } error("bad index"); - object = 0; - l74: /* end instVar:ofContext: */; - longAtPointerput((localSP -= BytesPerOop), object); + object3 = 0; + l85: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object3); } else { /* begin internalPush: */ - object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object1); + object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object11); } - goto l65; + goto l66; } if (opType == 3) { /* begin fetchNextBytecode */ @@ -6066,10 +6081,10 @@ interpret(void) /* begin pushLiteralConstant: */ assert(GIV(method) == (iframeMethod(localFP))); /* begin fetchPointer:ofObject: */ - object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object2); - goto l65; + longAtPointerput((localSP -= BytesPerOop), object); + goto l66; } if (opType == 4) { /* begin fetchNextBytecode */ @@ -6089,10 +6104,10 @@ interpret(void) litVar = unfollowatIndex(litVar, byte3); } /* begin internalPush: */ - object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object3); + object2 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object2); - goto l65; + goto l66; } top = longAtPointer(localSP); if (opType == 7) { @@ -6122,7 +6137,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar1)))); - if (((((usqInt) (longAt(litVar1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar1); /* begin internalPush: */ @@ -6133,7 +6148,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l72; + goto l92; } # endif /* IMMUTABILITY */ @@ -6153,11 +6168,11 @@ interpret(void) } } longAtput((litVar1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), top); - l72: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l92: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l65; + goto l66; } if (opType == 6) { /* begin internalPop: */ @@ -6201,7 +6216,7 @@ interpret(void) longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); if (byte3 == StackPointerIndex) { } - goto l86; + goto l82; } /* begin frameOfMarriedContext: */ senderOop1 = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -6222,7 +6237,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l86; + goto l82; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -6252,14 +6267,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l86: /* end instVar:ofContext:put: */; + l82: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj1)))); - if (((((usqInt) (longAt(obj1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj1); /* begin internalPush: */ @@ -6270,7 +6285,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l79; + goto l86; } # endif /* IMMUTABILITY */ @@ -6290,13 +6305,13 @@ interpret(void) } } longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); - l79: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l86: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); } - l65: /* end case */; + l66: /* end case */; BREAK; CASE(133) /* singleExtendedSuperBytecode */ @@ -6442,7 +6457,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -6461,12 +6475,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -6487,10 +6498,10 @@ interpret(void) goto l103; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l103: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l103: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -6534,15 +6545,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l110; + goto l109; } else { goto respondToUnknownBytecode; - goto l110; + goto l109; } } - l110: /* end case */; + l109: /* end case */; BREAK; CASE(140) CASE(506) /*250*/ @@ -6579,7 +6590,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeRemoteTempLongBytecode); /* begin fetchByte */ @@ -6594,21 +6604,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); } BREAK; CASE(142) @@ -6619,7 +6628,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeAndPopRemoteTempLongBytecode); /* begin storeRemoteTempLongBytecode */ @@ -6634,21 +6642,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); /* begin internalPop: */ localSP += 1 * BytesPerOop; } @@ -6684,10 +6691,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l140; + goto l139; } context = marryFrameSP(localFP, localSP + (numCopied * BytesPerOop)); - l140: /* end ensureFrameIsMarried:SP: */; + l139: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -6715,13 +6722,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l134; + goto l130; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l134: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l130: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -6896,7 +6903,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l145; + goto l143; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6904,7 +6911,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l145: /* end jumplfFalseBy: */; + l143: /* end jumplfFalseBy: */; } BREAK; CASE(160) @@ -6967,7 +6974,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l150; + goto l148; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6975,7 +6982,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l150: /* end jumplfTrueBy: */; + l148: /* end jumplfTrueBy: */; } BREAK; CASE(172) @@ -7004,7 +7011,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l154; + goto l152; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7012,7 +7019,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l154: /* end jumplfFalseBy: */; + l152: /* end jumplfFalseBy: */; } BREAK; CASE(176) @@ -7041,7 +7048,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l156; + goto l154; } } else { @@ -7054,43 +7061,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l163; + goto l159; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l157; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l159; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l157: /* end floatValueOf: */; - l163: /* end loadFloatOrIntFrom: */; + l159: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l158; + goto l155; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l161; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l155; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l161: /* end floatValueOf: */; - l158: /* end loadFloatOrIntFrom: */; + l155: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -7104,7 +7109,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l156; + goto l154; } } /* begin fetchPointer:ofObject: */ @@ -7113,7 +7118,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l156: /* end case */; + l154: /* end case */; BREAK; CASE(177) /* bytecodePrimSubtract */ @@ -7141,7 +7146,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l165; + goto l161; } } else { @@ -7154,14 +7159,14 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l172; + goto l166; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; goto l166; } /* begin primitiveFail */ @@ -7169,28 +7174,26 @@ interpret(void) GIV(primFailCode) = 1; } rcvr1 = 0.0; - l166: /* end floatValueOf: */; - l172: /* end loadFloatOrIntFrom: */; + l166: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l167; + goto l162; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l170; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l162; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l170: /* end floatValueOf: */; - l167: /* end loadFloatOrIntFrom: */; + l162: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -7204,7 +7207,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l165; + goto l161; } } /* begin fetchPointer:ofObject: */ @@ -7213,7 +7216,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l165: /* end case */; + l161: /* end case */; BREAK; CASE(178) /* bytecodePrimLessThan */ @@ -7243,14 +7246,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l174; + goto l168; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l177; + goto l170; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7258,19 +7261,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l179; + goto l170; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l179: /* end floatValueOf: */; - l177: /* end loadFloatOrIntFrom: */; + l170: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l181; + goto l173; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7278,15 +7280,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l175; + goto l173; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l175: /* end floatValueOf: */; - l181: /* end loadFloatOrIntFrom: */; + l173: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7296,7 +7297,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l174; + goto l168; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7304,7 +7305,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l174: /* end case */; + l168: /* end case */; booleanCheatTrue: /* booleanCheatTrue */ @@ -7326,7 +7327,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } if (bytecode == 172) { @@ -7335,7 +7336,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } if (bytecode > 167) { @@ -7345,7 +7346,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -7353,7 +7354,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l921: /* end case */; + l849: /* end case */; BREAK; CASE(179) /* bytecodePrimGreaterThan */ @@ -7383,14 +7384,14 @@ interpret(void) else { /* goto booleanCheatFalse */ } - goto l182; + goto l174; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l185; + goto l176; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7398,19 +7399,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l187; + goto l176; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l187: /* end floatValueOf: */; - l185: /* end loadFloatOrIntFrom: */; + l176: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l189; + goto l179; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7418,15 +7418,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l183; + goto l179; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l183: /* end floatValueOf: */; - l189: /* end loadFloatOrIntFrom: */; + l179: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7436,7 +7435,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l182; + goto l174; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7444,7 +7443,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l182: /* end case */; + l174: /* end case */; booleanCheatFalse: /* booleanCheatFalse */ @@ -7466,7 +7465,7 @@ interpret(void) localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l924; + goto l852; } if (bytecode == 172) { @@ -7476,14 +7475,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l924; + goto l852; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l924: /* end case */; + l852: /* end case */; BREAK; CASE(180) /* bytecodePrimLessOrEqual */ @@ -7513,14 +7512,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l190; + goto l180; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l193; + goto l182; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7528,19 +7527,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l195; + goto l182; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l195: /* end floatValueOf: */; - l193: /* end loadFloatOrIntFrom: */; + l182: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l197; + goto l185; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7548,15 +7546,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l191; + goto l185; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l191: /* end floatValueOf: */; - l197: /* end loadFloatOrIntFrom: */; + l185: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7566,7 +7563,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l190; + goto l180; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7574,7 +7571,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l190: /* end case */; + l180: /* end case */; BREAK; CASE(181) /* bytecodePrimGreaterOrEqual */ @@ -7604,14 +7601,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l198; + goto l186; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l201; + goto l188; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7619,19 +7616,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l203; + goto l188; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l203: /* end floatValueOf: */; - l201: /* end loadFloatOrIntFrom: */; + l188: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l205; + goto l191; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7639,15 +7635,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l199; + goto l191; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l199: /* end floatValueOf: */; - l205: /* end loadFloatOrIntFrom: */; + l191: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7657,7 +7652,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l198; + goto l186; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7665,7 +7660,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l198: /* end case */; + l186: /* end case */; BREAK; CASE(182) /* bytecodePrimEqual */ @@ -7692,14 +7687,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l206; + goto l192; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l209; + goto l194; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7707,19 +7702,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l211; + goto l194; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l211: /* end floatValueOf: */; - l209: /* end loadFloatOrIntFrom: */; + l194: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l213; + goto l197; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7727,15 +7721,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l207; + goto l197; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l207: /* end floatValueOf: */; - l213: /* end loadFloatOrIntFrom: */; + l197: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7745,7 +7738,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l206; + goto l192; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7753,7 +7746,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l206: /* end case */; + l192: /* end case */; BREAK; CASE(183) /* bytecodePrimNotEqual */ @@ -7780,14 +7773,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l214; + goto l198; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l217; + goto l200; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7795,19 +7788,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l219; + goto l200; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l219: /* end floatValueOf: */; - l217: /* end loadFloatOrIntFrom: */; + l200: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l221; + goto l203; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7815,15 +7807,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l215; + goto l203; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l215: /* end floatValueOf: */; - l221: /* end loadFloatOrIntFrom: */; + l203: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7833,7 +7824,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l214; + goto l198; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7841,7 +7832,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l214: /* end case */; + l198: /* end case */; BREAK; CASE(184) /* bytecodePrimMultiply */ @@ -7882,7 +7873,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l222; + goto l204; } } else { @@ -7895,43 +7886,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l229; + goto l209; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l223; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l209; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l223: /* end floatValueOf: */; - l229: /* end loadFloatOrIntFrom: */; + l209: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l224; + goto l205; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l227; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l205; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l227: /* end floatValueOf: */; - l224: /* end loadFloatOrIntFrom: */; + l205: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -7945,7 +7934,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l222; + goto l204; } } /* begin fetchPointer:ofObject: */ @@ -7954,7 +7943,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l222: /* end case */; + l204: /* end case */; BREAK; CASE(185) /* bytecodePrimDivide */ @@ -7988,7 +7977,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l231; + goto l211; } } } @@ -8002,7 +7991,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l237; + goto l216; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8010,19 +7999,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l233; + goto l216; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l233: /* end floatValueOf: */; - l237: /* end loadFloatOrIntFrom: */; + l216: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l236; + goto l212; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8030,15 +8018,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l232; + goto l212; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l232: /* end floatValueOf: */; - l236: /* end loadFloatOrIntFrom: */; + l212: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -8060,7 +8047,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l231; + goto l211; } } /* begin fetchPointer:ofObject: */ @@ -8069,7 +8056,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l231: /* end case */; + l211: /* end case */; BREAK; CASE(186) /* bytecodePrimMod */ @@ -8087,7 +8074,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l240; + goto l218; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8095,7 +8082,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l240: /* end case */; + l218: /* end case */; BREAK; CASE(187) /* bytecodePrimMakePoint */ @@ -8118,7 +8105,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l244; + goto l222; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8126,7 +8113,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l244: /* end case */; + l222: /* end case */; BREAK; CASE(188) /* bytecodePrimBitShift */ @@ -8156,7 +8143,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -8170,7 +8157,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -8178,7 +8165,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } } else { @@ -8189,7 +8176,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -8198,7 +8185,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l258; + goto l234; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8221,13 +8208,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l256; + goto l228; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l256: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l228: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8238,15 +8225,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l258; + goto l234; - l258: /* end positive32BitIntegerFor: */; + l234: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l250: /* end primitiveBitShift */; + l233: /* end primitiveBitShift */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -8255,7 +8242,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l248; + goto l226; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8263,7 +8250,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l248: /* end case */; + l226: /* end case */; BREAK; CASE(189) /* bytecodePrimDiv */ @@ -8281,7 +8268,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l259; + goto l236; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8289,7 +8276,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l259: /* end case */; + l236: /* end case */; BREAK; CASE(190) /* bytecodePrimBitAnd */ @@ -8308,7 +8295,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l263; + goto l240; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8325,7 +8312,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l263; + goto l240; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8333,7 +8320,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l263: /* end case */; + l240: /* end case */; BREAK; CASE(191) /* bytecodePrimBitOr */ @@ -8352,7 +8339,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l268; + goto l245; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8369,7 +8356,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l268; + goto l245; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8377,7 +8364,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l268: /* end case */; + l245: /* end case */; BREAK; CASE(192) /* bytecodePrimAt */ @@ -8398,10 +8385,10 @@ interpret(void) sqInt newLargeInteger; usqInt newObj; usqInt numBytes; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objFormat; sqInt objOop; sqInt objOop1; @@ -8432,21 +8419,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l273; + goto l250; } if (primitiveFunctionPointer == primitiveAt) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l288; + goto l265; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -8454,62 +8442,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l288; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l265; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l293; + totalLength = numSlots2; + goto l262; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l293; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l262; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l293; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l262; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l293; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l262; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l293; + totalLength = ((usqInt) numSlots2) >> 1; + goto l262; } totalLength = 0; - l293: /* end lengthOf:format: */; + l262: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l310; + goto l258; } if (fmt < 2) { fixedFields = totalLength; - goto l310; + goto l258; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l310: /* end fixedFieldsOf:format:length: */; + l258: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l288: /* end install:inAtCache:at:string: */; + l265: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAt) { @@ -8517,48 +8501,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l279; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l260; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l301; + totalLength1 = numSlots3; + goto l275; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l301; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l275; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l301; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l275; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l301; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l275; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l301; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l275; } totalLength1 = 0; - l301: /* end lengthOf:format: */; + l275: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -8568,12 +8549,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l279: /* end install:inAtCache:at:string: */; + l260: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l273; + goto l250; } } } @@ -8589,18 +8570,18 @@ interpret(void) fixedFields2 = GIV(atCache)[atIx + AtCacheFixedFields]; /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord()))))); - goto l283; + goto l274; } if (fmt2 < (firstByteFormat())) { /* 64, 32, & 16 bits */ if (fmt2 >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))))))) << 1) | 1); - goto l283; + goto l274; } if (fmt2 == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))))); - goto l283; + goto l274; } /* begin fetchLong32:ofObject: */ @@ -8610,7 +8591,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) result1)) <= (MaxSmallInteger)) { result = ((result1 << 1) | 1); - goto l312; + goto l274; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8633,13 +8614,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l281; + goto l280; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l281: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l280: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8650,10 +8631,8 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l312; + goto l274; - l312: /* end positive32BitIntegerFor: */; - goto l283; } if (fmt2 >= 32) { @@ -8674,16 +8653,16 @@ interpret(void) /* begin fetchByte:ofObject: */ result1 = byteAt((rcvr + BaseHeaderSize) + (index1 - 1)); } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (result1 << (numTagBits())) + (characterTag()); - goto l283; + goto l274; } else { if ((fmt2 < (firstCompiledMethodFormat())) || (index1 >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index1 - 1))) << 1) | 1); - goto l283; + goto l274; } } } @@ -8692,7 +8671,7 @@ interpret(void) ? PrimErrBadIndex : PrimErrBadReceiver); result = (GIV(primFailCode) = reasonCode); - l283: /* end commonVariable:at:cacheIndex: */; + l274: /* end commonVariable:at:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -8700,7 +8679,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (2 - 1) * BytesPerOop), result); - goto l273; + goto l250; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8711,7 +8690,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l273: /* end case */; + l250: /* end case */; BREAK; CASE(193) /* bytecodePrimAtPut */ @@ -8731,10 +8710,10 @@ interpret(void) sqInt index; sqInt index1; sqInt isCharacter; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objOop; sqInt objOop1; sqInt rcvr; @@ -8752,8 +8731,9 @@ interpret(void) rcvr = longAtPointer(localSP + (2 * BytesPerOop)); # if IMMUTABILITY + /* begin isOopMutable: */ correctRcvr = ((rcvr & (tagMask())) == 0) - && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)); # else /* IMMUTABILITY */ /* begin isNonImmediate: */ @@ -8775,21 +8755,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l313; + goto l282; } if (primitiveFunctionPointer == primitiveAtPut) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l319; + goto l290; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -8797,62 +8778,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l319; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l290; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l343; + totalLength = numSlots2; + goto l300; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l343; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l300; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l343; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l300; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l343; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l300; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l343; + totalLength = ((usqInt) numSlots2) >> 1; + goto l300; } totalLength = 0; - l343: /* end lengthOf:format: */; + l300: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l345; + goto l289; } if (fmt < 2) { fixedFields = totalLength; - goto l345; + goto l289; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l345: /* end fixedFieldsOf:format:length: */; + l289: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l319: /* end install:inAtCache:at:string: */; + l290: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAtPut) { @@ -8860,48 +8837,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l314; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l285; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l333; + totalLength1 = numSlots3; + goto l291; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l333; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l291; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l333; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l291; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l333; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l291; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l333; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l291; } totalLength1 = 0; - l333: /* end lengthOf:format: */; + l291: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -8911,12 +8885,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l314: /* end install:inAtCache:at:string: */; + l285: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l313; + goto l282; } } } @@ -8945,7 +8919,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord())))), value); - goto l318; + goto l292; } if (fmt2 < (firstByteFormat())) { @@ -8958,33 +8932,33 @@ interpret(void) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l318; + goto l292; } if (fmt2 == (sixtyFourBitIndexableFormat())) { val64ToPut = positive64BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))), val64ToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } valToPut = positive32BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } if (fmt2 >= 32) { @@ -8994,7 +8968,7 @@ interpret(void) if (!isCharacter) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin characterValueOf: */ valToPut = ((usqInt) (((usqInt)value))) >> (numTagBits()); @@ -9004,18 +8978,18 @@ interpret(void) assert(fmt2 != ((sixtyFourBitIndexableFormat()) + (firstStringyFakeFormat()))); /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l318; + goto l292; } else { if (!((valToPut >= 0) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l318; + goto l292; } } @@ -9025,7 +8999,7 @@ interpret(void) && (index1 < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; - goto l318; + goto l292; } valToPut = ((value & 1) ? (value >> 1) @@ -9035,18 +9009,18 @@ interpret(void) && (valToPut <= 0xFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index1 - 1), valToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ reasonCode = (isIndexable(rcvr) ? PrimErrBadIndex : PrimErrBadReceiver); GIV(primFailCode) = reasonCode; - l318: /* end commonVariable:at:put:cacheIndex: */; + l292: /* end commonVariable:at:put:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -9054,7 +9028,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (3 - 1) * BytesPerOop), value); - goto l313; + goto l282; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -9065,21 +9039,23 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; } - l313: /* end case */; + l282: /* end case */; BREAK; CASE(194) /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -9092,114 +9068,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l352; + goto l320; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l352; + goto l320; - l352: /* end is:instanceOf:compactClassIndex: */; + l320: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l350; + goto l322; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l350; + goto l322; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l350; + goto l322; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l350; + goto l322; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l350; + goto l322; } sz = 0; - l350: /* end lengthOf:format: */; + l322: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l347; + goto l311; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l355; + goto l323; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l355; + goto l323; - l355: /* end is:instanceOf:compactClassIndex: */; + l323: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l358; + sz = numSlots2; + goto l321; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l358; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l321; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l358; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l321; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l358; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l321; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l358; + sz = ((usqInt) numSlots2) >> 1; + goto l321; } sz = 0; - l358: /* end lengthOf:format: */; + l321: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l347; + goto l311; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9207,7 +9177,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l347: /* end case */; + l311: /* end case */; BREAK; CASE(195) CASE(355) /*99*/ @@ -9331,6 +9301,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9339,18 +9310,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l372; + goto l334; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l372; + goto l334; - l372: /* end is:instanceOf:compactClassIndex: */; + l334: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -9367,7 +9339,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l368; + goto l332; } GIV(primFailCode) = 0; } @@ -9376,12 +9348,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l368: /* end case */; + l332: /* end case */; BREAK; CASE(202) /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9390,18 +9363,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l378; + goto l340; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l378; + goto l340; - l378: /* end is:instanceOf:compactClassIndex: */; + l340: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -9418,7 +9392,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l374; + goto l338; } GIV(primFailCode) = 0; } @@ -9427,7 +9401,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l374: /* end case */; + l338: /* end case */; BREAK; CASE(203) CASE(363) /*107*/ @@ -9488,9 +9462,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9506,7 +9480,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l386; + goto l350; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9515,7 +9489,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l386: /* end case */; + l350: /* end case */; BREAK; CASE(207) /* bytecodePrimPointY */ @@ -9534,9 +9508,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9552,7 +9526,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l393; + goto l358; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9561,7 +9535,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l393: /* end case */; + l358: /* end case */; BREAK; CASE(208) CASE(209) @@ -9740,7 +9714,7 @@ interpret(void) case 0: /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); - goto l416; + goto l382; break; case 1: @@ -9758,10 +9732,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l420; + goto l384; } context = marryFrameSP(localFP, localSP); - l420: /* end ensureFrameIsMarried:SP: */; + l384: /* end ensureFrameIsMarried:SP: */; thing = context; break; @@ -9774,10 +9748,11 @@ interpret(void) } extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), thing); } - l416: /* end case */; + l382: /* end case */; BREAK; CASE(336) /*80*/ /* bytecodePrimAdd */ @@ -9805,7 +9780,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l424; + goto l390; } } else { @@ -9818,43 +9793,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l431; + goto l395; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l425; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l395; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l425: /* end floatValueOf: */; - l431: /* end loadFloatOrIntFrom: */; + l395: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l426; + goto l391; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l429; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l391; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l429: /* end floatValueOf: */; - l426: /* end loadFloatOrIntFrom: */; + l391: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -9868,7 +9841,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l424; + goto l390; } } /* begin fetchPointer:ofObject: */ @@ -9877,7 +9850,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l424: /* end case */; + l390: /* end case */; BREAK; CASE(337) /*81*/ /* bytecodePrimSubtract */ @@ -9905,7 +9878,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l433; + goto l397; } } else { @@ -9918,43 +9891,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l440; + goto l402; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l434; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l402; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l434: /* end floatValueOf: */; - l440: /* end loadFloatOrIntFrom: */; + l402: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l435; + goto l398; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l438; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l398; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l438: /* end floatValueOf: */; - l435: /* end loadFloatOrIntFrom: */; + l398: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -9968,7 +9939,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l433; + goto l397; } } /* begin fetchPointer:ofObject: */ @@ -9977,7 +9948,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l433: /* end case */; + l397: /* end case */; BREAK; CASE(338) /*82*/ /* bytecodePrimLessThanV4 */ @@ -10007,14 +9978,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l442; + goto l404; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l445; + goto l406; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10022,19 +9993,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l447; + goto l406; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l447: /* end floatValueOf: */; - l445: /* end loadFloatOrIntFrom: */; + l406: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l449; + goto l409; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10042,15 +10012,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l443; + goto l409; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l443: /* end floatValueOf: */; - l449: /* end loadFloatOrIntFrom: */; + l409: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10060,7 +10029,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l442; + goto l404; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10068,7 +10037,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l442: /* end case */; + l404: /* end case */; booleanCheatTrueV4: /* booleanCheatTrueV4 */ @@ -10089,7 +10058,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } if (bytecode == 244) { @@ -10098,7 +10067,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } if (bytecode == 243) { @@ -10108,7 +10077,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -10116,7 +10085,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l925: /* end case */; + l853: /* end case */; BREAK; CASE(339) /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -10146,14 +10115,14 @@ interpret(void) else { /* goto booleanCheatFalseV4 */ } - goto l450; + goto l410; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l453; + goto l412; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10161,19 +10130,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l455; + goto l412; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l455: /* end floatValueOf: */; - l453: /* end loadFloatOrIntFrom: */; + l412: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l457; + goto l415; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10181,15 +10149,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l451; + goto l415; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l451: /* end floatValueOf: */; - l457: /* end loadFloatOrIntFrom: */; + l415: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10199,7 +10166,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l450; + goto l410; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10207,7 +10174,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l450: /* end case */; + l410: /* end case */; booleanCheatFalseV4: /* booleanCheatFalseV4 */ @@ -10229,7 +10196,7 @@ interpret(void) localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l928; + goto l856; } if (bytecode == 244) { @@ -10239,14 +10206,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l928; + goto l856; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l928: /* end case */; + l856: /* end case */; BREAK; CASE(340) /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -10276,14 +10243,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l458; + goto l416; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l461; + goto l418; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10291,19 +10258,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l463; + goto l418; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l463: /* end floatValueOf: */; - l461: /* end loadFloatOrIntFrom: */; + l418: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l465; + goto l421; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10311,15 +10277,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l459; + goto l421; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l459: /* end floatValueOf: */; - l465: /* end loadFloatOrIntFrom: */; + l421: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10329,7 +10294,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l458; + goto l416; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10337,7 +10302,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l458: /* end case */; + l416: /* end case */; BREAK; CASE(341) /*85*/ /* bytecodePrimGreaterOrEqualV4 */ @@ -10367,14 +10332,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l466; + goto l422; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l469; + goto l424; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10382,19 +10347,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l471; + goto l424; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l471: /* end floatValueOf: */; - l469: /* end loadFloatOrIntFrom: */; + l424: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l473; + goto l427; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10402,15 +10366,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l467; + goto l427; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l467: /* end floatValueOf: */; - l473: /* end loadFloatOrIntFrom: */; + l427: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10420,7 +10383,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l466; + goto l422; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10428,7 +10391,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l466: /* end case */; + l422: /* end case */; BREAK; CASE(342) /*86*/ /* bytecodePrimEqualV4 */ @@ -10455,14 +10418,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l474; + goto l428; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l477; + goto l430; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10470,19 +10433,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l479; + goto l430; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l479: /* end floatValueOf: */; - l477: /* end loadFloatOrIntFrom: */; + l430: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l481; + goto l433; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10490,15 +10452,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l475; + goto l433; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l475: /* end floatValueOf: */; - l481: /* end loadFloatOrIntFrom: */; + l433: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10508,7 +10469,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l474; + goto l428; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10516,7 +10477,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l474: /* end case */; + l428: /* end case */; BREAK; CASE(343) /*87*/ /* bytecodePrimNotEqualV4 */ @@ -10543,14 +10504,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l482; + goto l434; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l485; + goto l436; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10558,19 +10519,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l487; + goto l436; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l487: /* end floatValueOf: */; - l485: /* end loadFloatOrIntFrom: */; + l436: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l489; + goto l439; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10578,15 +10538,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l483; + goto l439; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l483: /* end floatValueOf: */; - l489: /* end loadFloatOrIntFrom: */; + l439: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10596,7 +10555,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l482; + goto l434; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10604,7 +10563,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l482: /* end case */; + l434: /* end case */; BREAK; CASE(344) /*88*/ /* bytecodePrimMultiply */ @@ -10645,7 +10604,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l490; + goto l440; } } else { @@ -10658,114 +10617,7 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l497; - } - /* begin floatValueOf: */ - isFloat = ((rcvr & (tagMask())) == 0) - && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); - if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l491; - } - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } - rcvr1 = 0.0; - l491: /* end floatValueOf: */; - l497: /* end loadFloatOrIntFrom: */; - /* begin loadFloatOrIntFrom: */ - if ((arg & 1)) { - arg1 = ((double) ((arg >> 1)) ); - goto l492; - } - /* begin floatValueOf: */ - isFloat1 = ((arg & (tagMask())) == 0) - && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); - if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l495; - } - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } - arg1 = 0.0; - l495: /* end floatValueOf: */; - l492: /* end loadFloatOrIntFrom: */; - if (!GIV(primFailCode)) { - /* begin pop:thenPushFloat: */ - longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); - GIV(stackPointer) = sp; - } - /* begin internalizeIPandSP */ - localIP = pointerForOop(GIV(instructionPointer)); - localSP = pointerForOop(GIV(stackPointer)); - localFP = pointerForOop(GIV(framePointer)); - if (!GIV(primFailCode)) { - /* begin fetchNextBytecode */ - currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - - goto l490; - } - } - /* begin fetchPointer:ofObject: */ - objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); - GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); - GIV(argumentCount) = 1; - goto normalSend; - } - l490: /* end case */; - BREAK; - CASE(345) /*89*/ - /* bytecodePrimDivide */ - { - sqInt arg; - double arg1; - sqInt isFloat; - sqInt isFloat1; - sqInt objOop; - sqInt rcvr; - double rcvr1; - sqInt result; - double result1; - double result2; - char *sp; - - VM_LABEL(bytecodePrimDivide1); - rcvr = longAtPointer(localSP + (1 * BytesPerOop)); - arg = longAtPointer(localSP + (0 * BytesPerOop)); - if (((rcvr & arg) & 1) != 0) { - rcvr = (rcvr >> 1); - arg = (arg >> 1); - if ((arg != 0) - && ((rcvr % arg) == 0)) { - - /* generates C / operation */ - result = rcvr / arg; - if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { - /* begin internalPop:thenPush: */ - longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); - /* begin fetchNextBytecode */ - currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - - goto l499; - } - } - } - else { - /* begin initPrimCall */ - GIV(primFailCode) = 0; - /* begin externalizeIPandSP */ - GIV(instructionPointer) = oopForPointer(localIP); - GIV(stackPointer) = localSP; - GIV(framePointer) = localFP; - /* begin primitiveFloatDivide:byArg: */ - if ((rcvr & 1)) { - rcvr1 = ((double) ((rcvr >> 1)) ); - goto l505; + goto l445; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10773,19 +10625,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l501; + goto l445; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l501: /* end floatValueOf: */; - l505: /* end loadFloatOrIntFrom: */; + l445: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l504; + goto l441; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10793,15 +10644,119 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l500; + goto l441; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l500: /* end floatValueOf: */; - l504: /* end loadFloatOrIntFrom: */; + l441: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l440; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l440: /* end case */; + BREAK; + CASE(345) /*89*/ + /* bytecodePrimDivide */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimDivide1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + if ((arg != 0) + && ((rcvr % arg) == 0)) { + + /* generates C / operation */ + result = rcvr / arg; + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l447; + } + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatDivide:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l452; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l452; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l452: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l448; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l448; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l448: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -10823,7 +10778,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l499; + goto l447; } } /* begin fetchPointer:ofObject: */ @@ -10832,7 +10787,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l499: /* end case */; + l447: /* end case */; BREAK; CASE(346) /*90*/ /* bytecodePrimMod */ @@ -10850,7 +10805,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l508; + goto l454; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10858,7 +10813,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l508: /* end case */; + l454: /* end case */; BREAK; CASE(347) /*91*/ /* bytecodePrimMakePoint */ @@ -10881,7 +10836,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l512; + goto l458; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10889,7 +10844,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l512: /* end case */; + l458: /* end case */; BREAK; CASE(348) /*92*/ /* bytecodePrimBitShift */ @@ -10919,7 +10874,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -10933,7 +10888,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -10941,7 +10896,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } } else { @@ -10952,7 +10907,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -10961,7 +10916,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l526; + goto l470; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -10984,13 +10939,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l524; + goto l464; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l524: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l464: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -11001,15 +10956,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l526; + goto l470; - l526: /* end positive32BitIntegerFor: */; + l470: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l518: /* end primitiveBitShift */; + l469: /* end primitiveBitShift */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -11018,7 +10973,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l516; + goto l462; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11026,7 +10981,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l516: /* end case */; + l462: /* end case */; BREAK; CASE(349) /*93*/ /* bytecodePrimDiv */ @@ -11044,7 +10999,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l527; + goto l472; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11052,7 +11007,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l527: /* end case */; + l472: /* end case */; BREAK; CASE(350) /*94*/ /* bytecodePrimBitAnd */ @@ -11071,7 +11026,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l531; + goto l476; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11088,7 +11043,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l531; + goto l476; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11096,7 +11051,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l531: /* end case */; + l476: /* end case */; BREAK; CASE(351) /*95*/ /* bytecodePrimBitOr */ @@ -11115,7 +11070,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l536; + goto l481; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11132,7 +11087,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l536; + goto l481; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11140,7 +11095,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l536: /* end case */; + l481: /* end case */; BREAK; CASE(352) /*96*/ /* bytecodePrimAt */ @@ -11161,10 +11116,10 @@ interpret(void) sqInt newLargeInteger; usqInt newObj; usqInt numBytes; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objFormat; sqInt objOop; sqInt objOop1; @@ -11195,21 +11150,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l541; + goto l486; } if (primitiveFunctionPointer == primitiveAt) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l556; + goto l501; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -11217,62 +11173,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l556; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l501; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l561; + totalLength = numSlots2; + goto l498; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l561; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l498; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l561; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l498; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l561; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l498; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l561; + totalLength = ((usqInt) numSlots2) >> 1; + goto l498; } totalLength = 0; - l561: /* end lengthOf:format: */; + l498: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l578; + goto l494; } if (fmt < 2) { fixedFields = totalLength; - goto l578; + goto l494; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l578: /* end fixedFieldsOf:format:length: */; + l494: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l556: /* end install:inAtCache:at:string: */; + l501: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAt) { @@ -11280,48 +11232,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l547; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l496; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l569; + totalLength1 = numSlots3; + goto l511; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l569; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l511; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l569; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l511; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l569; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l511; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l569; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l511; } totalLength1 = 0; - l569: /* end lengthOf:format: */; + l511: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -11331,12 +11280,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l547: /* end install:inAtCache:at:string: */; + l496: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l541; + goto l486; } } } @@ -11352,18 +11301,18 @@ interpret(void) fixedFields2 = GIV(atCache)[atIx + AtCacheFixedFields]; /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord()))))); - goto l551; + goto l510; } if (fmt2 < (firstByteFormat())) { /* 64, 32, & 16 bits */ if (fmt2 >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))))))) << 1) | 1); - goto l551; + goto l510; } if (fmt2 == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))))); - goto l551; + goto l510; } /* begin fetchLong32:ofObject: */ @@ -11373,7 +11322,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) result1)) <= (MaxSmallInteger)) { result = ((result1 << 1) | 1); - goto l580; + goto l510; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -11396,13 +11345,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l549; + goto l516; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l549: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l516: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -11413,10 +11362,8 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l580; + goto l510; - l580: /* end positive32BitIntegerFor: */; - goto l551; } if (fmt2 >= 32) { @@ -11437,16 +11384,16 @@ interpret(void) /* begin fetchByte:ofObject: */ result1 = byteAt((rcvr + BaseHeaderSize) + (index1 - 1)); } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (result1 << (numTagBits())) + (characterTag()); - goto l551; + goto l510; } else { if ((fmt2 < (firstCompiledMethodFormat())) || (index1 >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index1 - 1))) << 1) | 1); - goto l551; + goto l510; } } } @@ -11455,7 +11402,7 @@ interpret(void) ? PrimErrBadIndex : PrimErrBadReceiver); result = (GIV(primFailCode) = reasonCode); - l551: /* end commonVariable:at:cacheIndex: */; + l510: /* end commonVariable:at:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -11463,7 +11410,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (2 - 1) * BytesPerOop), result); - goto l541; + goto l486; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11474,7 +11421,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l541: /* end case */; + l486: /* end case */; BREAK; CASE(353) /*97*/ /* bytecodePrimAtPut */ @@ -11494,10 +11441,10 @@ interpret(void) sqInt index; sqInt index1; sqInt isCharacter; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objOop; sqInt objOop1; sqInt rcvr; @@ -11515,8 +11462,9 @@ interpret(void) rcvr = longAtPointer(localSP + (2 * BytesPerOop)); # if IMMUTABILITY + /* begin isOopMutable: */ correctRcvr = ((rcvr & (tagMask())) == 0) - && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)); # else /* IMMUTABILITY */ /* begin isNonImmediate: */ @@ -11538,21 +11486,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l581; + goto l518; } if (primitiveFunctionPointer == primitiveAtPut) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l587; + goto l526; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -11560,62 +11509,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l587; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l526; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l611; + totalLength = numSlots2; + goto l536; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l611; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l536; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l611; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l536; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l611; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l536; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l611; + totalLength = ((usqInt) numSlots2) >> 1; + goto l536; } totalLength = 0; - l611: /* end lengthOf:format: */; + l536: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l613; + goto l525; } if (fmt < 2) { fixedFields = totalLength; - goto l613; + goto l525; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l613: /* end fixedFieldsOf:format:length: */; + l525: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l587: /* end install:inAtCache:at:string: */; + l526: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAtPut) { @@ -11623,48 +11568,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l582; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l521; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l601; + totalLength1 = numSlots3; + goto l527; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l601; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l527; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l601; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l527; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l601; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l527; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l601; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l527; } totalLength1 = 0; - l601: /* end lengthOf:format: */; + l527: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -11674,12 +11616,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l582: /* end install:inAtCache:at:string: */; + l521: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l581; + goto l518; } } } @@ -11708,7 +11650,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord())))), value); - goto l586; + goto l528; } if (fmt2 < (firstByteFormat())) { @@ -11721,33 +11663,33 @@ interpret(void) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l586; + goto l528; } if (fmt2 == (sixtyFourBitIndexableFormat())) { val64ToPut = positive64BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))), val64ToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } valToPut = positive32BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } if (fmt2 >= 32) { @@ -11757,7 +11699,7 @@ interpret(void) if (!isCharacter) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin characterValueOf: */ valToPut = ((usqInt) (((usqInt)value))) >> (numTagBits()); @@ -11767,18 +11709,18 @@ interpret(void) assert(fmt2 != ((sixtyFourBitIndexableFormat()) + (firstStringyFakeFormat()))); /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l586; + goto l528; } else { if (!((valToPut >= 0) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l586; + goto l528; } } @@ -11788,7 +11730,7 @@ interpret(void) && (index1 < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; - goto l586; + goto l528; } valToPut = ((value & 1) ? (value >> 1) @@ -11798,18 +11740,18 @@ interpret(void) && (valToPut <= 0xFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index1 - 1), valToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ reasonCode = (isIndexable(rcvr) ? PrimErrBadIndex : PrimErrBadReceiver); GIV(primFailCode) = reasonCode; - l586: /* end commonVariable:at:put:cacheIndex: */; + l528: /* end commonVariable:at:put:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -11817,7 +11759,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (3 - 1) * BytesPerOop), value); - goto l581; + goto l518; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11828,21 +11770,23 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; } - l581: /* end case */; + l518: /* end case */; BREAK; CASE(354) /*98*/ /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -11855,114 +11799,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l620; + goto l556; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l620; + goto l556; - l620: /* end is:instanceOf:compactClassIndex: */; + l556: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l618; + goto l558; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l618; + goto l558; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l618; + goto l558; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l618; + goto l558; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l618; + goto l558; } sz = 0; - l618: /* end lengthOf:format: */; + l558: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l615; + goto l547; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l623; + goto l559; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l623; + goto l559; - l623: /* end is:instanceOf:compactClassIndex: */; + l559: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l626; + sz = numSlots2; + goto l557; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l626; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l557; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l626; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l557; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l626; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l557; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l626; + sz = ((usqInt) numSlots2) >> 1; + goto l557; } sz = 0; - l626: /* end lengthOf:format: */; + l557: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l615; + goto l547; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11970,7 +11908,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l615: /* end case */; + l547: /* end case */; BREAK; CASE(358) /*102*/ /* bytecodePrimIdenticalV4 */ @@ -12028,6 +11966,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -12036,18 +11975,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l640; + goto l570; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l640; + goto l570; - l640: /* end is:instanceOf:compactClassIndex: */; + l570: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12064,7 +12004,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l636; + goto l568; } GIV(primFailCode) = 0; } @@ -12073,12 +12013,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l636: /* end case */; + l568: /* end case */; BREAK; CASE(362) /*106*/ /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -12087,18 +12028,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l646; + goto l576; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l646; + goto l576; - l646: /* end is:instanceOf:compactClassIndex: */; + l576: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12115,7 +12057,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l642; + goto l574; } GIV(primFailCode) = 0; } @@ -12124,7 +12066,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l642: /* end case */; + l574: /* end case */; BREAK; CASE(366) /*110*/ /* bytecodePrimPointX */ @@ -12143,9 +12085,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -12161,7 +12103,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l654; + goto l586; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -12170,7 +12112,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l654: /* end case */; + l586: /* end case */; BREAK; CASE(367) /*111*/ /* bytecodePrimPointY */ @@ -12189,9 +12131,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -12207,7 +12149,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l661; + goto l594; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -12216,7 +12158,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l661: /* end case */; + l594: /* end case */; BREAK; CASE(416) /*160*/ CASE(417) /*161*/ @@ -12271,7 +12213,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -12282,7 +12224,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l675; + goto l609; } # endif /* IMMUTABILITY */ @@ -12302,7 +12244,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); - l675: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l609: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12338,7 +12280,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l683; + goto l618; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12346,7 +12288,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l683: /* end jumplfTrueBy: */; + l618: /* end jumplfTrueBy: */; } BREAK; CASE(464) /*208*/ @@ -12379,7 +12321,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l687; + goto l622; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12387,7 +12329,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l687: /* end jumplfFalseBy: */; + l622: /* end jumplfFalseBy: */; } BREAK; CASE(472) /*216*/ @@ -12406,12 +12348,12 @@ interpret(void) if (extA == 0) { localReturnValue = longAtPointer(localSP); goto commonCallerReturn; - goto l691; + goto l626; } error("shouldBeImplemented"); extA = 0; } - l691: /* end case */; + l626: /* end case */; BREAK; CASE(477) /*221*/ /* extNopBytecode */ @@ -12420,7 +12362,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extA = (extB = 0); + numExtB = (extA = (extB = 0)); } BREAK; CASE(478) /*222*/ @@ -12455,10 +12397,11 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte > 0x7F) ? byte - 256 : (((usqInt) extB << 8)) + byte); + numExtB += 1; } BREAK; CASE(482) /*226*/ @@ -12488,7 +12431,7 @@ interpret(void) if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { /* begin fetchPointer:ofObject: */ object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l699; + goto l632; } /* begin writeBackHeadFramePointers */ assert(GIV(stackPage) == (mostRecentlyUsedPage())); @@ -12504,7 +12447,7 @@ interpret(void) if (isWidowedContext(obj)) { /* begin fetchPointer:ofObject: */ object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l699; + goto l632; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12518,30 +12461,30 @@ interpret(void) /* base frame, context in saved ip slot (or base of stack in Cog) */ object = longAt(spouseFP + FoxCallerContext); - goto l699; + goto l632; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); object = longAt(callerFP + FoxThisContext); - goto l699; + goto l632; } object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l699; + goto l632; } if (index == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l699; + goto l632; } if (index == InstructionPointerIndex) { object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l699; + goto l632; } error("bad index"); object = 0; - l699: /* end instVar:ofContext: */; + l632: /* end instVar:ofContext: */; longAtPointerput((localSP -= BytesPerOop), object); } else { @@ -12614,6 +12557,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 1) | 1)); } @@ -12645,7 +12589,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -12664,12 +12607,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -12687,13 +12627,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l710; + goto l645; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l710: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l645: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -12774,7 +12714,7 @@ interpret(void) longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); if (variableIndex == StackPointerIndex) { } - goto l717; + goto l655; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12795,7 +12735,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l717; + goto l655; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12825,14 +12765,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l717: /* end instVar:ofContext:put: */; + l655: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12843,7 +12783,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l720; + goto l657; } # endif /* IMMUTABILITY */ @@ -12863,7 +12803,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); - l720: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l657: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12908,7 +12848,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12919,7 +12859,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l730; + goto l660; } # endif /* IMMUTABILITY */ @@ -12939,7 +12879,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), anObject); - l730: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l660: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12957,6 +12897,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (index < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); } @@ -13021,7 +12962,7 @@ interpret(void) longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); if (variableIndex == StackPointerIndex) { } - goto l736; + goto l674; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -13042,7 +12983,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l736; + goto l674; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13072,14 +13013,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l736: /* end instVar:ofContext:put: */; + l674: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -13090,7 +13031,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l739; + goto l676; } # endif /* IMMUTABILITY */ @@ -13110,7 +13051,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l739: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l676: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13157,7 +13098,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -13168,7 +13109,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l749; + goto l679; } # endif /* IMMUTABILITY */ @@ -13188,7 +13129,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l749: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l679: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13206,6 +13147,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (index < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); } @@ -13232,6 +13174,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); GIV(lkupClassTag) = (((tagBits = rcvr & (tagMask()))) != 0 ? ((tagBits & 1) != 0 @@ -13255,9 +13198,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; goto superclassSend; } - l756: /* end case */; + l690: /* end case */; BREAK; CASE(496) /*240*/ /* extSendAbsentImplicitBytecode */ @@ -13273,6 +13217,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendImplicitReceiver */ } @@ -13284,7 +13229,6 @@ interpret(void) sqInt candidateMixin; sqInt candidateMixinApplication; sqInt candidateReceiver; - sqInt classIndex; sqInt classTablePage; sqInt dictionary; sqInt errorCode; @@ -13314,8 +13258,6 @@ interpret(void) sqInt objOop5; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -13325,9 +13267,7 @@ interpret(void) VM_LABEL(commonSendImplicitReceiver); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodImplicitReceiver */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -13359,21 +13299,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l935; + goto l876; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l935: /* end classAtIndex: */; + l876: /* end classAtIndex: */; /* begin lookupImplicitReceiverSend */ GIV(messageSelector) = (((GIV(messageSelector) & (tagMask())) == 0) && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) @@ -13387,8 +13326,8 @@ interpret(void) while (1) { assert(!((isForwarded(candidateMixin)))); assert(!((isForwarded(candidateReceiver)))); - candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits2 = candidateReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits1 = candidateReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) : fetchClassOfNonImm(candidateReceiver))); assert(!((candidateMixinApplication == 0))); assert(!((candidateMixinApplication == (nilObject())))); @@ -13404,13 +13343,9 @@ interpret(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -13435,19 +13370,19 @@ interpret(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; - goto l959; + goto l866; } index += 1; } found = 0; - goto l959; + goto l866; } /* It is assumed that there are some nils in this dictionary, and search will @@ -13458,13 +13393,13 @@ interpret(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -13473,7 +13408,7 @@ interpret(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l959; + goto l866; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -13481,12 +13416,12 @@ interpret(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -13495,24 +13430,24 @@ interpret(void) } GIV(newMethod) = objOop4; found = 1; - goto l959; + goto l866; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l959; + goto l866; } wrapAround = 1; index = SelectorStart; } } found = 0; - l959: /* end lookupMethodInDictionary: */; + l866: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; actualLookupRule = lookupLexicalfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l945; + goto l886; } /* begin followObjField:ofObject: */ objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); @@ -13527,13 +13462,12 @@ interpret(void) } GIV(localAbsentReceiverOrZero) = 0; GIV(localAbsentReceiver) = methodReceiver; - - /* MNU lookup starts here. */ - GIV(lkupClass) = (((tagBits1 = methodReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) + /* begin fetchClassOf: */ + GIV(lkupClass) = (((tagBits2 = methodReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) : fetchClassOfNonImm(methodReceiver)); actualLookupRule = lookupProtectedstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l945: /* end lookupImplicitReceiverSend */; + l886: /* end lookupImplicitReceiverSend */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -13564,29 +13498,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l965; + goto l857; } if (localPrimIndex == 256) { - goto l965; + goto l857; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l965; + goto l857; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l965; + goto l857; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l965; + goto l857; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l965: /* end internalQuickPrimitiveResponse */; - goto l955; + goto l857; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13622,7 +13555,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l955; + goto l857; } } /* begin internalActivateNewMethod */ @@ -13633,8 +13566,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13658,7 +13591,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13682,11 +13615,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l957; + goto l870; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l957: /* end getErrorObjectFromPrimFailCode */; + l870: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13706,7 +13639,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l955: /* end internalExecuteNewMethod */; + l857: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13726,6 +13659,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendDynamicSuper */ } @@ -13734,7 +13668,6 @@ interpret(void) { sqInt actualLookupRule; sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -13752,8 +13685,6 @@ interpret(void) sqInt oop; sqInt probe1; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -13761,9 +13692,7 @@ interpret(void) VM_LABEL(commonSendDynamicSuper); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodDynamicSuper */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -13783,7 +13712,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } /* second probe */ @@ -13795,7 +13724,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } probe1 = (((usqInt) hash1) >> 2) & NSMethodCacheMask; if (((((GIV(nsMethodCache)[probe1 + NSMethodCacheSelector]) == GIV(messageSelector)) @@ -13805,7 +13734,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13823,20 +13752,19 @@ interpret(void) } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l989; + goto l900; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l989: /* end classAtIndex: */; + l900: /* end classForClassTag: */; /* begin lookupDynamicSuperSend */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13857,7 +13785,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToNSCache(actualLookupRule); - l986: ; + l898: ; /* begin shuffleArgumentsAndStoreAbsentReceiver: */ @@ -13883,29 +13811,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l984; + goto l896; } if (localPrimIndex == 256) { - goto l984; + goto l896; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l984; + goto l896; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l984; + goto l896; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l984; + goto l896; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l984: /* end internalQuickPrimitiveResponse */; - goto l979; + goto l896; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13941,7 +13868,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l979; + goto l896; } } /* begin internalActivateNewMethod */ @@ -13952,8 +13879,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13977,7 +13904,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14001,11 +13928,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l977; + goto l908; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l977: /* end getErrorObjectFromPrimFailCode */; + l908: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14025,7 +13952,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l979: /* end internalExecuteNewMethod */; + l896: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14041,6 +13968,7 @@ interpret(void) byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; localIP += offset; /* begin ifBackwardsCheckForEvents: */ if ((offset < 0) @@ -14071,7 +13999,7 @@ interpret(void) VM_LABEL(extJumpIfTrue); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfTrueBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(trueObj)) { @@ -14086,7 +14014,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l763; + goto l697; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14094,7 +14022,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l763: /* end jumplfTrueBy: */; + l697: /* end jumplfTrueBy: */; } BREAK; CASE(500) /*244*/ @@ -14107,7 +14035,7 @@ interpret(void) VM_LABEL(extJumpIfFalse); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfFalseBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(falseObj)) { @@ -14122,7 +14050,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l767; + goto l701; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14130,7 +14058,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l767: /* end jumplfFalseBy: */; + l701: /* end jumplfFalseBy: */; } BREAK; CASE(501) /*245*/ @@ -14139,7 +14067,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt errorCode; @@ -14155,8 +14082,6 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -14172,10 +14097,9 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOuter: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -14207,21 +14131,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l784; + goto l703; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l784: /* end classAtIndex: */; + l703: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14272,29 +14195,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l786; + goto l708; } if (localPrimIndex == 256) { - goto l786; + goto l708; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l786; + goto l708; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l786; + goto l708; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l786; + goto l708; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l786: /* end internalQuickPrimitiveResponse */; - goto l781; + goto l708; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -14330,7 +14252,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l781; + goto l708; } } /* begin internalActivateNewMethod */ @@ -14341,8 +14263,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14366,7 +14288,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14390,11 +14312,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l779; + goto l716; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l779: /* end getErrorObjectFromPrimFailCode */; + l716: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14414,7 +14336,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l781: /* end internalExecuteNewMethod */; + l708: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14438,15 +14360,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l793; + goto l725; } else { goto respondToUnknownBytecode; - goto l793; + goto l725; } } - l793: /* end case */; + l725: /* end case */; BREAK; CASE(509) /*253*/ /* extPushClosureBytecode */ @@ -14472,15 +14394,15 @@ interpret(void) numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8); extA = 0; blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); - extB = 0; + numExtB = (extB = 0); /* begin pushClosureNumArgs:copiedValues:blockSize: */ if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l823; + goto l754; } context = marryFrameSP(localFP, localSP + (numCopied * BytesPerOop)); - l823: /* end ensureFrameIsMarried:SP: */; + l754: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -14508,13 +14430,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l817; + goto l746; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l817: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l746: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -14553,7 +14475,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt depth; @@ -14570,8 +14491,6 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -14587,11 +14506,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byteAtPointer(++localIP); /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOuter: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -14623,21 +14541,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l840; + goto l756; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l840: /* end classAtIndex: */; + l756: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14688,29 +14605,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l842; + goto l761; } if (localPrimIndex == 256) { - goto l842; + goto l761; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l842; + goto l761; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l842; + goto l761; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l842; + goto l761; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l842: /* end internalQuickPrimitiveResponse */; - goto l837; + goto l761; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -14746,7 +14662,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l837; + goto l761; } } /* begin internalActivateNewMethod */ @@ -14757,8 +14673,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14782,7 +14698,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14806,11 +14722,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l835; + goto l769; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l835: /* end getErrorObjectFromPrimFailCode */; + l769: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14830,7 +14746,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l837: /* end internalExecuteNewMethod */; + l761: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -15146,16 +15062,16 @@ cStringOrNullFor(sqInt oop) classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (oop & (tagMask())) { isString = 0; - goto l3; + goto l2; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l3; + goto l2; -l3: /* end is:instanceOf:compactClassIndex: */; +l2: /* end is:instanceOf:compactClassIndex: */; if (!isString) { if (oop != GIV(nilObj)) { GIV(primFailCode) = PrimErrBadArgument; @@ -15166,37 +15082,33 @@ cStringOrNullFor(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { len = numSlots; - goto l1; + goto l4; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ len = (numSlots << (shiftForWord())) - (fmt & 7); - goto l1; + goto l4; } if (fmt >= (firstShortFormat())) { len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l1; + goto l4; } if (fmt >= (firstLongFormat())) { len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l1; + goto l4; } if (fmt == (sixtyFourBitIndexableFormat())) { len = ((usqInt) numSlots) >> 1; - goto l1; + goto l4; } len = 0; -l1: /* end lengthOf:format: */; +l4: /* end lengthOf:format: */; if (len == 0) { return 0; } @@ -15921,14 +15833,14 @@ primitiveArctan(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = atan(rcvr); @@ -16109,68 +16021,63 @@ primitiveAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -16179,23 +16086,23 @@ primitiveAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l16; + goto l13; } } else { @@ -16209,19 +16116,19 @@ primitiveAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l16; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l16; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l16; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l16; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -16230,7 +16137,7 @@ primitiveAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l16; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -16259,7 +16166,7 @@ primitiveAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -16270,7 +16177,7 @@ primitiveAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l16; + goto l13; } /* begin primitiveFailFor: */ @@ -16279,13 +16186,13 @@ primitiveAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l16: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveAtPut */ @@ -16320,79 +16227,75 @@ primitiveAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(rcvr + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l29; + goto l21; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l29; + goto l21; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l29; + goto l21; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l29; + goto l21; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l29; + goto l21; } totalLength1 = 0; -l29: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l16; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l16; } class1 = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l27: /* end fixedFieldsOf:format:length: */; +l16: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -16401,23 +16304,23 @@ primitiveAtPut(void) sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(rcvr))); stSize1 = sp3; - goto l18; + goto l17; } /* begin fetchStackPointerOf: */ sp11 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l18; + goto l17; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr))); stSize1 = (sp11 >> 1); - l18: /* end stackPointerForMaybeMarriedContext: */; + l17: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value); - goto l33; + goto l29; } } else { @@ -16444,37 +16347,37 @@ primitiveAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l21; + goto l28; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -16482,7 +16385,7 @@ primitiveAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l21; + goto l28; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -16490,7 +16393,7 @@ primitiveAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l21: /* end subscript:with:storing:format: */; + l28: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -16499,14 +16402,14 @@ primitiveAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode1; } -l33: /* end stObject:at:put: */; +l29: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -16893,10 +16796,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -16904,7 +16807,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -16920,7 +16823,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -16932,18 +16835,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -16954,10 +16857,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -16965,23 +16868,23 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -16993,18 +16896,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue); @@ -17073,10 +16976,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -17084,7 +16987,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -17100,7 +17003,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -17112,18 +17015,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -17134,10 +17037,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -17145,23 +17048,23 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -17173,18 +17076,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue); @@ -17284,7 +17187,7 @@ primitiveBitShift(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -17307,13 +17210,13 @@ primitiveBitShift(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -17324,9 +17227,9 @@ primitiveBitShift(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l6; + goto l5; - l6: /* end positive32BitIntegerFor: */; + l5: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); @@ -17453,10 +17356,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (integerArgument & (tagMask())) { /* begin primitiveFail */ @@ -17464,7 +17367,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerArgument))); @@ -17480,7 +17383,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask()); @@ -17492,18 +17395,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } - l5: /* end positiveMachineIntegerValueOf: */; + l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ if ((integerReceiver & 1)) { value1 = (integerReceiver >> 1); @@ -17513,10 +17416,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (integerReceiver & (tagMask())) { /* begin primitiveFail */ @@ -17524,23 +17427,23 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerReceiver))); /* begin classIndexOf: */ ccIndex1 = (longAt(integerReceiver)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask()); @@ -17552,18 +17455,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } - l10: /* end positiveMachineIntegerValueOf: */; + l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue); @@ -17814,7 +17717,7 @@ primitiveClipboardText(void) sqInt fmt; sqInt formatField; usqInt newObj; - usqInt numBytes; + usqInt numBytes1; sqInt numSlots; sqInt s; char *sp; @@ -17850,23 +17753,23 @@ primitiveClipboardText(void) formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? (/* begin allocationUnit */ 8) : (numSlots + (numSlots & 1)) * BytesPerOop)); } - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); - goto l6; + s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex); + goto l4; } if (numSlots >= (numSlotsMask())) { @@ -17879,11 +17782,11 @@ primitiveClipboardText(void) else { long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex); } - assert((numBytes % (allocationUnit())) == 0); + assert((numBytes1 % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); - GIV(freeStart) += numBytes; + GIV(freeStart) += numBytes1; s = newObj; - l6: /* end allocateSlots:format:classIndex: */; + l4: /* end allocateBytes:classIndex: */; if (!(s)) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -17976,7 +17879,7 @@ primitiveClockLogAddresses(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)usecs)))) <= (MaxSmallInteger)) { v1 = (((((usqInt)usecs)) << 1) | 1); - goto l13; + goto l9; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -17999,13 +17902,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l8; + goto l7; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l8: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l7: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -18016,15 +17919,15 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); v1 = newLargeInteger; - goto l13; + goto l9; -l13: /* end positive32BitIntegerFor: */; +l9: /* end positive32BitIntegerFor: */; /* begin positive32BitIntegerFor: */ /* begin maybeInlinePositive32BitIntegerFor: */ assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)msecs)))) <= (MaxSmallInteger)) { v2 = (((((usqInt)msecs)) << 1) | 1); - goto l19; + goto l14; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -18047,13 +17950,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l14; + goto l12; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; -l14: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l12: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -18064,9 +17967,9 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); v2 = newLargeInteger1; - goto l19; + goto l14; -l19: /* end positive32BitIntegerFor: */; +l14: /* end positive32BitIntegerFor: */; if (GIV(primFailCode)) { /* begin popRemappableOop */ oop = GIV(remapBuffer)[GIV(remapBufferCount)]; @@ -18410,13 +18313,9 @@ primitiveClosureValueWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -18576,73 +18475,63 @@ primitiveCompareBytes(void) /* begin byteSizeOf: */ if (arg1 & (tagMask())) { len1 = 0; - goto l1; + goto l2; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(arg1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(arg1 - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(arg1 - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len1 = numBytes - (fmt & 7); - goto l5; + goto l2; } if (fmt <= (sixtyFourBitIndexableFormat())) { len1 = numBytes; - goto l5; + goto l2; } if (fmt >= (firstShortFormat())) { len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l2; } len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l1: /* end byteSizeOf: */; +l2: /* end byteSizeOf: */; /* begin byteSizeOf: */ if (arg2 & (tagMask())) { len2 = 0; - goto l2; + goto l4; } /* begin numBytesOf: */ fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(arg2 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes1 = longAt(arg2 - BaseHeaderSize); - } - else { - numBytes1 = numSlots1; - } + numBytes1 = (numSlots1 == (numSlotsMask()) + ? longAt(arg2 - BaseHeaderSize) + : numSlots1); numBytes1 = numBytes1 << (shiftForWord()); if (fmt1 >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len2 = numBytes1 - (fmt1 & 7); - goto l8; + goto l4; } if (fmt1 <= (sixtyFourBitIndexableFormat())) { len2 = numBytes1; - goto l8; + goto l4; } if (fmt1 >= (firstShortFormat())) { len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); - goto l8; + goto l4; } len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); -l8: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l4: /* end byteSizeOf: */; if (!(len1 == len2)) { /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); @@ -18690,7 +18579,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } if (format >= (firstShortFormat())) { if (format >= (firstByteFormat())) { @@ -18700,7 +18589,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24); oddBytes = format & 7; @@ -18711,7 +18600,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 16; oddBytes = ((sqInt)((usqInt)((format & 3)) << 1)); @@ -18728,7 +18617,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 32; oddBytes = ((sqInt)((usqInt)((format & 1)) << 2)); @@ -18736,13 +18625,9 @@ primitiveConstantFill(void) } /* begin addressAfter: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -18763,7 +18648,7 @@ primitiveConstantFill(void) } /* begin pop: */ GIV(stackPointer) += 1 * BytesPerWord; -l2: /* end primitiveConstantFillSpur */; +l5: /* end primitiveConstantFillSpur */; } @@ -18870,30 +18755,26 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots1; - } + numBytes = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ length = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { length = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask()))) && (length == (numBytesOf(arg))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -18909,13 +18790,9 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(rcvr - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); if (!((isAppropriateForCopyObject(arg)) && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -18964,11 +18841,11 @@ primitiveCrashVM(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { crashInThisThread = 1; - goto l2; + goto l1; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { crashInThisThread = 0; - goto l2; + goto l1; } /* begin success: */ @@ -18978,7 +18855,7 @@ primitiveCrashVM(void) } crashInThisThread = null; - l2: /* end booleanValueOf: */; + l1: /* end booleanValueOf: */; } if (GIV(primFailCode) || (GIV(argumentCount) != 1)) { @@ -19418,14 +19295,14 @@ primitiveExp(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = exp(rcvr); @@ -19465,14 +19342,14 @@ primitiveExponent(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { /* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */ @@ -19571,14 +19448,13 @@ primitiveFloatAdd(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -19591,14 +19467,13 @@ primitiveFloatAdd(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -19650,7 +19525,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l7; + goto l6; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -19673,13 +19548,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -19690,9 +19565,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l7; + goto l6; - l7: /* end positive32BitIntegerFor: */; + l6: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -19708,7 +19583,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { result = ((integerValue1 << 1) | 1); - goto l13; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -19731,13 +19606,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l8; + goto l9; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l8: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -19748,9 +19623,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger1; - goto l13; + goto l11; - l13: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp1; @@ -19793,7 +19668,8 @@ primitiveFloatAtPut(void) index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -19859,14 +19735,13 @@ primitiveFloatDivide(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -19879,14 +19754,13 @@ primitiveFloatDivide(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg != 0.0)) { @@ -19909,57 +19783,50 @@ primitiveFloatEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -19977,57 +19844,50 @@ primitiveFloatGreaterOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreaterOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr >= arg; if (!GIV(primFailCode)) { @@ -20045,57 +19905,50 @@ primitiveFloatGreaterThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreater:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr > arg; if (!GIV(primFailCode)) { @@ -20113,57 +19966,50 @@ primitiveFloatLessOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLessOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr <= arg; if (!GIV(primFailCode)) { @@ -20181,57 +20027,50 @@ primitiveFloatLessThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLess:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr < arg; if (!GIV(primFailCode)) { @@ -20271,14 +20110,13 @@ primitiveFloatMultiply(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -20291,14 +20129,13 @@ primitiveFloatMultiply(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -20313,57 +20150,50 @@ primitiveFloatNotEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -20403,14 +20233,13 @@ primitiveFloatSubtract(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -20423,14 +20252,13 @@ primitiveFloatSubtract(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -20475,10 +20303,10 @@ primitiveFlushExternalPrimitives(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -20500,8 +20328,8 @@ primitiveFlushExternalPrimitives(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -20517,37 +20345,33 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -20562,32 +20386,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -20609,32 +20429,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } flushMethodCache(); /* begin flushExternalPrimitiveTable */ @@ -20690,11 +20506,11 @@ primitiveFormPrint(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { landscapeFlag = 1; - goto l5; + goto l2; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { landscapeFlag = 0; - goto l5; + goto l2; } /* begin success: */ @@ -20704,7 +20520,7 @@ primitiveFormPrint(void) } landscapeFlag = null; -l5: /* end booleanValueOf: */; +l2: /* end booleanValueOf: */; /* begin floatValueOf: */ oop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); isFloat = ((oop & (tagMask())) == 0) @@ -20712,14 +20528,14 @@ primitiveFormPrint(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); vScale = result; - goto l6; + goto l5; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } vScale = 0.0; -l6: /* end floatValueOf: */; +l5: /* end floatValueOf: */; /* begin floatValueOf: */ oop1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); isFloat1 = ((oop1 & (tagMask())) == 0) @@ -20727,14 +20543,14 @@ primitiveFormPrint(void) if (isFloat1) { fetchFloatAtinto(oop1 + BaseHeaderSize, result1); hScale = result1; - goto l7; + goto l6; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } hScale = 0.0; -l7: /* end floatValueOf: */; +l6: /* end floatValueOf: */; rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord)); if (!((((rcvr & (tagMask())) == 0) && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) @@ -20765,36 +20581,32 @@ primitiveFormPrint(void) pixelsPerWord = 32 / depth; wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord; if (((bitsArray & (tagMask())) == 0) - && (isWordsOrBytesNonImm(bitsArray))) { + && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) { /* begin numBytesOf: */ fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(bitsArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(bitsArray - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(bitsArray - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ bitsArraySize = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { bitsArraySize = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; /* begin success: */ if (!(bitsArraySize == ((wordsPerLine * h) * 4))) { @@ -20854,14 +20666,14 @@ primitiveFractionalPart(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { frac = modf(rcvr, (&trunc)); /* begin pushFloat: */ @@ -20931,7 +20743,7 @@ primitiveGetImmutability(void) rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin pop:thenPushBool: */ trueOrFalse = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); @@ -21143,7 +20955,6 @@ primitiveGetWindowLabel(void) EXPORT(sqInt) primitiveGetWindowSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt h; sqInt knownClassIndex; @@ -21167,8 +20978,7 @@ primitiveGetWindowSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -21191,13 +21001,13 @@ primitiveGetWindowSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l6; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l6: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 1) | 1)); @@ -21356,7 +21166,7 @@ primitiveHeartbeatFrequency(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop = ((integerValue << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -21379,13 +21189,13 @@ primitiveHeartbeatFrequency(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21396,9 +21206,9 @@ primitiveHeartbeatFrequency(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; return 0; @@ -21524,7 +21334,7 @@ primitiveImageFormatVersion(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) 6521)) <= (MaxSmallInteger)) { oop = (((usqInt)6521 << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -21547,13 +21357,13 @@ primitiveImageFormatVersion(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21564,9 +21374,9 @@ primitiveImageFormatVersion(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; return 0; @@ -21582,6 +21392,7 @@ primitiveImageFormatVersion(void) static void primitiveImageName(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOop; sqInt ok; sqInt okToRename; sqInt s; @@ -21606,11 +21417,13 @@ primitiveImageName(void) } s = longAt(GIV(stackPointer)); /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + /* begin isNonImmediate: */ ok = (s & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(s)); - ok = ((longAt(s)) & (classIndexMask())) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord())))))) + 4)) & (identityHashHalfWordMask())); - + ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); } /* begin success: */ if (!ok) { @@ -21784,37 +21597,33 @@ primitiveIntegerAt(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l4; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l6; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l6; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l4; + goto l6; } sz = 0; -l4: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -21828,12 +21637,12 @@ primitiveIntegerAt(void) /* begin signed32BitIntegerFor: */ if ((((sqInt)((((usqInt)intValue)) ^ ((((usqInt)intValue)) << 1)))) >= 0) { result = (((usqInt)intValue << 1) | 1); - goto l5; + goto l4; } result = noInlineSigned32BitIntegerGutsFor(intValue); - goto l5; + goto l4; -l5: /* end signed32BitIntegerFor: */; +l4: /* end signed32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -21878,12 +21687,12 @@ primitiveIntegerAtPut(void) /* begin signed32BitValueOf: */ if ((valueOop & 1)) { value = (valueOop >> 1); - goto l7; + goto l9; } value = noInlineSigned32BitValueGutsOf(valueOop); - goto l7; + goto l9; -l7: /* end signed32BitValueOf: */; +l9: /* end signed32BitValueOf: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -21898,7 +21707,8 @@ primitiveIntegerAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -21911,37 +21721,33 @@ primitiveIntegerAtPut(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l5; + goto l8; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l8; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l8; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l8; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l5; + goto l8; } sz = 0; -l5: /* end lengthOf:format: */; +l8: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -22045,7 +21851,6 @@ primitiveInvokeObjectAsMethod(void) sqInt numArgs; sqInt numTemps; sqInt object; - sqInt objFormat; sqInt rcvr; sqInt runArgs; sqInt runReceiver; @@ -22067,13 +21872,10 @@ primitiveInvokeObjectAsMethod(void) sqInt valuePointer; /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2, ClassArrayCompactIndex); for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) { /* begin storePointerUnchecked:ofObject:withValue: */ @@ -22116,7 +21918,7 @@ primitiveInvokeObjectAsMethod(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l7; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -22143,7 +21945,7 @@ primitiveInvokeObjectAsMethod(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l7; + goto l16; } } /* begin activateNewMethod */ @@ -22211,11 +22013,11 @@ primitiveInvokeObjectAsMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -22225,7 +22027,7 @@ primitiveInvokeObjectAsMethod(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l7: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -22256,6 +22058,7 @@ primitiveIsPinned(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt obj; char *sp; + sqInt trueOrFalse; obj = longAt(GIV(stackPointer)); if ((obj & (tagMask())) @@ -22265,7 +22068,8 @@ primitiveIsPinned(void) return; } /* begin pop:thenPushBool: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((((usqInt) (longAt(obj))) >> 30) & 1) != 0 + trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); GIV(stackPointer) = sp; @@ -22678,14 +22482,14 @@ primitiveLogN(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = log(rcvr); @@ -22742,7 +22546,6 @@ primitiveLowSpaceSemaphore(void) static void primitiveMakePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -22770,8 +22573,7 @@ primitiveMakePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -22794,13 +22596,13 @@ primitiveMakePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pt = 0; - goto l3; + goto l2; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pt = newObj; -l3: /* end eeInstantiateSmallClass:numSlots: */; +l2: /* end eeInstantiateSmallClass:numSlots: */; assert(!(isOopForwarded(pt))); longAtput((pt + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), rcvr); @@ -22979,7 +22781,6 @@ primitiveMouseButtons(void) static void primitiveMousePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -23021,8 +22822,7 @@ primitiveMousePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -23045,13 +22845,13 @@ primitiveMousePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l7; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l7: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 1) | 1)); @@ -23208,12 +23008,13 @@ primitiveNew(void) less than lowSpaceThreshold bytes free. This *will not* cause a GC :-) */ /* begin instantiateClass: */ classObj1 = longAt(GIV(stackPointer)); + /* begin formatOfClass: */ classFormat = ((longAt((classObj1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); if (!((instSpec <= 1) || (instSpec == 5))) { obj = null; - goto l7; + goto l9; } assert(addressCouldBeClassObj(classObj1)); classIndex = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 @@ -23228,8 +23029,9 @@ primitiveNew(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l7; + goto l9; } + /* begin fixedFieldsOfClassFormat: */ numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); /* begin allocateSlots:format:classIndex: */ if (numSlots >= (numSlotsMask())) { @@ -23250,7 +23052,7 @@ primitiveNew(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -23267,7 +23069,7 @@ primitiveNew(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; -l4: /* end allocateSlots:format:classIndex: */; +l5: /* end allocateSlots:format:classIndex: */; if (!(newObj == null)) { /* begin fillObj:numSlots:with: */ assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj))); @@ -23277,7 +23079,7 @@ primitiveNew(void) } } obj = newObj; -l7: /* end instantiateClass: */; +l9: /* end instantiateClass: */; if (obj == null) { /* begin primitiveFailFor: */ reasonCode = (isFixedSizePointerFormat(instSpecOfClass(longAt(GIV(stackPointer)))) @@ -23463,7 +23265,6 @@ primitiveNewWithArg(void) usqInt bs; sqInt ccIndex; sqInt classFormat; - sqInt classPointer; sqInt fmt; sqInt instSpec; sqInt obj; @@ -23493,10 +23294,10 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l9; } size = value; - goto l10; + goto l9; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -23504,23 +23305,23 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); /* begin classIndexOf: */ ccIndex = (longAt(oop1)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; + goto l8; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l8: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -23532,18 +23333,18 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))); - goto l10; + goto l9; } else { size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))); - goto l10; + goto l9; } -l10: /* end positiveMachineIntegerValueOf: */; +l9: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -23554,9 +23355,7 @@ primitiveNewWithArg(void) obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); if (obj == null) { /* begin instSpecOfClass: */ - classPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); /* begin primitiveFailFor: */ reasonCode = (((instSpec >= 2) @@ -23612,42 +23411,38 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(actualObj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (actualObj + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { actualObj = GIV(freeStart); - goto l1; + goto l5; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); actualObj = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l5: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(freeStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } if (oopisGreaterThan(GIV(pastSpaceStart), ((pastSpace()).start))) { /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - actualObj = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + actualObj = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); } @@ -23659,13 +23454,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(actualObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -23676,18 +23467,18 @@ primitiveNextInstance(void) followingWordAddress1 = (actualObj + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { actualObj = GIV(pastSpaceStart); - goto l2; + goto l10; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); actualObj = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l10: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(pastSpaceStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } actualObj = GIV(nilObj); @@ -23695,13 +23486,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(actualObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -23712,22 +23499,22 @@ primitiveNextInstance(void) followingWordAddress2 = (actualObj + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { actualObj = GIV(endOfMemory); - goto l3; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); actualObj = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(endOfMemory)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } subsequentObject = null; - l5: /* end instanceAfter: */; + l15: /* end instanceAfter: */; if (!(subsequentObject == null)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), subsequentObject); @@ -23958,7 +23745,8 @@ primitiveObjectAtPut(void) thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(thisReceiver))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -24018,30 +23806,28 @@ primitivePathToUsing(void) sqInt next; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; sqInt path; char *sp; sqInt stack; sqInt stackp; sqInt stackSize; - char *theSP; err = 0; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!(GIV(argumentCount) >= 2)) { /* begin primitiveFailFor: */ @@ -24059,7 +23845,7 @@ primitivePathToUsing(void) if (!(((stack & (tagMask())) == 0) && (((((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask())) == 2))) { err = PrimErrBadArgument; - goto l16; + goto l15; } assert(allObjectsUnmarked()); @@ -24069,38 +23855,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(stack + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(stack - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots11 = byteAt(stack + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(stack - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - stackSize = numSlots1; - goto l10; + stackSize = numSlots2; + goto l12; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - stackSize = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l10; + stackSize = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l12; } if (fmt1 >= (firstShortFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l10; + stackSize = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l12; } if (fmt1 >= (firstLongFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l10; + stackSize = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l12; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - stackSize = ((usqInt) numSlots1) >> 1; - goto l10; + stackSize = ((usqInt) numSlots2) >> 1; + goto l12; } stackSize = 0; -l10: /* end lengthOf:format: */; +l12: /* end lengthOf:format: */; /* begin mark: */ setIsMarkedOfto(stack, 1); /* begin specialObjectsOop */ @@ -24110,38 +23892,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(current))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(current + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(current - BaseHeaderSize); - } - else { - numSlots2 = numSlots5; - } + numSlots12 = byteAt(current + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(current - BaseHeaderSize) + : numSlots12); if (fmt2 <= 5) { - index = numSlots2; - goto l11; + index = numSlots3; + goto l14; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - index = (numSlots2 << (shiftForWord())) - (fmt2 & 7); - goto l11; + index = (numSlots3 << (shiftForWord())) - (fmt2 & 7); + goto l14; } if (fmt2 >= (firstShortFormat())) { - index = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l11; + index = (numSlots3 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l14; } if (fmt2 >= (firstLongFormat())) { - index = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l11; + index = (numSlots3 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l14; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - index = ((usqInt) numSlots2) >> 1; - goto l11; + index = ((usqInt) numSlots3) >> 1; + goto l14; } index = 0; -l11: /* end lengthOf:format: */; +l14: /* end lengthOf:format: */; stackp = 0; while(1) { while (((index -= 1)) >= -1) { @@ -24196,18 +23974,18 @@ primitivePathToUsing(void) longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(stackp) << (shiftForWord())))), current); pruneStackstackp(stack, stackp); err = 0; - goto l16; + goto l15; } if (((next & 1) == 0) && (((((((usqInt)next)) & (BytesPerWord - 1)) == 0) && ((((((usqInt)next)) >= (((usqInt)GIV(stackMemory)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages)))))) ? !(((longAt(next + FoxFrameFlags)) & 2) != 0) - : (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) + : (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) && (((((next & (tagMask())) == 0) && (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) <= 5)) || (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) && (followWeak - || (!(isWeakNonImm(next)))))))) { + || (!(isWeakFormat((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()))))))))) { if ((stackp + 2) > stackSize) { assert(freeStartAtStart == (freeStart())); unmarkAfterPathTo(); @@ -24217,7 +23995,7 @@ primitivePathToUsing(void) longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); } err = PrimErrBadIndex; - goto l16; + goto l15; } /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(stack))); @@ -24237,49 +24015,40 @@ primitivePathToUsing(void) /* begin mark: */ setIsMarkedOfto(next, 1); if (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - index = ((assert((((assert(isCompiledMethod(next)), -/* begin fetchPointer:ofObject: */ -longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(next)), -/* begin fetchPointer:ofObject: */ -longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + index = (literalCountOf(next)) + LiteralStart; } else { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(next + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(next - BaseHeaderSize); - } - else { - numSlots = numSlots3; - } + numSlots1 = byteAt(next + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(next - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { index = numSlots; - goto l9; + goto l10; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ index = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l10; } if (fmt >= (firstShortFormat())) { index = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l10; } if (fmt >= (firstLongFormat())) { index = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l10; } if (fmt == (sixtyFourBitIndexableFormat())) { index = ((usqInt) numSlots) >> 1; - goto l9; + goto l10; } index = 0; - l9: /* end lengthOf:format: */; + l10: /* end lengthOf:format: */; } } current = next; @@ -24294,14 +24063,14 @@ longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord( longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); } err = PrimErrNotFound; - goto l16; + goto l15; } index = ((longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 1)) << (shiftForWord())))))) >> 1); /* begin fetchPointer:ofObject: */ current = longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 2)) << (shiftForWord()))))); stackp -= 2; } -l16: /* end pathTo:using:followWeak: */; +l15: /* end pathTo:using:followWeak: */; if (err != 0) { /* begin primitiveFailFor: */ return (GIV(primFailCode) = err); @@ -24395,22 +24164,18 @@ primitivePerformInSuperclass(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l21; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l11; + goto l21; } /* Push newMethod to save it in case of failure, @@ -24468,7 +24233,7 @@ primitivePerformInSuperclass(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l11; + goto l21; } /* +2 = receiver + saved newMethod */ @@ -24482,7 +24247,7 @@ primitivePerformInSuperclass(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -24509,7 +24274,7 @@ primitivePerformInSuperclass(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l16; } } /* begin activateNewMethod */ @@ -24577,11 +24342,11 @@ primitivePerformInSuperclass(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l17; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l17: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -24591,10 +24356,10 @@ primitivePerformInSuperclass(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l6: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; -l11: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l21: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } /* InterpreterPrimitives>>#primitivePerformWithArgs */ @@ -24642,22 +24407,18 @@ primitivePerformWithArgs(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l7; + goto l17; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l7; + goto l17; } /* Push newMethod to save it in case of failure, @@ -24705,7 +24466,7 @@ primitivePerformWithArgs(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l7; + goto l17; } /* +2 = receiver + saved newMethod */ @@ -24719,7 +24480,7 @@ primitivePerformWithArgs(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -24746,7 +24507,7 @@ primitivePerformWithArgs(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l16; } } /* begin activateNewMethod */ @@ -24814,11 +24575,11 @@ primitivePerformWithArgs(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -24828,10 +24589,10 @@ primitivePerformWithArgs(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l6: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; -l7: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l17: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } @@ -25254,7 +25015,7 @@ primitiveScanCharacters(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { kernDelta = (integerPointer >> 1); - goto l10; + goto l14; } else { /* begin primitiveFail */ @@ -25262,16 +25023,16 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } kernDelta = 0; - goto l10; + goto l14; } -l10: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; stops = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { scanRightX = (integerPointer1 >> 1); - goto l11; + goto l15; } else { /* begin primitiveFail */ @@ -25279,16 +25040,16 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanRightX = 0; - goto l11; + goto l15; } -l11: /* end stackIntegerValue: */; +l15: /* end stackIntegerValue: */; sourceString = longAt(GIV(stackPointer) + (3 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (4 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { scanStopIndex = (integerPointer2 >> 1); - goto l12; + goto l16; } else { /* begin primitiveFail */ @@ -25296,15 +25057,15 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanStopIndex = 0; - goto l12; + goto l16; } -l12: /* end stackIntegerValue: */; +l16: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer3 = longAt(GIV(stackPointer) + (5 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer3 & 1)) { scanStartIndex = (integerPointer3 >> 1); - goto l13; + goto l17; } else { /* begin primitiveFail */ @@ -25312,9 +25073,9 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanStartIndex = 0; - goto l13; + goto l17; } -l13: /* end stackIntegerValue: */; +l17: /* end stackIntegerValue: */; rcvr = longAt(GIV(stackPointer) + (6 * BytesPerWord)); if (GIV(primFailCode)) { return; @@ -25570,7 +25331,6 @@ primitiveScreenScaleFactor(void) static void primitiveScreenSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -25590,8 +25350,7 @@ primitiveScreenSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -25614,13 +25373,13 @@ primitiveScreenSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l5; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l5: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)((((usqInt) pointWord) >> 16) & 0xFFFF) << 1) | 1)); @@ -25654,7 +25413,7 @@ primitiveSecondsClock(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop = ((integerValue << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -25677,13 +25436,13 @@ primitiveSecondsClock(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -25694,9 +25453,9 @@ primitiveSecondsClock(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; } @@ -25847,7 +25606,8 @@ primitiveSetImmutability(void) } wasImmutable = # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -25859,12 +25619,12 @@ primitiveSetImmutability(void) return; } /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) | (1U << 23)); + longAtput(rcvr, (longAt(rcvr)) | (1U << (immutableBitShift()))); } else { if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << 23))); + longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << (immutableBitShift())))); } else { /* begin primitiveFailFor: */ @@ -25944,38 +25704,33 @@ primitiveSetLogDirectory(void) /* begin byteSizeOf: */ if (stringOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(stringOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(stringOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(stringOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(stringOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetLogDirectoryOfSize(firstIndexableField(stringOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -26003,10 +25758,10 @@ primitiveSetOrHasIdentityHash(void) hasHash = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask())); /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (GIV(argumentCount) == 2) { @@ -26041,7 +25796,7 @@ primitiveSetOrHasIdentityHash(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { hash = (integerPointer >> 1); - goto l4; + goto l5; } else { /* begin primitiveFail */ @@ -26049,9 +25804,9 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } hash = 0; - goto l4; + goto l5; } -l4: /* end stackIntegerValue: */; +l5: /* end stackIntegerValue: */; /* begin stackObjectValue: */ oop = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); if (oop & (tagMask())) { @@ -26060,10 +25815,10 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } thisReceiver = null; - goto l5; + goto l3; } thisReceiver = oop; -l5: /* end stackObjectValue: */; +l3: /* end stackObjectValue: */; if (!GIV(primFailCode)) { /* begin hashBitsOf: */ hash1 = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask()); @@ -26088,8 +25843,8 @@ primitiveSetOrHasIdentityHash(void) allInstancesOf(thisReceiver); } /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); + GIV(stackPointer) = sp1; } } @@ -26121,38 +25876,33 @@ primitiveSetWindowLabel(void) /* begin byteSizeOf: */ if (labelOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(labelOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(labelOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(labelOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(labelOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetWindowLabelOfSize(firstIndexableField(labelOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -26236,7 +25986,7 @@ primitiveShortAt(void) } rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; @@ -26284,14 +26034,15 @@ primitiveShortAtPut(void) } rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -26470,14 +26221,14 @@ primitiveSine(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = sin(rcvr); @@ -26524,37 +26275,33 @@ primitiveSize(void) } /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l2; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l2; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l2; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l2; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l2; + goto l3; } totalLength = 0; -l2: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { @@ -26823,14 +26570,14 @@ primitiveSquareRoot(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; /* begin success: */ if (!(rcvr >= 0.0)) { @@ -26960,68 +26707,63 @@ primitiveStringAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27030,23 +26772,23 @@ primitiveStringAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l16; + goto l13; } } else { @@ -27060,19 +26802,19 @@ primitiveStringAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l16; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l16; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l16; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l16; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -27081,7 +26823,7 @@ primitiveStringAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l16; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -27110,7 +26852,7 @@ primitiveStringAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -27121,7 +26863,7 @@ primitiveStringAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l16; + goto l13; } /* begin primitiveFailFor: */ @@ -27130,14 +26872,14 @@ primitiveStringAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l16: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { if (!(((result >= 0) && (result <= ((1U << 30) - 1))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l1; + goto l14; } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (((sqInt)((usqInt)(((result >> 1))) << (numTagBits())))) + (characterTag()); @@ -27145,7 +26887,7 @@ primitiveStringAt(void) longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveStringAtPut */ @@ -27181,81 +26923,77 @@ primitiveStringAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ value1 = asciiOfCharacter(value); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27264,23 +27002,23 @@ primitiveStringAtPut(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value1); - goto l17; + goto l15; } } else { @@ -27307,37 +27045,37 @@ primitiveStringAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value1); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value1); @@ -27345,7 +27083,7 @@ primitiveStringAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value1); @@ -27353,7 +27091,7 @@ primitiveStringAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -27362,14 +27100,14 @@ primitiveStringAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } -l17: /* end stObject:at:put: */; +l15: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -27397,8 +27135,8 @@ primitiveStringReplace(void) sqInt integerPointer2; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt repl; usqLong replFmt; sqInt replInstSize; @@ -27415,7 +27153,7 @@ primitiveStringReplace(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { start = (integerPointer >> 1); - goto l15; + goto l14; } else { /* begin primitiveFail */ @@ -27423,15 +27161,15 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } start = 0; - goto l15; + goto l14; } -l15: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { stop = (integerPointer1 >> 1); - goto l16; + goto l15; } else { /* begin primitiveFail */ @@ -27439,16 +27177,16 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } stop = 0; - goto l16; + goto l15; } -l16: /* end stackIntegerValue: */; +l15: /* end stackIntegerValue: */; repl = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { replStart = (integerPointer2 >> 1); - goto l17; + goto l16; } else { /* begin primitiveFail */ @@ -27456,9 +27194,9 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } replStart = 0; - goto l17; + goto l16; } -l17: /* end stackIntegerValue: */; +l16: /* end stackIntegerValue: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -27474,7 +27212,8 @@ primitiveStringReplace(void) if ((stop >= start) && ( # if IMMUTABILITY - ((((usqInt) (longAt(array))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(array))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -27486,38 +27225,34 @@ primitiveStringReplace(void) hdr = long64At(array); arrayFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots2 = byteAt(array + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(array + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (arrayFmt <= 5) { totalLength = numSlots; - goto l12; + goto l18; } if (arrayFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (arrayFmt & 7); - goto l12; + goto l18; } if (arrayFmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (arrayFmt & 3); - goto l12; + goto l18; } if (arrayFmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (arrayFmt & 1); - goto l12; + goto l18; } if (arrayFmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l18; } totalLength = 0; -l12: /* end lengthOf:format: */; +l18: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((arrayFmt >= (sixtyFourBitIndexableFormat())) || (arrayFmt == 2)) { @@ -27543,53 +27278,49 @@ primitiveStringReplace(void) hdr = long64At(repl); replFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots3 = byteAt(repl + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(repl - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(repl + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(repl - BaseHeaderSize) + : numSlots11); if (replFmt <= 5) { - totalLength = numSlots1; - goto l13; + totalLength = numSlots2; + goto l21; } if (replFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (replFmt & 7); - goto l13; + totalLength = (numSlots2 << (shiftForWord())) - (replFmt & 7); + goto l21; } if (replFmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (replFmt & 3); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (replFmt & 3); + goto l21; } if (replFmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (replFmt & 1); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (replFmt & 1); + goto l21; } if (replFmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l13; + totalLength = ((usqInt) numSlots2) >> 1; + goto l21; } totalLength = 0; -l13: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((replFmt >= (sixtyFourBitIndexableFormat())) || (replFmt == 2)) { replInstSize = 0; - goto l21; + goto l22; } if (replFmt < 2) { replInstSize = totalLength; - goto l21; + goto l22; } class1 = fetchClassOfNonImm(repl); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); replInstSize = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l21: /* end fixedFieldsOf:format:length: */; +l22: /* end fixedFieldsOf:format:length: */; if (!((replStart >= 1) && ((((stop - start) + replStart) + replInstSize) <= totalLength))) { /* begin primitiveFailFor: */ @@ -28119,14 +27850,14 @@ primitiveTruncated(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { modf(rcvr, (&trunc)); /* begin success: */ @@ -28175,10 +27906,10 @@ primitiveUnloadModule(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -28230,8 +27961,8 @@ primitiveUnloadModule(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -28247,37 +27978,33 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -28292,32 +28019,28 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -28339,20 +28062,16 @@ primitiveUnloadModule(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -28568,10 +28287,10 @@ primitiveVMProfileSamplesInto(void) ioNewProfileStatus((&running), (&bufferSize)); if (GIV(argumentCount) == 0) { /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (!(GIV(argumentCount) == 1)) { @@ -28589,8 +28308,8 @@ primitiveVMProfileSamplesInto(void) } numSamples = ioNewProfileSamplesInto(firstFixedField(sampleBuffer)); /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); + GIV(stackPointer) = sp1; } /* InterpreterPrimitives>>#primitiveWait */ @@ -28861,13 +28580,9 @@ signedMachineIntegerValueOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -28934,7 +28649,6 @@ sizeOfAlienData(sqInt oop) GIV(primFailCode) = PrimErrBadArgument; return 0; } - /* begin sizeFieldOfAlien: */ size = longAt(oop + BaseHeaderSize); return SQABS(size); } @@ -29108,13 +28822,9 @@ addressAfter(sqInt objOop) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -29399,18 +29109,10 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to l16: /* end allocateOldSpaceChunkOfBytes:suchThat: */; if (!(chunk)) { chunk = allocateOldSpaceChunkOfBytes(totalBytes); - if (!(chunk == null)) { - ((segmentContainingObj(chunk))->containsPinned = 1); + if (!(chunk)) { + return null; } - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - if (!(chunk)) { - return null; + ((segmentContainingObj(chunk))->containsPinned = 1); } if (numSlots >= (numSlotsMask())) { @@ -29418,10 +29120,22 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to flag("endianness"); longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << 30)); + long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } - long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << 30)); + long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -29437,12 +29151,6 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt chunk; chunk = allocateOldSpaceChunkOfBytes(totalBytes); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } if (!(chunk)) { return null; } @@ -29453,9 +29161,21 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(chunk + BaseHeaderSize, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } long64Atput(chunk, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -29483,7 +29203,6 @@ bytesInObject(sqInt objOop) headerNumSlots = byteAt(objOop + 7); if (headerNumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ numSlots = longAt(objOop - BaseHeaderSize); } else { @@ -29525,7 +29244,8 @@ changeClassOfto(sqInt rcvr, sqInt argClass) if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -29539,16 +29259,16 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin classFormatForInstanceFormat: */ if (instFormat < (firstLongFormat())) { normalizedInstFormat = instFormat; - goto l2; + goto l5; } if (instFormat >= (firstByteFormat())) { normalizedInstFormat = instFormat & -8; - goto l2; + goto l5; } normalizedInstFormat = (instFormat >= (firstShortFormat()) ? instFormat & -4 : instFormat & -2); -l2: /* end classFormatForInstanceFormat: */; +l5: /* end classFormatForInstanceFormat: */; if (((assert(addressCouldBeClassObj(argClass)), (classIndex = (((hash = (long32At(argClass + 4)) & (identityHashHalfWordMask()))) != 0 ? hash @@ -29584,13 +29304,9 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -29783,13 +29499,13 @@ floatObjectOf(double aFloat) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newFloatObj = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFloatCompactIndex); GIV(freeStart) += numBytes; newFloatObj = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; storeFloatAtfrom(newFloatObj + BaseHeaderSize, aFloat); return newFloatObj; } @@ -29884,16 +29600,16 @@ initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address) if (numSlots == 0) { /* short bridge for adjacent segments */ - longAtput(address, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 4, 1U << 23); + longAtput(address, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 4, 1U << (markedBitHalfShift())); } else { /* long bridge */ longAtput(address, numSlots); longAtput(address + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - longAtput(address + 8, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << 23)); + longAtput(address + 8, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << (markedBitHalfShift()))); } } @@ -30102,7 +29818,7 @@ sqInt isMarked(sqInt objOop) { flag("endianness"); - return ((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0; + return ((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0; } @@ -30119,13 +29835,9 @@ lengthOfformat(sqInt objOop, sqInt fmt) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -30175,7 +29887,7 @@ numFreeLists(void) /* Object parsing. 1. all objects have at least a word following the header, for a forwarding - pointer. 2. objects with an overflow size have a preceeing word with a + pointer. 2. objects with an overflow size have a preceding word with a saturated numSlots. If the word following an object doesn't have a saturated numSlots field it must be a single-header object. @@ -30194,13 +29906,9 @@ objectAfterlimit(sqInt objOop, sqInt limit) /* begin addressAfter: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30226,8 +29934,8 @@ setIsMarkedOfto(sqInt objOop, sqInt aBoolean) assert(!(isFreeObject(objOop))); flag("endianness"); longAtput(objOop + 4, (aBoolean - ? (longAt(objOop + 4)) | (1U << 23) - : (longAt(objOop + 4)) & ((unsigned int)~(1U << 23)))); + ? (longAt(objOop + 4)) | (1U << (markedBitHalfShift())) + : (longAt(objOop + 4)) & ((unsigned int)~(1U << (markedBitHalfShift()))))); } @@ -30277,7 +29985,7 @@ addToEphemeronList(sqInt ephemeronCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) ephemeronListOffset) >> 5; + hash = ((usqInt) ephemeronListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(ephemeronCorpse + 4, ((((long32At(ephemeronCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -30314,7 +30022,7 @@ addToWeakList(sqInt weakCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) weakListOffset) >> 5; + hash = ((usqInt) weakListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(weakCorpse + 4, ((((long32At(weakCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -30376,13 +30084,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30393,14 +30097,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); @@ -30419,13 +30123,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -30436,14 +30136,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 1; } @@ -30469,8 +30169,8 @@ allWeakSurvivorsOnWeakList(void) prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = (GIV(futureSpace).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(futureSurvivorStart); @@ -30485,31 +30185,27 @@ allWeakSurvivorsOnWeakList(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -30638,7 +30334,6 @@ copyAndForwardMourner(sqInt mourner) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -30688,11 +30383,10 @@ copyAndForwardMourner(sqInt mourner) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(mourner); } @@ -30712,7 +30406,6 @@ copyAndForward(sqInt survivor) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -30778,11 +30471,10 @@ copyAndForward(sqInt survivor) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(survivor); } @@ -30867,10 +30559,134 @@ copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSur return newOop; } + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Leave it to scavengeLoop + to remove any scavenged ephemerons that no longer have + new referents. */ + + /* SpurGenerationScavenger>>#fireEphemeronsInRememberedSet */ +static void +fireEphemeronsInRememberedSet(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt i; + sqInt key; + sqInt valuePointer; + + assert(noUnfiredEphemeronsAtEndOfRememberedSet()); + i = 0; + while (i < GIV(numRememberedEphemerons)) { + ephemeron = GIV(rememberedSet)[i]; + assert(isEphemeron(ephemeron)); + assert((isNonImmediate(ephemeron)) + && (isObjEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + if (scavengeReferentsOf(ephemeron)) { + + /* keep in set */ + i += 1; + } + else { + /* begin setIsRememberedOf:to: */ + longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(numRememberedEphemerons) -= 1; + GIV(previousRememberedSetSize) -= 1; + + /* First overwrite with last firable ephemeron (could be a noop if this is the last one). + Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). + Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); + GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + GIV(numRememberedEphemerons) = 0; +} + + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Be careful since copyAndForward: + can remember ephemerons (ephemerons pointing to ephemerons). */ +/* old ones for debugging */ + + /* SpurGenerationScavenger>>#fireEphemeronsOnEphemeronList */ +static void +fireEphemeronsOnEphemeronList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + usqInt ephemeronCorpse; + sqInt key; + sqInt listOffset; + sqInt oldCorpse; + sqInt oldList; + sqInt referent; + sqInt valuePointer; + + if (!(GIV(ephemeronList))) { + return; + } + oldCorpse = null; + /* begin corpseForCorpseOffset: */ + ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); + oldList = GIV(ephemeronList); + GIV(ephemeronList) = null; + while (ephemeronCorpse != null) { + assert((isYoung(ephemeronCorpse)) + && (isForwarded(ephemeronCorpse))); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(ephemeronCorpse)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + ephemeron = referent; + assert((isNonImmediate(ephemeron)) + && (isMaybeFiredEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + ((void) (scavengeReferentsOf(ephemeron))); + oldCorpse = ephemeronCorpse; + /* begin nextCorpseOrNil: */ + assert(isYoung(ephemeronCorpse)); + listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + ephemeronCorpse = (listOffset != 0 + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) + : 0); + } +} + /* SpurGenerationScavenger>>#firstCorpse: */ static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList) { DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin corpseForCorpseOffset: */ return (((sqInt)((usqInt)((headOfCorpseList - 1)) << 3))) + GIV(newSpaceStart); } @@ -30900,13 +30716,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(obj - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); assert(numSlots >= 1024); /* begin allocatePinnedSlots: */ nSlots1 = numSlots * 2; @@ -30954,7 +30766,7 @@ growRememberedSet(void) for (i = 0; i < GIV(rememberedSetSize); i += 1) { base[i] = (GIV(rememberedSet)[i]); } - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { setIsMarkedOfto(newObj, 1); setIsMarkedOfto(obj, 0); } @@ -30963,13 +30775,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(newObj)) > (isForwardedObjectClassIndexPun())); numSlots2 = byteAt(newObj + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(newObj - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots2; - } + GIV(rememberedSetLimit) = (numSlots2 == (numSlotsMask()) + ? longAt(newObj - BaseHeaderSize) + : numSlots2); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -31025,7 +30833,7 @@ isMaybeOldScavengeSurvivor(sqInt oop) return ((assert(isNonImmediate(target)), oopisGreaterThanOrEqualTo(target, GIV(oldSpaceStart))) ? (GIV(tenureCriterion) != MarkOnTenure) - || (((((usqInt) (longAt(target + 4))) >> 23) & 1) != 0) + || (((((usqInt) (longAt(target + 4))) >> (markedBitHalfShift())) & 1) != 0) : oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart())); } @@ -31078,6 +30886,7 @@ isonWeaklingList(sqInt oop, sqInt listHead) usqInt corpse; sqInt listOffset; + /* begin firstCorpse: */ corpse = (((sqInt)((usqInt)((listHead - 1)) << 3))) + GIV(newSpaceStart); while (corpse != null) { if (oop == (followForwarded(corpse))) { @@ -31085,9 +30894,10 @@ isonWeaklingList(sqInt oop, sqInt listHead) } /* begin nextCorpseOrNil: */ assert(isYoung(corpse)); - listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); corpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } return 0; @@ -31159,31 +30969,17 @@ printRememberedSet(void) static void processEphemerons(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt ephemeron1; - usqInt ephemeronCorpse; - sqInt format; - sqInt format1; sqInt hasNewReferents; sqInt i; - sqInt i1; - sqInt key; - sqInt key1; - sqInt listOffset; - sqInt oldCorpse; - sqInt oldList; - sqInt referent; sqInt referrer; sqInt unfiredEphemeronsScavenged; sqInt unfiredEphemeronsScavenged1; - sqInt valuePointer; - sqInt valuePointer1; /* begin scavengeUnfiredEphemeronsInRememberedSet */ unfiredEphemeronsScavenged1 = 0; - i1 = 0; - while (i1 < GIV(numRememberedEphemerons)) { - referrer = GIV(rememberedSet)[i1]; + i = 0; + while (i < GIV(numRememberedEphemerons)) { + referrer = GIV(rememberedSet)[i]; assert(isEphemeron(referrer)); if (isScavengeSurvivor((assert((isNonImmediate(referrer)) && (isObjEphemeron(referrer))), @@ -31194,7 +30990,7 @@ processEphemerons(void) /* remove from unscanned ephemerons in set by swapping with last ephemeron */ hasNewReferents = scavengeReferentsOf(referrer); GIV(numRememberedEphemerons) -= 1; - GIV(rememberedSet)[i1] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); if (hasNewReferents) { /* keep in set */ @@ -31212,7 +31008,7 @@ processEphemerons(void) } } else { - i1 += 1; + i += 1; } } unfiredEphemeronsScavenged = unfiredEphemeronsScavenged1; @@ -31220,111 +31016,8 @@ processEphemerons(void) unfiredEphemeronsScavenged = 1; } if (!unfiredEphemeronsScavenged) { - /* begin fireEphemeronsInRememberedSet */ - assert(noUnfiredEphemeronsAtEndOfRememberedSet()); - i = 0; - while (i < GIV(numRememberedEphemerons)) { - ephemeron = GIV(rememberedSet)[i]; - assert(isEphemeron(ephemeron)); - assert((isNonImmediate(ephemeron)) - && (isObjEphemeron(ephemeron))); - /* begin fetchPointer:ofObject: */ - key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer = copyAndForward(key); - assert(!(isOopForwarded(ephemeron))); - longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); - } - assert(!(((isScavengeSurvivor(key)) - && (isEphemeron(ephemeron))))); - if (scavengeReferentsOf(ephemeron)) { - - /* keep in set */ - i += 1; - } - else { - /* begin setIsRememberedOf:to: */ - longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(numRememberedEphemerons) -= 1; - GIV(previousRememberedSetSize) -= 1; - - /* First overwrite with last firable ephemeron (could be a noop if this is the last one). - Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). - Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); - GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); - GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - GIV(numRememberedEphemerons) = 0; - /* begin fireEphemeronsOnEphemeronList */ - if (!(GIV(ephemeronList))) { - goto l12; - } - oldCorpse = null; - /* begin corpseForCorpseOffset: */ - ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); - oldList = GIV(ephemeronList); - GIV(ephemeronList) = null; - while (ephemeronCorpse != null) { - assert((isYoung(ephemeronCorpse)) - && (isForwarded(ephemeronCorpse))); - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(ephemeronCorpse)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - ephemeron1 = referent; - assert((isNonImmediate(ephemeron1)) - && (isMaybeFiredEphemeron(ephemeron1))); - /* begin fetchPointer:ofObject: */ - key1 = longAt((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key1))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron1); - /* begin setFormatOf:to: */ - format1 = 1; - assert(((format1 >= 0) && (format1 <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron1, ((longAt(ephemeron1)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format1) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer1 = copyAndForward(key1); - assert(!(isOopForwarded(ephemeron1))); - longAtput((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1); - } - assert(!(((isScavengeSurvivor(key1)) - && (isEphemeron(ephemeron1))))); - ((void) (scavengeReferentsOf(ephemeron1))); - oldCorpse = ephemeronCorpse; - /* begin nextCorpseOrNil: */ - assert(isYoung(ephemeronCorpse)); - listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); - ephemeronCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) - : 0); - } - l12: /* end fireEphemeronsOnEphemeronList */; + fireEphemeronsInRememberedSet(); + fireEphemeronsOnEphemeronList(); } } @@ -31368,6 +31061,7 @@ processWeaklings(void) } } if (!(GIV(weakList) == null)) { + /* begin firstCorpse: */ weakCorpse = (((sqInt)((usqInt)((GIV(weakList) - 1)) << 3))) + GIV(newSpaceStart); while (weakCorpse != null) { assert(isForwarded(weakCorpse)); @@ -31389,9 +31083,10 @@ processWeaklings(void) } /* begin nextCorpseOrNil: */ assert(isYoung(weakCorpse)); - listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); weakCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } GIV(weakList) = null; @@ -31470,13 +31165,7 @@ processWeakSurvivor(sqInt weakObj) } } if (weakObjShouldMourn) { - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakObj); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakObj); } return hasYoungReferents; } @@ -31531,13 +31220,9 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress) : ptr); /* begin addressAfter: */ numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(obj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -31593,7 +31278,6 @@ scavengeLoop(void) sqInt oop; sqInt previousFutureSurvivorStart; StackPage *thePage; - char *theSP; assert(GIV(futureSurvivorStart) == ((GIV(futureSpace).start))); GIV(weakList) = (GIV(ephemeronList) = null); @@ -31607,14 +31291,13 @@ scavengeLoop(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { @@ -31712,16 +31395,12 @@ scavengeReferentsOf(sqInt referrer) /* begin numSlotsOf: */ assert((classIndexOf(referrer)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(referrer + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(referrer - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(referrer - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (indexablePointersFormat())) { if (((longAt(referrer)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -31730,16 +31409,16 @@ scavengeReferentsOf(sqInt referrer) sp = longAt((referrer + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l4; + goto l5; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(referrer))); contextSize = (sp >> 1); - l4: /* end fetchStackPointerOf: */; + l5: /* end fetchStackPointerOf: */; numSlots = CtxtTempFrameStart + contextSize; - goto l8; + goto l9; } numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -31747,31 +31426,31 @@ scavengeReferentsOf(sqInt referrer) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l8; + goto l9; } assert(fmt == (ephemeronFormat())); numSlots = (isScavengeSurvivor((keyOfEphemeron(referrer))) ? numSlots2 : 0); - goto l8; + goto l9; } if (fmt == 7) { numSlots = 1; - goto l8; + goto l9; } if (fmt < (firstCompiledMethodFormat())) { numSlots = 0; - goto l8; + goto l9; } /* begin methodHeaderOf: */ assert(isCompiledMethod(referrer)); /* begin fetchPointer:ofObject: */ header = longAt((referrer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numSlots = numLiterals + LiteralStart; -l8: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; +l9: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; for (i = 0; i < numSlots; i += 1) { referent = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { @@ -31909,6 +31588,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) unfiredEphemeronsScavenged = 0; corpseOffset = GIV(ephemeronList); while (corpseOffset != 0) { + /* begin corpseForCorpseOffset: */ ephemeronCorpse = (((sqInt)((usqInt)((corpseOffset - 1)) << 3))) + GIV(newSpaceStart); assert(isForwarded(ephemeronCorpse)); /* begin followForwarded: */ @@ -31921,7 +31601,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); } ephemeron = referent; - nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); if (isScavengeSurvivor((assert((isNonImmediate(ephemeron)) && (isObjEphemeron(ephemeron))), /* begin fetchPointer:ofObject: */ @@ -31938,7 +31618,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) nextCorpseOffset) >> 5; + hash = ((usqInt) nextCorpseOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(previousCorpse + 4, ((((long32At(previousCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -32007,31 +31687,27 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objAfter + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objAfter + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { objAfter = GIV(freeStart); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objAfter = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(freeStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -32042,8 +31718,8 @@ accessibleObjectAfter(sqInt objOop) } /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objAfter = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objAfter = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { @@ -32053,13 +31729,9 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objAfter + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -32070,14 +31742,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress1 = (objAfter + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { objAfter = GIV(pastSpaceStart); - goto l2; + goto l9; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objAfter = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l9: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(pastSpaceStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -32088,13 +31760,9 @@ accessibleObjectAfter(sqInt objOop) while(1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(objAfter + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -32105,14 +31773,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress2 = (objAfter + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objAfter = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objAfter = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; if (objAfter == GIV(endOfMemory)) { return null; } @@ -32138,7 +31806,7 @@ activeAndDeferredScan(sqInt anEphemeron) && (isObjEphemeron(anEphemeron))), /* begin fetchPointer:ofObject: */ (key = longAt((anEphemeron + BaseHeaderSize) + (0U << (shiftForWord()))))))) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } return pushOnUnscannedEphemeronsStack(anEphemeron); @@ -32233,7 +31901,7 @@ addressCouldBeObj(sqInt address) && ((oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))))); } @@ -32412,7 +32080,6 @@ allInstancesOf(sqInt aClass) usqInt followingWordAddress2; usqInt followingWordAddress21; usqInt followingWordAddress3; - sqInt format; sqInt freeChunk; sqInt i; sqInt i1; @@ -32433,9 +32100,7 @@ allInstancesOf(sqInt aClass) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots131; usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; @@ -32443,7 +32108,9 @@ allInstancesOf(sqInt aClass) usqInt numSlots4; usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; + usqInt numSlots7; sqInt obj; sqInt obj1; sqInt objOop; @@ -32487,7 +32154,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } freeChunk = allocateSlotsInOldSpacebytesformatclassIndex(0, numBytes, 2, ClassArrayCompactIndex); - goto l5; + goto l6; } long64Atput(newObj, (((((usqLong) 0)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); @@ -32495,20 +32162,16 @@ allInstancesOf(sqInt aClass) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; freeChunk = newObj; - l5: /* end allocateSlots:format:classIndex: */; + l6: /* end allocateSlots:format:classIndex: */; return freeChunk; } freeChunk = allocateLargestFreeChunk(); start = freeChunk + BaseHeaderSize; /* begin addressAfter: */ numSlots1 = byteAt(freeChunk + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -32548,32 +32211,28 @@ allInstancesOf(sqInt aClass) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l20; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l20: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -32583,8 +32242,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots5 = byteAt(address + 7); - objOop = (numSlots5 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -32608,37 +32267,33 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l17; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop = (numSlots14 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -32661,32 +32316,28 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l23; + goto l20; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l23: /* end objectAfter:limit: */; + l20: /* end objectAfter:limit: */; } count = count1; ptr = ptr1; @@ -32731,32 +32382,28 @@ allInstancesOf(sqInt aClass) prevPrevObj11 = prevObj11; prevObj11 = objOop11; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots121 = byteAt(objOop11 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes4 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes4; + followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes21; if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l31; + goto l36; } flag("endianness"); followingWord21 = longAt(followingWordAddress21 + 4); objOop11 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress21 + BaseHeaderSize : followingWordAddress21); - l31: /* end objectAfter:limit: */; + l36: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -32766,8 +32413,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots6 = byteAt(address2 + 7); - objOop2 = (numSlots6 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit11 = GIV(pastSpaceStart); @@ -32798,37 +32445,33 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop2 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots14 = byteAt(objOop2 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes11; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit11)) { objOop2 = limit11; - goto l27; + goto l24; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l27: /* end objectAfter:limit: */; + l24: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots15 = byteAt(address11 + 7); - objOop2 = (numSlots15 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop2 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop2, GIV(freeStart))) { @@ -32858,32 +32501,28 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots131 = byteAt(objOop2 + 7); - if (numSlots131 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots41 = numSlots131; - } - if (numSlots41 == 0) { + numSlots111 = byteAt(objOop2 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ - slotBytes21 = ((sqInt) 8); + slotBytes11 = ((sqInt) 8); } else { - slotBytes21 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } - followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes21; + followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { objOop2 = GIV(freeStart); - goto l36; + goto l32; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop2 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l36: /* end objectAfter:limit: */; + l32: /* end objectAfter:limit: */; } /* begin purgeDuplicateClassTableEntriesFor: */ expectedIndex1 = (long32At(aClass + 4)) & (identityHashHalfWordMask()); @@ -32942,7 +32581,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } smallObj = allocateSlotsInOldSpacebytesformatclassIndex(count, numBytes1, 2, ClassArrayCompactIndex); - goto l7; + goto l8; } if (count >= (numSlotsMask())) { @@ -32959,7 +32598,7 @@ allInstancesOf(sqInt aClass) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; smallObj = newObj1; - l7: /* end allocateSlots:format:classIndex: */; + l8: /* end allocateSlots:format:classIndex: */; for (i = 0; i < count; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(smallObj))); @@ -32977,21 +32616,18 @@ allInstancesOf(sqInt aClass) } return smallObj; } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -33027,7 +32663,6 @@ allObjects(void) usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress2; - sqInt format; sqInt freeChunk; usqInt limit; usqInt limit1; @@ -33036,11 +32671,11 @@ allObjects(void) usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; - usqInt numSlots14; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -33058,22 +32693,18 @@ allObjects(void) freeChunk = allocateLargestFreeChunk(); ptr = (start = freeChunk + BaseHeaderSize); /* begin addressAfter: */ - numSlots13 = byteAt(freeChunk + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - limit = (freeChunk + BaseHeaderSize) + slotBytes2; + limit = (freeChunk + BaseHeaderSize) + slotBytes; count = 0; /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -33100,32 +32731,28 @@ allObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop1 + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots14; - } + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l16; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l16: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -33135,8 +32762,8 @@ allObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -33158,37 +32785,33 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -33209,32 +32832,28 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); @@ -33256,21 +32875,18 @@ allObjects(void) } return (((usqInt)count << 1) | 1); } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -33302,10 +32918,10 @@ allObjectsUnmarked(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -33327,14 +32943,14 @@ allObjectsUnmarked(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33342,42 +32958,38 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33385,32 +32997,28 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -33421,7 +33029,7 @@ allObjectsUnmarked(void) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33430,32 +33038,28 @@ allObjectsUnmarked(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return 1; } @@ -33483,7 +33087,7 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; assert((long64At(objOop)) != 0); if ((isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()))) - && (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) { + && (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { if (!(isonObjStack(objOop, GIV(weaklingStack)))) { return 0; } @@ -33493,13 +33097,9 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -33510,14 +33110,14 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -33577,7 +33177,6 @@ allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt c if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - /* begin largeObjectBytesForSlots: */ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { @@ -33845,7 +33444,7 @@ allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling) classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) { referent = longAt((aWeakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -33867,7 +33466,7 @@ allUnscannedEphemeronsAreActive(void) key = longAt(((longAt(p)) + BaseHeaderSize) + (0U << (shiftForWord()))); if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -33933,7 +33532,6 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt errCode; sqInt fieldOffset; sqInt fmt; - sqInt format; sqInt hash; sqInt header; sqInt i; @@ -33950,21 +33548,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt obj21; sqInt objOop; sqInt objOop1; + sqInt objOop11; sqInt objOop2; + sqInt objOop21; sqInt objOop3; sqInt objOop4; - sqInt objOop5; - sqInt objOop6; sqInt oop1; sqInt oop2; sqInt referent; sqInt referent1; + sqInt referent11; sqInt referent2; sqInt referent3; - sqInt referent4; sqInt size; sqInt sp; - char *theSP; assert(GIV(becomeEffectsFlags) == 0); runLeakCheckerFor(GCModeBecome); @@ -33989,20 +33586,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sp = longAt((array1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l35; + goto l40; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array1))); contextSize = (sp >> 1); - l35: /* end fetchStackPointerOf: */; + l40: /* end fetchStackPointerOf: */; fieldOffset = (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l30; } fieldOffset = (((numSlotsOf(array1)) - 1) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l30; } if (fmt < (firstCompiledMethodFormat())) { fieldOffset = 0; - goto l40; + goto l30; } assert(isCompiledMethod(array1)); /* begin fetchPointer:ofObject: */ @@ -34011,7 +33608,7 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop fieldOffset = (((((assert((header & 1)), /* begin literalCountOfAlternateHeader: */ ((header >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize; -l40: /* end lastPointerOf: */; +l30: /* end lastPointerOf: */; /* array1 is known to be the same size as array2 */ effectsFlags = (size = 0); @@ -34022,41 +33619,42 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop1 = referent1; + oop1 = referent3; longAtput(array1 + fieldOffset, oop1); } /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop1 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l41; - goto l27; + goto l39; } - if (((((usqInt) (longAt(oop1))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l41; - goto l27; + goto l39; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop1))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop1))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l41; - goto l27; + goto l39; } - l27: /* end ifOopInvalidForBecome:errorCodeInto: */; + l39: /* end ifOopInvalidForBecome:errorCodeInto: */; effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop1)); oop2 = longAt(array2 + fieldOffset); if (((oop2 & (tagMask())) == 0) @@ -34064,42 +33662,43 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop2 = referent2; + oop2 = referent11; longAtput(array2 + fieldOffset, oop2); } if (twoWayFlag) { /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop2 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l41; - goto l26; + goto l36; } - if (((((usqInt) (longAt(oop2))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l41; - goto l26; + goto l36; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop2))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l41; - goto l26; + goto l36; } - l26: /* end ifOopInvalidForBecome:errorCodeInto: */; + l36: /* end ifOopInvalidForBecome:errorCodeInto: */; size = (size + (bytesInObject(oop1))) + (bytesInObject(oop2)); effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop2)); } @@ -34107,18 +33706,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop if (copyHashFlag && (oop2 & (tagMask()))) { ec = PrimErrInappropriate; - goto l19; + goto l41; } } fieldOffset -= BytesPerOop; } if (size >= (GIV(totalFreeOldSpace) + (GIV(scavengeThreshold) - GIV(freeStart)))) { ec = PrimErrNoMemory; - goto l19; + goto l41; } GIV(becomeEffectsFlags) = effectsFlags; ec = 0; -l19: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; +l41: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; if (ec != 0) { GIV(becomeEffectsFlags) = 0; return ec; @@ -34129,14 +33728,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } if (twoWayFlag) { @@ -34178,11 +33776,11 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop && ((o1ClassIndex == 0) && (o2ClassIndex == 0))) { inPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); - goto l1; + goto l15; } outOfPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); if (copyHashFlag) { - goto l1; + goto l15; } if (o1ClassIndex != 0) { if (o2ClassIndex != 0) { @@ -34195,13 +33793,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj2 = referent3; + newObj2 = referent2; assert((rawHashBitsOf(newObj2)) == 0); /* begin setHashBitsOf:to: */ assert(((o1ClassIndex >= 0) && (o1ClassIndex <= (identityHashHalfWordMask())))); @@ -34215,20 +33813,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj1 = referent4; + newObj1 = referent1; assert((rawHashBitsOf(newObj1)) == 0); /* begin setHashBitsOf:to: */ assert(((o2ClassIndex >= 0) && (o2ClassIndex <= (identityHashHalfWordMask())))); long32Atput(newObj1 + 4, ((((long32At(newObj1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o2ClassIndex); } } - l1: /* end doBecome:and:copyHash: */; + l15: /* end doBecome:and:copyHash: */; /* begin followField:ofObject: */ objOop = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if (((objOop & (tagMask())) == 0) @@ -34254,31 +33852,30 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop appear in the other array. So the enumeration could encounter an object already becommed earlier in the same enumeration. */ /* begin followField:ofObject: */ - objOop5 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop5 & (tagMask())) == 0) - && (((longAt(objOop5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop5 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop5); + objOop11 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop11); } - obj11 = objOop5; + obj11 = objOop11; /* begin followField:ofObject: */ - objOop6 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop6 & (tagMask())) == 0) - && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop6 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop6); + objOop21 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop21 & (tagMask())) == 0) + && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop21 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop21); } - obj21 = objOop6; + obj21 = objOop21; if (obj11 != obj21) { /* begin doBecome:to:copyHash: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << 23))); + longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -34413,13 +34010,9 @@ byteSizeOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -34505,10 +34098,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -34520,8 +34113,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; + usqInt total; ok = 1; + total = 0; for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { if ((GIV(freeLists)[i]) != 0) { if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) == 0) { @@ -34543,8 +34138,8 @@ checkHeapFreeSpaceIntegrity(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -34580,37 +34175,33 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -34645,32 +34236,28 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -34720,6 +34307,7 @@ checkHeapFreeSpaceIntegrity(void) } } } + total += bytesInObject(objOop1); } else { for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { @@ -34744,32 +34332,37 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; + } + if (total != GIV(totalFreeOldSpace)) { + print("incorrect totalFreeOldSpace; expected "); + printNum(GIV(totalFreeOldSpace)); + print(" found "); + printNum(total); + /* begin cr */ + printf("\n"); + ok = 0; } return ok; } @@ -34787,7 +34380,7 @@ checkHeapFreeSpaceIntegrity(void) /* SpurMemoryManager>>#checkHeapIntegrity:classIndicesShouldBeValid: */ static sqInt NoDbgRegParms -checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; sqInt address1; @@ -34826,10 +34419,10 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -34868,8 +34461,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -34883,8 +34476,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -34959,37 +34552,33 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -35002,8 +34591,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -35078,32 +34667,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -35155,96 +34740,99 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } } else { - containsYoung = 0; - if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { - numRememberedObjectsInHeap += 1; - if (!(isInRememberedSet(objOop1))) { - print("remembered object "); - printHex(objOop1); - print(" is not in remembered table"); - /* begin cr */ - printf("\n"); - ok = 0; - } - } - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in forwarder "); - printHex(objOop1); - print(" to unmapped "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { - containsYoung = 1; - } - } - else { - /* begin classOrNilAtIndex: */ - classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); - assert((classIndex3 <= (tagMask())) - || (classIndex3 >= (arrayClassIndexPun()))); - /* begin fetchPointer:ofObject: */ - fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); - classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); - if (classTablePage2 == GIV(nilObj)) { - classOop = GIV(nilObj); - goto l27; + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { + containsYoung = 0; + if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { + numRememberedObjectsInHeap += 1; + if (!(isInRememberedSet(objOop1))) { + print("remembered object "); + printHex(objOop1); + print(" is not in remembered table"); + /* begin cr */ + printf("\n"); + ok = 0; + } } - /* begin fetchPointer:ofObject: */ - fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); - classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); - l27: /* end classOrNilAtIndex: */; - if (classIndicesShouldBeValid - && ((classOop == GIV(nilObj)) - && (classIndex > (lastClassIndexPun())))) { - print("object leak in "); - printHex(objOop1); - print(" invalid class index "); - printHex(classIndex); - print(" -> "); - print((classOop == null - ? "nil" - : "nilObj")); - /* begin cr */ - printf("\n"); - ok = 0; + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in forwarder "); + printHex(objOop1); + print(" to unmapped "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { + containsYoung = 1; + } } - for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); - if ((fieldOop & (tagMask())) == 0) { - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in "); - printHex(objOop1); - print(" @ "); - printNum(fi); - print(" = "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { - containsYoung = 1; + else { + /* begin classOrNilAtIndex: */ + classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); + assert((classIndex3 <= (tagMask())) + || (classIndex3 >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); + classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); + if (classTablePage2 == GIV(nilObj)) { + classOop = GIV(nilObj); + goto l27; + } + /* begin fetchPointer:ofObject: */ + fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); + classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + l27: /* end classOrNilAtIndex: */; + if (classIndicesShouldBeValid + && ((classOop == GIV(nilObj)) + && (classIndex > (lastClassIndexPun())))) { + print("object leak in "); + printHex(objOop1); + print(" invalid class index "); + printHex(classIndex); + print(" -> "); + print((classOop == null + ? "nil" + : "nilObj")); + /* begin cr */ + printf("\n"); + ok = 0; + } + for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); + if ((fieldOop & (tagMask())) == 0) { + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in "); + printHex(objOop1); + print(" @ "); + printNum(fi); + print(" = "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { + containsYoung = 1; + } } } } - } - if (containsYoung) { - if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { - print("unremembered object "); - printHex(objOop1); - print(" contains young oop(s)"); - /* begin cr */ - printf("\n"); - ok = 0; + if (containsYoung) { + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + print("unremembered object "); + printHex(objOop1); + print(" contains young oop(s)"); + /* begin cr */ + printf("\n"); + ok = 0; + } } } } @@ -35252,32 +34840,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l23; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } if (numRememberedObjectsInHeap != (rememberedSetSize())) { print("root count mismatch. #heap roots "); @@ -35327,7 +34911,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } /* begin objStack:do: */ if (GIV(mournQueue) == GIV(nilObj)) { - goto l9; + goto l14; } eassert(isValidObjStack(GIV(mournQueue))); objStackPage = GIV(mournQueue); @@ -35348,10 +34932,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!(excludeUnmarkedNewSpaceObjs - && ((((obj & (tagMask())) == 0) - && (oopisLessThan(obj, GIV(newSpaceLimit)))) - && (!(((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0))))) { + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { if ((heapMapAtWord(pointerForOop(obj))) == 0) { print("object leak in mournQueue @ "); printNum(i2); @@ -35370,7 +34952,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s /* begin fetchPointer:ofObject: */ objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } -l9: /* end objStack:do: */; +l14: /* end objStack:do: */; for (ri = 1; ri <= GIV(remapBufferCount); ri += 1) { obj = GIV(remapBuffer)[ri]; if ((obj & (BytesPerWord - 1)) != 0) { @@ -35484,7 +35066,7 @@ checkOkayOop(usqInt oop) print(" has some unused header bits set; should be zero"); return 0; } - unusedBitsInYoungObjects = (1U << 0x1F) | ((1U << 30) | (1U << (rememberedBitShift()))); + unusedBitsInYoungObjects = (1U << (greyBitShift())) | ((1U << (pinnedBitShift())) | (1U << (rememberedBitShift()))); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { print("oop "); printHex(oop); @@ -35544,7 +35126,6 @@ checkOopHasOkayClass(usqInt obj) objFormat = ((((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) | 7) - 7); } else { - /* begin formatOf: */ objFormat = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask()); } if ((instSpecOfClassFormat(((longAt((objClass + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) != objFormat) { @@ -35959,13 +35540,9 @@ clearLeakMapAndMapAccessibleFreeSpace(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -35976,14 +35553,14 @@ clearLeakMapAndMapAccessibleFreeSpace(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } } @@ -36008,10 +35585,10 @@ clearLeakMapAndMapAccessibleObjects(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -36034,8 +35611,8 @@ clearLeakMapAndMapAccessibleObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -36047,37 +35624,33 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -36088,32 +35661,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -36131,32 +35700,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -36176,13 +35741,9 @@ cloneInOldSpaceForPinning(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); newObj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(numSlots, ((numSlots == 0 ? 8 @@ -36260,13 +35821,9 @@ clone(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { /* begin allocateSlotsInOldSpace:format:classIndex: */ @@ -36298,7 +35855,7 @@ clone(sqInt objOop) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, fmt, classIndex1); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -36315,7 +35872,7 @@ clone(sqInt objOop) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l4: /* end allocateSlots:format:classIndex: */; + l5: /* end allocateSlots:format:classIndex: */; } if (!(newObj)) { return 0; @@ -36489,10 +36046,10 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -36515,14 +36072,14 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -36539,42 +36096,38 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -36591,32 +36144,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -36627,7 +36176,7 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop11); @@ -36645,32 +36194,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } print("n marked: "); printNum(nm); @@ -36829,7 +36374,7 @@ doScavenge(sqInt tenuringCriterion) sqInt p; SpurNewSpaceSpace temp; - GIV(scavengeInProgress) = 1; + GIV(gcPhaseInProgress) = ScavengeInProgress; /* begin scavenge: */ GIV(statSurvivorCount) = 0; GIV(tenureCriterion) = tenuringCriterion; @@ -36867,7 +36412,7 @@ doScavenge(sqInt tenuringCriterion) } } } - GIV(scavengeInProgress) = 0; + GIV(gcPhaseInProgress) = 0; } @@ -37170,9 +36715,9 @@ existInstancesInNewSpaceOf(sqInt classObj) usqInt numSlots; usqInt numSlots1; usqInt numSlots11; - usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37190,8 +36735,8 @@ existInstancesInNewSpaceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37205,37 +36750,33 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37248,32 +36789,28 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 0; } @@ -37453,10 +36990,10 @@ findStringBeginningWith(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37479,8 +37016,8 @@ findStringBeginningWith(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37504,37 +37041,33 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37557,32 +37090,28 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -37612,32 +37141,28 @@ findStringBeginningWith(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -37664,10 +37189,10 @@ findString(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37690,8 +37215,8 @@ findString(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37712,37 +37237,33 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37762,32 +37283,28 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -37814,35 +37331,44 @@ findString(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#fireAllUnscannedEphemerons */ +static void +fireAllUnscannedEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt p; + + assert(!(noUnscannedEphemerons())); + assert(allUnscannedEphemeronsAreActive()); + for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { + fireEphemeron(longAt(p)); + } +} + /* SpurMemoryManager>>#firstAccessibleObject */ static sqInt firstAccessibleObject(void) @@ -38436,7 +37962,9 @@ freeObject(sqInt objOop) usqLong NeverInline fullGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - char *theSP; + sqInt i; + sqInt index; + sqInt obj; GIV(needGCFlag) = 0; GIV(gcStartUsecs) = ioUTCMicrosecondsNow(); @@ -38447,14 +37975,13 @@ fullGC(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } flushMethodCache(); @@ -38464,10 +37991,38 @@ fullGC(void) assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); markObjects(1); - /* begin freeUnmarkedObjectsAndPrepareFreeSpace */ - freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); - runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin forgetUnmarkedRememberedObjects */ + index = 0; + while (index < GIV(rememberedSetSize)) { + obj = GIV(rememberedSet)[index]; + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { + index += 1; + } + else { + + /* unmarked; remove by overwriting with last element. */ + /* begin setIsRememberedOf:to: */ + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + assert(GIV(rememberedSetSize) >= 0); + doScavenge(MarkOnTenure); + runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin prepareForGlobalSweep */ + GIV(sweepIndex) = 0; + for (i = 0; i < GIV(numSegments); i += 1) { + ((GIV(segments)[i]).containsPinned = 0); + } + setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); compact(); + /* begin attemptToShrink */ + if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) + && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { + GIV(statShrinkMemory) += 1; + shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); + } /* begin setHeapSizeAtPreviousGC */ GIV(heapSizeAtPreviousGC) = (GIV(endOfMemory) - GIV(nilObj)) - GIV(totalFreeOldSpace); assert(validObjStacks()); @@ -38475,12 +38030,6 @@ fullGC(void) assert(isEmptyObjStack(GIV(weaklingStack))); assert(allObjectsUnmarked()); runLeakCheckerFor(GCModeFull); - /* begin attemptToShrink */ - if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) - && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { - GIV(statShrinkMemory) += 1; - shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); - } /* begin postGCAction: */ signalSemaphoreWithIndex(GIV(gcSemaphoreIndex)); GIV(statFullGCs) += 1; @@ -38508,13 +38057,9 @@ goodContextSize(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); return (numSlots == SmallContextSlots) || (numSlots == LargeContextSlots); } @@ -38699,7 +38244,7 @@ imageSegmentVersion(void) sqInt immutableBitMask(void) { - return 1U << 23; + return 1U << (immutableBitShift()); } #endif /* IMMUTABILITY */ @@ -38793,10 +38338,10 @@ initialInstanceOf(sqInt classObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -38834,8 +38379,8 @@ initialInstanceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -38849,37 +38394,33 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -38892,32 +38433,28 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -38937,20 +38474,16 @@ initialInstanceOf(sqInt classObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -39055,21 +38588,17 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(classTableRoot)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classTableRoot + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(numClassTablePages) = longAt(classTableRoot - BaseHeaderSize); - } - else { - GIV(numClassTablePages) = numSlots1; - } + GIV(numClassTablePages) = (numSlots1 == (numSlotsMask()) + ? longAt(classTableRoot - BaseHeaderSize) + : numSlots1); assert(GIV(numClassTablePages) == ((classTableRootSlots()) + (hiddenRootSlots()))); for (i1 = 2; i1 < GIV(numClassTablePages); i1 += 1) { if ((longAt((classTableRoot + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))))) == nilObjPreSwizzle) { GIV(numClassTablePages) = i1; - goto l11; + goto l8; } } -l11: /* end countNumClassPagesPreSwizzle: */; +l8: /* end countNumClassPagesPreSwizzle: */; if ((bytesToShift != 0) || ((numSegments()) > 1)) { /* begin objectStartingAt: */ @@ -39145,16 +38674,17 @@ initializeObjectMemory(sqInt bytesToShift) flag("endianness"); longAtput(GIV(classTableFirstPage), ((longAt(GIV(classTableFirstPage))) & ((unsigned int)~(classIndexMask()))) + classIndex1); } + /* begin classTableRootSlots */ GIV(numClassTablePages) = 1U << (22 - (classTableMajorIndexShift())); for (i2 = 2; i2 < GIV(numClassTablePages); i2 += 1) { if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))))) == GIV(nilObj)) { GIV(numClassTablePages) = i2; GIV(classTableIndex) = ((sqInt)((usqInt)(((((GIV(numClassTablePages) - 1) < 1) ? 1 : (GIV(numClassTablePages) - 1)))) << (classTableMajorIndexShift()))); - goto l13; + goto l14; } } GIV(classTableIndex) = 1U << (classTableMajorIndexShift()); -l13: /* end setHiddenRootsObj: */; +l14: /* end setHiddenRootsObj: */; GIV(markStack) = swizzleObjStackAt(MarkStackRootIndex); GIV(weaklingStack) = swizzleObjStackAt(WeaklingStackRootIndex); GIV(mournQueue) = swizzleObjStackAt(MournQueueRootIndex); @@ -39222,13 +38752,9 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(obj2)) > (isForwardedObjectClassIndexPun())); numSlots3 = byteAt(obj2 + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(obj2 - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots3; - } + GIV(rememberedSetLimit) = (numSlots3 == (numSlotsMask()) + ? longAt(obj2 - BaseHeaderSize) + : numSlots3); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -39343,7 +38869,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o1HasYoung && ((assert(isNonImmediate(obj1)), oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj1))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -39356,7 +38881,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o2HasYoung && ((assert(isNonImmediate(obj2)), oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj2))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -39458,7 +38982,6 @@ isBytes(sqInt oop) sqInt isCharacterObject(sqInt oop) { - /* begin isImmediateCharacter: */ return (oop & (tagMask())) == (characterTag()); } @@ -39674,7 +39197,6 @@ isIndexable(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); return (fmt >= 2) && ((fmt <= (weakArrayFormat())) @@ -39708,7 +39230,7 @@ isInMemory(sqInt address) && (oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))) { return (oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))); } /* begin isInSegments: */ @@ -39781,7 +39303,8 @@ isObjImmutable(sqInt anOop) { return # if IMMUTABILITY - ((((usqInt) (longAt(anOop))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(anOop))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -39823,7 +39346,7 @@ sqInt isOopImmutable(sqInt oop) { return (oop & (tagMask())) - || (((((usqInt) (longAt(oop))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0); } /* SpurMemoryManager>>#isOopMutable: */ @@ -39831,14 +39354,14 @@ sqInt isOopMutable(sqInt oop) { return ((oop & (tagMask())) == 0) - && (!(((((usqInt) (longAt(oop))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0)); } /* SpurMemoryManager>>#isPinned: */ sqInt isPinned(sqInt objOop) { - return ((((usqInt) (longAt(objOop))) >> 30) & 1) != 0; + return ((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0; } @@ -40016,7 +39539,7 @@ isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx) return 0; } if (GIV(marking) - && (!(((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0))) { + && (!(((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0))) { GIV(objStackInvalidBecause) = "marking but page is unmarked"; GIV(invalidObjStackPage) = objStackPage; return 0; @@ -40145,25 +39668,7 @@ sqInt isWeak(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWeakNonImm(oop)); -} - - -/* Answer if the contains only indexable words or bytes (no oops). See - comment in formatOf: - */ -/* Note: Excludes CompiledMethods. */ - - /* SpurMemoryManager>>#isWordsOrBytesNonImm: */ -static sqInt NoDbgRegParms -isWordsOrBytesNonImm(sqInt objOop) -{ - sqInt format; - - /* begin isPureBitsFormat: */ - format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); - return (format >= (sixtyFourBitIndexableFormat())) - && (format < (firstCompiledMethodFormat())); + && (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -40177,7 +39682,7 @@ sqInt isWordsOrBytes(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)); + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -40307,7 +39812,6 @@ lastPointerOfWhileSwizzling(sqInt objOop) sqInt fmt; sqInt header; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -40338,7 +39842,6 @@ lastPointerOf(sqInt objOop) sqInt header; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -40350,11 +39853,11 @@ lastPointerOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l4; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l4: /* end fetchStackPointerOf: */; return (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; } return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize; @@ -40417,13 +39920,9 @@ lengthOfMaybeImmediate(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -40461,13 +39960,9 @@ lengthOf(sqInt objOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -40533,8 +40028,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt addr1; sqInt classIndex; sqInt classIndex1; - sqInt classIndex11; sqInt classIndex2; + sqInt classIndex3; sqInt classOop; sqInt classRef; sqInt errorCode; @@ -40548,8 +40043,6 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) usqInt followingWordAddress1; usqInt followingWordAddress2; usqInt followingWordAddress3; - sqInt format; - sqInt format1; sqInt hash; sqInt i; sqInt iLimiT; @@ -40560,24 +40053,23 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt numLoadedObjects; usqInt numOutPointers; sqInt numSegObjs; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots10; usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; usqInt numSlots14; usqInt numSlots15; - usqInt numSlots16; usqInt numSlots2; usqInt numSlots21; + usqInt numSlots22; usqInt numSlots3; + usqInt numSlots31; usqInt numSlots4; usqInt numSlots5; usqInt numSlots6; usqInt numSlots7; usqInt numSlots8; - usqInt numSlots9; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -40598,14 +40090,10 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin numSlotsOf: */ assert((classIndexOf(segmentWordArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(segmentWordArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - segmentLimit = longAt(segmentWordArray - BaseHeaderSize); - } - else { - segmentLimit = numSlots1; - } + numSlots = byteAt(segmentWordArray + 7); + segmentLimit = (numSlots == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots); if ((((segmentLimit == 0 ? 8 : (segmentLimit + (segmentLimit & 1)) << (shiftForWord()))) + ((segmentLimit >= (numSlotsMask()) @@ -40622,22 +40110,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots12 = byteAt(segmentWordArray + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots13 = byteAt(segmentWordArray + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes1; + stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes3; addr1 = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr1, stopAddr1)) { long32Atput(addr1, SQ_SWAP_4_BYTES((long32At(addr1)))); @@ -40649,22 +40133,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(segmentWordArray + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes; + stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes2; addr = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr, stopAddr)) { long32Atput(addr, SQ_SWAP_4_BYTES((long32At(addr)))); @@ -40689,63 +40169,59 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } /* begin mapOopsAndValidateClassRefsFrom:to:outPointers: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots8 = byteAt(outPointerArray + 7); - if (numSlots8 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numOutPointers = longAt(outPointerArray - BaseHeaderSize); - } - else { - numOutPointers = numSlots8; - } + numSlots22 = byteAt(outPointerArray + 7); + numOutPointers = (numSlots22 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots22); numSegObjs = 0; /* begin objectStartingAt: */ - numSlots9 = byteAt(segmentStart + 7); - objOop1 = (numSlots9 == (numSlotsMask()) + numSlots31 = byteAt(segmentStart + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); - while (objOop1 < segmentLimit) { + while (objOop2 < segmentLimit) { numSegObjs += 1; - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } /* validate the class ref, but don't update it until any internal classes have been added to the class table. */ - classIndex = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); - if (classIndex & TopHashBit) { - if ((classIndex - TopHashBit) >= numOutPointers) { + classIndex3 = ((longAt(objOop2)) & (classIndexMask())) - (firstClassIndexPun()); + if (classIndex3 & TopHashBit) { + if ((classIndex3 - TopHashBit) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } /* begin fetchPointer:ofObject: */ - mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex - TopHashBit)) << (shiftForWord()))))); + mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex3 - TopHashBit)) << (shiftForWord()))))); hash = (long32At(mappedOop + 4)) & (identityHashHalfWordMask()); if (!((hash > (lastClassIndexPun())) && ((classOrNilAtIndex(hash)) == mappedOop))) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } } else { /* The class is contained within the segment. */ - if (((oop1 = (classIndex * 8) + segmentStart)) >= segmentLimit) { + if (((oop1 = (classIndex3 * 8) + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } if (((long32At(oop1 + 4)) & (identityHashHalfWordMask())) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } } - for (i = 0, iLimiT = ((numPointerSlotsOf(objOop1)) - 1); i <= iLimiT; i += 1) { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop2)) - 1); i <= iLimiT; i += 1) { /* begin fetchPointer:ofObject: */ - oop1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + oop1 = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop1 & (tagMask())) == 0) { if (oop1 & TopOopBit) { if (((oop1 = (oop1 - TopOopBit) / BytesPerOop)) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } /* begin fetchPointer:ofObject: */ mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(oop1) << (shiftForWord()))))); @@ -40753,47 +40229,43 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) else { if ((oop1 & (8 - 1)) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } if (((mappedOop = oop1 + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } } - assert(!(isOopForwarded(objOop1))); - longAtput((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), mappedOop); + assert(!(isOopForwarded(objOop2))); + longAtput((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), mappedOop); } } /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots15 = byteAt(objOop2 + 7); + numSlots8 = (numSlots15 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots15); + if (numSlots8 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes5 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes5 = (numSlots8 + (numSlots8 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { - objOop1 = segmentLimit; - goto l9; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; + if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { + objOop2 = segmentLimit; + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l9: /* end objectAfter:limit: */; + followingWord3 = longAt(followingWordAddress3 + 4); + objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress3 + BaseHeaderSize + : followingWordAddress3); + l29: /* end objectAfter:limit: */; } errorCode = -numSegObjs; -l11: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; +l38: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; if (errorCode > 0) { return errorCode; } @@ -40817,7 +40289,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) forceInterruptCheck(); } loadedObjectsArray = allocateSlotsInOldSpacebytesformatclassIndex(numLoadedObjects, numBytes, 2, ClassArrayCompactIndex); - goto l13; + goto l14; } if (numLoadedObjects >= (numSlotsMask())) { @@ -40834,7 +40306,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; loadedObjectsArray = newObj; -l13: /* end allocateSlots:format:classIndex: */; +l14: /* end allocateSlots:format:classIndex: */; if (!(loadedObjectsArray)) { return PrimErrNoMemory; } @@ -40850,84 +40322,76 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) while (objOop < oop) { expungeFromClassTable(objOop); /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots6 = numSlots14; - } - if (numSlots6 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots3 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segmentLimit)) { objOop = segmentLimit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } errorCode = errorCode1; - goto l5; + goto l12; } /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots7 = numSlots15; - } - if (numSlots7 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes4; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, segmentLimit)) { objOop = segmentLimit; - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } errorCode = 0; -l5: /* end enterClassesIntoClassTableFrom:to: */; +l12: /* end enterClassesIntoClassTableFrom:to: */; if (errorCode != 0) { return errorCode; } /* begin assignClassIndicesAndPinFrom:to:outPointers:filling: */ - numSlots10 = byteAt(segmentStart + 7); - objOop2 = (numSlots10 == (numSlotsMask()) + numSlots21 = byteAt(segmentStart + 7); + objOop1 = (numSlots21 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); fillIdx = 0; - while (objOop2 < segmentLimit) { + while (objOop1 < segmentLimit) { assert(!(isOopForwarded(loadedObjectsArray))); - longAtput((loadedObjectsArray + BaseHeaderSize) + (((sqInt)((usqInt)(fillIdx) << (shiftForWord())))), objOop2); + longAtput((loadedObjectsArray + BaseHeaderSize) + (((sqInt)((usqInt)(fillIdx) << (shiftForWord())))), objOop1); /* In the segment, class indices are offset indexes into the segment data, or into outPointers. See mapOopsFrom:to:outPointers:outHashes:. */ fillIdx += 1; - classRef = ((longAt(objOop2)) & (classIndexMask())) - (firstClassIndexPun()); + classRef = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); if (classRef & TopHashBit) { /* begin fetchPointer:ofObject: */ classOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classRef - TopHashBit)) << (shiftForWord()))))); @@ -40941,97 +40405,90 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin setClassIndexOf:to: */ assert(((classIndex2 >= 0) && (classIndex2 <= (classIndexMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~(classIndexMask()))) + classIndex2); - if (((oopisLessThan(objOop2, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(objOop2, GIV(newSpaceStart)))) - && (((((usqInt) (longAt(objOop2))) >> 30) & 1) != 0)) { - oldClone = cloneInOldSpaceForPinning(objOop2); + longAtput(objOop1, ((longAt(objOop1)) & ((unsigned int)~(classIndexMask()))) + classIndex2); + if (((oopisLessThan(objOop1, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(objOop1, GIV(newSpaceStart)))) + && (((((usqInt) (longAt(objOop1))) >> (pinnedBitShift())) & 1) != 0)) { + oldClone = cloneInOldSpaceForPinning(objOop1); if (oldClone != 0) { /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ - classIndex11 = isForwardedObjectClassIndexPun(); - format1 = 7; - assert(((classIndex11 >= 0) && (classIndex11 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + classIndex1 = isForwardedObjectClassIndexPun(); + assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(objOop1, ((longAt(objOop1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << 23))); + longAtput(objOop1, (longAt(objOop1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ /* begin storePointer:ofForwarder:withValue: */ - assert(isForwarded(objOop2)); + assert(isForwarded(objOop1)); assert(!(isOopForwarded(oldClone))); - if ((assert(isNonImmediate(objOop2)), - oopisGreaterThanOrEqualTo(objOop2, GIV(oldSpaceStart)))) { + if ((assert(isNonImmediate(objOop1)), + oopisGreaterThanOrEqualTo(objOop1, GIV(oldSpaceStart)))) { /* most stores into young objects */ if (((oldClone & (tagMask())) == 0) && (oopisLessThan(oldClone, GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(objOop2))) >> (rememberedBitShift())) & 1) != 0)) { - remember(objOop2); + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop1); } } } - longAtput((objOop2 + BaseHeaderSize) + (0U << (shiftForWord())), oldClone); - if ((byteAt(objOop2 + 7)) == 0) { - byteAtput(objOop2 + 7, 1); + longAtput((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())), oldClone); + if ((byteAt(objOop1 + 7)) == 0) { + byteAtput(objOop1 + 7, 1); } } } /* begin objectAfter:limit: */ - numSlots16 = byteAt(objOop2 + 7); - if (numSlots16 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots21 = numSlots16; - } - if (numSlots21 == 0) { + numSlots14 = byteAt(objOop1 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes5 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes5 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; - if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { - objOop2 = segmentLimit; - goto l35; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes4; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { + objOop1 = segmentLimit; + goto l23; } flag("endianness"); - followingWord3 = longAt(followingWordAddress3 + 4); - objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress3 + BaseHeaderSize - : followingWordAddress3); - l35: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l23: /* end objectAfter:limit: */; } if ((byteAt(segmentWordArray + 7)) == (numSlotsMask())) { /* begin rawOverflowSlotsOf:put: */ - numSlots = 8 / BytesPerOop; - longAtput(segmentWordArray - BaseHeaderSize, numSlots); + longAtput(segmentWordArray - BaseHeaderSize, 8 / BytesPerOop); } else { /* begin rawNumSlotsOf:put: */ byteAtput(segmentWordArray + 7, 8 / BytesPerOop); } /* begin forward:to: */ - classIndex1 = isForwardedObjectClassIndexPun(); - format = 7; - assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + classIndex = isForwardedObjectClassIndexPun(); + assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << 23))); + longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -41056,8 +40513,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } runLeakCheckerFor(GCModeImageSegment); /* begin objectStartingAt: */ - numSlots2 = byteAt(segmentStart + 7); - return (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(segmentStart + 7); + return (numSlots4 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); } @@ -41101,10 +40558,10 @@ longPrintInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -41133,32 +40590,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -41168,8 +40621,8 @@ longPrintInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -41183,37 +40636,33 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -41226,32 +40675,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -41278,11 +40723,11 @@ longPrintReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -41306,8 +40751,8 @@ longPrintReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -41316,12 +40761,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41331,13 +40771,9 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41361,37 +40797,33 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -41399,12 +40831,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41414,13 +40841,9 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41444,32 +40867,28 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -41483,12 +40902,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop11)) + LiteralStart; } else { if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41498,13 +40912,9 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41529,14 +40939,10 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -41547,14 +40953,14 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l14; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l14: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -41632,11 +41038,11 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe sqInt hash2; sqInt i; sqInt iLimiT; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots11; - usqInt numSlots2; + sqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt objOop; sqInt oop; sqInt outIndex; @@ -41649,27 +41055,23 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe outIndex = 0; /* begin fillObj:numSlots:with: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(outPointerArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(outPointerArray - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(outPointerArray))); - for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { + numSlots4 = byteAt(outPointerArray + 7); + numSlots2 = (numSlots4 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots4); + assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1, addressAfter(outPointerArray))); + for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1))); p += 8) { longAtput(p, GIV(nilObj)); longAtput(p + 4, GIV(nilObj)); } /* begin objectStartingAt: */ - numSlots2 = byteAt(segStart + 7); - objOop = (numSlots2 == (numSlotsMask()) + numSlots3 = byteAt(segStart + 7); + objOop = (numSlots3 == (numSlotsMask()) ? segStart + BaseHeaderSize : segStart); while (objOop < segAddr) { oop = fetchClassOfNonImm(objOop); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -41677,7 +41079,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l7; + goto l11; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -41703,7 +41105,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1); setIsMarkedOfto(oop, 1); outIndex += 1; - l7: /* end newOutPointer:at:in:hashes: */; + l11: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -41720,7 +41122,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* begin fetchPointer:ofObject: */ oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -41728,7 +41130,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l9; + goto l14; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -41754,7 +41156,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2); setIsMarkedOfto(oop, 1); outIndex += 1; - l9: /* end newOutPointer:at:in:hashes: */; + l14: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -41772,32 +41174,28 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe } } /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segAddr)) { objOop = segAddr; - goto l2; + goto l6; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l2: /* end objectAfter:limit: */; + l6: /* end objectAfter:limit: */; } return outIndex; } @@ -41848,7 +41246,7 @@ markAndTraceClassOf(sqInt objOop) flag("endianness"); longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~(classIndexMask()))) + realClassIndex); } - if (!(((((usqInt) (longAt(classObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(classObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { setIsMarkedOfto(classObj, 1); markAndTraceClassOf(classObj); pushonObjStack(classObj, GIV(markStack)); @@ -41916,24 +41314,8 @@ markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents) void NeverInline markAndTrace(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; - sqInt contextSize; - sqInt field; - sqInt fmt; sqInt format1; - sqInt format11; - sqInt header; - sqInt index; - sqInt numLiterals; - usqInt numSlots; - usqInt numSlots1; - sqInt numStrongSlots; - sqInt objOop1; - sqInt objToScan; - sqInt scanLargeObject; - sqInt sp; - numStrongSlots = 0; /* inline markAndShouldScan: */ if (objOop & (tagMask())) { @@ -41941,12 +41323,11 @@ markAndTrace(sqInt objOop) } assert(!(isForwarded(objOop))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { return; } setIsMarkedOfto(objOop, 1); - /* begin formatOf: */ format1 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if ((format1 >= (sixtyFourBitIndexableFormat())) && (format1 < (firstCompiledMethodFormat()))) { @@ -41972,7 +41353,88 @@ markAndTrace(sqInt objOop) } - /* begin markLoopFrom: */ + markLoopFrom(objOop); +} + + +/* Go through the unscanned ephemerons, marking the inactive ones, and + removing them from the unscanned ephemerons. Answer if any inactive + ones were found. We cannot fire the ephemerons until all are found to + be active since scan-marking an inactive ephemeron later in the set may + render a previously-observed active ephemeron as inactive. */ + + /* SpurMemoryManager>>#markInactiveEphemerons */ +static sqInt +markInactiveEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt foundInactive; + sqInt key; + sqInt objOop; + sqInt oop; + usqInt ptr; + + foundInactive = 0; + ptr = (GIV(unscannedEphemerons).start); + while (ptr < ((GIV(unscannedEphemerons).top))) { + /* begin followedKeyOfEphemeron: */ + objOop = (ephemeron = longAt(ptr)); + assert((isNonImmediate(objOop)) + && (isEphemeron(objOop))); + /* begin followOopField:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); + } + key = oop; + if ((key & (tagMask())) + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + + /* Now remove the inactive ephemeron from the set, and scan-mark it. + Scan-marking it may add more ephemerons to the set. */ + foundInactive = 1; + (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); + if (((GIV(unscannedEphemerons).top)) > ptr) { + longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); + } + markAndTrace(ephemeron); + } + else { + ptr += BytesPerOop; + } + } + return foundInactive; +} + + +/* Scan objOop and all objects on the mark stack, until the mark stack is + empty. N.B. When the incremental GC is written this will probably be + refactored as + markLoopFrom: objOop while: aBlock */ +/* Now scan the object, and any remaining objects on the mark stack. */ + + /* SpurMemoryManager>>#markLoopFrom: */ +static void NoDbgRegParms +markLoopFrom(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt contextSize; + sqInt field; + sqInt fmt; + sqInt format1; + sqInt header; + sqInt index; + sqInt numLiterals; + usqInt numSlots; + usqInt numSlots1; + sqInt numStrongSlots; + sqInt objOop1; + sqInt objToScan; + sqInt scanLargeObject; + sqInt sp; + + numStrongSlots = 0; /* To avoid overflowing the mark stack when we encounter large objects, we push the obj, then its numStrongSlots, and then index the object from the stack. */ @@ -41990,16 +41452,12 @@ markAndTrace(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objToScan)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objToScan + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objToScan - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objToScan - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (indexablePointersFormat())) { if (((longAt(objToScan)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -42008,16 +41466,16 @@ markAndTrace(sqInt objOop) sp = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l7; + goto l5; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objToScan))); contextSize = (sp >> 1); - l7: /* end fetchStackPointerOf: */; + l5: /* end fetchStackPointerOf: */; numStrongSlots = CtxtTempFrameStart + contextSize; - goto l12; + goto l10; } numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -42025,26 +41483,26 @@ markAndTrace(sqInt objOop) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l12; + goto l10; } } if (fmt == 7) { numStrongSlots = 1; - goto l12; + goto l10; } if (fmt < (firstCompiledMethodFormat())) { numStrongSlots = 0; - goto l12; + goto l10; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objToScan)); /* begin fetchPointer:ofObject: */ header = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numStrongSlots = numLiterals + LiteralStart; - l12: /* end numStrongSlotsOfInephemeral: */; + l10: /* end numStrongSlotsOfInephemeral: */; scanLargeObject = numStrongSlots > 64; } if (scanLargeObject) { @@ -42072,14 +41530,13 @@ markAndTrace(sqInt objOop) goto l3; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l3; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -42088,13 +41545,13 @@ markAndTrace(sqInt objOop) } goto l3; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l3; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l3; } @@ -42138,14 +41595,13 @@ markAndTrace(sqInt objOop) goto l4; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l4; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -42154,13 +41610,13 @@ markAndTrace(sqInt objOop) } goto l4; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l4; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l4; } @@ -42179,57 +41635,6 @@ markAndTrace(sqInt objOop) } -/* Go through the unscanned ephemerons, marking the inactive ones, and - removing them from the unscanned ephemerons. Answer if any inactive - ones were found. We cannot fire the ephemerons until all are found to - be active since scan-marking an inactive ephemeron later in the set may - render a previously-observed active ephemeron as inactive. */ - - /* SpurMemoryManager>>#markInactiveEphemerons */ -static sqInt -markInactiveEphemerons(void) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt foundInactive; - sqInt key; - sqInt objOop; - sqInt oop; - usqInt ptr; - - foundInactive = 0; - ptr = (GIV(unscannedEphemerons).start); - while (ptr < ((GIV(unscannedEphemerons).top))) { - /* begin followedKeyOfEphemeron: */ - objOop = (ephemeron = longAt(ptr)); - assert((isNonImmediate(objOop)) - && (isEphemeron(objOop))); - /* begin followOopField:ofObject: */ - oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - if (((oop & (tagMask())) == 0) - && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); - } - key = oop; - if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { - - /* Now remove the inactive ephemeron from the set, and scan-mark it. - Scan-marking it may add more ephemerons to the set. */ - foundInactive = 1; - (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); - if (((GIV(unscannedEphemerons).top)) > ptr) { - longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); - } - markAndTrace(ephemeron); - } - else { - ptr += BytesPerOop; - } - } - return foundInactive; -} - - /* for profiling */ /* Mark all accessible objects. objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged is true if all @@ -42264,7 +41669,6 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) sqInt referent4; usqInt sizeOfUnusedEden; StackPage *thePage; - char *theSP; runLeakCheckerFor(GCModeFull); /* begin shutDownIncrementalGC: */ @@ -42299,19 +41703,18 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } - for (i3 = 0; i3 < GIV(numStackPages); i3 += 1) { + for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { /* begin stackPageAt: */ - thePage = stackPageAtpages(i3, GIV(pages)); + thePage = stackPageAtpages(i1, GIV(pages)); (thePage->trace = StackPageUnreached); } /* begin markAndTraceHiddenRoots */ @@ -42321,20 +41724,20 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((int)((usqInt)(RememberedSetRootIndex) << (shiftForWord()))))), 1); setIsMarkedOfto((assert((firstIndexableField(objectAfter(GIV(trueObj)))) == GIV(freeLists)), objectAfter(GIV(trueObj))), 1); - if (isWeakNonImm(GIV(classTableFirstPage))) { + if (isWeakFormat((((usqInt) (longAt(GIV(classTableFirstPage)))) >> (formatShift())) & (formatMask()))) { markAndTrace(GIV(hiddenRootsObj)); - goto l1; + goto l2; } setIsMarkedOfto(GIV(hiddenRootsObj), 1); markAndTrace(GIV(classTableFirstPage)); for (i2 = 1; i2 < GIV(numClassTablePages); i2 += 1) { setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))), 1); } -l1: /* end markAndTraceHiddenRoots */; +l2: /* end markAndTraceHiddenRoots */; /* begin markAndTraceExtraRoots */ assert(GIV(remapBufferCount) == 0); - for (i = 1; i <= GIV(extraRootCount); i += 1) { - oop = (GIV(extraRoots)[i])[0]; + for (i4 = 1; i4 <= GIV(extraRootCount); i4 += 1) { + oop = (GIV(extraRoots)[i4])[0]; if (!((oop & (tagMask())) || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { markAndTrace(oop); @@ -42430,18 +41833,18 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) if (!(GIV(tempOop3) == 0)) { markAndTrace(GIV(tempOop3)); } - for (i4 = 1, iLimiT = (remapBufferCount()); i4 <= iLimiT; i4 += 1) { - oop1 = GIV(remapBuffer)[i4]; + for (i3 = 1, iLimiT = (remapBufferCount()); i3 <= iLimiT; i3 += 1) { + oop1 = GIV(remapBuffer)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } } - for (i4 = 1; i4 <= GIV(jmpDepth); i4 += 1) { - oop1 = GIV(suspendedCallbacks)[i4]; + for (i3 = 1; i3 <= GIV(jmpDepth); i3 += 1) { + oop1 = GIV(suspendedCallbacks)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } - oop1 = GIV(suspendedMethods)[i4]; + oop1 = GIV(suspendedMethods)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } @@ -42450,13 +41853,13 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) markWeaklingsAndMarkAndFireEphemerons(); assert(validObjStacks()); /* begin expungeDuplicateAndUnmarkedClasses: */ - for (i1 = 1; i1 < GIV(numClassTablePages); i1 += 1) { + for (i = 1; i < GIV(numClassTablePages); i += 1) { /* Avoid expunging the puns by not scanning the 0th page. */ - classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) { classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord()))))); - classIndex = (((sqInt)((usqInt)(i1) << (classTableMajorIndexShift())))) + j; + classIndex = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j; assert((classOrNil == GIV(nilObj)) || (addressCouldBeClassObj(classOrNil))); if (classOrNil == GIV(nilObj)) { @@ -42466,7 +41869,7 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) } else { if ((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged - && (!(((((usqInt) (longAt(classOrNil + 4))) >> 23) & 1) != 0))) + && (!(((((usqInt) (longAt(classOrNil + 4))) >> (markedBitHalfShift())) & 1) != 0))) || (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) != classIndex)) { assert(!(isOopForwarded(classTablePage))); longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj)); @@ -42500,7 +41903,6 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt classFormat; sqInt ephemeron; sqInt field; - sqInt format; sqInt i; sqInt i1; sqInt iLimiT; @@ -42511,11 +41913,9 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt numToEnumerateOnThisPage; sqInt numTracedWeaklings; sqInt objOop; - sqInt objStack; sqInt objStackPage; sqInt oop; sqInt oop1; - sqInt p; sqInt size; sqInt topIndex; sqInt weakling; @@ -42525,12 +41925,11 @@ markWeaklingsAndMarkAndFireEphemerons(void) markAndTraceUntracedReachableStackPages(); do { /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -42538,7 +41937,7 @@ markWeaklingsAndMarkAndFireEphemerons(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size - numTracedWeaklings; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); @@ -42563,7 +41962,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += } field = oop; if (!((field & (tagMask())) - || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0))) { markAndTrace(field); } } @@ -42581,21 +41980,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += return; } if (!(markInactiveEphemerons())) { - /* begin fireAllUnscannedEphemerons */ - assert(!(noUnscannedEphemerons())); - assert(allUnscannedEphemeronsAreActive()); - for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { - /* begin fireEphemeron: */ - queueMourner(longAt(p)); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(longAt(p), ((longAt(longAt(p))) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - } + fireAllUnscannedEphemerons(); } /* begin markAllUnscannedEphemerons */ assert(!(noUnscannedEphemerons())); @@ -42607,7 +41992,6 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += longAtput((GIV(unscannedEphemerons).start), longAt(lastptr)); } (GIV(unscannedEphemerons).top = lastptr); - /* begin followedKeyOfMaybeFiredEphemeron: */ assert((isNonImmediate(ephemeron)) && (isMaybeFiredEphemeron(ephemeron))); /* begin followOopField:ofObject: */ @@ -42617,6 +42001,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += oop1 = fixFollowedFieldofObjectwithInitialValue(0, ephemeron, oop1); } key = oop1; + setIsMarkedOfto(ephemeron, 0); markAndTrace(key); markAndTrace(ephemeron); @@ -42678,20 +42063,6 @@ newSpaceIsEmpty(void) && (GIV(pastSpaceStart) == (((pastSpace()).start))); } - -/* Answer the next free free chunk using the xor trick to use only one field, - see e.g. - The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 - `Circular Lists', exercise. 18 - http://en.wikipedia.org/wiki/XOR_linked_list. */ - - /* SpurMemoryManager>>#nextInSortedFreeListLink:given: */ -usqInt -nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) -{ - return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); -} - /* SpurMemoryManager>>#nilObject */ sqInt nilObject(void) @@ -42717,7 +42088,6 @@ nilUnmarkedWeaklingSlots(void) sqInt numOnThisPage; sqInt numToEnumerate; sqInt numToEnumerateOnThisPage; - sqInt objStack; sqInt objStackPage; sqInt referent; sqInt size; @@ -42729,12 +42099,11 @@ nilUnmarkedWeaklingSlots(void) return; } /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -42742,30 +42111,30 @@ nilUnmarkedWeaklingSlots(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage); topIndex = (numOnThisPage + ObjStackFixedSlots) - 1; - for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) { - assert(isWeak(fetchPointerofObject(i1, objStackPage))); - weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + for (i = topIndex; i >= ((topIndex - numToEnumerateOnThisPage) + 1); i += -1) { + assert(isWeak(fetchPointerofObject(i, objStackPage))); + weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); /* begin nilUnmarkedWeaklingSlotsIn: */ anyUnmarked1 = 0; assert(allStrongSlotsOfWeaklingAreMarked(weakling)); - for (i = ((assert((formatOf(weakling)) == (weakArrayFormat())), -fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i <= iLimiT; i += 1) { + for (i1 = ((assert((formatOf(weakling)) == (weakArrayFormat())), +fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i1 <= iLimiT; i1 += 1) { /* begin fetchPointer:ofObject: */ - referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { if (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - referent = fixFollowedFieldofObjectwithInitialValue(i, weakling, referent); + referent = fixFollowedFieldofObjectwithInitialValue(i1, weakling, referent); } if (!((referent & (tagMask())) - || (((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0))) { assert(!(isOopForwarded(weakling))); - longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); + longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); anyUnmarked1 = 1; } @@ -42777,13 +42146,7 @@ fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakli /* fireFinalization: could grow the mournQueue and if so, additional pages must be marked to avoid being GC'ed. */ assert(GIV(marking)); - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakling); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakling); } } @@ -42909,13 +42272,9 @@ noInlineObjectAfterlimit(sqInt objOop, sqInt limit) /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -42959,7 +42318,6 @@ numBytesOfBytes(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt >= (firstByteFormat())); return ((numSlotsOf(objOop)) << (shiftForWord())) - (fmt & 7); @@ -42977,18 +42335,13 @@ numBytesOf(sqInt objOop) usqInt numBytes; usqInt numSlots; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(objOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -43022,10 +42375,10 @@ numberOfForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -43053,32 +42406,28 @@ numberOfForwarders(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -43088,8 +42437,8 @@ numberOfForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -43101,37 +42450,33 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -43142,32 +42487,28 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return n; } @@ -43187,7 +42528,6 @@ numPointerSlotsOf(sqInt objOop) usqInt numSlots; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -43209,8 +42549,7 @@ numPointerSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } if (fmt == 7) { @@ -43223,9 +42562,9 @@ numPointerSlotsOf(sqInt objOop) assert(isCompiledMethod(objOop)); /* begin fetchPointer:ofObject: */ header = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -43242,8 +42581,7 @@ numSlotsOfAny(sqInt objOop) numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -43257,8 +42595,7 @@ numSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -43281,7 +42618,6 @@ numStrongSlotsOfInephemeral(sqInt objOop) sqInt objOop1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert((fmt != (ephemeronFormat())) || (isMarked(keyOfEphemeron(objOop)))); @@ -43289,13 +42625,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { return numSlots; } @@ -43333,9 +42665,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) assert(isCompiledMethod(objOop)); /* begin fetchPointer:ofObject: */ header = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -43396,13 +42728,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart))) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43423,13 +42751,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((pastSpace()).start), GIV(pastSpaceStart))) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -43451,13 +42775,9 @@ objectAfter(sqInt objOop) limit = futureSurvivorStart(); /* begin addressAfter: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -43477,13 +42797,9 @@ objectAfter(sqInt objOop) } /* begin objectAfter:limit: */ numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } + numSlots4 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); @@ -43519,10 +42835,10 @@ objectBefore(sqInt objOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop1; sqInt objOop2; @@ -43545,8 +42861,8 @@ objectBefore(sqInt objOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -43559,37 +42875,33 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -43601,32 +42913,28 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return prev; } @@ -43646,32 +42954,28 @@ objectBefore(sqInt objOop) prevPrevObj1 = prevObj1; prevObj1 = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop2 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop2 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop2 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return prev; } @@ -43694,6 +42998,335 @@ objectStartingAt(sqInt address) } +/* This is part of storeImageSegmentInto:outPointers:roots:. + Answer an Array of all the objects only reachable from the argument, an + Array of root objects, + starting with arrayOfRoots. If there is no space, answer a SmallInteger + whose value is the + number of slots required. This is used to collect the objects to include + in an image segment + on Spur, separate from creating the segment, hence simplifying the + implementation. Thanks to Igor Stasenko for this idea. */ + + /* SpurMemoryManager>>#objectsReachableFromRoots: */ +static sqInt NoDbgRegParms +objectsReachableFromRoots(sqInt arrayOfRoots) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt count; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt freeChunk; + sqInt i; + sqInt i1; + sqInt iLimiT; + sqInt iLimiT1; + usqInt limit; + usqInt limit1; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots13; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + usqInt numSlots6; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oop; + sqInt oop1; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + sqInt ptr; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + usqInt slotBytes3; + sqInt start; + + assert(isArray(arrayOfRoots)); + assert(allObjectsUnmarked()); + /* begin markObjectsIn: */ + setIsMarkedOfto(arrayOfRoots, 1); + for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { + /* begin followField:ofObject: */ + objOop1 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop1); + } + oop1 = objOop1; + if ((oop1 & (tagMask())) == 0) { + setIsMarkedOfto(oop1, 1); + } + } + markObjects(0); + assert(isEmptyObjStack(GIV(markStack))); + assert(isEmptyObjStack(GIV(weaklingStack))); + assert(noUnscannedEphemerons()); + freeChunk = allocateLargestFreeChunk(); + ptr = (start = freeChunk + BaseHeaderSize); + /* begin addressAfter: */ + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + limit = (freeChunk + BaseHeaderSize) + slotBytes; + + /* First put the arrayOfRoots; order is important. */ + count = 0; + count += 1; + if (ptr < limit) { + longAtput(ptr, arrayOfRoots); + ptr += BytesPerOop; + } + for (i = 0, iLimiT = ((numSlotsOf(arrayOfRoots)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if ((oop & (tagMask())) == 0) { + pushonObjStack(oop, GIV(markStack)); + } + } + while (!(isEmptyObjStack(GIV(markStack)))) { + objOop = popObjStack(GIV(markStack)); + count += 1; + if (ptr < limit) { + longAtput(ptr, objOop); + ptr += BytesPerOop; + } + oop = fetchClassOfNonImm(objOop); + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + if ((((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((((longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(objOop))))) { + + /* widow now, before the loop */ + for (i = 0, iLimiT = ((numSlotsOfMarriedContext(objOop)) - 1); i <= iLimiT; i += 1) { + oop = fetchPointerofMarriedContext(i, objOop); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + else { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + } + /* begin unmarkAllObjects */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop11, 0); + } + else { + if (!(((longAt(objOop11)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop11, 0); + } + } + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + /* begin allNewSpaceEntitiesDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit1 = GIV(pastSpaceStart); + while (oopisLessThan(objOop2, limit1)) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots13 = byteAt(objOop2 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); + } + else { + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { + objOop2 = limit1; + goto l16; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l16: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop2 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + + /* Now try and allocate the result */ + GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); + if ((count > ((ptr - start) / BytesPerOop)) + || ((limit != ptr) + && ((limit - ptr) <= 8))) { + + /* can't split a single word */ + freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) + ? freeChunk - BaseHeaderSize + : freeChunk)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + return (((usqInt)count << 1) | 1); + } + /* begin setFormatOf:to: */ + assert(((2 >= 0) && (2 <= (formatMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (2U << (formatShift()))); + /* begin setClassIndexOf:to: */ + assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); + shortentoIndexableSize(freeChunk, count); + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { + remember(freeChunk); + } + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + runLeakCheckerFor(GCModeImageSegment); + return freeChunk; +} + + /* This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code @@ -43745,7 +43378,6 @@ okayOop(sqInt signedOop) error("oop header has overflow header word, but overflow word does not have a saturated numSlots field"); return 0; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if ((fmt == 6) || (fmt == 8)) { error("oop has an unknown format type"); @@ -43760,7 +43392,7 @@ okayOop(sqInt signedOop) error("some unused header bits are set; should be zero"); return 0; } - unusedBitsInYoungObjects = ((1U << 0x1F) | (1U << 30)) | (1U << (rememberedBitShift())); + unusedBitsInYoungObjects = ((1U << (greyBitShift())) | (1U << (pinnedBitShift()))) | (1U << (rememberedBitShift())); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { error("some header bits unused in young objects are set; should be zero"); return 0; @@ -43782,8 +43414,6 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) sqInt classIndex1; sqInt clone1; sqInt clone2; - sqInt format; - sqInt format1; sqInt hash; sqInt hash1; sqInt hash2; @@ -43817,15 +43447,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << 23))); + longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -43850,15 +43479,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << 23))); + longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -43901,7 +43529,6 @@ sqInt pinObject(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt format; sqInt i; sqInt oldClone; sqInt referent; @@ -43922,12 +43549,12 @@ pinObject(sqInt objOop) l1: /* end segmentContainingObj: */; if ((seg->containsPinned)) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); return objOop; } if (!(someSegmentContainsPinned())) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); (seg->containsPinned = 1); return objOop; } @@ -43936,18 +43563,17 @@ pinObject(sqInt objOop) if (oldClone != 0) { GIV(becomeEffectsFlags) = becomeEffectFlagsFor(objOop); /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 23))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -44187,10 +43813,10 @@ printActivationsOf(sqInt aMethodObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44212,8 +43838,8 @@ printActivationsOf(sqInt aMethodObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44235,37 +43861,33 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -44286,32 +43908,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44339,32 +43957,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -44391,10 +44005,10 @@ printContextReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44416,8 +44030,8 @@ printContextReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44446,90 +44060,82 @@ printContextReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { - /* begin allocationUnit */ - slotBytes = ((sqInt) 8); - } - else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l1: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop1)); - if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { - i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); - while (((i -= 1)) >= 0) { - if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { - printHex(objOop1); - print(" @ "); - printNum(i); - /* begin space */ - putchar(' '); - printOopShort(objOop1); - print(" pc "); - printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); - /* begin cr */ - printf("\n"); - i = 0; - } - } - } - - - prevPrevObj = prevObj; - prevObj = objOop1; - /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); } else { - numSlots3 = numSlots12; + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - if (numSlots3 == 0) { + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { + i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); + while (((i -= 1)) >= 0) { + if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { + printHex(objOop1); + print(" @ "); + printNum(i); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + print(" pc "); + printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); + /* begin cr */ + printf("\n"); + i = 0; + } + } + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44564,35 +44170,92 @@ printContextReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#printEntity: */ +void +printEntity(sqInt oop) +{ + sqInt isObj; + sqInt n; + + isObj = 0; + printHex(oop); + /* begin space */ + putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + return; + } + print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) + ? "free" + : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) + ? "bridge" + : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 + ? "forwarder" + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } + /* begin cr */ + printf("\n"); +} + /* SpurMemoryManager>>#printForwarders */ void printForwarders(void) @@ -44610,10 +44273,10 @@ printForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -44628,46 +44291,42 @@ printForwarders(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop2 = GIV(nilObj); + objOop1 = GIV(nilObj); while (1) { - assert((objOop2 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break; - assert((long64At(objOop2)) != 0); - if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop2); + assert((objOop1 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; + assert((long64At(objOop1)) != 0); + if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop1); /* begin cr */ printf("\n"); } prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop2 = GIV(endOfMemory); - goto l3; + objOop1 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44677,90 +44336,82 @@ printForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, limit)) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop2 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; + objOop2 = limit; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l2; + objOop2 = GIV(freeStart); + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -44786,10 +44437,10 @@ printFreeChunks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -44811,8 +44462,8 @@ printFreeChunks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44831,37 +44482,33 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44879,32 +44526,28 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -44922,32 +44565,28 @@ printFreeChunks(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -45107,13 +44746,9 @@ printHeaderOf(sqInt objOop) print(" hdr16 slotf "); /* begin printHexnp: */ numSlots = byteAt((objOop - 8) + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n = longAt((objOop - 8) - BaseHeaderSize); - } - else { - n = numSlots; - } + n = (numSlots == (numSlotsMask()) + ? longAt((objOop - 8) - BaseHeaderSize) + : numSlots); printf("0x%lx", ((unsigned long) n)); print(" slotc "); /* begin printHexnp: */ @@ -45125,29 +44760,25 @@ printHeaderOf(sqInt objOop) print(" hdr8 slots "); /* begin printHexnp: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n1 = longAt(objOop - BaseHeaderSize); - } - else { - n1 = numSlots1; - } + n1 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); printf("0x%lx", ((unsigned long) n1)); } /* begin space */ putchar(' '); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'M' : 'm'); putchar(aByte); /* begin printChar: */ - aByte1 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte1 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'G' : 'g'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'P' : 'p'); putchar(aByte2); @@ -45157,7 +44788,7 @@ printHeaderOf(sqInt objOop) : 'r'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'I' : 'i'); putchar(aByte4); @@ -45191,7 +44822,7 @@ printHeaderTypeOf(sqInt objOop) ? " hdr16 " : " hdr8 ")); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'i' : '.'); putchar(aByte); @@ -45201,17 +44832,17 @@ printHeaderTypeOf(sqInt objOop) : '.'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'p' : '.'); putchar(aByte2); /* begin printChar: */ - aByte3 = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte3 = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'm' : '.'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'g' : '.'); putchar(aByte4); @@ -45256,10 +44887,10 @@ printInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45288,32 +44919,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -45323,8 +44950,8 @@ printInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -45338,37 +44965,33 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -45381,32 +45004,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -45460,6 +45079,191 @@ printInvalidClassTableEntries(void) } +/* Scan the heap printing the oops of any and all methods that implement + anOop + */ + + /* SpurMemoryManager>>#printMethodImplementorsOf: */ +void +printMethodImplementorsOf(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + /* begin allObjectsDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == anOop)) { + printHex(objOop11); + /* begin space */ + putchar(' '); + printOopShort(objOop11); + /* begin cr */ + printf("\n"); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + } + + /* Scan the heap printing the oops of any and all methods that refer to anOop */ /* SpurMemoryManager>>#printMethodReferencesTo: */ @@ -45480,10 +45284,10 @@ printMethodReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45505,20 +45309,15 @@ printMethodReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -45538,48 +45337,39 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -45599,32 +45389,28 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -45636,12 +45422,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop11)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -45662,20 +45443,16 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -45734,10 +45511,10 @@ printObjectsWithHash(sqInt hash) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45766,32 +45543,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -45801,8 +45574,8 @@ printObjectsWithHash(sqInt hash) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -45816,37 +45589,33 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -45859,32 +45628,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -45971,7 +45736,7 @@ printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType) printNum(longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackMyx) << (shiftForWord())))))); print(" ("); printNum(myx); - print((((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0 + print((((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0 ? ") mkd" : ") unmkd")); /* begin cr */ @@ -45996,7 +45761,9 @@ printObjStack(sqInt objStack) void printOopsFromto(sqInt startAddress, sqInt endAddress) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt isObj; sqInt limit; + sqInt n; sqInt oop; oop = objectBefore(startAddress); @@ -46007,20 +45774,60 @@ printOopsFromto(sqInt startAddress, sqInt endAddress) ? startAddress : oop)); while (oopisLessThan(oop, limit)) { + /* begin printEntity: */ + isObj = 0; printHex(oop); - print("/"); - printNum(oop); /* begin space */ putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + goto l1; + } print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) ? "free" : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) ? "bridge" : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 ? "forwarder" - : "object")))); + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } /* begin cr */ printf("\n"); + l1: /* end printEntity: */; oop = objectAfter(oop); } } @@ -46050,11 +45857,11 @@ printReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -46077,8 +45884,8 @@ printReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46095,43 +45902,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l20; + goto l21; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop1))); contextSize = (sp >> 1); - l20: /* end fetchStackPointerOf: */; + l21: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l21; + goto l20; } /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l21; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); + goto l20; } if (fmt == 7) { i = 1; - goto l21; + goto l20; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l21; + goto l20; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop1)); /* begin fetchPointer:ofObject: */ header = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l21: /* end numPointerSlotsOf: */; + l20: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -46150,37 +45953,33 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l12; + goto l15; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l12: /* end objectAfter:limit: */; + l15: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -46196,43 +45995,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l22; + goto l23; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop1))); contextSize = (sp >> 1); - l22: /* end fetchStackPointerOf: */; + l23: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l23; + goto l22; } /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l23; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); + goto l22; } if (fmt == 7) { i = 1; - goto l23; + goto l22; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l23; + goto l22; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop1)); /* begin fetchPointer:ofObject: */ header = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l23: /* end numPointerSlotsOf: */; + l22: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -46251,32 +46046,28 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l15; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l15: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -46298,43 +46089,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l24; + goto l25; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop11))); contextSize = (sp >> 1); - l24: /* end fetchStackPointerOf: */; + l25: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l25; + goto l24; } /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l25; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); + goto l24; } if (fmt == 7) { i = 1; - goto l25; + goto l24; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l25; + goto l24; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop11)); /* begin fetchPointer:ofObject: */ header = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l25: /* end numPointerSlotsOf: */; + l24: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -46354,14 +46141,10 @@ printReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -46372,14 +46155,14 @@ printReferencesTo(sqInt anOop) followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l17; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l17: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -46472,45 +46255,6 @@ rawHashBitsOf(sqInt objOop) } -/* Scavenge or simply follow objOop. Answer the new location of objOop. - The send should have been guarded by a send of shouldRemapOop:. - The method is called remapObj: for compatibility with ObjectMemory. */ - - /* SpurMemoryManager>>#remapObj: */ -sqInt -remapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt referent; - sqInt resolvedObj; - - assert(shouldRemapOop(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(objOop)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - resolvedObj = referent; - } - else { - assert(!((isInFutureSpace(objOop)))); - resolvedObj = objOop; - } - if (GIV(scavengeInProgress) - && ((((resolvedObj & (tagMask())) == 0) - && ((assert(isNonImmediate(resolvedObj)), - oopisLessThan(resolvedObj, GIV(newSpaceLimit))))) - && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { - return copyAndForward(resolvedObj); - } - return resolvedObj; -} - - /* Remove the given variable location to the extra roots table. */ /* SpurMemoryManager>>#removeGCRoot: */ @@ -46582,7 +46326,7 @@ runLeakCheckerForFreeSpace(sqInt gcModes) static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -46592,18 +46336,18 @@ runLeakCheckerFor(sqInt gcModes) } clearLeakMapAndMapAccessibleObjects(); asserta(checkHeapIntegrityclassIndicesShouldBeValid(0, 1)); - asserta(checkInterpreterIntegrity()); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } return; } - /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ static void NoDbgRegParms -runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -46612,8 +46356,8 @@ runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcMo reverseDisplayFromto(8, 15); } clearLeakMapAndMapAccessibleObjects(); - asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedNewSpaceObjs, classIndicesShouldBeValid)); - asserta(checkInterpreterIntegrity()); + asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedObjs, classIndicesShouldBeValid)); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } @@ -46629,7 +46373,6 @@ scavengingGCTenuringIf(sqInt tenuringCriterion) sqInt i; sqInt i1; sqInt probe; - char *theSP; assert(GIV(remapBufferCount) == 0); if (!(asserta(((((eden()).limit)) - GIV(freeStart)) > (interpreterAllocationReserveBytes())))) { @@ -46669,14 +46412,13 @@ scavengingGCTenuringIf(sqInt tenuringCriterion) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } /* begin flushMethodCacheFrom:to: */ @@ -46834,7 +46576,6 @@ shortentoIndexableSize(sqInt objOop, sqInt indexableSize) } bytesBefore = bytesInObject(objOop); if ((byteAt(objOop + 7)) == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ longAtput(objOop - BaseHeaderSize, numSlots); } else { @@ -46892,25 +46633,6 @@ shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress) } -/* Answer if the obj should be scavenged (or simply followed). The method is - called shouldRemapObj: for compatibility with ObjectMemory. We test for - being already - scavenged because mapStackPages via mapInterpreterOops may be applied - twice in the context of a global GC where a scavenge, followed by a - scan-mark-free, and - final compaction passes may result in scvenged fields being visited twice. */ - - /* SpurMemoryManager>>#shouldRemapObj: */ -sqInt -shouldRemapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) - || (((assert(isNonImmediate(objOop)), - oopisLessThan(objOop, GIV(newSpaceLimit)))) - && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); -} - - /* Answer if the oop should be scavenged.. The method is called shouldRemapOop: for compatibility with ObjectMemory. */ @@ -46970,13 +46692,9 @@ slotSizeOf(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -47068,35 +46786,18 @@ storeCheckBoundary(void) static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt address; - sqInt address1; sqInt arrayOfObjects; sqInt classIndex; sqInt classIndex1; - sqInt count; usqInt endSeg; sqInt fillValue; - sqInt followingWord; - sqInt followingWord1; - sqInt followingWord2; - usqInt followingWordAddress; - usqInt followingWordAddress1; - usqInt followingWordAddress2; - sqInt format; sqInt formatField; sqInt formatField1; - sqInt freeChunk; sqInt hash; sqInt here; sqInt hereLimiT; sqInt i; - sqInt i1; - sqInt i2; sqInt iLimiT; - sqInt iLimiT1; - sqInt iLimiT2; - usqInt limit; - usqInt limit1; usqInt newObj; usqInt newObj1; sqInt newSegAddrOrError; @@ -47107,360 +46808,46 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr sqInt numSlots; sqInt numSlots1; usqInt numSlots11; - usqInt numSlots111; - usqInt numSlots12; - usqInt numSlots121; - usqInt numSlots13; - usqInt numSlots14; - sqInt numSlots2; - usqInt numSlots21; + usqInt numSlots2; sqInt numSlots3; - usqInt numSlots31; - usqInt numSlots4; - usqInt numSlots41; + sqInt numSlots4; usqInt numSlots5; usqInt numSlots6; - usqInt numSlots7; - usqInt numSlots8; - sqInt obj; sqInt objOop; sqInt objOop1; - sqInt objOop11; - sqInt objOop12; - sqInt objOop2; - sqInt objOop3; - sqInt oop; - sqInt oop1; sqInt outIndex; usqInt p; usqInt p1; - sqInt prevObj; - sqInt prevObj1; - sqInt prevPrevObj; - sqInt prevPrevObj1; - sqInt ptr; sqInt savedInHashes; sqInt savedOutHashes; sqInt segAddr; sqInt segStart; usqInt slotBytes; - usqInt slotBytes1; - usqInt slotBytes11; - usqInt slotBytes2; - usqInt slotBytes3; - sqInt start; sqInt tempObjOop; sqInt there; sqInt valueWord; runLeakCheckerFor(GCModeImageSegment); - /* begin objectsReachableFromRoots: */ - assert(isArray(arrayOfRoots)); - assert(allObjectsUnmarked()); - /* begin markObjectsIn: */ - setIsMarkedOfto(arrayOfRoots, 1); - for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { - /* begin followField:ofObject: */ - objOop11 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop11); - } - oop1 = objOop11; - if ((oop1 & (tagMask())) == 0) { - setIsMarkedOfto(oop1, 1); - } - } - markObjects(0); - assert(isEmptyObjStack(GIV(markStack))); - assert(isEmptyObjStack(GIV(weaklingStack))); - assert(noUnscannedEphemerons()); - freeChunk = allocateLargestFreeChunk(); - ptr = (start = freeChunk + BaseHeaderSize); - /* begin addressAfter: */ - numSlots12 = byteAt(freeChunk + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots7 = numSlots12; - } - if (numSlots7 == 0) { - /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); - } - else { - slotBytes1 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); - } - limit = (freeChunk + BaseHeaderSize) + slotBytes1; - - /* First put the arrayOfRoots; order is important. */ - count = 0; - count += 1; - if (ptr < limit) { - longAtput(ptr, arrayOfRoots); - ptr += BytesPerOop; - } - for (i2 = 0, iLimiT2 = ((numSlotsOf(arrayOfRoots)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if ((oop & (tagMask())) == 0) { - pushonObjStack(oop, GIV(markStack)); - } - } - while (!(isEmptyObjStack(GIV(markStack)))) { - objOop2 = popObjStack(GIV(markStack)); - count += 1; - if (ptr < limit) { - longAtput(ptr, objOop2); - ptr += BytesPerOop; - } - oop = fetchClassOfNonImm(objOop2); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - if ((((longAt(objOop2)) & (classIndexMask())) == ClassMethodContextCompactIndex) - && ((((longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) - && (!(isWidowedContext(objOop2))))) { - - /* widow now, before the loop */ - for (i2 = 0, iLimiT2 = ((numSlotsOfMarriedContext(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - oop = fetchPointerofMarriedContext(i2, objOop2); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - else { - for (i2 = 0, iLimiT2 = ((numPointerSlotsOf(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - } - /* begin unmarkAllObjects */ - assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); - while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (((((usqInt) (longAt(objOop12 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop12)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop12, 0); - } - else { - if (!(((longAt(objOop12)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop12, 0); - } - } - } - - prevPrevObj1 = prevObj1; - prevObj1 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l30; - } - flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l30: /* end objectAfter:limit: */; - } - /* begin allNewSpaceEntitiesDo: */ - - /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are - in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ - prevPrevObj = (prevObj = null); - assert((((pastSpace()).start)) < (((eden()).start))); - /* begin objectStartingAt: */ - address = ((pastSpace()).start); - numSlots8 = byteAt(address + 7); - objOop3 = (numSlots8 == (numSlotsMask()) - ? address + BaseHeaderSize - : address); - limit1 = GIV(pastSpaceStart); - while (oopisLessThan(objOop3, limit1)) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop3 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { - /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); - } - else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop3 + BaseHeaderSize) + slotBytes11; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { - objOop3 = limit1; - goto l26; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop3 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l26: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop3 = (numSlots14 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop3, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop3 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots41 = numSlots13; - } - if (numSlots41 == 0) { - /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); - } - else { - slotBytes2 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); - } - followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop3 = GIV(freeStart); - goto l35; - } - flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l35: /* end objectAfter:limit: */; - } - - /* Now try and allocate the result */ - GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); - if ((count > ((ptr - start) / BytesPerOop)) - || ((limit != ptr) - && ((limit - ptr) <= 8))) { - - /* can't split a single word */ - freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) - ? freeChunk - BaseHeaderSize - : freeChunk)); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - arrayOfObjects = (((usqInt)count << 1) | 1); - goto l23; - } - /* begin setFormatOf:to: */ - format = 2; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin setClassIndexOf:to: */ - assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); - shortentoIndexableSize(freeChunk, count); - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { - remember(freeChunk); - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - runLeakCheckerFor(GCModeImageSegment); - arrayOfObjects = freeChunk; -l23: /* end objectsReachableFromRoots: */; + arrayOfObjects = objectsReachableFromRoots(arrayOfRoots); if (!(arrayOfObjects)) { return PrimErrNoMemory; } assert(allObjectsUnmarked()); /* begin allocateSlots:format:classIndex: */ numBytes2 = (numSlotsOf(arrayOfObjects)) * 4; - numSlots2 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; + numSlots3 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; formatField = firstLongFormat(); classIndex = thirtyTwoBitLongsClassIndexPun(); - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots2 + (numSlots2 & 1)) * BytesPerOop); + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots2 <= 1 + numBytes = BaseHeaderSize + ((numSlots3 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots2 + (numSlots2 & 1)) * BytesPerOop)); + : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -47468,40 +46855,40 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots2, numBytes, formatField, classIndex); - goto l6; + savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes, formatField, classIndex); + goto l9; } - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots2); + longAtput(GIV(freeStart), numSlots3); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); } else { - long64Atput(newObj, (((((usqLong) numSlots2)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + long64Atput(newObj, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); } assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; savedInHashes = newObj; -l6: /* end allocateSlots:format:classIndex: */; +l9: /* end allocateSlots:format:classIndex: */; /* begin allocateSlots:format:classIndex: */ numBytes3 = (numSlotsOf(outPointerArray)) * 4; - numSlots3 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; + numSlots4 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; formatField1 = firstLongFormat(); classIndex1 = thirtyTwoBitLongsClassIndexPun(); - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { newObj1 = GIV(freeStart) + BaseHeaderSize; - numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots4 + (numSlots4 & 1)) * BytesPerOop); } else { newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + ((numSlots3 <= 1 + numBytes1 = BaseHeaderSize + ((numSlots4 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); + : (numSlots4 + (numSlots4 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -47509,25 +46896,25 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes1, formatField1, classIndex1); - goto l8; + savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots4, numBytes1, formatField1, classIndex1); + goto l11; } - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots3); + longAtput(GIV(freeStart), numSlots4); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), formatField1, classIndex1)); } else { - long64Atput(newObj1, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); + long64Atput(newObj1, (((((usqLong) numSlots4)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); } assert((numBytes1 % (allocationUnit())) == 0); assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; savedOutHashes = newObj1; -l8: /* end allocateSlots:format:classIndex: */; +l11: /* end allocateSlots:format:classIndex: */; if ((savedInHashes == null) || (savedOutHashes == null)) { freeObject(arrayOfObjects); @@ -47536,14 +46923,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr fillValue = (identityHashHalfWordMask()) + 1; /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedInHashes)) > (isForwardedObjectClassIndexPun())); - numSlots4 = byteAt(savedInHashes + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(savedInHashes - BaseHeaderSize); - } - else { - numSlots = numSlots4; - } + numSlots5 = byteAt(savedInHashes + 7); + numSlots = (numSlots5 == (numSlotsMask()) + ? longAt(savedInHashes - BaseHeaderSize) + : numSlots5); assert(oopisLessThan(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(savedInHashes))); for (p = (((usqInt)(savedInHashes + BaseHeaderSize))); p <= (((usqInt)(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { longAtput(p, fillValue); @@ -47551,14 +46934,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr } /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedOutHashes)) > (isForwardedObjectClassIndexPun())); - numSlots5 = byteAt(savedOutHashes + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(savedOutHashes - BaseHeaderSize); - } - else { - numSlots1 = numSlots5; - } + numSlots6 = byteAt(savedOutHashes + 7); + numSlots1 = (numSlots6 == (numSlotsMask()) + ? longAt(savedOutHashes - BaseHeaderSize) + : numSlots6); assert(oopisLessThan(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(savedOutHashes))); for (p1 = (((usqInt)(savedOutHashes + BaseHeaderSize))); p1 <= (((usqInt)(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p1 += 8) { longAtput(p1, fillValue); @@ -47597,19 +46976,15 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr segAddr = segmentWordArray + BaseHeaderSize; /* begin addressAfter: */ numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots6 = numSlots11; - } - if (numSlots6 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } endSeg = (segmentWordArray + BaseHeaderSize) + slotBytes; if (segAddr >= endSeg) { @@ -48129,7 +47504,7 @@ unpinObject(sqInt objOop) { assert(isNonImmediate(objOop)); /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 30))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (pinnedBitShift())))); return 0; } @@ -48328,13 +47703,9 @@ checkTraversableSortedFreeList(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -48345,14 +47716,14 @@ checkTraversableSortedFreeList(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } assert(prevFree == GIV(lastFreeChunk)); assert((nextInSortedFreeListLinkgiven(GIV(lastFreeChunk), 0)) == prevPrevFree); @@ -48367,7 +47738,7 @@ checkTraversableSortedFreeList(void) /* for profiling */ /* SpurPigCompactor>>#compact */ -static sqInt NeverInline +static void NeverInline compact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; @@ -48382,6 +47753,7 @@ compact(void) usqInt scanAddress; usqInt slotBytes; + freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); /* begin statCompactPassCount: */ anInteger = GIV(statCompactPassCount) + 1; GIV(statCompactPassCount) = anInteger; @@ -48395,18 +47767,15 @@ compact(void) while (free != 0) { high = (prevFree == 0 ? (endOfMemory()) - (2 * BaseHeaderSize) - : ((byteAt(prevFree + 7)) == (numSlotsMask()) - ? prevFree - BaseHeaderSize - : prevFree)); + : (/* begin startOfObject: */ + ((byteAt(prevFree + 7)) == (numSlotsMask()) + ? prevFree - BaseHeaderSize + : prevFree))); /* begin addressAfter: */ numSlots1 = byteAt(free + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(free - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(free - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -48418,7 +47787,7 @@ compact(void) while (oopisLessThan(scanAddress, high)) { scanAddress = moveARunOfObjectsStartingAtupTo(scanAddress, high); if (scanAddress == 0) { - goto l2; + goto l6; } } @@ -48443,12 +47812,11 @@ compact(void) } } assert(checkTraversableSortedFreeList()); - l2: /* end pigCompact */; + l6: /* end pigCompact */; eliminateAndFreeForwardersForPigCompact(); } assert(freeListHeadsEmpty()); rebuildFreeListsForPigCompact(); - return 0; } @@ -48456,7 +47824,7 @@ compact(void) forwarders, then free forwarders, coalescing with free space as we go. */ /* SpurPigCompactor>>#eliminateAndFreeForwardersForPigCompact */ -static sqInt +static void eliminateAndFreeForwardersForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; @@ -48581,50 +47949,46 @@ eliminateAndFreeForwardersForPigCompact(void) index += 1; } } - /* begin unmarkSurvivingObjectsForPigCompact */ - prevPrevObj1 = (prevObj1 = null); + /* begin unmarkSurvivingObjectsForCompact */ + prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots3 = byteAt(address + 7); - objOop2 = (numSlots3 == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop1 = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); - while (oopisLessThan(objOop2, GIV(pastSpaceStart))) { - assert(isEnumerableObjectNoAssert(objOop2)); - if (((((usqInt) (longAt(objOop2 + 4))) >> 23) & 1) != 0) { - setIsMarkedOfto(objOop2, 0); + while (oopisLessThan(objOop1, GIV(pastSpaceStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + setIsMarkedOfto(objOop1, 0); } - prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevPrevObj = prevObj; + prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { - objOop2 = GIV(pastSpaceStart); - goto l18; + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(pastSpaceStart))) { + objOop1 = GIV(pastSpaceStart); + goto l4; } flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l18: /* end objectAfter:limit: */; + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; } /* begin sweepToFollowForwardersForPigCompact */ assert(((freeStart()) == (((eden()).start))) @@ -48633,8 +47997,8 @@ eliminateAndFreeForwardersForPigCompact(void) prevPrevObj2 = (prevObj2 = null); /* begin objectStartingAt: */ address1 = ((pastSpace()).start); - numSlots4 = byteAt(address1 + 7); - objOop12 = (numSlots4 == (numSlotsMask()) + numSlots21 = byteAt(address1 + 7); + objOop12 = (numSlots21 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop12, GIV(pastSpaceStart))) { @@ -48667,31 +48031,27 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj2 = objOop12; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop12 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots12; - } - if (numSlots21 == 0) { + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots12); + if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(pastSpaceStart))) { objOop12 = GIV(pastSpaceStart); - goto l31; + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l31: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } lowestForwarder1 = 0; /* begin allOldSpaceObjectsDo: */ @@ -48749,13 +48109,9 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj11 = objOop11; /* begin objectAfter:limit: */ numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots31 = numSlots111; - } + numSlots31 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots111); if (numSlots31 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); @@ -48766,14 +48122,14 @@ eliminateAndFreeForwardersForPigCompact(void) followingWordAddress11 = (objOop11 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l38; + goto l37; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop11 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l38: /* end objectAfter:limit: */; + l37: /* end objectAfter:limit: */; } lowestForwarder = lowestForwarder1; /* begin sweepToCoallesceFreeSpaceForPigCompactFrom: */ @@ -48789,28 +48145,29 @@ eliminateAndFreeForwardersForPigCompact(void) firstOfFreeRun = (prevPrevFree = (prevFree = 0)); /* begin allOldSpaceEntitiesFrom:do: */ assert(isOldObject(lowest)); - prevPrevObj = (prevObj = null); - objOop = lowest; + prevPrevObj1 = (prevObj1 = null); + objOop3 = lowest; while (1) { - assert((objOop % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; - assert((long64At(objOop)) != 0); - if ((((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) - || (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + assert((objOop3 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; + assert((long64At(objOop3)) != 0); + if ((((longAt(objOop3)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) + || (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { if (firstOfFreeRun == 0) { /* begin setObjectFree: */ - if ((byteAt(objOop + 7)) == 0) { + if ((byteAt(objOop3 + 7)) == 0) { /* begin rawNumSlotsOf:put: */ - byteAtput(objOop + 7, 1); + byteAtput(objOop3 + 7, 1); } /* begin setFree: */ - long32Atput(objOop, 0); - firstOfFreeRun = objOop; - startOfFreeRun = ((byteAt(objOop + 7)) == (numSlotsMask()) - ? objOop - BaseHeaderSize - : objOop); + long32Atput(objOop3, 0); + firstOfFreeRun = objOop3; + /* begin startOfObject: */ + startOfFreeRun = ((byteAt(objOop3 + 7)) == (numSlotsMask()) + ? objOop3 - BaseHeaderSize + : objOop3); } - endOfFreeRun = objOop; + endOfFreeRun = objOop3; } else { if (firstOfFreeRun != 0) { @@ -48822,9 +48179,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex1 = 0; + fieldIndex = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -48832,35 +48189,31 @@ eliminateAndFreeForwardersForPigCompact(void) } } - prevPrevObj = prevObj; - prevObj = objOop; + prevPrevObj1 = prevObj1; + prevObj1 = objOop3; /* begin objectAfter:limit: */ - numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - if (numSlots == 0) { + numSlots11 = byteAt(objOop3 + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop3 - BaseHeaderSize) + : numSlots11); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { - objOop = GIV(endOfMemory); - goto l7; + followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { + objOop3 = GIV(endOfMemory); + goto l15; } flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l7: /* end objectAfter:limit: */; + followingWord1 = longAt(followingWordAddress1 + 4); + objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l15: /* end objectAfter:limit: */; } if (firstOfFreeRun != 0) { bytes = (addressAfter(endOfFreeRun)) - startOfFreeRun; @@ -48871,9 +48224,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex2 = 0; + fieldIndex1 = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -48881,11 +48234,11 @@ eliminateAndFreeForwardersForPigCompact(void) } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ - fieldIndex = 0; + fieldIndex2 = 0; assert(isFreeObject(prevFree)); assert((prevPrevFree == 0) || (isFreeObject(prevPrevFree))); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree); } GIV(lastFreeChunk) = prevFree; /* begin inSortedFreeListLink:to:given: */ @@ -48900,7 +48253,6 @@ eliminateAndFreeForwardersForPigCompact(void) } assert(checkTraversableSortedFreeList()); assert((numberOfForwarders()) == 0); - return 0; } @@ -48920,7 +48272,7 @@ eliminateAndFreeForwardersForPigCompact(void) */ /* SpurPigCompactor>>#freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact */ -static sqInt NeverInline +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt fieldIndex; @@ -48937,20 +48289,16 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) sqInt here; sqInt here1; sqInt i; - sqInt i1; sqInt iLimiT; - sqInt index; usqInt newNumSlots; sqInt next; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt o; - sqInt obj; usqInt obj2slots; sqInt objOop; sqInt prevFree; @@ -48962,7 +48310,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; - sqInt sweepIndex; /* for profiling */ @@ -48972,30 +48319,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - /* begin forgetUnmarkedRememberedObjects */ - index = 0; - while (index < GIV(rememberedSetSize)) { - obj = GIV(rememberedSet)[index]; - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { - index += 1; - } - else { - - /* unmarked; remove by overwriting with last element. */ - /* begin setIsRememberedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - assert(GIV(rememberedSetSize) >= 0); - doScavenge(MarkOnTenure); - /* begin prepareForGlobalSweep */ - sweepIndex = 0; - for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { - ((GIV(segments)[i1]).containsPinned = 0); - } - setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); /* begin resetFreeListHeads */ for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { GIV(freeLists)[i] = 0; @@ -49011,22 +48334,22 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) rawNumSlots = byteAt(objOop + 7); assert((GIV(firstFreeChunk) == 0) || (isFreeObject(GIV(firstFreeChunk)))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { /* forwarders should have been followed in markAndTrace: */ assert(!(isForwarded(objOop))); setIsMarkedOfto(objOop, 0); - if (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) { /* begin notePinned: */ assert(isPinned(objOop)); if (((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun())) { setIsMarkedOfto(objOop, 1); } else { - while (((((GIV(segments)[sweepIndex]).segSize)) + (((GIV(segments)[sweepIndex]).segStart))) < objOop) { - sweepIndex += 1; + while (((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart))) < objOop) { + GIV(sweepIndex) += 1; } - ((GIV(segments)[sweepIndex]).containsPinned = 1); + ((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1); } } } @@ -49040,32 +48363,28 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) assert(isMarked(lastBridge())); /* begin objectAfter:limit: */ numSlots11 = byteAt(here1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (here1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); next = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; - while (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) { + l21: /* end objectAfter:limit: */; + while (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* coalescing; rare case */ assert(!(isRemembered(next))); @@ -49083,11 +48402,9 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) obj2slots += obj2slots & 1; assert((obj2slots * BytesPerWord) == (bytesInObject(next))); if (header1NumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ - numSlots = obj2slots + (longAt(here1 - BaseHeaderSize)); - longAtput(here1 - BaseHeaderSize, numSlots); + longAtput(here1 - BaseHeaderSize, obj2slots + (longAt(here1 - BaseHeaderSize))); here1 = here1; - goto l21; + goto l20; } header1NumSlots = (header1NumSlots == 0 ? 2 @@ -49099,7 +48416,7 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (newNumSlots < (numSlotsMask())) { byteAtput(here1 + 7, newNumSlots); here1 = here1; - goto l21; + goto l20; } newNumSlots -= BaseHeaderSize / BytesPerWord; longAtput(here1 + BaseHeaderSize, longAt(here1)); @@ -49107,34 +48424,30 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput(here1, newNumSlots); longAtput(here1 + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); here1 += BaseHeaderSize; - l21: /* end coalesce:and: */; + l20: /* end coalesce:and: */; /* begin objectAfter:limit: */ numSlots1 = byteAt(here1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (here1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l22; + goto l19; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); next = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l22: /* end objectAfter:limit: */; + l19: /* end objectAfter:limit: */; } here = here1; /* begin setObjectFree: */ @@ -49169,31 +48482,27 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); + if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l6; + goto l16; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ @@ -49215,7 +48524,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput((GIV(lastFreeChunk) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ 0); } assert(checkTraversableSortedFreeList()); - return 0; } @@ -49256,8 +48564,6 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) sqInt fieldIndex4; sqInt fieldIndex41; sqInt fieldIndex5; - sqInt format; - sqInt format1; usqInt freeBytes; usqInt freeChunk; usqInt here; @@ -49306,17 +48612,13 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (thisFreeChunk != 0) { /* skip any initial immobile objects */ - while (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + while (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { /* begin addressAfter: */ numSlots11 = byteAt(hereObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots11; - } + numSlots4 = (numSlots11 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots11); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -49342,6 +48644,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) && (isFreeObject(thisFreeChunk))); freeBytes = bytesInObject(thisFreeChunk); nextFree = ((usqInt)((longAt((thisFreeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFreeChunk)); + /* begin startOfObject: */ destination = ((byteAt(thisFreeChunk + 7)) == (numSlotsMask()) ? thisFreeChunk - BaseHeaderSize : thisFreeChunk); @@ -49353,13 +48656,9 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (1) { /* begin addressAfter: */ numSlots12 = byteAt(hereObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots5 = numSlots12; - } + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -49368,7 +48667,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) slotBytes1 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } there = (hereObj + BaseHeaderSize) + slotBytes1; - if (!(((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!(((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun()))) && ((freeBytes > ((there - here) + 8)) || (freeBytes == (there - here))))) break; @@ -49383,11 +48682,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); destination += there - here; freeBytes -= there - here; /* begin objectStartingAt: */ @@ -49480,7 +48778,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) prevFreeChunk = thisFreeChunk; thisFreeChunk = nextFree; } - if (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { return (maxFreeChunk >= startAddress ? 0 @@ -49496,6 +48794,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while ((freeChunk != 0) && (freeChunk < hereObj)) { next = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + /* begin startOfObject: */ dest = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); @@ -49514,11 +48813,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); if (next != 0) { nextNext = ((usqInt)((longAt((next + BaseHeaderSize) + (0U << (shiftForWord())))) ^ freeChunk)); } @@ -49584,14 +48882,14 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } } usedChunk = freeChunk; - goto l25; + goto l27; } prevPrevFree = prevFree; prevFree = freeChunk; freeChunk = next; } usedChunk = 0; - l25: /* end tryToMovePig:at:end: */; + l27: /* end tryToMovePig:at:end: */; /* begin objectStartingAt: */ numSlots2 = byteAt(there + 7); hereObj = (numSlots2 == (numSlotsMask()) @@ -49621,10 +48919,59 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } +/* Answer the next free free chunk using the xor trick to use only one field, + see e.g. + The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 + `Circular Lists', exercise. 18 + http://en.wikipedia.org/wiki/XOR_linked_list. */ + + /* SpurPigCompactor>>#nextInSortedFreeListLink:given: */ +static usqInt NoDbgRegParms +nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) +{ + return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); +} + + /* SpurPigCompactor>>#printSortedFreeList */ +void +printSortedFreeList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt freeChunk; + usqInt nextFree; + sqInt prevFree; + + if (!((GIV(firstFreeChunk) > 0) + && (GIV(lastFreeChunk) > GIV(firstFreeChunk)))) { + print("sorted free list empty or corrupt"); + /* begin cr */ + printf("\n"); + return; + } + freeChunk = GIV(firstFreeChunk); + prevFree = 0; + while (1) { + if (!((addressCouldBeObj(freeChunk)) + && (((longAt(freeChunk)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) freeChunk)); + print(" is not a free chunk!"); + /* begin cr */ + printf("\n"); + return; + } + printFreeChunkprintAsTreeNode(freeChunk, 0); + if (!(freeChunk != GIV(lastFreeChunk))) break; + nextFree = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + prevFree = freeChunk; + freeChunk = nextFree; + } +} + + /* Rebuild the free lists from the doubly-linked free list. */ /* SpurPigCompactor>>#rebuildFreeListsForPigCompact */ -static sqInt +static void rebuildFreeListsForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt bytes; @@ -49650,6 +48997,7 @@ rebuildFreeListsForPigCompact(void) assert((prevFree == 0) || (prevFree < free)); bytes = bytesInObject(free); + /* begin startOfObject: */ start = ((byteAt(free + 7)) == (numSlotsMask()) ? free - BaseHeaderSize : free); @@ -49667,7 +49015,64 @@ rebuildFreeListsForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - return 0; +} + + +/* Scavenge or simply follow objOop. Answer the new location of objOop. + The send should have been guarded by a send of shouldRemapOop:. + The method is called remapObj: for compatibility with ObjectMemory. */ + + /* SpurPigCompactor>>#remapObj: */ +sqInt +remapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt referent; + sqInt resolvedObj; + + /* begin vanillaRemapObj: */ + assert(shouldRemapOop(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(objOop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + resolvedObj = referent; + } + else { + assert(!((isInFutureSpace(objOop)))); + resolvedObj = objOop; + } + if ((GIV(gcPhaseInProgress) == ScavengeInProgress) + && ((((resolvedObj & (tagMask())) == 0) + && ((assert(isNonImmediate(resolvedObj)), + oopisLessThan(resolvedObj, GIV(newSpaceLimit))))) + && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { + return copyAndForward(resolvedObj); + } + return resolvedObj; +} + + +/* Answer if the obj should be scavenged (or simply followed). The method is + called shouldRemapObj: for compatibility with ObjectMemory. Defer to the + compactor to choose the actual test, there being a difference between the + vanilla test and + that used with a sliding compactor where objects are not marked as + forwarded. */ + + /* SpurPigCompactor>>#shouldRemapObj: */ +sqInt +shouldRemapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(objOop)), + oopisLessThan(objOop, GIV(newSpaceLimit)))) + && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); } /* SpurSegmentInfo>>#segLimit */ @@ -49765,19 +49170,22 @@ static sqInt allBridgesMarked(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; + SpurSegmentInfo *aSegment; sqInt bridgeObj; sqInt i; usqInt numSlots; for (i = 0; i < GIV(numSegments); i += 1) { + /* begin bridgeFor: */ + aSegment = ((SpurSegmentInfo *) ((&(GIV(segments)[i])))); /* begin objectStartingAt: */ - address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * BaseHeaderSize); + address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize); numSlots = byteAt(address + 7); bridgeObj = (numSlots == (numSlotsMask()) ? address + BaseHeaderSize : address); assert(isValidSegmentBridge(bridgeObj)); - if (!(((((usqInt) (longAt(bridgeObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(bridgeObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -49849,7 +49257,6 @@ bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil) sqInt clifton; usqInt segEnd; - /* begin segLimit */ segEnd = ((aSegment->segSize)) + ((aSegment->segStart)); /* clifton is where the Avon bridge begins... */ @@ -50113,7 +49520,7 @@ prepareForSnapshot(void) /* begin freeTreeNodesDo: */ treeNode = GIV(freeLists)[0]; if (treeNode == 0) { - goto l7; + goto l5; } cameFrom = -1; do { @@ -50141,13 +49548,9 @@ prepareForSnapshot(void) limit = endOfMemory(); /* begin addressAfter: */ numSlots1 = byteAt(node + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(node - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(node - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -50204,7 +49607,7 @@ prepareForSnapshot(void) cameFrom = -1; } } while(treeNode != 0); -l7: /* end freeTreeNodesDo: */; +l5: /* end freeTreeNodesDo: */; for (i = 0; i < GIV(numSegments); i += 1) { freeChunk = ((GIV(segments)[i]).lastFreeObject); if (!(freeChunk == null)) { @@ -50318,14 +49721,14 @@ shrinkObjectMemory(usqInt delta) SpurSegmentInfo *segInfo; usqInt shrinkage; - i2 = 0; + i = 0; shrinkage = delta; while (1) { /* begin findEmptySegNearestInSizeTo: */ best = null; delta1 = shrinkage; - for (i = 0; i < GIV(numSegments); i += 1) { - seg = (&(GIV(segments)[i])); + for (i2 = 0; i2 < GIV(numSegments); i2 += 1) { + seg = (&(GIV(segments)[i2])); if (isEmptySegment(seg)) { if (best == null) { best = seg; @@ -50349,20 +49752,20 @@ shrinkObjectMemory(usqInt delta) /* begin removeSegment: */ for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { if (((emptySeg->segStart)) == (((GIV(segments)[i1]).segStart))) { - i2 = i1; - goto l2; + i = i1; + goto l1; } } error("segment not found"); - l2: /* end indexOfSegment: */; - assert(i2 > 0); + l1: /* end indexOfSegment: */; + assert(i > 0); sqDeallocateMemorySegmentAtOfSize(((void *)((emptySeg->segStart))), (emptySeg->segSize)); - for (j = i2; j < GIV(numSegments); j += 1) { + for (j = i; j < GIV(numSegments); j += 1) { GIV(segments)[j] = (GIV(segments)[j + 1]); } GIV(numSegments) -= 1; - bridgeFromto((&(GIV(segments)[i2 - 1])), (i2 <= (GIV(numSegments) - 1) - ? (&(GIV(segments)[i2])) + bridgeFromto((&(GIV(segments)[i - 1])), (i <= (GIV(numSegments) - 1) + ? (&(GIV(segments)[i])) : 0)); /* begin setLastSegment: */ segInfo = ((SpurSegmentInfo *) ((&(GIV(segments)[GIV(numSegments) - 1])))); @@ -50636,6 +50039,7 @@ addNewMethodToCache(sqInt classObj) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -50723,6 +50127,7 @@ addNewMethodToNSCache(sqInt rule) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -50835,7 +50240,7 @@ void * arrayValueOf(sqInt arrayOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -50852,7 +50257,7 @@ arrayValueOf(sqInt arrayOop) static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if (isCharacterObject(characterObj)) { + if ((characterObj & (tagMask())) == (characterTag())) { return (/* begin integerObjectOfCharacterObject: */ ((usqInt) (((usqInt) characterObj))) >> 1); } @@ -51038,8 +50443,7 @@ canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader) sqInt characterForAscii(sqInt ascii) { - return (/* begin characterObjectOf: */ - (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag())); + return (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag()); } @@ -51062,10 +50466,10 @@ checkAllAccessibleObjectsOkay(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -51089,8 +50493,8 @@ checkAllAccessibleObjectsOkay(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -51102,37 +50506,33 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -51143,32 +50543,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -51186,32 +50582,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return ok; } @@ -51285,7 +50677,6 @@ checkForEventsMayContextSwitch(sqInt mayContextSwitch) sqInt objOop1; sqInt sema; sqInt switched; - char *theSP; /* restore the stackLimit if it has been smashed. */ @@ -51297,14 +50688,13 @@ checkForEventsMayContextSwitch(sqInt mayContextSwitch) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); assert(GIV(stackPage) == (mostRecentlyUsedPage())); ioSynchronousCheckForEvents(); @@ -51478,55 +50868,55 @@ checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset) /* Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccessibleObjects has set a bit at each object's header. Check that all oops in the interpreter's state - points to a header. Answer if all checks pass. */ + points to a header. Answer 0 if all checks pass. */ /* StackInterpreter>>#checkInterpreterIntegrity */ static sqInt checkInterpreterIntegrity(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt flags; sqInt i; - sqInt ok; - ok = 1; + flags = 0; if (!(checkOopIntegritynamed(GIV(specialObjectsOop), "specialObjectsOop"))) { - ok = 0; + flags = 1; } if (!(checkOopIntegritynamed(GIV(newMethod), "newMethod"))) { - ok = 0; + flags += 2; } if (!(checkOopIntegritynamed(GIV(profileProcess), "profileProcess"))) { - ok = 0; + flags += 4; } if (!(checkOopIntegritynamed(GIV(profileMethod), "profileMethod"))) { - ok = 0; + flags += 8; } if (!(checkOopIntegritynamed(GIV(profileSemaphore), "profileSemaphore"))) { - ok = 0; + flags += 16; } if (!(GIV(tempOop) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop), "tempOop"))) { - ok = 0; + flags += 32; } } if (!(GIV(tempOop2) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop2), "tempOop2"))) { - ok = 0; + flags += 64; } } if (!(GIV(tempOop3) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop3), "tempOop3"))) { - ok = 0; + flags += 128; } } for (i = 1; i <= GIV(jmpDepth); i += 1) { if (!(checkOopIntegritynamedindex(GIV(suspendedCallbacks)[i], "suspendedCallbacks", i))) { - ok = 0; + flags += 256; } if (!(checkOopIntegritynamedindex(GIV(suspendedMethods)[i], "suspendedMethods", i))) { - ok = 0; + flags += 512; } } - return ok; + return flags; } @@ -51622,12 +51012,7 @@ checkOkayFields(sqInt oop) } hasYoung = 0; if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(oop)), -/* begin fetchPointer:ofObject: */ -longAt((oop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(oop)), -/* begin fetchPointer:ofObject: */ -longAt((oop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(oop)) + LiteralStart) - 1; } else { if (((oop & (tagMask())) == 0) @@ -51773,21 +51158,19 @@ checkOkayStackZone(sqInt writeBack) sqInt i; sqInt ok; StackPage *thePage; - char *theSP; if (writeBack) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } ok = 1; @@ -52084,9 +51467,9 @@ contexthasValidInversePCMappingOfin(sqInt aContext, sqInt theIP, char *theFP) /* begin fetchPointer:ofObject: */ pc = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + /* begin contextInstructionPointer:frame: */ assert(validInstructionPointerinFrame(theIP + 1, theFP)); encodedip = (((usqInt)(((theIP - (longAt(theFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1); - return (pc == encodedip) || (((methodHeader = methodHeaderOf(longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))))), ((/* begin alternateHeaderHasPrimitiveFlag: */ @@ -52204,10 +51587,6 @@ createActualMessageTo(sqInt lookupClass) usqInt numBytes; usqInt numBytes1; sqInt numSlots; - sqInt numSlots1; - sqInt objFormat; - sqInt objFormat1; - sqInt selector; char *sp; @@ -52215,22 +51594,17 @@ createActualMessageTo(sqInt lookupClass) assert((isImmediate(GIV(messageSelector))) || (addressCouldBeObj(GIV(messageSelector)))); /* begin mnuBreakpoint:receiver: */ - selector = GIV(messageSelector); - mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null); + mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), null); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - numSlots1 = GIV(argumentCount); - assert(numSlots1 < (numSlotsMask())); + assert(GIV(argumentCount) < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots1 <= 1 + numBytes = BaseHeaderSize + ((GIV(argumentCount) <= 1 ? 8 - : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); + : (GIV(argumentCount) + (GIV(argumentCount) & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -52242,21 +51616,18 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); argumentArray = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) GIV(argumentCount))) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; argumentArray = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = 1; numSlots = MessageLookupClassIndex + 1; assert((numSlots >= 0) && (ClassMessageCompactIndex != 0)); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); + assert((1) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -52274,13 +51645,13 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); message = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassMessageCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + ClassMessageCompactIndex); GIV(freeStart) += numBytes1; message = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) { longAtput((argumentArray + BaseHeaderSize) + i, popStack()); @@ -52429,21 +51800,19 @@ divorceAllFrames(void) sqInt activeContext; StackPage *aPage; sqInt i; - char *theSP; if (GIV(stackPage) != 0) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } /* begin ensureFrameIsMarried:SP: */ @@ -52564,6 +51933,7 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) int posArg; int posRcvr; sqInt result; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -52612,7 +51982,8 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -52629,6 +52000,7 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) sqInt integerArg; sqInt integerRcvr; sqInt integerResult; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -52667,7 +52039,8 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -52804,14 +52177,14 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) sqInt followingWord1; sqInt followingWord11; sqInt followingWord2; + sqInt followingWord21; sqInt followingWord3; - sqInt followingWord4; usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress11; usqInt followingWordAddress2; + usqInt followingWordAddress21; usqInt followingWordAddress3; - usqInt followingWordAddress4; usqInt limit; usqInt limit1; sqInt methodHeader; @@ -52822,39 +52195,39 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; usqInt numSlots31; usqInt numSlots4; + usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; sqInt objOop11; + sqInt objOop111; sqInt objOop12; - sqInt objOop13; sqInt objOop2; + sqInt objOop21; sqInt objOop3; - sqInt objOop4; sqInt oop; sqInt prevObj; sqInt prevObj1; + sqInt prevObj11; sqInt prevObj2; - sqInt prevObj3; sqInt prevPrevObj; sqInt prevPrevObj1; + sqInt prevPrevObj11; sqInt prevPrevObj2; - sqInt prevPrevObj3; usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes11; usqInt slotBytes2; + usqInt slotBytes21; usqInt slotBytes3; - usqInt slotBytes4; sqInt stopAddr; int swapFloatWords; int temp; @@ -52879,87 +52252,13 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots5 = byteAt(address2 + 7); - objOop12 = (numSlots5 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop12 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit1 = GIV(pastSpaceStart); while (oopisLessThan(objOop12, limit1)) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); - if (fmt >= (firstByteFormat())) { - - /* oop contains bytes */ - wordAddr = objOop12 + BaseHeaderSize; - if (fmt >= (firstCompiledMethodFormat())) { - - /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop12 + BaseHeaderSize); - wordAddr += (((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; - } - /* begin reverseBytesFrom:to: */ - stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize); - addr1 = wordAddr; - while (oopisLessThan(addr1, stopAddr)) { - longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); - addr1 += BytesPerWord; - } - } - if (fmt == (firstLongFormat())) { - - /* Bitmap, Float etc */ - if (swapFloatWords - && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop12 + BaseHeaderSize); - longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4)); - longAtput((objOop12 + BaseHeaderSize) + 4, temp1); - } - else { - } - } - - - prevPrevObj2 = prevObj2; - prevObj2 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { - objOop12 = limit1; - goto l17; - } - flag("endianness"); - followingWord3 = longAt(followingWordAddress3 + 4); - objOop12 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress3 + BaseHeaderSize - : followingWordAddress3); - l17: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address11 = ((eden()).start); - numSlots14 = byteAt(address11 + 7); - objOop12 = (numSlots14 == (numSlotsMask()) - ? address11 + BaseHeaderSize - : address11); - while (oopisLessThan(objOop12, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -52997,20 +52296,84 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop12 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop12 - BaseHeaderSize); + numSlots13 = byteAt(objOop12 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); } else { - numSlots31 = numSlots121; + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { + objOop12 = limit1; + goto l17; + } + flag("endianness"); + followingWord3 = longAt(followingWordAddress3 + 4); + objOop12 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress3 + BaseHeaderSize + : followingWordAddress3); + l17: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address11 = ((eden()).start); + numSlots41 = byteAt(address11 + 7); + objOop12 = (numSlots41 == (numSlotsMask()) + ? address11 + BaseHeaderSize + : address11); + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); + if (fmt >= (firstByteFormat())) { + + /* oop contains bytes */ + wordAddr = objOop12 + BaseHeaderSize; + if (fmt >= (firstCompiledMethodFormat())) { + + /* compiled method; start after methodHeader and literals */ + methodHeader = longAt(objOop12 + BaseHeaderSize); + wordAddr += (((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + } + /* begin reverseBytesFrom:to: */ + stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize); + addr1 = wordAddr; + while (oopisLessThan(addr1, stopAddr)) { + longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); + addr1 += BytesPerWord; + } } - if (numSlots31 == 0) { + if (fmt == (firstLongFormat())) { + + /* Bitmap, Float etc */ + if (swapFloatWords + && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop12 + BaseHeaderSize); + longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4)); + longAtput((objOop12 + BaseHeaderSize) + 4, temp1); + } + else { + } + } + + + prevPrevObj2 = prevObj2; + prevObj2 = objOop12; + /* begin objectAfter:limit: */ + numSlots111 = byteAt(objOop12 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } followingWordAddress11 = (objOop12 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { @@ -53026,28 +52389,27 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop11 = GIV(nilObj); + prevPrevObj11 = (prevObj11 = null); + objOop111 = GIV(nilObj); while (1) { - assert((objOop11 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; - assert((long64At(objOop11)) != 0); - if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); + assert((objOop111 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop111, GIV(endOfMemory)))) break; + assert((long64At(objOop111)) != 0); + if (isEnumerableObject(objOop111)) { + fmt = (((usqInt) (longAt(objOop111))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { /* oop contains bytes */ - wordAddr = objOop11 + BaseHeaderSize; + wordAddr = objOop111 + BaseHeaderSize; if (fmt >= (firstCompiledMethodFormat())) { /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop11 + BaseHeaderSize); + methodHeader = longAt(objOop111 + BaseHeaderSize); wordAddr += (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; } /* begin reverseBytesFrom:to: */ - stopAddr = objOop11 + (((numSlotsOf(objOop11)) << (shiftForWord())) + BaseHeaderSize); + stopAddr = objOop111 + (((numSlotsOf(objOop111)) << (shiftForWord())) + BaseHeaderSize); addr1 = wordAddr; while (oopisLessThan(addr1, stopAddr)) { longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); @@ -53058,10 +52420,10 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) /* Bitmap, Float etc */ if (swapFloatWords - && ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop11 + BaseHeaderSize); - longAtput(objOop11 + BaseHeaderSize, longAt((objOop11 + BaseHeaderSize) + 4)); - longAtput((objOop11 + BaseHeaderSize) + 4, temp1); + && ((compactClassIndexOf(objOop111)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop111 + BaseHeaderSize); + longAtput(objOop111 + BaseHeaderSize, longAt((objOop111 + BaseHeaderSize) + 4)); + longAtput((objOop111 + BaseHeaderSize) + 4, temp1); } else { } @@ -53069,41 +52431,37 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } - prevPrevObj1 = prevObj1; - prevObj1 = objOop11; + prevPrevObj11 = prevObj11; + prevObj11 = objOop111; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots121 = byteAt(objOop111 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop111 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop11 = GIV(endOfMemory); - goto l18; + followingWordAddress21 = (objOop111 + BaseHeaderSize) + slotBytes21; + if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { + objOop111 = GIV(endOfMemory); + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l18: /* end objectAfter:limit: */; + followingWord21 = longAt(followingWordAddress21 + 4); + objOop111 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress21 + BaseHeaderSize + : followingWordAddress21); + l29: /* end objectAfter:limit: */; } } else { /* begin convertFloatsToPlatformOrder */ if (VMBIGENDIAN == GIV(imageFloatsBigEndian)) { - goto l1; + goto l15; } assert(ClassFloatCompactIndex != 0); /* begin allObjectsDo: */ @@ -53114,8 +52472,8 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -53131,37 +52489,33 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -53176,81 +52530,73 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj3 = (prevObj3 = null); - objOop13 = GIV(nilObj); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); while (1) { - assert((objOop13 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop13, GIV(endOfMemory)))) break; - assert((long64At(objOop13)) != 0); - if (isEnumerableObject(objOop13)) { - if ((compactClassIndexOf(objOop13)) == ClassFloatCompactIndex) { - temp = long32At(objOop13 + BaseHeaderSize); - long32Atput(objOop13 + BaseHeaderSize, long32At((objOop13 + BaseHeaderSize) + 4)); - long32Atput((objOop13 + BaseHeaderSize) + 4, temp); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex) { + temp = long32At(objOop11 + BaseHeaderSize); + long32Atput(objOop11 + BaseHeaderSize, long32At((objOop11 + BaseHeaderSize) + 4)); + long32Atput((objOop11 + BaseHeaderSize) + 4, temp); } } - prevPrevObj3 = prevObj3; - prevObj3 = objOop13; + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop13 + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop13 - BaseHeaderSize); - } - else { - numSlots6 = numSlots15; - } - if (numSlots6 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes4 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress4 = (objOop13 + BaseHeaderSize) + slotBytes4; - if (oopisGreaterThanOrEqualTo(followingWordAddress4, GIV(endOfMemory))) { - objOop13 = GIV(endOfMemory); - goto l28; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); - followingWord4 = longAt(followingWordAddress4 + 4); - objOop13 = ((((usqInt) followingWord4) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress4 + BaseHeaderSize - : followingWordAddress4); - l28: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; } - l1: /* end convertFloatsToPlatformOrder */; + l15: /* end convertFloatsToPlatformOrder */; } } @@ -53301,11 +52647,10 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) if ((byteAt((callerFP1 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP1))); callerCtx = longAt(callerFP1 + FoxThisContext); - goto l5; + goto l4; } callerCtx = marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l5: /* end ensureFrameIsMarried:SP: */; l4: /* end ensureCallerContext: */; if (((frameAbove = findFrameAboveinPage(theFP, thePage))) == 0) { @@ -53319,11 +52664,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l2: /* end newStackPage */; + l1: /* end newStackPage */; theIP = oopForPointer(pointerForOop(longAt(frameAbove + FoxCallerSavedIP))); frameAbove = moveFramesInthroughtoPage(thePage, frameAbove, newPage); if (onCurrent) { @@ -53432,8 +52777,6 @@ externalEnsureIsBaseFrame(char *aFramePtr) static sqInt NoDbgRegParms externalInstVarofContext(sqInt offset, sqInt aContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - char *theSP; - assert(isContext(aContext)); assert(offset <= (ReceiverIndex + (checkStackPointerForMaybeMarriedContext(aContext)))); if (offset <= StackPointerIndex) { @@ -53441,14 +52784,13 @@ externalInstVarofContext(sqInt offset, sqInt aContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))) { @@ -53468,21 +52810,19 @@ externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) sqInt senderOop; char *theFP; StackPage *thePage; - char *theSP; assert(isContext(maybeMarriedContext)); /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); assert(!((isObjImmutable(maybeMarriedContext)))); if (!((((longAt((maybeMarriedContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -53634,7 +52974,7 @@ fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer) arrayOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); /* begin arrayValueOf: */ if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -53878,26 +53218,22 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop1 = referent1; + objOop1 = referent2; } classDict = objOop1; assert(!(isForwarded(classDict))); /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin noFixupFollowField:ofObject: */ objOop = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -53906,13 +53242,13 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop = referent2; + objOop = referent1; } methodArray = objOop; assert(!(isForwarded(methodArray))); @@ -54149,7 +53485,7 @@ findNewMethodInClassTag(sqInt classTagArg) return null; } } - /* begin classForClassTag: */ + /* begin classAtIndex: */ assert((classTag <= (tagMask())) || (classTag >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ @@ -54157,12 +53493,12 @@ findNewMethodInClassTag(sqInt classTagArg) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l3; + goto l2; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l3: /* end classAtIndex: */; + l2: /* end classAtIndex: */; lookupOrdinarySend(); addNewMethodToCache(GIV(lkupClass)); @@ -54205,13 +53541,9 @@ findSelectorOfMethod(sqInt meth) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin fetchPointer:ofObject: */ methodArray = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -54279,6 +53611,32 @@ findSPOfon(char *theFP, StackPage *thePage) return 0; } + /* StackInterpreter>>#fireEphemeron: */ +static void NoDbgRegParms +fireEphemeron(sqInt ephemeron) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + queueMourner(ephemeron); + /* begin setFormatOf:to: */ + assert(((1 >= 0) && (1 <= (formatMask())))); + flag("endianness"); + longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift()))); + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + + /* StackInterpreter>>#fireFinalization: */ +static void NoDbgRegParms +fireFinalization(sqInt weakling) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (GIV(newFinalization)) { + queueMourner(weakling); + } + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + /* Like #stackFloatValue: but access method arguments left-to-right */ @@ -54469,20 +53827,18 @@ followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) char *theFP; usqInt theIPPtr; StackPage *thePage; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (theBecomeEffectsFlags & BecameCompiledMethodFlag) { if (((longAt(GIV(method))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { @@ -55055,27 +54411,26 @@ handleStackOverflow(void) /* base frame, context in saved ip slot (or base of stack in Cog) */ longAt(theFP + FoxCallerContext); - goto l1; + goto l2; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP1 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP1))); longAt(callerFP1 + FoxThisContext); - goto l3; + goto l2; } marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l3: /* end ensureFrameIsMarried:SP: */; -l1: /* end ensureCallerContext: */; +l2: /* end ensureCallerContext: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l2: /* end newStackPage */; +l1: /* end newStackPage */; moveFramesInthroughtoPage(GIV(stackPage), theFP, newPage); /* begin setStackPageAndLimit: */ assert(newPage != 0); @@ -55104,7 +54459,6 @@ static sqInt NoDbgRegParms handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt switched; - char *theSP; /* If the stackLimit differs from the realStackLimit then the stackLimit @@ -55114,14 +54468,13 @@ handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); switched = 0; } @@ -55348,24 +54701,25 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq fp = (thePage->headFP); if (fp == spouseFP) { theFPAbove = 0; - goto l2; + goto l1; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == spouseFP) { theFPAbove = fp; - goto l2; + goto l1; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l2: /* end findFrameAbove:inPage: */; + l1: /* end findFrameAbove:inPage: */; theIP = (theFPAbove == 0 ? longAt((thePage->headSP)) : oopForPointer(pointerForOop(longAt(theFPAbove + FoxCallerSavedIP)))); } - return (assert(validInstructionPointerinFrame(theIP + 1, spouseFP)), - (((usqInt)(((theIP - (longAt(spouseFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1)); + /* begin contextInstructionPointer:frame: */ + assert(validInstructionPointerinFrame(theIP + 1, spouseFP)); + return (((usqInt)(((theIP - (longAt(spouseFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1); } @@ -55487,6 +54841,7 @@ isKindOfInteger(sqInt oop) sqInt isLargeIntegerObject(sqInt oop) { + /* begin isLargeIntegerInstance: */ return ((oop & (tagMask())) == 0) && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1); } @@ -55495,6 +54850,7 @@ isLargeIntegerObject(sqInt oop) sqInt isLargeNegativeIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargeNegativeInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargeNegativeIntegerCompactIndex); } @@ -55503,6 +54859,7 @@ isLargeNegativeIntegerObject(sqInt oop) sqInt isLargePositiveIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargePositiveInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargePositiveIntegerCompactIndex); } @@ -55762,6 +55119,7 @@ isKindOfClass(sqInt oop, sqInt aClass) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55791,6 +55149,7 @@ isKindOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55819,6 +55178,7 @@ isMemberOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55839,13 +55199,9 @@ lengthOfNameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { return lengthOfNameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord())))))); } @@ -55858,13 +55214,9 @@ lengthOfNameOfClass(sqInt classOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { return numSlots2; } @@ -55959,8 +55311,8 @@ longPrintOop(sqInt oop) sqInt n1; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt startIP; if ((oop & (tagMask())) @@ -55989,7 +55341,6 @@ longPrintOop(sqInt oop) printf("0x%lx", ((unsigned long) class)); print(")"); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); print(" format "); /* begin printHexnp: */ @@ -56005,14 +55356,10 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(oop + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(oop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { len = numSlots; goto l5; @@ -56104,38 +55451,34 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(oop + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(oop - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(oop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots11); if (fmt2 <= 5) { - lastIndex = numSlots1; - goto l7; + lastIndex = numSlots2; + goto l8; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - lastIndex = (numSlots1 << (shiftForWord())) - (fmt2 & 7); - goto l7; + lastIndex = (numSlots2 << (shiftForWord())) - (fmt2 & 7); + goto l8; } if (fmt2 >= (firstShortFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l8; } if (fmt2 >= (firstLongFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l8; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - lastIndex = ((usqInt) numSlots1) >> 1; - goto l7; + lastIndex = ((usqInt) numSlots2) >> 1; + goto l8; } lastIndex = 0; - l7: /* end lengthOf:format: */; + l8: /* end lengthOf:format: */; if ((lastIndex - startIP) > 100) { lastIndex = startIP + 100; } @@ -56259,6 +55602,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) sqInt tagBits; sqInt wrapAround; + /* begin fetchClassOf: */ receiverClass = (((tagBits = GIV(localAbsentReceiver) & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(GIV(localAbsentReceiver))); @@ -56276,13 +55620,9 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56307,19 +55647,19 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l15; + goto l16; } index += 1; } found = 0; - goto l15; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56330,13 +55670,13 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56345,7 +55685,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l15; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56353,12 +55693,12 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56367,20 +55707,20 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } GIV(newMethod) = objOop4; found = 1; - goto l15; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l15; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; -l15: /* end lookupMethodInDictionary: */; +l16: /* end lookupMethodInDictionary: */; if (found && ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate)) { return rule; @@ -56437,13 +55777,9 @@ lookupMethodInClass(sqInt class) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56468,12 +55804,12 @@ lookupMethodInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; goto l19; } @@ -56491,13 +55827,13 @@ lookupMethodInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56514,12 +55850,12 @@ lookupMethodInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56594,11 +55930,11 @@ lookupMNU(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; createActualMessageTo(GIV(lkupClass)); @@ -56616,13 +55952,9 @@ lookupMNU(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56647,19 +55979,19 @@ lookupMNU(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l18; + goto l16; } index += 1; } found = 0; - goto l18; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56670,13 +56002,13 @@ lookupMNU(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56685,7 +56017,7 @@ lookupMNU(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l18; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56693,12 +56025,12 @@ lookupMNU(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56707,30 +56039,30 @@ lookupMNU(void) } GIV(newMethod) = objOop4; found = 1; - goto l18; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l18; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; - l18: /* end lookupMethodInDictionary: */; + l16: /* end lookupMethodInDictionary: */; if (found) { return LookupRuleMNU; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } error("Recursive not understood error encountered"); return 0; @@ -56759,41 +56091,37 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56818,19 +56146,19 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56841,13 +56169,13 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56856,7 +56184,7 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56864,12 +56192,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56878,20 +56206,20 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { addNewMethodToCache(class); @@ -56904,12 +56232,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -56942,11 +56270,11 @@ lookupOrdinarySend(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; assert(addressCouldBeClassObj(GIV(lkupClass))); @@ -56962,13 +56290,9 @@ lookupOrdinarySend(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56993,19 +56317,19 @@ lookupOrdinarySend(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -57016,13 +56340,13 @@ lookupOrdinarySend(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -57031,7 +56355,7 @@ lookupOrdinarySend(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57039,12 +56363,12 @@ lookupOrdinarySend(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -57053,20 +56377,20 @@ lookupOrdinarySend(void) } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { return LookupRuleOrdinary; @@ -57076,12 +56400,12 @@ lookupOrdinarySend(void) } } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -57108,11 +56432,11 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -57127,13 +56451,9 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -57158,19 +56478,19 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -57181,13 +56501,13 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -57196,7 +56516,7 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57204,12 +56524,12 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -57218,31 +56538,31 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return rule; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -57267,8 +56587,8 @@ lookupSelectorinClass(sqInt selector, sqInt class) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; + sqInt objOop3; sqInt wrapAround; currentClass = class; @@ -57286,13 +56606,9 @@ lookupSelectorinClass(sqInt selector, sqInt class) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -57317,7 +56633,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { meth = null; - goto l11; + goto l9; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57332,36 +56648,36 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop11); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } - meth = objOop11; - goto l11; + meth = objOop1; + goto l9; } index += 1; if (index == length) { if (wrapAround) { meth = null; - goto l11; + goto l9; } wrapAround = 1; index = SelectorStart; } } meth = null; - l11: /* end lookupMethodFor:InDictionary: */; + l9: /* end lookupMethodFor:InDictionary: */; if (!(meth == null)) { return meth; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop3 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop3 & (tagMask())) == 0) + && (((longAt(objOop3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop3); } - currentClass = objOop1; + currentClass = objOop3; } return null; } @@ -57401,11 +56717,11 @@ makeBaseFrameFor(sqInt aContext) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { page = lruOrFree; - goto l11; + goto l3; } divorceFramesIn(lruOrFree); page = lruOrFree; -l11: /* end newStackPage */; +l3: /* end newStackPage */; pointer = (page->baseAddress); /* begin fetchPointer:ofObject: */ theIP = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); @@ -57433,7 +56749,7 @@ makeBaseFrameFor(sqInt aContext) if (((longAt(maybeClosure)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { maybeClosure = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, aContext, maybeClosure); } - /* begin argumentCountOfClosure: */ + /* begin quickFetchInteger:ofObject: */ oop = longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); assert((oop & 1)); numArgs = (oop >> 1); @@ -57551,7 +56867,6 @@ makeContextSnapshotSafe(sqInt ctxt) sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -57567,8 +56882,7 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -57591,13 +56905,13 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l4: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)xValue << 1) | 1)); @@ -57782,9 +57096,10 @@ mapStackPages(void) && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxThisContext), ((futureSpace()).start), futureSurvivorStart()))))) { longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext))); } - assert((isMarriedOrWidowedContext(frameContext(theFP))) - && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); - + if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) { + assert((isMarriedOrWidowedContext(frameContext(theFP))) + && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); + } } if ((((longAt(longAt(theFP + FoxMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) || (((assert(isNonImmediate(longAt(theFP + FoxMethod))), @@ -58158,7 +57473,6 @@ marryFrameSP(char *theFP, char *theSP) numSlots = ((methodHeader & LargeContextBit) != 0 ? LargeContextSlots : SmallContextSlots); - /* begin eeInstantiateMethodContextSlots: */ theContext = allocateNewSpaceSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassMethodContextCompactIndex); assert((numStack + ReceiverIndex) <= numSlots); /* begin storePointerUnchecked:ofObject:withValue: */ @@ -58266,7 +57580,7 @@ maybeSelectorOfMethod(sqInt methodObj) penultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset1 + LiteralStart)) << (shiftForWord()))))); if (((penultimateLiteral & (tagMask())) == 0) - && (isWordsOrBytesNonImm(penultimateLiteral))) { + && (isPureBitsFormat((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())))) { return ((fetchClassTagOfNonImm(penultimateLiteral)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand))) ? penultimateLiteral : 0); @@ -58277,7 +57591,7 @@ maybeSelectorOfMethod(sqInt methodObj) && (((longAt((penultimateLiteral + BaseHeaderSize) + (0U << (shiftForWord())))) == methodObj) && (((maybeSelector = longAt((penultimateLiteral + BaseHeaderSize) + (1U << (shiftForWord())))), (((maybeSelector & (tagMask())) == 0) - && (isWordsOrBytesNonImm(maybeSelector))) + && (isPureBitsFormat((((usqInt) (longAt(maybeSelector))) >> (formatShift())) & (formatMask())))) && ((fetchClassTagOfNonImm(maybeSelector)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand)))))))) ? maybeSelector : 0); @@ -58316,12 +57630,7 @@ methodClassAssociationOf(sqInt methodPointer) sqInt offset; /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -58343,12 +57652,7 @@ methodClassOf(sqInt methodPointer) sqInt offset; /* begin followLiteral:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin followField:ofObject: */ objOop2 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((objOop2 & (tagMask())) == 0) @@ -58392,7 +57696,8 @@ methodPrimitiveIndex(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -58545,13 +57850,9 @@ nameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { /* begin fetchPointer:ofObject: */ maybeThisClassOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))); @@ -58617,13 +57918,13 @@ noInlineSigned32BitIntegerGutsFor(sqInt integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l4: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l3: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong32:ofObject:withValue: */ valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(magnitude); long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); @@ -58672,7 +57973,7 @@ noMarkedContextsOnPage(StackPage *thePage) do { if ((byteAt((theFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP))); - if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } } @@ -58761,12 +58062,7 @@ penultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 2; + offset = (literalCountOf(aMethodOop)) - 2; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -58851,13 +58147,13 @@ positive32BitIntegerFor(unsigned int integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -58901,33 +58197,33 @@ positive64BitIntegerFor(usqLong integerValue) return (((((unsigned int) integerValue)) << 1) | 1); } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); assert(ClassLargePositiveIntegerCompactIndex != 0); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(1 < (numSlotsMask())); - newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + (8); - assert((numBytes1 % (allocationUnit())) == 0); - assert((newObj1 % (allocationUnit())) == 0); - if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l5; + goto l4; } } - long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); - GIV(freeStart) += numBytes1; - newLargeInteger1 = newObj1; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger1 = newObj; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -58952,37 +58248,37 @@ positive64BitIntegerFor(usqLong integerValue) } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + objFormat1 = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); numSlots = 8 / BytesPerOop; assert((numSlots >= 0) && (ClassLargePositiveIntegerCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); - newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + newObj1 = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? 8 : (numSlots + (numSlots & 1)) * BytesPerOop)); - assert((numBytes % (allocationUnit())) == 0); - assert((newObj % (allocationUnit())) == 0); - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l3; + goto l6; } } - long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); - GIV(freeStart) += numBytes; - newLargeInteger = newObj; -l3: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes1; + newLargeInteger = newObj1; +l6: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong64:ofObject:withValue: */ value = SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue); long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), value); @@ -59005,7 +58301,7 @@ positiveMachineIntegerFor(usqIntptr_t value) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) value)) <= (MaxSmallInteger)) { resultObj = ((value << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -59028,13 +58324,13 @@ positiveMachineIntegerFor(usqIntptr_t value) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -59045,9 +58341,9 @@ positiveMachineIntegerFor(usqIntptr_t value) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); resultObj = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; return resultObj; } @@ -59117,7 +58413,8 @@ primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader) sqInt firstBytecode; return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -59134,7 +58431,8 @@ primitiveIndexOf(sqInt methodPointer) /* begin fetchPointer:ofObject: */ methodHeader = longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -59161,13 +58459,9 @@ printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); i = SelectorStart; while (i < classDictSize) { if (aSelector == (longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { @@ -59334,11 +58628,11 @@ printAllStacks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -59362,9 +58656,9 @@ printAllStacks(void) sqInt tagBits; /* begin activeProcess */ - objOop11 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop4 = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - proc = longAt((objOop4 + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + proc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); printNameOfClasscount((((tagBits = proc & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(proc)), 5); @@ -59377,20 +58671,16 @@ printAllStacks(void) printf("\n"); printCallStackFP(GIV(framePointer)); /* begin fetchPointer:ofObject: */ - objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - schedLists = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + objOop3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop1 = longAt((objOop3 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + schedLists = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); if (GIV(highestRunnableProcessPriority) == 0) { /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -59423,47 +58713,43 @@ printAllStacks(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop3 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop3 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; - assert((long64At(objOop3)) != 0); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); /* begin classIndexOf: */ - classIdx = (longAt(objOop3)) & (classIndexMask()); + classIdx = (longAt(objOop11)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop3); + printProcsOnList(objOop11); } prevPrevObj1 = prevObj1; - prevObj1 = objOop3; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop3 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop3 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop3 = GIV(endOfMemory); - goto l10; + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop3 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l10: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -59473,92 +58759,84 @@ printAllStacks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots1 = byteAt(address + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop4 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { + while (oopisLessThan(objOop4, limit)) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(objOop4 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop4 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l5; + objOop4 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l5: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots2 = byteAt(address1 + 7); - objOop1 = (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop4 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { + while (oopisLessThan(objOop4, GIV(freeStart))) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots11 = byteAt(objOop4 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop4 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l6; + objOop4 = GIV(freeStart); + goto l22; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l6: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } } @@ -60059,7 +59337,7 @@ printFrame(char *theFP) assert(!(isFree(thePage))); if (startFrame == theFP) { frameAbove = null; - goto l4; + goto l3; } aFrame = startFrame; while (1) { @@ -60069,11 +59347,11 @@ printFrame(char *theFP) if (!(aFrame != 0)) break; if (theFP == aFrame) { frameAbove = prevFrame; - goto l4; + goto l3; } } frameAbove = null; - l4: /* end safeFindFrameAbove:on:startingFrom: */; + l3: /* end safeFindFrameAbove:on:startingFrom: */; theSP = (!(frameAbove == null) ? (assert(!(isBaseFrame(frameAbove))), (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord) @@ -60206,10 +59484,10 @@ printLikelyImplementorsOfSelector(sqInt selector) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -60237,28 +59515,23 @@ printLikelyImplementorsOfSelector(sqInt selector) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop11 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop12 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop11, limit)) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, limit)) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60286,7 +59559,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l31; + goto l30; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60297,23 +59570,23 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l31; + goto l30; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l31; + goto l30; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l31; + goto l30; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l31; + goto l30; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60329,38 +59602,38 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l31; + goto l30; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l31; + goto l30; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l31; + goto l30; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l31; + goto l30; } if (oop == GIV(nilObj)) { print("nil"); - goto l31; + goto l30; } if (oop == GIV(trueObj)) { print("true"); - goto l31; + goto l30; } if (oop == GIV(falseObj)) { print("false"); - goto l31; + goto l30; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l31; + goto l30; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60373,7 +59646,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l31; + goto l30; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60381,7 +59654,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l31; + goto l30; } } if ((nameLen == 9) @@ -60392,7 +59665,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l31; + goto l30; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60406,7 +59679,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l31; + goto l30; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60419,12 +59692,12 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l29; + goto l28; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l30; + goto l29; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60435,7 +59708,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l30: ; + l29: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60443,67 +59716,58 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l29: ; + l28: ; } - l31: /* end printOopShortInner: */; + l30: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop11 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop12 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop11 + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop12 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop11 = limit; - goto l17; + objOop12 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop11 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop11 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop12 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop11, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60531,7 +59795,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l34; + goto l33; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60542,23 +59806,23 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l34; + goto l33; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l34; + goto l33; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l34; + goto l33; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l34; + goto l33; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60574,38 +59838,38 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l34; + goto l33; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l34; + goto l33; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l34; + goto l33; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l34; + goto l33; } if (oop == GIV(nilObj)) { print("nil"); - goto l34; + goto l33; } if (oop == GIV(trueObj)) { print("true"); - goto l34; + goto l33; } if (oop == GIV(falseObj)) { print("false"); - goto l34; + goto l33; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l34; + goto l33; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60618,7 +59882,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l34; + goto l33; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60626,7 +59890,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l34; + goto l33; } } if ((nameLen == 9) @@ -60637,7 +59901,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l34; + goto l33; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60651,7 +59915,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l34; + goto l33; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60664,12 +59928,12 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l32; + goto l31; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l33; + goto l32; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60680,7 +59944,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l33: ; + l32: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60688,40 +59952,36 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l32: ; + l31: ; } - l34: /* end printOopShortInner: */; + l33: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop11 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop12 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop11 + BaseHeaderSize) + slotBytes1; + followingWordAddress1 = (objOop12 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop11 = GIV(freeStart); + objOop12 = GIV(freeStart); goto l23; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop11 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); l23: /* end objectAfter:limit: */; @@ -60729,27 +59989,22 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (isEnumerableObject(objOop12)) { - if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop12)) == selector)) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop12)), -/* begin fetchPointer:ofObject: */ -longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop12)), -/* begin fetchPointer:ofObject: */ -longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop11)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop12)); + printf("0x%lx", ((unsigned long) objOop11)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60777,7 +60032,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l37; + goto l36; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60788,23 +60043,23 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l37; + goto l36; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l37; + goto l36; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l37; + goto l36; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l37; + goto l36; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60820,38 +60075,38 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l37; + goto l36; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l37; + goto l36; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l37; + goto l36; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l37; + goto l36; } if (oop == GIV(nilObj)) { print("nil"); - goto l37; + goto l36; } if (oop == GIV(trueObj)) { print("true"); - goto l37; + goto l36; } if (oop == GIV(falseObj)) { print("false"); - goto l37; + goto l36; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l37; + goto l36; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60864,7 +60119,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l37; + goto l36; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60872,7 +60127,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l37; + goto l36; } } if ((nameLen == 9) @@ -60883,7 +60138,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l37; + goto l36; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60897,7 +60152,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l37; + goto l36; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60910,12 +60165,12 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l35; + goto l34; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l36; + goto l35; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60926,7 +60181,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l36: ; + l35: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60934,9 +60189,9 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l35: ; + l34: ; } - l37: /* end printOopShortInner: */; + l36: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } @@ -60944,34 +60199,30 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } prevPrevObj1 = prevObj1; - prevObj1 = objOop12; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop12 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l26; + objOop11 = GIV(endOfMemory); + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l26: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } } @@ -61150,13 +60401,9 @@ printNameOfClasscount(sqInt classOop, sqInt cnt) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if ((numSlots == GIV(metaclassNumSlots)) && (GIV(metaclassNumSlots) > GIV(thisClassIndex))) { printNameOfClasscount(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))), cnt - 1); @@ -61438,7 +60685,6 @@ printOop(sqInt oop) /* begin cr */ printf("\n")); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt > 5) { print(" nbytes "); @@ -61507,13 +60753,9 @@ printOop(sqInt oop) fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { lastIndex = numSlots; goto l3; @@ -61925,7 +61167,6 @@ printStringOf(sqInt oop) if (!(addressCouldBeObj(oop))) { return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt < (firstByteFormat())) { return; @@ -62316,21 +61557,21 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea sqInt oop; sqInt seed; sqInt swapBytes; - int w; + sqInt w; int w1; - sqInt w10; - sqInt w11; + unsigned short w10; + unsigned short w11; sqInt w12; sqInt w13; sqInt w14; - unsigned short w2; - unsigned short w3; - int w4; - unsigned short w5; - unsigned short w6; - sqInt w7; - sqInt w8; - sqInt w9; + sqInt w2; + sqInt w3; + sqInt w4; + sqInt w5; + int w6; + unsigned short w7; + unsigned short w8; + int w9; /* guess Metaclass instSize */ @@ -62343,69 +61584,69 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* record header start position */ headerStart = (sqImageFilePosition(f)) - 4; /* begin getWord32FromFile:swap: */ - w = 0; - sqImageFileRead((&w), sizeof(int), 1, f); + w1 = 0; + sqImageFileRead((&w1), sizeof(int), 1, f); headerSize = (swapBytes - ? SQ_SWAP_4_BYTES(w) - : w); + ? SQ_SWAP_4_BYTES(w1) + : w1); /* begin getLongFromFile:swap: */ - w8 = 0; - sqImageFileRead((&w8), sizeof(w8), 1, f); + w2 = 0; + sqImageFileRead((&w2), sizeof(w2), 1, f); dataSize = ((sqInt) ((swapBytes ? (/* begin byteSwapped: */ - SQ_SWAP_4_BYTES(w8)) - : w8))); + SQ_SWAP_4_BYTES(w2)) + : w2))); /* begin getLongFromFile:swap: */ - w9 = 0; - sqImageFileRead((&w9), sizeof(w9), 1, f); + w3 = 0; + sqImageFileRead((&w3), sizeof(w3), 1, f); if (swapBytes) { /* begin byteSwapped: */ - oldBaseAddr = SQ_SWAP_4_BYTES(w9); + oldBaseAddr = SQ_SWAP_4_BYTES(w3); } else { - oldBaseAddr = w9; + oldBaseAddr = w3; } /* begin specialObjectsOop: */ - w10 = 0; - sqImageFileRead((&w10), sizeof(w10), 1, f); + w13 = 0; + sqImageFileRead((&w13), sizeof(w13), 1, f); if (swapBytes) { /* begin byteSwapped: */ - anObject = SQ_SWAP_4_BYTES(w10); + anObject = SQ_SWAP_4_BYTES(w13); } else { - anObject = w10; + anObject = w13; } GIV(specialObjectsOop) = anObject; /* begin lastHash: */ - w11 = 0; - sqImageFileRead((&w11), sizeof(w11), 1, f); + w14 = 0; + sqImageFileRead((&w14), sizeof(w14), 1, f); if (swapBytes) { /* begin byteSwapped: */ - seed = SQ_SWAP_4_BYTES(w11); + seed = SQ_SWAP_4_BYTES(w14); } else { - seed = w11; + seed = w14; } GIV(lastHash) = seed; /* begin getLongFromFile:swap: */ - w12 = 0; - sqImageFileRead((&w12), sizeof(w12), 1, f); + w4 = 0; + sqImageFileRead((&w4), sizeof(w4), 1, f); if (swapBytes) { /* begin byteSwapped: */ - GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w12); + GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w4); } else { - GIV(savedWindowSize) = w12; + GIV(savedWindowSize) = w4; } /* begin getLongFromFile:swap: */ - w13 = 0; - sqImageFileRead((&w13), sizeof(w13), 1, f); + w5 = 0; + sqImageFileRead((&w5), sizeof(w5), 1, f); if (swapBytes) { /* begin byteSwapped: */ - headerFlags = SQ_SWAP_4_BYTES(w13); + headerFlags = SQ_SWAP_4_BYTES(w5); } else { - headerFlags = w13; + headerFlags = w5; } /* begin setImageHeaderFlagsFrom: */ @@ -62418,17 +61659,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(preemptionYields) = (headerFlags & 16) == 0; GIV(newFinalization) = (headerFlags & 64) != 0; /* begin getWord32FromFile:swap: */ - w1 = 0; - sqImageFileRead((&w1), sizeof(int), 1, f); + w6 = 0; + sqImageFileRead((&w6), sizeof(int), 1, f); extraVMMemory = (swapBytes - ? SQ_SWAP_4_BYTES(w1) - : w1); + ? SQ_SWAP_4_BYTES(w6) + : w6); /* begin getShortFromFile:swap: */ - w2 = 0; - sqImageFileRead((&w2), sizeof(unsigned short), 1, f); + w7 = 0; + sqImageFileRead((&w7), sizeof(unsigned short), 1, f); hdrNumStackPages = (swapBytes - ? ((((usqInt) w2) >> 8) & 0xFF) | (((int)((usqInt)((w2 & 0xFF)) << 8))) - : w2); + ? ((((usqInt) w7) >> 8) & 0xFF) | (((int)((usqInt)((w7 & 0xFF)) << 8))) + : w7); GIV(numStackPages) = (desiredNumStackPages != 0 ? desiredNumStackPages : (hdrNumStackPages == 0 @@ -62439,17 +61680,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea It is used for the cog code size in Cog. Preserve it to be polite to other VMs. */ desiredNumStackPages = hdrNumStackPages; /* begin getShortFromFile:swap: */ - w3 = 0; - sqImageFileRead((&w3), sizeof(unsigned short), 1, f); + w8 = 0; + sqImageFileRead((&w8), sizeof(unsigned short), 1, f); GIV(theUnknownShort) = (swapBytes - ? ((((usqInt) w3) >> 8) & 0xFF) | (((int)((usqInt)((w3 & 0xFF)) << 8))) - : w3); + ? ((((usqInt) w8) >> 8) & 0xFF) | (((int)((usqInt)((w8 & 0xFF)) << 8))) + : w8); /* begin getWord32FromFile:swap: */ - w4 = 0; - sqImageFileRead((&w4), sizeof(int), 1, f); + w9 = 0; + sqImageFileRead((&w9), sizeof(int), 1, f); hdrEdenBytes = (swapBytes - ? SQ_SWAP_4_BYTES(w4) - : w4); + ? SQ_SWAP_4_BYTES(w9) + : w9); /* begin edenBytes: */ bytes = (desiredEdenBytes != 0 ? desiredEdenBytes @@ -62459,45 +61700,45 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(edenBytes) = bytes; desiredEdenBytes = hdrEdenBytes; /* begin getShortFromFile:swap: */ - w5 = 0; - sqImageFileRead((&w5), sizeof(unsigned short), 1, f); + w10 = 0; + sqImageFileRead((&w10), sizeof(unsigned short), 1, f); hdrMaxExtSemTabSize = (swapBytes - ? ((((usqInt) w5) >> 8) & 0xFF) | (((int)((usqInt)((w5 & 0xFF)) << 8))) - : w5); + ? ((((usqInt) w10) >> 8) & 0xFF) | (((int)((usqInt)((w10 & 0xFF)) << 8))) + : w10); if (hdrMaxExtSemTabSize != 0) { /* begin setMaxExtSemSizeTo: */ GIV(maxExtSemTabSizeSet) = 1; ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize); } /* begin getShortFromFile:swap: */ - w6 = 0; - sqImageFileRead((&w6), sizeof(unsigned short), 1, f); + w11 = 0; + sqImageFileRead((&w11), sizeof(unsigned short), 1, f); GIV(the2ndUnknownShort) = (swapBytes - ? ((((usqInt) w6) >> 8) & 0xFF) | (((int)((usqInt)((w6 & 0xFF)) << 8))) - : w6); + ? ((((usqInt) w11) >> 8) & 0xFF) | (((int)((usqInt)((w11 & 0xFF)) << 8))) + : w11); /* begin getLongFromFile:swap: */ - w14 = 0; - sqImageFileRead((&w14), sizeof(w14), 1, f); + w12 = 0; + sqImageFileRead((&w12), sizeof(w12), 1, f); if (swapBytes) { /* begin byteSwapped: */ - firstSegSize = SQ_SWAP_4_BYTES(w14); + firstSegSize = SQ_SWAP_4_BYTES(w12); } else { - firstSegSize = w14; + firstSegSize = w12; } /* begin firstSegmentSize: */ GIV(firstSegmentSize) = firstSegSize; allocationReserve = interpreterAllocationReserveBytes(); minimumMemory = (dataSize + GIV(edenBytes)) + allocationReserve; /* begin getLongFromFile:swap: */ - w7 = 0; - sqImageFileRead((&w7), sizeof(w7), 1, f); + w = 0; + sqImageFileRead((&w), sizeof(w), 1, f); if (swapBytes) { /* begin byteSwapped: */ - freeOldSpaceInImage = SQ_SWAP_4_BYTES(w7); + freeOldSpaceInImage = SQ_SWAP_4_BYTES(w); } else { - freeOldSpaceInImage = w7; + freeOldSpaceInImage = w; } /* begin initialHeadroom:givenFreeOldSpaceInImage: */ headroom1 = (extraVMMemory == 0 @@ -62507,26 +61748,26 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea : extraVMMemory); if (freeOldSpaceInImage >= headroom1) { headroom = 0; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) { headroom = headroom1 / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) { headroom = headroom1 / 4; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) { headroom = (headroom1 * 3) / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= (headroom1 / 2)) { headroom = headroom1 / 2; - goto l1; + goto l2; } headroom = headroom1; -l1: /* end initialHeadroom:givenFreeOldSpaceInImage: */; +l2: /* end initialHeadroom:givenFreeOldSpaceInImage: */; /* begin roundUpHeapSize: */ heapSize1 = ((dataSize + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve ? 0 @@ -62600,13 +61841,9 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* begin numSlotsOf: */ assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classArrayClass + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(metaclassNumSlots) = longAt(classArrayClass - BaseHeaderSize); - } - else { - GIV(metaclassNumSlots) = numSlots; - } + GIV(metaclassNumSlots) = (numSlots == (numSlotsMask()) + ? longAt(classArrayClass - BaseHeaderSize) + : numSlots); /* default */ GIV(thisClassIndex) = 5; @@ -62664,7 +61901,6 @@ reestablishContextPriorToCallback(sqInt callbackContext) char *sp; char *theFP; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -62686,14 +61922,13 @@ reestablishContextPriorToCallback(sqInt callbackContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (isSingleContext(callbackContext)) { /* begin markContextAsDead: */ @@ -62975,6 +62210,7 @@ retryPrimitiveOnFailure(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -63052,7 +62288,6 @@ retryPrimitiveOnFailure(void) EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt aMethodObj; sqInt calloutMethodContext; sqInt index; sqInt senderOop; @@ -63060,7 +62295,6 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac char *sp; char *theFP; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -63082,14 +62316,13 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (isSingleContext(callbackMethodContext)) { /* begin markContextAsDead: */ @@ -63120,8 +62353,7 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac /* begin frameCallerFP: */ GIV(framePointer) = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP)); /* begin setMethod: */ - aMethodObj = longAt(GIV(framePointer) + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(GIV(framePointer) + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -63292,12 +62524,7 @@ safeMethodClassOf(sqInt methodPointer) sqInt referent1; /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ literal = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((literal & (tagMask())) == 0) @@ -63398,7 +62625,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) char *sp6; char *sp7; sqInt table; - char *theSP; /* begin fetchClassTagOfNonImm: */ obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); @@ -63501,11 +62727,11 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -63515,14 +62741,13 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin checkForStackOverflow */ if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { @@ -63570,7 +62795,6 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg char *sp6; char *sp7; sqInt table; - char *theSP; /* begin fetchClassTagOfNonImm: */ obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); @@ -63673,11 +62897,11 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -63687,14 +62911,13 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin checkForStackOverflow */ if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { @@ -64196,13 +63419,13 @@ signed64BitIntegerFor(sqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ /* begin storeLong64:ofObject:withValue: */ @@ -64258,7 +63481,7 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) oop = (oopForPointer(cPtr)) - BaseHeaderSize; if (!(((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)))) { + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; @@ -64269,13 +63492,9 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -64499,11 +63718,11 @@ snapshot(sqInt embedded) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l11; + goto l12; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l11: /* end getErrorObjectFromPrimFailCode */; + l12: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -64701,13 +63920,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent11 & (tagMask())) == 0) - && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent21 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent21 & (tagMask())) == 0) + && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj1 = referent11; + obj1 = referent21; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64730,13 +63949,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent21 & (tagMask())) == 0) - && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent31 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent31 & (tagMask())) == 0) + && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj2 = referent21; + obj2 = referent31; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64759,13 +63978,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj3)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent31 & (tagMask())) == 0) - && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent4 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent4 & (tagMask())) == 0) + && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj3 = referent31; + obj3 = referent4; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64788,13 +64007,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj4)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent5 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent5 & (tagMask())) == 0) + && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj4 = referent4; + obj4 = referent5; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64847,13 +64066,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent5 & (tagMask())) == 0) - && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj = referent5; + obj = referent11; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(xArray))); if ((assert(isNonImmediate(xArray)), @@ -64878,37 +64097,37 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileProcess))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileProcess) = referent1; + GIV(profileProcess) = referent3; } if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileMethod))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileMethod) = referent2; + GIV(profileMethod) = referent1; } if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileSemaphore))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileSemaphore) = referent3; + GIV(profileSemaphore) = referent2; } } } @@ -65223,12 +64442,7 @@ stackValue(sqInt offset) sqInt startPCOfMethod(sqInt aCompiledMethod) { - return (((assert((((assert(isCompiledMethod(aCompiledMethod)), -/* begin fetchPointer:ofObject: */ -longAt((aCompiledMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aCompiledMethod)), -/* begin fetchPointer:ofObject: */ -longAt((aCompiledMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + return ((literalCountOf(aCompiledMethod)) + LiteralStart) * BytesPerOop; } @@ -65259,56 +64473,51 @@ stObjectat(sqInt array, sqInt index) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -65317,17 +64526,17 @@ stObjectat(sqInt array, sqInt index) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -65391,7 +64600,7 @@ stObjectat(sqInt array, sqInt index) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -65437,56 +64646,51 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -65495,17 +64699,17 @@ stObjectatput(sqInt array, sqInt index, sqInt value) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -65537,37 +64741,37 @@ stObjectatput(sqInt array, sqInt index, sqInt value) } } longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((array + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -65575,7 +64779,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong64:ofObject:withValue: */ long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value); @@ -65583,7 +64787,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong32:ofObject:withValue: */ long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -65647,18 +64851,17 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) /* base frame, context in saved ip slot (or base of stack in Cog) */ longAt(theFP + FoxCallerContext); - goto l3; + goto l4; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); longAt(callerFP + FoxThisContext); - goto l6; + goto l4; } marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l6: /* end ensureFrameIsMarried:SP: */; -l3: /* end ensureCallerContext: */; +l4: /* end ensureCallerContext: */; /* begin stackPageFor: */ index = pageIndexForstackMemorybytesPerPage(theFP, GIV(stackMemory), GIV(bytesPerPage)); thePage = stackPageAtpages(index, GIV(pages)); @@ -65673,11 +64876,11 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l5; + goto l2; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l5: /* end newStackPage */; +l2: /* end newStackPage */; theMovedFP = moveFramesInthroughtoPage(thePage, theFP, newPage); if (onCurrentPage) { /* begin setStackPageAndLimit: */ @@ -65718,56 +64921,51 @@ stSizeOf(sqInt oop) /* begin baseHeader: */ hdr = long64At(oop); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l4; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l4; + goto l3; } totalLength = 0; -l4: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l6; + goto l4; } if (fmt < 2) { fixedFields = totalLength; - goto l6; + goto l4; } class = fetchClassOfNonImm(oop); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l6: /* end fixedFieldsOf:format:length: */; +l4: /* end fixedFieldsOf:format:length: */; if (fmt == (indexablePointersFormat())) { assert(!(isContextHeader(hdr))); } @@ -65906,7 +65104,6 @@ transferTo(sqInt newProc) char *sp; char *theFrame; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -65919,14 +65116,13 @@ transferTo(sqInt newProc) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin assertValidExecutionPointe:r:s: */ lip = GIV(instructionPointer) + 1; @@ -66005,11 +65201,11 @@ transferTo(sqInt newProc) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l11; + goto l12; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l11: /* end newStackPage */; + l12: /* end newStackPage */; moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage); /* begin markStackPageLeastMostRecentlyUsed: */ assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage))); @@ -66018,7 +65214,7 @@ transferTo(sqInt newProc) lastUsedPage = (lastUsedPage->nextPage); } if (((lastUsedPage->nextPage)) == newPage) { - goto l14; + goto l15; } (((newPage->prevPage))->nextPage = (newPage->nextPage)); (((newPage->nextPage))->prevPage = (newPage->prevPage)); @@ -66027,7 +65223,7 @@ transferTo(sqInt newProc) (newPage->nextPage = lastUsedPage); (lastUsedPage->prevPage = newPage); assert(pageListIsWellFormed()); - l14: /* end markStackPageLeastMostRecentlyUsed: */; + l15: /* end markStackPageLeastMostRecentlyUsed: */; } assert(((thePage->headFP)) == theFrame); } @@ -66069,12 +65265,7 @@ ultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(aMethodOop)) - 1; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -66196,12 +65387,8 @@ updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP) static sqInt NoDbgRegParms validInstructionPointerinFrame(usqInt anInstrPointer, char *fp) { - usqInt aMethod; - - /* begin validInstructionPointer:inMethod:framePointer: */ - aMethod = longAt(fp + FoxMethod); - return (anInstrPointer >= (((aMethod + (lastPointerOf(aMethod))) + BytesPerOop) - 1)) - && (anInstrPointer < (((aMethod + (numBytesOfBytes(aMethod))) + BaseHeaderSize) - 1)); + return (anInstrPointer >= ((((longAt(fp + FoxMethod)) + (lastPointerOf(longAt(fp + FoxMethod)))) + BytesPerOop) - 1)) + && (anInstrPointer < ((((longAt(fp + FoxMethod)) + (numBytesOfBytes(longAt(fp + FoxMethod)))) + BaseHeaderSize) - 1)); } @@ -66312,10 +65499,10 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -66338,14 +65525,13 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66360,42 +65546,37 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66410,32 +65591,28 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -66446,7 +65623,6 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66462,20 +65638,16 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -66512,20 +65684,18 @@ wakeHighestPriority(void) sqInt proc; sqInt processList; sqInt schedLists; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin fetchPointer:ofObject: */ objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); @@ -66535,13 +65705,9 @@ wakeHighestPriority(void) /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -66579,39 +65745,39 @@ whereIs(sqInt anOop) && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) { if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) { where = " is in eden"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) { where = " is in future space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) { where = " is in past space"; - goto l2; + goto l1; } where = " is in new space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) { if (!((segmentContainingObj(anOop)) == null)) { where = " is in old space"; - goto l2; + goto l1; } where = " is between old space segments"; - goto l2; + goto l1; } where = null; -l2: /* end whereIsMaybeHeapThing: */; +l1: /* end whereIsMaybeHeapThing: */; if (!(where == null)) { return where; } /* begin whereIsMaybeStackThing: */ if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackMemory), GIV(pages))) { where = " is in the stack zone"; - goto l1; + goto l2; } where = null; -l1: /* end whereIsMaybeStackThing: */; +l2: /* end whereIsMaybeStackThing: */; if (!(where == null)) { return where; } @@ -66663,7 +65829,6 @@ writeImageFileIO(void) } return null; } - /* begin imageSizeToWrite */ assert(newSpaceIsEmpty()); /* begin totalBytesInNonEmptySegments */ total = 0; @@ -66673,6 +65838,7 @@ writeImageFileIO(void) } } imageBytes = total; + headerStart = sqImageFileStartLocation(f, imageName, headerSize + imageBytes); /* Note: on Unix systems one could put an exec command here, padded to 512 bytes */; sqImageFileSeek(f, headerStart); @@ -66746,14 +65912,9 @@ cloneContext(sqInt aContext) /* begin numSlotsOf: */ assert((classIndexOf(aContext)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(aContext + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - sz = longAt(aContext - BaseHeaderSize); - } - else { - sz = numSlots; - } - /* begin eeInstantiateMethodContextSlots: */ + sz = (numSlots == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots); cloned = allocateNewSpaceSlotsformatclassIndex(sz, indexablePointersFormat(), ClassMethodContextCompactIndex); if (cloned != 0) { for (i = 0; i <= StackPointerIndex; i += 1) { @@ -66841,6 +66002,7 @@ fieldofFrame(sqInt index, char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *callerFP; sqInt frameNumArgs; + sqInt numArgs; switch (index) { @@ -66867,7 +66029,8 @@ fieldofFrame(sqInt index, char *theFP) case ClosureIndex: return ((byteAt((theFP + FoxFrameFlags) + 3)) != 0 ? (/* begin frameStackedReceiver:numArgs: */ - longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFP + FoxFrameFlags) + 1))) << (shiftForWord()))))))) + (numArgs = byteAt((theFP + FoxFrameFlags) + 1)), + longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))))))) : (/* begin nilObject */ GIV(nilObj))); @@ -66877,6 +66040,7 @@ fieldofFrame(sqInt index, char *theFP) default: assert((((index - CtxtTempFrameStart) >= 0) && ((index - CtxtTempFrameStart) <= (stackPointerIndexForFrame(theFP))))); + /* begin temporary:in: */ return ((index - CtxtTempFrameStart) < ((frameNumArgs = byteAt((theFP + FoxFrameFlags) + 1))) ? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord)) : longAt(((theFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord))); @@ -66945,7 +66109,6 @@ primitiveClone(void) static void primitiveClosureCopyWithCopiedValues(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt context; sqInt copiedValues; sqInt i; sqInt initialIP; @@ -66956,8 +66119,8 @@ primitiveClosureCopyWithCopiedValues(void) sqInt numArgs; usqInt numBytes; usqInt numCopied; - sqInt numSlots; - usqInt numSlots1; + usqInt numSlots; + sqInt numSlots1; sqInt objFormat; char *sp; sqInt valuePointer; @@ -66986,33 +66149,28 @@ primitiveClosureCopyWithCopiedValues(void) return; } /* begin closureIn:numArgs:instructionPointer:copiedValues: */ - context = longAt(GIV(stackPointer) + (2 * BytesPerWord)); initialIP = (GIV(instructionPointer) + 2) - (GIV(method) + BaseHeaderSize); copiedValues = longAt(GIV(stackPointer)); /* begin numSlotsOf: */ assert((classIndexOf(copiedValues)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(copiedValues + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numCopied = longAt(copiedValues - BaseHeaderSize); - } - else { - numCopied = numSlots1; - } + numSlots = byteAt(copiedValues + 7); + numCopied = (numSlots == (numSlotsMask()) + ? longAt(copiedValues - BaseHeaderSize) + : numSlots); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = indexablePointersFormat(); - numSlots = ClosureFirstCopiedValueIndex + numCopied; - assert((numSlots >= 0) + numSlots1 = ClosureFirstCopiedValueIndex + numCopied; + assert((numSlots1 >= 0) && (ClassBlockClosureCompactIndex != 0)); assert(((objFormat < (firstByteFormat()) ? objFormat : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - assert(numSlots < (numSlotsMask())); + assert(numSlots1 < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes = BaseHeaderSize + ((numSlots1 <= 1 ? 8 - : (numSlots + (numSlots & 1)) * BytesPerOop)); + : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -67024,17 +66182,17 @@ primitiveClosureCopyWithCopiedValues(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l7; + goto l6; } } - long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); + long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l6: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); - longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), longAt(GIV(stackPointer) + (2 * BytesPerWord))); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 1) | 1)); @@ -67099,7 +66257,6 @@ primitiveContextAt(void) char *spouseFP; sqInt stSize; sqInt stSize1; - char *theSP; sqInt totalLength; sqInt totalLength1; sqInt value; @@ -67123,56 +66280,51 @@ primitiveContextAt(void) /* might be an instance of a subclass */ /* begin stObject:at: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l33; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l33; + goto l24; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l33; + goto l24; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l33; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l33; + goto l24; } totalLength1 = 0; - l33: /* end lengthOf:format: */; + l24: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l20; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l20; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l27: /* end fixedFieldsOf:format:length: */; + l20: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -67181,23 +66333,23 @@ primitiveContextAt(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l23; + goto l21; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l23; + goto l21; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l23: /* end stackPointerForMaybeMarriedContext: */; + l21: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { value = noInlineTemporaryin(index - 1, frameOfMarriedContext(aContext)); - goto l37; + goto l31; } } else { @@ -67211,19 +66363,19 @@ primitiveContextAt(void) if (fmt1 <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord()))))); - goto l37; + goto l31; } if (fmt1 >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1))) << 1) | 1); - goto l37; + goto l31; } if (fmt1 >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))))))) << 1) | 1); - goto l37; + goto l31; } if (fmt1 == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))))); - goto l37; + goto l31; } /* begin positive32BitIntegerFor: */ @@ -67232,7 +66384,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { value = ((integerValue1 << 1) | 1); - goto l37; + goto l31; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -67255,13 +66407,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l35; + goto l30; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l35: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l30: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -67272,7 +66424,7 @@ primitiveContextAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger1; - goto l37; + goto l31; } /* begin primitiveFailFor: */ @@ -67281,7 +66433,7 @@ primitiveContextAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; value = 0; - l37: /* end stObject:at: */; + l31: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -67293,76 +66445,70 @@ primitiveContextAt(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l9; + goto l11; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l11; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l11; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l11; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l9; + goto l11; } totalLength = 0; - l9: /* end lengthOf:format: */; + l11: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l16; + goto l12; } if (fmt < 2) { fixedFields = totalLength; - goto l16; + goto l12; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l16: /* end fixedFieldsOf:format:length: */; + l12: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp3 & 1))) { stSize = 0; - goto l11; + goto l14; } assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); stSize = (sp3 >> 1); - l11: /* end fetchStackPointerOf: */; + l14: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -67372,19 +66518,19 @@ primitiveContextAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l12; + goto l19; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l12; + goto l19; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l12; + goto l19; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l12; + goto l19; } /* begin positive32BitIntegerFor: */ @@ -67393,7 +66539,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l22; + goto l19; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -67422,7 +66568,7 @@ primitiveContextAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l17: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l17: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -67433,10 +66579,9 @@ primitiveContextAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l22; + goto l19; - l22: /* end positive32BitIntegerFor: */; - l12: /* end subscript:with:format: */; + l19: /* end subscript:with:format: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp1; @@ -67452,6 +66597,7 @@ primitiveContextAt(void) GIV(primFailCode) = PrimErrBadIndex; return; } + /* begin temporary:in: */ value = ((index - 1) < ((frameNumArgs = byteAt((spouseFP + FoxFrameFlags) + 1))) ? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord)) : longAt(((spouseFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - (index - 1)) * BytesPerWord))); @@ -67498,7 +66644,6 @@ primitiveContextAtPut(void) char *spouseFP; sqInt stSize; sqInt stSize1; - char *theSP; sqInt totalLength; sqInt totalLength1; usqLong unsigned64BitValueToStore; @@ -67526,56 +66671,51 @@ primitiveContextAtPut(void) /* might be an instance of a subclass */ /* begin stObject:at:put: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l34; + goto l27; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l34; + goto l27; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l34; + goto l27; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l34; + goto l27; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l34; + goto l27; } totalLength1 = 0; - l34: /* end lengthOf:format: */; + l27: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l32; + goto l22; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l32; + goto l22; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l32: /* end fixedFieldsOf:format:length: */; + l22: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -67600,7 +66740,7 @@ primitiveContextAtPut(void) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(aContext), value); - goto l38; + goto l35; } } else { @@ -67627,37 +66767,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l26; + goto l34; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l26; + goto l34; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l26; + goto l34; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -67665,7 +66805,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l26; + goto l34; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -67673,7 +66813,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l26: /* end subscript:with:storing:format: */; + l34: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -67682,7 +66822,7 @@ primitiveContextAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } - l38: /* end stObject:at:put: */; + l35: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -67694,76 +66834,70 @@ primitiveContextAtPut(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l10; + goto l12; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l10; + goto l12; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l10; + goto l12; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l10; + goto l12; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l10; + goto l12; } totalLength = 0; - l10: /* end lengthOf:format: */; + l12: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l22; + goto l13; } if (fmt < 2) { fixedFields = totalLength; - goto l22; + goto l13; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l22: /* end fixedFieldsOf:format:length: */; + l13: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp3 & 1))) { stSize = 0; - goto l12; + goto l15; } assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); stSize = (sp3 >> 1); - l12: /* end fetchStackPointerOf: */; + l15: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -67786,37 +66920,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l17; + goto l21; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l17; + goto l21; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l17; + goto l21; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -67824,7 +66958,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l17; + goto l21; } unsignedValueToStore = positive32BitValueOf(value); @@ -67832,7 +66966,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l17: /* end subscript:with:storing:format: */; + l21: /* end subscript:with:storing:format: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp1; @@ -67848,6 +66982,7 @@ primitiveContextAtPut(void) GIV(primFailCode) = PrimErrBadIndex; return; } + /* begin temporary:in:put: */ if ((index - 1) < ((frameNumArgs = byteAt((spouseFP + FoxFrameFlags) + 1)))) { longAtput((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord), value); } @@ -67879,76 +67014,69 @@ primitiveContextSize(void) sqInt sp1; sqInt sp2; sqInt sz; - char *theSP; sqInt totalLength; /* begin stackTop */ rcvr = longAt(GIV(stackPointer)); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin stackPointerForMaybeMarriedContext: */ if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -67956,17 +67084,17 @@ primitiveContextSize(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); sz = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { sz = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); sz = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; } else { sz = totalLength - fixedFields; @@ -68060,6 +67188,7 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt argumentArray; usqInt arraySize; sqInt ccIndex; + sqInt classOop; sqInt firstBytecode; sqInt fmt; sqInt fmt1; @@ -68072,18 +67201,17 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt moduleLength; sqInt moduleName; sqInt nItems; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; + sqInt numSlots4; sqInt object; sqInt object1; sqInt object2; sqInt object3; sqInt object4; - sqInt objFormat; sqInt primRcvr; char *sp; char *sp1; @@ -68115,14 +67243,10 @@ primitiveDoNamedPrimitiveWithArgs(void) } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); - numSlots2 = byteAt(argumentArray + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots2; - } + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -2); @@ -68141,22 +67265,24 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin fetchPointer:ofObject: */ spec = longAt((methodArg + BaseHeaderSize) + (1U << (shiftForWord()))); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (spec & (tagMask())) { isArray = 0; - goto l24; + goto l22; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(spec))); /* begin classIndexOf: */ ccIndex = (longAt(spec)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex; - goto l24; + goto l22; -l24: /* end is:instanceOf:compactClassIndex: */; +l22: /* end is:instanceOf:compactClassIndex: */; if (!(isArray && (((numSlotsOf(spec)) == 4) && (((methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0)) == PrimNumberExternalCall)))) { /* begin primitiveFailFor: */ @@ -68187,38 +67313,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(moduleName + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots1 = byteAt(moduleName + 7); + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { - moduleLength = numSlots1; - goto l14; + moduleLength = numSlots2; + goto l18; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - moduleLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l14; + moduleLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l18; } if (fmt >= (firstShortFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l18; } if (fmt >= (firstLongFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l18; } if (fmt == (sixtyFourBitIndexableFormat())) { - moduleLength = ((usqInt) numSlots1) >> 1; - goto l14; + moduleLength = ((usqInt) numSlots2) >> 1; + goto l18; } moduleLength = 0; - l14: /* end lengthOf:format: */; + l18: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((spec + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -68235,38 +67357,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(functionName + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots3 = numSlots5; - } + numSlots11 = byteAt(functionName + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { functionLength = numSlots3; - goto l17; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ functionLength = (numSlots3 << (shiftForWord())) - (fmt1 & 7); - goto l17; + goto l24; } if (fmt1 >= (firstShortFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l17; + goto l24; } if (fmt1 >= (firstLongFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l17; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { functionLength = ((usqInt) numSlots3) >> 1; - goto l17; + goto l24; } functionLength = 0; -l17: /* end lengthOf:format: */; +l24: /* end lengthOf:format: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -3); @@ -68279,14 +67397,11 @@ primitiveDoNamedPrimitiveWithArgs(void) return; } /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; - numSlots = 5; - assert((numSlots >= 0) + numSlots4 = 5; + assert((numSlots4 >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots, objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots4, 2, ClassArrayCompactIndex); /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = (argumentArray = popStack()); assert(!(isOopForwarded(GIV(tempOop)))); @@ -68418,13 +67533,9 @@ primitiveDoPrimitiveWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -PrimErrLimitExceeded); @@ -68599,6 +67710,7 @@ primitiveExecuteMethod(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -68615,7 +67727,7 @@ primitiveExecuteMethod(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l17; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -68642,16 +67754,16 @@ primitiveExecuteMethod(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l17; } } /* begin activateNewMethod */ assert(isCompiledMethod(GIV(newMethod))); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15; + numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -68669,8 +67781,8 @@ primitiveExecuteMethod(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader2); - GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader1); + GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 ? 256 : 0); @@ -68691,16 +67803,16 @@ primitiveExecuteMethod(void) longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp; } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), -((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), +((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader2 & AlternateHeaderHasPrimFlag)) { + methodHeader1 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ GIV(instructionPointer) += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader2)) < 0 + if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader1)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -68710,21 +67822,21 @@ primitiveExecuteMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; } } - methodHeader1 = methodHeader2; + methodHeader2 = methodHeader1; if (GIV(stackPointer) < GIV(stackLimit)) { - handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader1)); + handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); } -l6: /* end executeNewMethod */; +l17: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -68821,6 +67933,7 @@ primitiveExecuteMethodArgsArray(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -68837,7 +67950,7 @@ primitiveExecuteMethodArgsArray(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l9; + goto l22; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -68864,16 +67977,16 @@ primitiveExecuteMethodArgsArray(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l9; + goto l22; } } /* begin activateNewMethod */ assert(isCompiledMethod(GIV(newMethod))); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15; + numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr1 = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -68891,8 +68004,8 @@ primitiveExecuteMethodArgsArray(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader2); - GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader1); + GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 ? 256 : 0); @@ -68913,16 +68026,16 @@ primitiveExecuteMethodArgsArray(void) longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp7; } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), -((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), +((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader2 & AlternateHeaderHasPrimFlag)) { + methodHeader1 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ GIV(instructionPointer) += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader2)) < 0 + if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader1)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -68932,21 +68045,21 @@ primitiveExecuteMethodArgsArray(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l18; + goto l16; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l18: /* end getErrorObjectFromPrimFailCode */; + l16: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; } } - methodHeader1 = methodHeader2; + methodHeader2 = methodHeader1; if (GIV(stackPointer) < GIV(stackLimit)) { - handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader1)); + handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); } -l9: /* end executeNewMethod */; +l22: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -68994,8 +68107,8 @@ primitiveExternalCall(void) sqInt moduleName; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt val; @@ -69006,12 +68119,7 @@ primitiveExternalCall(void) val = 0; if (!((((GIV(newMethod) & (tagMask())) == 0) && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) - && ((((assert((((assert(isCompiledMethod(GIV(newMethod))), -/* begin fetchPointer:ofObject: */ -longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), - ((((assert(isCompiledMethod(GIV(newMethod))), -/* begin fetchPointer:ofObject: */ -longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) > 0) + && (((literalCountOf(GIV(newMethod))) > 0) && (((lit = literalofMethod(0, GIV(newMethod))), (((lit & (tagMask())) == 0) && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) @@ -69081,38 +68189,34 @@ longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shi /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(moduleName + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(moduleName + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { moduleLength = numSlots; - goto l13; + goto l14; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ moduleLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l13; + goto l14; } if (fmt >= (firstShortFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l13; + goto l14; } if (fmt >= (firstLongFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l13; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { moduleLength = ((usqInt) numSlots) >> 1; - goto l13; + goto l14; } moduleLength = 0; - l13: /* end lengthOf:format: */; + l14: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((lit + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -69124,38 +68228,34 @@ longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shi /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(functionName + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(functionName + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - functionLength = numSlots1; - goto l14; + functionLength = numSlots2; + goto l17; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - functionLength = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l14; + functionLength = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l17; } if (fmt1 >= (firstShortFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l14; + functionLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l17; } if (fmt1 >= (firstLongFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l14; + functionLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l17; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - functionLength = ((usqInt) numSlots1) >> 1; - goto l14; + functionLength = ((usqInt) numSlots2) >> 1; + goto l17; } functionLength = 0; -l14: /* end lengthOf:format: */; +l17: /* end lengthOf:format: */; addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&accessorDepth)); if (addr == 0) { index = -1; @@ -69220,20 +68320,18 @@ primitiveFindHandlerContext(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt handlerOrNilOrZero; char *sp; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(199, longAt(GIV(stackPointer)), GIV(nilObj)); if (handlerOrNilOrZero == 0) { @@ -69269,7 +68367,6 @@ primitiveFindNextUnwindContext(void) char *theFPAbove; sqInt theMethod; char *theSP; - char *theSP1; /* begin stackTop */ stopContext = longAt(GIV(stackPointer)); @@ -69289,14 +68386,13 @@ primitiveFindNextUnwindContext(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((calleeContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(calleeContext)))) { @@ -69323,11 +68419,11 @@ primitiveFindNextUnwindContext(void) theMethod = longAt(theFP1 + FoxMethod); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { if (theFP1 == theFPAbove) { - theSP1 = findSPOfon(theFP1, stackPageFor(theFP1)); + theSP = findSPOfon(theFP1, stackPageFor(theFP1)); } else { assert(!(isBaseFrame(theFPAbove))); - theSP1 = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord; + theSP = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord; } /* begin ensureFrameIsMarried:SP: */ @@ -69336,7 +68432,7 @@ primitiveFindNextUnwindContext(void) handlerOrNilOrZero = longAt(theFP1 + FoxThisContext); goto l7; } - handlerOrNilOrZero = marryFrameSP(theFP1, theSP1); + handlerOrNilOrZero = marryFrameSP(theFP1, theSP); goto l7; } } @@ -69453,20 +68549,18 @@ primitiveFullGC(void) sqInt integerVal1; char *sp; char *sp1; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin pop:thenPushInteger: */ integerVal = ((sqInt) (fullGC())); @@ -69501,20 +68595,18 @@ primitiveIncrementalGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt integerVal; char *sp; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin scavengingGC */ scavengingGCTenuringIf(TenureByAge); @@ -69568,56 +68660,51 @@ primitiveInstVarAt(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l7; + goto l10; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l7; + goto l10; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l7; + goto l10; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l7; + goto l10; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l7; + goto l10; } totalLength = 0; -l7: /* end lengthOf:format: */; +l10: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l11; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l11; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l11: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -69633,19 +68720,19 @@ primitiveInstVarAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))); - goto l6; + goto l8; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l6; + goto l8; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))))))) << 1) | 1); - goto l6; + goto l8; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))))); - goto l6; + goto l8; } /* begin positive32BitIntegerFor: */ @@ -69654,7 +68741,7 @@ primitiveInstVarAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l15; + goto l8; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -69677,13 +68764,13 @@ primitiveInstVarAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l10; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -69694,10 +68781,9 @@ primitiveInstVarAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l15; + goto l8; - l15: /* end positive32BitIntegerFor: */; - l6: /* end subscript:with:format: */; + l8: /* end subscript:with:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -69745,7 +68831,8 @@ primitiveInstVarAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -69757,56 +68844,51 @@ primitiveInstVarAtPut(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l12; + goto l7; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l7; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l7; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l7; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l7; } totalLength = 0; -l12: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l8; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l8; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l15: /* end fixedFieldsOf:format:length: */; +l8: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -69835,37 +68917,37 @@ primitiveInstVarAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue); - goto l11; + goto l14; } if (fmt >= (firstByteFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index - 1), signedValueToStore); - goto l11; + goto l14; } if (fmt >= (firstShortFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), signedValueToStore); - goto l11; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(newValue); @@ -69873,7 +68955,7 @@ primitiveInstVarAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))), unsigned64BitValueToStore); } - goto l11; + goto l14; } unsignedValueToStore = positive32BitValueOf(newValue); @@ -69881,7 +68963,7 @@ primitiveInstVarAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))), unsignedValueToStore); } - l11: /* end subscript:with:storing:format: */; + l14: /* end subscript:with:storing:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue); @@ -70020,7 +69102,6 @@ primitiveObjectPointsTo(void) char *sp4; char *sp5; sqInt thang; - char *theSP; sqInt trueOrFalse; /* begin stackTop */ @@ -70035,7 +69116,6 @@ primitiveObjectPointsTo(void) } /* begin baseHeader: */ header = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)header) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -70045,14 +69125,13 @@ primitiveObjectPointsTo(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))) { @@ -70071,13 +69150,9 @@ primitiveObjectPointsTo(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); } } else { @@ -70184,7 +69259,7 @@ primitivePerform(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l4; + goto l13; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -70211,7 +69286,7 @@ primitivePerform(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l4; + goto l13; } } /* begin activateNewMethod */ @@ -70279,11 +69354,11 @@ primitivePerform(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l10; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l10: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -70293,7 +69368,7 @@ primitivePerform(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l4: /* end executeNewMethod */; +l13: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -70329,12 +69404,12 @@ primitivePin(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - if (((((usqInt) (longAt(obj))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0) { /* begin trueObject */ wasPinned = GIV(trueObj); if (boolean != wasPinned) { /* begin setIsPinnedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << 30))); + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (pinnedBitShift())))); } } else { @@ -70572,7 +69647,6 @@ primitiveSlotAt(void) char *sp2; char *sp3; char *sp4; - char *theSP; sqInt value; sqInt valueWord; @@ -70590,34 +69664,28 @@ primitiveSlotAt(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); numLiveSlots = (stackPointerForMaybeMarriedContext(rcvr)) + CtxtTempFrameStart; if ((((usqInt)index)) < numLiveSlots) { @@ -70663,8 +69731,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstShortFormat())) { - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPushInteger: */ integerVal1 = ((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1)))))); @@ -70677,8 +69744,7 @@ primitiveSlotAt(void) return; } if (fmt == (sixtyFourBitIndexableFormat())) { - /* begin num64BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 3)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ oop = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 3))))); @@ -70691,7 +69757,6 @@ primitiveSlotAt(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ @@ -70700,7 +69765,7 @@ primitiveSlotAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop1 = ((integerValue << 1) | 1); - goto l17; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -70723,13 +69788,13 @@ primitiveSlotAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l9; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -70740,9 +69805,9 @@ primitiveSlotAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop1 = newLargeInteger; - goto l17; + goto l11; - l17: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop1); GIV(stackPointer) = sp4; return; @@ -70802,8 +69867,9 @@ primitiveSlotAtPut(void) } # if IMMUTABILITY + /* begin isOopImmutable: */ badRcvr = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); # else /* IMMUTABILITY */ /* begin isImmediate: */ @@ -70816,20 +69882,15 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { externalInstVarofContextput(index, rcvr, newValue); @@ -70869,10 +69930,10 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = null; - goto l21; + goto l16; } value = value1; - goto l21; + goto l16; } if (newValue & (tagMask())) { /* begin primitiveFail */ @@ -70880,23 +69941,23 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(newValue))); /* begin classIndexOf: */ ccIndex = (longAt(newValue)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l20; + goto l15; -l20: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l15: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin numBytesOfBytes: */ fmt2 = (((usqInt) (longAt(newValue))) >> (formatShift())) & (formatMask()); @@ -70908,18 +69969,18 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((newValue + BaseHeaderSize) + (0U << 3)))); - goto l21; + goto l16; } else { value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((newValue + BaseHeaderSize) + (0U << 2)))))); - goto l21; + goto l16; } -l21: /* end positiveMachineIntegerValueOf: */; +l16: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { GIV(primFailCode) = PrimErrBadArgument; return; @@ -70957,8 +70018,7 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value); @@ -70972,7 +70032,6 @@ primitiveSlotAtPut(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin storeLong32:ofObject:withValue: */ @@ -71010,7 +70069,6 @@ primitiveStoreStackp(void) sqInt stackp; char *theFP; StackPage *thePage; - char *theSP; sqInt valuePointer; /* begin stackValue: */ @@ -71020,7 +70078,7 @@ primitiveStoreStackp(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { newStackp = (integerPointer >> 1); - goto l10; + goto l8; } else { /* begin primitiveFail */ @@ -71028,9 +70086,9 @@ primitiveStoreStackp(void) GIV(primFailCode) = 1; } newStackp = 0; - goto l10; + goto l8; } -l10: /* end stackIntegerValue: */; +l8: /* end stackIntegerValue: */; if (!((!GIV(primFailCode)) && (((newStackp >= 0) && (newStackp <= ((numSlotsOf(ctxt)) - CtxtTempFrameStart)))))) { /* begin primitiveFail */ @@ -71043,14 +70101,13 @@ primitiveStoreStackp(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(ctxt)))) { @@ -71084,11 +70141,11 @@ primitiveStoreStackp(void) sp = longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { stackp = 0; - goto l8; + goto l10; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(ctxt))); stackp = (sp >> 1); -l8: /* end fetchStackPointerOf: */; +l10: /* end fetchStackPointerOf: */; for (i = (stackp + 1); i <= newStackp; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = GIV(nilObj); @@ -71148,7 +70205,6 @@ primitiveTerminateTo(void) char *theFP; char *theFP1; StackPage *thePage; - char *theSP; sqInt thisCtx; sqInt valuePointer; sqInt valuePointer1; @@ -71180,14 +70236,13 @@ primitiveTerminateTo(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((aContextOrNil != GIV(nilObj)) && ((((longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -71221,18 +70276,18 @@ primitiveTerminateTo(void) fp = (pageToStopOn->headFP); if (fp == contextsFP) { frameAbove = 0; - goto l16; + goto l4; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == contextsFP) { frameAbove = fp; - goto l16; + goto l4; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l16: /* end findFrameAbove:inPage: */; + l4: /* end findFrameAbove:inPage: */; contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)))); assert(!(isBaseFrame(frameAbove))); newSP = (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord; @@ -71310,18 +70365,18 @@ primitiveTerminateTo(void) fp1 = (thePage->headFP); if (fp1 == theFP) { frameAbove = 0; - goto l25; + goto l16; } while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) { if (callerFP1 == theFP) { frameAbove = fp1; - goto l25; + goto l16; } fp1 = callerFP1; } error("did not find theFP in stack page"); frameAbove = 0; - l25: /* end findFrameAbove:inPage: */; + l16: /* end findFrameAbove:inPage: */; assert(frameAbove != 0); /* May cause a GC!! May also reclaim aContextOrNil's page, hence... */ @@ -71352,18 +70407,18 @@ primitiveTerminateTo(void) fp2 = (thePage->headFP); if (fp2 == contextsFP) { frameAbove = 0; - goto l26; + goto l17; } while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) { if (callerFP2 == contextsFP) { frameAbove = fp2; - goto l26; + goto l17; } fp2 = callerFP2; } error("did not find theFP in stack page"); frameAbove = 0; - l26: /* end findFrameAbove:inPage: */; + l17: /* end findFrameAbove:inPage: */; if (frameAbove != 0) { contextsSP = ((assert(!(isBaseFrame(frameAbove))), (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord)) - BytesPerWord; @@ -72346,11 +71401,11 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); if ((((usqInt)arg)) > 0x1F) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; - goto l79; + goto l70; } GIV(preemptionYields) = (arg & 4) == 0; GIV(newFinalization) = (arg & 16) != 0; - l79: /* end setCogVMFlags: */; + l70: /* end setCogVMFlags: */; } } if (index == 49) { @@ -72453,6 +71508,7 @@ pruneStackstackp(sqInt stack, sqInt stackp) char *theFP; char *theFPAbove; StackPage *thePage; + char *theSP; sqInt theStack; sqInt valuePointer; @@ -72498,27 +71554,29 @@ pruneStackstackp(sqInt stack, sqInt stackp) fp = (thePage->headFP); if (fp == theFP) { theFPAbove = 0; - goto l10; + goto l6; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { theFPAbove = fp; - goto l10; + goto l6; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l10: /* end findFrameAbove:inPage: */; + l6: /* end findFrameAbove:inPage: */; /* begin ensureFrameIsMarried:SP: */ + assert(!(isBaseFrame(theFPAbove))); + theSP = (theFPAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFPAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord; + if ((byteAt((theFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP))); objOrFP = longAt(theFP + FoxThisContext); - goto l11; + goto l7; } - objOrFP = marryFrameSP(theFP, (assert(!(isBaseFrame(theFPAbove))), - (theFPAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFPAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord)); - l11: /* end ensureFrameIsMarried:SP: */; + objOrFP = marryFrameSP(theFP, theSP); + l7: /* end ensureFrameIsMarried:SP: */; /* begin topRemappableOop */ theStack = GIV(remapBuffer)[GIV(remapBufferCount)]; /* begin storePointer:ofObject:withValue: */ @@ -72560,10 +71618,10 @@ unmarkAfterPathTo(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -72584,7 +71642,7 @@ unmarkAfterPathTo(void) assert((objOop1 % (allocationUnit())) == 0); if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; assert((long64At(objOop1)) != 0); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop1, 0); } @@ -72598,32 +71656,28 @@ unmarkAfterPathTo(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -72633,13 +71687,13 @@ unmarkAfterPathTo(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop, limit)) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -72653,41 +71707,37 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -72701,32 +71751,28 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } diff --git a/nsspurstacksrc/vm/interp.c b/nsspurstacksrc/vm/interp.c index f8a3c803c4..9440535559 100644 --- a/nsspurstacksrc/vm/interp.c +++ b/nsspurstacksrc/vm/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c from - StackInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf + StackInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.2041 uuid: 89811978-7175-44e6-86c2-bdc85c2e9ecf " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -269,6 +269,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define ReceiverIndex 5 #define RemapBufferSize 25 #define RememberedSetRootIndex 4099 +#define ScavengeInProgress 1 #define SchedulerAssociation 3 #define SelectorAboutToReturn 48 #define SelectorAttemptToAssign 50 @@ -282,6 +283,7 @@ invalidCompactClassError(char *s) { /* Print a (compact) class index error messa #define SelectorUnknownBytecode 57 #define SenderIndex 0 #define SistaVM 0 +#define SlidingCompactionInProgress 2 #define SmallContextSlots 22 #define SPURVM 1 #define SpecialSelectors 23 @@ -642,6 +644,8 @@ static void NeverInline computeRefCountToShrinkRT(void); static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner); static sqInt NoDbgRegParms copyAndForward(sqInt survivor); static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor); +static void fireEphemeronsInRememberedSet(void); +static void fireEphemeronsOnEphemeronList(void); static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList); static void growRememberedSet(void); static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop); @@ -694,7 +698,7 @@ extern void characterTable(void); extern usqInt characterValueOf(sqInt oop); extern sqInt checkedLongAt(sqInt byteAddress); static sqInt checkHeapFreeSpaceIntegrity(void); -static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); extern sqInt checkOkayOop(usqInt oop); extern sqInt checkOopHasOkayClass(usqInt obj); static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name); @@ -755,6 +759,7 @@ extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop); static sqInt findLargestFreeChunk(void); extern void findStringBeginningWith(char *aCString); extern void findString(char *aCString); +static void fireAllUnscannedEphemerons(void); static sqInt firstAccessibleObject(void); static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop); extern void * firstFixedField(sqInt objOop); @@ -857,7 +862,6 @@ static sqInt NoDbgRegParms isValidObjStack(sqInt objStack); static sqInt NoDbgRegParms isWeakFormat(sqInt format); static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop); extern sqInt isWeak(sqInt oop); -static sqInt NoDbgRegParms isWordsOrBytesNonImm(sqInt objOop); extern sqInt isWordsOrBytes(sqInt oop); extern sqInt isWords(sqInt oop); extern sqInt isYoungObject(sqInt objOop); @@ -886,13 +890,13 @@ static void NoDbgRegParms markAndTraceClassOf(sqInt objOop); static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents); extern void NeverInline markAndTrace(sqInt objOop); static sqInt markInactiveEphemerons(void); +static void NoDbgRegParms markLoopFrom(sqInt objOop); static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged); static void markWeaklingsAndMarkAndFireEphemerons(void); extern sqInt maybeSplObj(sqInt index); static sqInt NoDbgRegParms methodHeaderOf(sqInt methodObj); static sqInt newObjectHash(void); static sqInt newSpaceIsEmpty(void); -extern usqInt nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); extern sqInt nilObject(void); static void NeverInline nilUnmarkedWeaklingSlots(void); static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex); @@ -913,6 +917,7 @@ extern sqInt numStrongSlotsOfWeakling(sqInt objOop); extern sqInt objectAfter(sqInt objOop); extern sqInt objectBefore(sqInt objOop); static sqInt NoDbgRegParms objectStartingAt(sqInt address); +static sqInt NoDbgRegParms objectsReachableFromRoots(sqInt arrayOfRoots); extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop); static sqInt NoDbgRegParms okayOop(sqInt signedOop); static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); @@ -923,6 +928,7 @@ static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags); extern sqInt primitiveErrorTable(void); extern void printActivationsOf(sqInt aMethodObj); extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); extern void printForwarders(void); extern void printFreeChunks(void); extern void printFreeChunk(sqInt freeChunk); @@ -936,6 +942,7 @@ static void NoDbgRegParms printHeaderTypeOf(sqInt objOop); extern void printInstancesOf(sqInt aClassOop); extern void printInstancesWithClassIndex(sqInt classIndex); extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); extern void printMethodReferencesTo(sqInt anOop); extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); extern void printObjectsWithHash(sqInt hash); @@ -949,17 +956,15 @@ extern void pushRemappableOop(sqInt oop); static sqInt NoDbgRegParms pushonObjStack(sqInt objOop, sqInt objStack); static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray); extern sqInt rawHashBitsOf(sqInt objOop); -extern sqInt remapObj(sqInt objOop); extern sqInt removeGCRoot(sqInt *varLoc); static void NoDbgRegParms restoreObjectsInsavedHashes(sqInt objArray, sqInt savedHashes); static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes); static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes); -static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid); +static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion); static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd); static sqInt NoDbgRegParms shortentoIndexableSize(sqInt objOop, sqInt indexableSize); extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); -extern sqInt shouldRemapObj(sqInt objOop); extern sqInt shouldRemapOop(sqInt oop); static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack); extern sqInt slotSizeOf(sqInt oop); @@ -986,11 +991,15 @@ static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt pa static sqInt validObjStacks(void); extern sqInt vmEndianness(void); extern sqInt checkTraversableSortedFreeList(void); -static sqInt NeverInline compact(void); -static sqInt eliminateAndFreeForwardersForPigCompact(void); -static sqInt NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); +static void NeverInline compact(void); +static void eliminateAndFreeForwardersForPigCompact(void); +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); static sqInt NoDbgRegParms moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit); -static sqInt rebuildFreeListsForPigCompact(void); +static usqInt NoDbgRegParms nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); +extern void printSortedFreeList(void); +static void rebuildFreeListsForPigCompact(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit); static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount); static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift); @@ -1094,6 +1103,8 @@ static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt p static sqInt NoDbgRegParms findNewMethodInClassTag(sqInt classTagArg); extern sqInt findSelectorOfMethod(sqInt meth); static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage); +static void NoDbgRegParms fireEphemeron(sqInt ephemeron); +static void NoDbgRegParms fireFinalization(sqInt weakling); extern double floatArg(sqInt index); static sqInt NoDbgRegParms flushExternalPrimitiveOf(sqInt methodObj); static void flushMethodCache(void); @@ -1415,10 +1426,10 @@ _iss usqInt oldSpaceStart; _iss sqInt needGCFlag; _iss sqInt trueObj; _iss SpurSegmentInfo * segments; +_iss sqInt lkupClassTag; _iss sqInt falseObj; _iss sqInt hiddenRootsObj; _iss usqInt scavengeThreshold; -_iss sqInt lkupClassTag; _iss usqInt totalFreeOldSpace; _iss usqInt pastSpaceStart; _iss StackPage * pages; @@ -1433,18 +1444,18 @@ _iss sqInt bytesPerPage; _iss sqInt localAbsentReceiver; _iss usqInt freeListsMask; _iss StackPage * mostRecentlyUsedPage; +_iss usqInt firstFreeChunk; _iss sqInt remapBufferCount; _iss sqInt tempOop; _iss sqInt markStack; _iss SpurContiguousObjStack unscannedEphemerons; -_iss usqInt firstFreeChunk; +_iss sqInt weaklingStack; _iss sqInt lkupClass; _iss usqInt newSpaceStart; -_iss sqInt weaklingStack; _iss SpurNewSpaceSpace pastSpace; _iss sqInt profileProcess; -_iss sqInt numClassTablePages; _iss sqInt numStackPages; +_iss sqInt numClassTablePages; _iss sqInt profileMethod; _iss sqInt classTableIndex; _iss sqInt futureSurvivorStart; @@ -1453,11 +1464,11 @@ _iss sqLong nextProfileTick; _iss sqInt numRememberedEphemerons; _iss SpurNewSpaceSpace futureSpace; _iss sqInt jmpDepth; +_iss usqInt lastFreeChunk; _iss sqInt longRunningPrimitiveCheckMethod; _iss sqInt longRunningPrimitiveCheckSemaphore; _iss sqInt mournQueue; _iss sqInt profileSemaphore; -_iss usqInt lastFreeChunk; _iss SpurNewSpaceSpace eden; _iss char * objStackInvalidBecause; _iss sqInt tempOop2; @@ -1472,7 +1483,6 @@ _iss sqInt invalidObjStackPage; _iss sqInt previousRememberedSetSize; _iss sqInt tenureCriterion; _iss sqInt classNameIndex; -_iss sqInt pendingFinalizationSignals; _iss sqInt metaclassNumSlots; _iss sqInt numSegInfos; _iss sqInt preemptionYields; @@ -1481,20 +1491,23 @@ _iss sqInt highestRunnableProcessPriority; _iss usqLong longRunningPrimitiveStartUsecs; _iss usqLong longRunningPrimitiveStopUsecs; _iss sqInt methodDictLinearSearchLimit; -_iss sqInt newFinalization; -_iss sqInt rememberedSetLimit; _iss usqLong statCheckForEvents; _iss usqLong statGCEndUsecs; _iss sqInt weakList; _iss sqInt externalPrimitiveTableFirstFreeIndex; _iss sqInt marking; +_iss sqInt newFinalization; _iss sqInt statSurvivorCount; _iss sqInt thisClassIndex; _iss sqInt firstSegmentSize; +_iss sqInt gcPhaseInProgress; _iss usqLong gcStartUsecs; _iss usqInt lowSpaceThreshold; +_iss sqInt pendingFinalizationSignals; +_iss sqInt rememberedSetLimit; _iss sqInt shrinkThreshold; _iss usqLong statIOProcessEvents; +_iss sqInt sweepIndex; _iss sqInt edenBytes; _iss sqInt imageHeaderFlags; _iss sqInt lastHash; @@ -1502,7 +1515,6 @@ _iss sqInt lastMethodCacheProbeWrite; _iss sqInt longRunningPrimitiveCheckSequenceNumber; _iss usqInt memory; _iss sqInt numCompactionPasses; -_iss sqInt scavengeInProgress; _iss sqInt fullScreenFlag; _iss float heapGrowthToSizeGCRatio; _iss usqInt heapSizeAtPreviousGC; @@ -2189,7 +2201,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.2041"; +const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-rsf.2077"; volatile int sendTrace; sqInt suppressHeartbeatFlag; @@ -2223,15 +2235,20 @@ sqInt suppressHeartbeatFlag; #define firstLongFormat() 10 #define firstShortFormat() 12 #define fixedFieldsFieldWidth() 16 +#define formatFieldWidthShift() 5 #define formatMask() 0x1F #define formatShift() 24 #define freeStart() GIV(freeStart) +#define greyBitShift() 31 #define identityHashFullWordShift() 32 #define identityHashHalfWordMask() 0x3FFFFF +#define immutableBitShift() 23 #define indexablePointersFormat() 3 #define isForwardedObjectClassIndexPun() 8 #define isFreeObjectClassIndexPun() 0 #define lastClassIndexPun() 31 +#define markedBitFullShift() 55 +#define markedBitHalfShift() 23 #define maxOldSpaceSize() maxOldSpaceSize #define memory() GIV(memory) #define newSpaceLimit() GIV(newSpaceLimit) @@ -2239,6 +2256,7 @@ sqInt suppressHeartbeatFlag; #define numSlotsHalfShift() 24 #define numSlotsMask() 0xFF #define oldSpaceStart() GIV(oldSpaceStart) +#define pinnedBitShift() 30 #define remapBufferCount() GIV(remapBufferCount) #define rememberedBitShift() 29 #define rootTableCapacity() GIV(rememberedSetLimit) @@ -2291,6 +2309,7 @@ interpret(void) char * localIP; sqInt localReturnValue; char * localSP; + sqInt numExtB; sqInt stackPageBytes; usqIntptr_t stackPagesBytes; void *theStackMemory; @@ -2317,7 +2336,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* begin initExtensions */ - extA = (extB = 0); + extA = (numExtB = (extB = 0)); while (1) { bytecodeDispatchDebugHook(); @@ -4394,7 +4413,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -4441,6 +4460,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (0 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP)); } @@ -4461,6 +4481,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (1 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4481,6 +4502,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (2 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4501,6 +4523,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (3 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4521,6 +4544,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (4 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4541,6 +4565,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (5 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4561,6 +4586,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (6 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4581,6 +4607,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (7 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); } @@ -4706,7 +4733,6 @@ interpret(void) commonReturn: /* commonReturn */ { - sqInt aMethodObj; char *callerFP; sqInt closure; sqInt contextToReturnTo; @@ -4747,7 +4773,7 @@ interpret(void) frameToReturnTo = 0; if (!((byteAt((localFP + FoxFrameFlags) + 3)) != 0)) { goto commonCallerReturn; - goto l849; + goto l778; } closure = longAt(localFP + (frameStackedReceiverOffset(localFP))); @@ -4796,7 +4822,7 @@ interpret(void) if (((byteAt((theFP2 + FoxFrameFlags) + 2)) != 0) && (home == (longAt(theFP2 + FoxThisContext)))) { ctxtOrNilOrZero = 0; - goto l856; + goto l785; } if (!((byteAt((theFP2 + FoxFrameFlags) + 3)) != 0)) { theMethod1 = longAt(theFP2 + FoxMethod); @@ -4813,10 +4839,10 @@ interpret(void) if ((byteAt((theFP2 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP2))); ctxtOrNilOrZero = longAt(theFP2 + FoxThisContext); - goto l856; + goto l785; } ctxtOrNilOrZero = marryFrameSP(theFP2, theSP); - goto l856; + goto l785; } } theFPAbove = theFP2; @@ -4827,10 +4853,10 @@ interpret(void) && (((longAt(senderContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { /* begin nilObject */ ctxtOrNilOrZero = GIV(nilObj); - goto l856; + goto l785; } ctxtOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, home); - l856: /* end findMethodWithPrimitive:FromFP:UpToContext: */; + l785: /* end findMethodWithPrimitive:FromFP:UpToContext: */; assert(!((onSamePage && (ctxtOrNilOrZero == (nilObject()))))); if (ctxtOrNilOrZero == 0) { @@ -4838,21 +4864,21 @@ interpret(void) theMethod = longAt((home + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { unwindContextOrNilOrZero = home; - goto l876; + goto l805; } unwindContextOrNilOrZero = 0; - goto l876; + goto l805; } if (!(onSamePage || (ctxtOrNilOrZero == GIV(nilObj)))) { if ((findMethodWithPrimitiveFromContextUpToContext(0, ctxtOrNilOrZero, home)) == GIV(nilObj)) { /* begin nilObject */ unwindContextOrNilOrZero = GIV(nilObj); - goto l876; + goto l805; } } unwindContextOrNilOrZero = ctxtOrNilOrZero; - l876: /* end findUnwindThroughContext: */; + l805: /* end findUnwindThroughContext: */; if (unwindContextOrNilOrZero == GIV(nilObj)) { /* error: can't find home on chain; cannot return */ @@ -4860,10 +4886,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l862; + goto l806; } ourContext = marryFrameSP(localFP, localSP); - l862: /* end ensureFrameIsMarried:SP: */; + l806: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -4873,17 +4899,17 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l849; + goto l778; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext1 = longAt(localFP + FoxThisContext); - goto l853; + goto l788; } ourContext1 = marryFrameSP(localFP, localSP); - l853: /* end ensureFrameIsMarried:SP: */; + l788: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -4895,7 +4921,7 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; /* return self */ - goto l849; + goto l778; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { @@ -4932,30 +4958,30 @@ interpret(void) if (!(((contextToReturnTo & (tagMask())) == 0) && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { frameToReturnTo = 0; - goto l863; + goto l792; } if (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { if (isWidowedContext(contextToReturnTo)) { /* error: home's sender is dead; cannot return */ frameToReturnTo = 0; - goto l863; + goto l792; } /* begin frameOfMarriedContext: */ senderOop2 = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); assert((senderOop2 & 1)); frameToReturnTo = pointerForOop(senderOop2 - 1); - goto l863; + goto l792; } if (!(((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))) & 1))) { frameToReturnTo = 0; - goto l863; + goto l792; } thePage1 = makeBaseFrameFor(contextToReturnTo); markStackPageMostRecentlyUsed(thePage1); frameToReturnTo = (thePage1->baseFP); - l863: /* end establishFrameForContextToReturnTo: */; + l792: /* end establishFrameForContextToReturnTo: */; if (frameToReturnTo == 0) { /* error: home's sender is dead; cannot return */ @@ -4963,10 +4989,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext2 = longAt(localFP + FoxThisContext); - goto l855; + goto l807; } ourContext2 = marryFrameSP(localFP, localSP); - l855: /* end ensureFrameIsMarried:SP: */; + l807: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -4976,7 +5002,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l849; + goto l778; } } assert(pageListIsWellFormed()); @@ -5045,8 +5071,7 @@ interpret(void) (callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord)) - BytesPerWord; } /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5057,7 +5082,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l849: /* end case */; + l778: /* end case */; break; case 121: /* returnTrue */ @@ -5108,8 +5133,6 @@ interpret(void) commonCallerReturn: /* commonCallerReturn */ { - sqInt aMethodObj; - sqInt aMethodObj1; char *callerFP; char *callersFPOrNull; sqInt contextToReturnTo; @@ -5133,6 +5156,7 @@ interpret(void) assert(localFP == ((GIV(stackPage)->baseFP))); /* begin baseFrameReturn */ contextToReturnTo = longAt(localFP + FoxCallerContext); + /* begin isContext: */ isAContext = ((contextToReturnTo & (tagMask())) == 0) && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex); if (isAContext @@ -5159,18 +5183,18 @@ interpret(void) fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l886; + goto l819; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l886; + goto l819; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l886: /* end findFrameAbove:inPage: */; + l819: /* end findFrameAbove:inPage: */; moveFramesInthroughtoPage(thePage, frameAbove, GIV(stackPage)); theFP = (thePage->headFP); theSP = (thePage->headSP); @@ -5183,10 +5207,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l885; + goto l810; } ourContext = marryFrameSP(localFP, localSP); - l885: /* end ensureFrameIsMarried:SP: */; + l810: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -5196,7 +5220,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l890; + goto l816; } thePage = makeBaseFrameFor(contextToReturnTo); theFP = (thePage->headFP); @@ -5214,8 +5238,7 @@ interpret(void) localSP = theSP; localFP = theFP; /* begin setMethod: */ - aMethodObj1 = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj1; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5228,15 +5251,14 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); /* return self */ - l890: /* end baseFrameReturn */; - goto l880; + l816: /* end baseFrameReturn */; + goto l809; } localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); localSP = localFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((localFP + FoxFrameFlags) + 1))) << (shiftForWord()))))); localFP = callersFPOrNull; /* begin setMethod: */ - aMethodObj = longAt(localFP + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(localFP + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -5247,7 +5269,7 @@ interpret(void) longAtPointerput(localSP, localReturnValue); } - l880: /* end case */; + l809: /* end case */; break; case 126: case 127: @@ -5275,10 +5297,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l891; + goto l821; } ourContext = marryFrameSP(localFP, localSP); - l891: /* end ensureFrameIsMarried:SP: */; + l821: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -5310,7 +5332,7 @@ interpret(void) /* begin pushReceiverVariable: */ object = longAt(((longAt(localFP + FoxReceiver)) + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object); - goto l32; + goto l33; } if (variableType == 1) { /* begin pushTemporaryVariable: */ @@ -5318,7 +5340,7 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord))); longAtPointerput((localSP -= BytesPerOop), object1); - goto l32; + goto l33; } if (variableType == 2) { /* begin pushLiteralConstant: */ @@ -5327,7 +5349,7 @@ interpret(void) object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object2); - goto l32; + goto l33; } if (variableType == 3) { /* begin pushLiteralVariable: */ @@ -5347,10 +5369,10 @@ interpret(void) object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); longAtPointerput((localSP -= BytesPerOop), object3); - goto l32; + goto l33; } } - l32: /* end case */; + l33: /* end case */; break; case 129: /* extendedStoreBytecode */ @@ -5376,7 +5398,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5387,7 +5409,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l44; + goto l49; } # endif /* IMMUTABILITY */ @@ -5407,11 +5429,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l44: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l49: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l40; + goto l43; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5423,7 +5445,7 @@ interpret(void) else { longAtput(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l40; + goto l43; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5452,7 +5474,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5463,7 +5485,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l42; + goto l47; } # endif /* IMMUTABILITY */ @@ -5483,14 +5505,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l42: /* end storeLiteralVariable:withValue: */; + l47: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l40; + goto l43; } error("illegal store"); - l40: /* end extendedStoreBytecodePop: */; + l43: /* end extendedStoreBytecodePop: */; } break; case 130: @@ -5520,7 +5542,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(objOop)))); - if (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), objOop); /* begin internalPush: */ @@ -5531,7 +5553,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l56; + goto l61; } # endif /* IMMUTABILITY */ @@ -5551,11 +5573,11 @@ interpret(void) } } longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l56: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l61: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l52; + goto l55; } if (variableType == 1) { /* begin fetchNextBytecode */ @@ -5567,7 +5589,7 @@ interpret(void) else { longAtput(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); } - goto l52; + goto l55; } if (variableType == 3) { /* begin storeLiteralVariable:withValue: */ @@ -5596,7 +5618,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -5607,7 +5629,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l54; + goto l59; } # endif /* IMMUTABILITY */ @@ -5627,14 +5649,14 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l54: /* end storeLiteralVariable:withValue: */; + l59: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l52; + goto l55; } error("illegal store"); - l52: /* end extendedStoreBytecodePop: */; + l55: /* end extendedStoreBytecodePop: */; } break; case 131: @@ -5673,7 +5695,6 @@ interpret(void) /* commonSendOrdinary */ { sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -5686,16 +5707,12 @@ interpret(void) sqInt object; sqInt probe1; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; VM_LABEL(commonSendOrdinary); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOrdinary */ hash1 = GIV(messageSelector) ^ (((sqInt)((usqInt)(GIV(lkupClassTag)) << 2))); @@ -5705,7 +5722,7 @@ interpret(void) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } /* second probe */ @@ -5714,14 +5731,14 @@ interpret(void) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } probe1 = (((usqInt) hash1) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe1 + MethodCacheSelector]) == GIV(messageSelector)) && ((GIV(methodCache)[probe1 + MethodCacheClass]) == GIV(lkupClassTag))) { GIV(newMethod) = GIV(methodCache)[probe1 + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe1 + MethodCachePrimFunction])); - goto l905; + goto l836; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -5738,24 +5755,23 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } if (lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag))) { - goto l895; + goto l827; } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l908; + goto l832; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l908: /* end classAtIndex: */; + l832: /* end classForClassTag: */; lookupOrdinarySend(); /* begin internalizeIPandSP */ @@ -5763,8 +5779,8 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); - l905: ; - l895: /* end internalFindNewMethodOrdinary */; + l836: ; + l827: /* end internalFindNewMethodOrdinary */; /* begin internalExecuteNewMethod */ if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { @@ -5777,29 +5793,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l897; + goto l835; } if (localPrimIndex == 256) { - goto l897; + goto l835; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l897; + goto l835; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l897; + goto l835; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l897; + goto l835; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l897: /* end internalQuickPrimitiveResponse */; - goto l910; + goto l835; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -5835,7 +5850,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l910; + goto l835; } } /* begin internalActivateNewMethod */ @@ -5846,8 +5861,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -5871,7 +5886,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i = (GIV(argumentCount) + 1); i <= numTemps; i += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -5895,11 +5910,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l894; + goto l834; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l894: /* end getErrorObjectFromPrimFailCode */; + l834: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -5919,7 +5934,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l910: /* end internalExecuteNewMethod */; + l835: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -5938,7 +5953,7 @@ interpret(void) sqInt obj; sqInt obj1; sqInt object; - sqInt object1; + sqInt object11; sqInt object2; sqInt object3; int onCurrentPage; @@ -5962,7 +5977,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto normalSend; - goto l65; + goto l66; } if (opType == 1) { assert(GIV(method) == (iframeMethod(localFP))); @@ -5971,7 +5986,7 @@ interpret(void) GIV(argumentCount) = byte2 & 0x1F; goto superclassSend; - goto l65; + goto l66; } if (opType == 2) { /* begin fetchNextBytecode */ @@ -5986,8 +6001,8 @@ interpret(void) assert(isContext(obj)); if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { /* begin fetchPointer:ofObject: */ - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l74; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l85; } /* begin writeBackHeadFramePointers */ assert(GIV(stackPage) == (mostRecentlyUsedPage())); @@ -6002,8 +6017,8 @@ interpret(void) assert(pageListIsWellFormed()); if (isWidowedContext(obj)) { /* begin fetchPointer:ofObject: */ - object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - goto l74; + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l85; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -6016,39 +6031,39 @@ interpret(void) if (callerFP == 0) { /* base frame, context in saved ip slot (or base of stack in Cog) */ - object = longAt(spouseFP + FoxCallerContext); - goto l74; + object3 = longAt(spouseFP + FoxCallerContext); + goto l85; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); - object = longAt(callerFP + FoxThisContext); - goto l74; + object3 = longAt(callerFP + FoxThisContext); + goto l85; } - object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l74; + goto l85; } if (byte3 == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); - object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l74; + object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l85; } if (byte3 == InstructionPointerIndex) { - object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l74; + object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l85; } error("bad index"); - object = 0; - l74: /* end instVar:ofContext: */; - longAtPointerput((localSP -= BytesPerOop), object); + object3 = 0; + l85: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object3); } else { /* begin internalPush: */ - object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object1); + object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object11); } - goto l65; + goto l66; } if (opType == 3) { /* begin fetchNextBytecode */ @@ -6057,10 +6072,10 @@ interpret(void) /* begin pushLiteralConstant: */ assert(GIV(method) == (iframeMethod(localFP))); /* begin fetchPointer:ofObject: */ - object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object2); - goto l65; + longAtPointerput((localSP -= BytesPerOop), object); + goto l66; } if (opType == 4) { /* begin fetchNextBytecode */ @@ -6080,10 +6095,10 @@ interpret(void) litVar = unfollowatIndex(litVar, byte3); } /* begin internalPush: */ - object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - longAtPointerput((localSP -= BytesPerOop), object3); + object2 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object2); - goto l65; + goto l66; } top = longAtPointer(localSP); if (opType == 7) { @@ -6113,7 +6128,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar1)))); - if (((((usqInt) (longAt(litVar1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar1); /* begin internalPush: */ @@ -6124,7 +6139,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l72; + goto l92; } # endif /* IMMUTABILITY */ @@ -6144,11 +6159,11 @@ interpret(void) } } longAtput((litVar1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), top); - l72: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l92: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l65; + goto l66; } if (opType == 6) { /* begin internalPop: */ @@ -6192,7 +6207,7 @@ interpret(void) longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); if (byte3 == StackPointerIndex) { } - goto l86; + goto l82; } /* begin frameOfMarriedContext: */ senderOop1 = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -6213,7 +6228,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l86; + goto l82; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -6243,14 +6258,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l86: /* end instVar:ofContext:put: */; + l82: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj1)))); - if (((((usqInt) (longAt(obj1))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj1); /* begin internalPush: */ @@ -6261,7 +6276,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l79; + goto l86; } # endif /* IMMUTABILITY */ @@ -6281,13 +6296,13 @@ interpret(void) } } longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); - l79: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l86: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); } - l65: /* end case */; + l66: /* end case */; break; case 133: /* singleExtendedSuperBytecode */ @@ -6433,7 +6448,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -6452,12 +6466,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -6478,10 +6489,10 @@ interpret(void) goto l103; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l103: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l103: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -6525,15 +6536,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l110; + goto l109; } else { goto respondToUnknownBytecode; - goto l110; + goto l109; } } - l110: /* end case */; + l109: /* end case */; break; case 140: case 506: /*250*/ @@ -6570,7 +6581,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeRemoteTempLongBytecode); /* begin fetchByte */ @@ -6585,21 +6595,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); } break; case 142: @@ -6610,7 +6619,6 @@ interpret(void) sqInt remoteTempIndex; sqInt tempVector; sqInt tempVectorIndex; - sqInt valuePointer; VM_LABEL(storeAndPopRemoteTempLongBytecode); /* begin storeRemoteTempLongBytecode */ @@ -6625,21 +6633,20 @@ interpret(void) ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) : longAt(((localFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); /* begin storePointer:ofObject:withValue: */ - valuePointer = longAtPointer(localSP); assert(!(isForwarded(tempVector))); if ((assert(isNonImmediate(tempVector)), oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { /* most stores into young objects */ - if (((valuePointer & (tagMask())) == 0) - && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { remember(tempVector); } } } - longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), valuePointer); + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); /* begin internalPop: */ localSP += 1 * BytesPerOop; } @@ -6675,10 +6682,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l140; + goto l139; } context = marryFrameSP(localFP, localSP + (numCopied * BytesPerOop)); - l140: /* end ensureFrameIsMarried:SP: */; + l139: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -6706,13 +6713,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l134; + goto l130; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l134: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l130: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -6887,7 +6894,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l145; + goto l143; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6895,7 +6902,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l145: /* end jumplfFalseBy: */; + l143: /* end jumplfFalseBy: */; } break; case 160: @@ -6958,7 +6965,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l150; + goto l148; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -6966,7 +6973,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l150: /* end jumplfTrueBy: */; + l148: /* end jumplfTrueBy: */; } break; case 172: @@ -6995,7 +7002,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l154; + goto l152; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -7003,7 +7010,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l154: /* end jumplfFalseBy: */; + l152: /* end jumplfFalseBy: */; } break; case 176: @@ -7032,7 +7039,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l156; + goto l154; } } else { @@ -7045,43 +7052,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l163; + goto l159; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l157; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l159; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l157: /* end floatValueOf: */; - l163: /* end loadFloatOrIntFrom: */; + l159: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l158; + goto l155; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l161; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l155; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l161: /* end floatValueOf: */; - l158: /* end loadFloatOrIntFrom: */; + l155: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -7095,7 +7100,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l156; + goto l154; } } /* begin fetchPointer:ofObject: */ @@ -7104,7 +7109,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l156: /* end case */; + l154: /* end case */; break; case 177: /* bytecodePrimSubtract */ @@ -7132,7 +7137,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l165; + goto l161; } } else { @@ -7145,14 +7150,14 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l172; + goto l166; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; goto l166; } /* begin primitiveFail */ @@ -7160,28 +7165,26 @@ interpret(void) GIV(primFailCode) = 1; } rcvr1 = 0.0; - l166: /* end floatValueOf: */; - l172: /* end loadFloatOrIntFrom: */; + l166: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l167; + goto l162; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l170; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l162; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l170: /* end floatValueOf: */; - l167: /* end loadFloatOrIntFrom: */; + l162: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -7195,7 +7198,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l165; + goto l161; } } /* begin fetchPointer:ofObject: */ @@ -7204,7 +7207,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l165: /* end case */; + l161: /* end case */; break; case 178: /* bytecodePrimLessThan */ @@ -7234,14 +7237,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l174; + goto l168; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l177; + goto l170; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7249,19 +7252,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l179; + goto l170; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l179: /* end floatValueOf: */; - l177: /* end loadFloatOrIntFrom: */; + l170: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l181; + goto l173; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7269,15 +7271,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l175; + goto l173; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l175: /* end floatValueOf: */; - l181: /* end loadFloatOrIntFrom: */; + l173: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7287,7 +7288,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l174; + goto l168; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7295,7 +7296,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l174: /* end case */; + l168: /* end case */; booleanCheatTrue: /* booleanCheatTrue */ @@ -7317,7 +7318,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } if (bytecode == 172) { @@ -7326,7 +7327,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } if (bytecode > 167) { @@ -7336,7 +7337,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l921; + goto l849; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -7344,7 +7345,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l921: /* end case */; + l849: /* end case */; break; case 179: /* bytecodePrimGreaterThan */ @@ -7374,14 +7375,14 @@ interpret(void) else { /* goto booleanCheatFalse */ } - goto l182; + goto l174; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l185; + goto l176; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7389,19 +7390,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l187; + goto l176; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l187: /* end floatValueOf: */; - l185: /* end loadFloatOrIntFrom: */; + l176: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l189; + goto l179; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7409,15 +7409,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l183; + goto l179; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l183: /* end floatValueOf: */; - l189: /* end loadFloatOrIntFrom: */; + l179: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7427,7 +7426,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l182; + goto l174; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7435,7 +7434,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l182: /* end case */; + l174: /* end case */; booleanCheatFalse: /* booleanCheatFalse */ @@ -7457,7 +7456,7 @@ interpret(void) localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l924; + goto l852; } if (bytecode == 172) { @@ -7467,14 +7466,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l924; + goto l852; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l924: /* end case */; + l852: /* end case */; break; case 180: /* bytecodePrimLessOrEqual */ @@ -7504,14 +7503,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l190; + goto l180; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l193; + goto l182; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7519,19 +7518,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l195; + goto l182; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l195: /* end floatValueOf: */; - l193: /* end loadFloatOrIntFrom: */; + l182: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l197; + goto l185; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7539,15 +7537,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l191; + goto l185; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l191: /* end floatValueOf: */; - l197: /* end loadFloatOrIntFrom: */; + l185: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7557,7 +7554,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l190; + goto l180; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7565,7 +7562,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l190: /* end case */; + l180: /* end case */; break; case 181: /* bytecodePrimGreaterOrEqual */ @@ -7595,14 +7592,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l198; + goto l186; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l201; + goto l188; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7610,19 +7607,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l203; + goto l188; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l203: /* end floatValueOf: */; - l201: /* end loadFloatOrIntFrom: */; + l188: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l205; + goto l191; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7630,15 +7626,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l199; + goto l191; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l199: /* end floatValueOf: */; - l205: /* end loadFloatOrIntFrom: */; + l191: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7648,7 +7643,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l198; + goto l186; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7656,7 +7651,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l198: /* end case */; + l186: /* end case */; break; case 182: /* bytecodePrimEqual */ @@ -7683,14 +7678,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l206; + goto l192; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l209; + goto l194; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7698,19 +7693,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l211; + goto l194; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l211: /* end floatValueOf: */; - l209: /* end loadFloatOrIntFrom: */; + l194: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l213; + goto l197; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7718,15 +7712,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l207; + goto l197; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l207: /* end floatValueOf: */; - l213: /* end loadFloatOrIntFrom: */; + l197: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7736,7 +7729,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l206; + goto l192; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7744,7 +7737,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l206: /* end case */; + l192: /* end case */; break; case 183: /* bytecodePrimNotEqual */ @@ -7771,14 +7764,14 @@ interpret(void) else { goto booleanCheatFalse; } - goto l214; + goto l198; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l217; + goto l200; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -7786,19 +7779,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l219; + goto l200; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l219: /* end floatValueOf: */; - l217: /* end loadFloatOrIntFrom: */; + l200: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l221; + goto l203; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -7806,15 +7798,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l215; + goto l203; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l215: /* end floatValueOf: */; - l221: /* end loadFloatOrIntFrom: */; + l203: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheat: */ @@ -7824,7 +7815,7 @@ interpret(void) else { goto booleanCheatFalse; } - goto l214; + goto l198; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -7832,7 +7823,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l214: /* end case */; + l198: /* end case */; break; case 184: /* bytecodePrimMultiply */ @@ -7873,7 +7864,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l222; + goto l204; } } else { @@ -7886,43 +7877,41 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l229; + goto l209; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l223; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l209; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l223: /* end floatValueOf: */; - l229: /* end loadFloatOrIntFrom: */; + l209: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l224; + goto l205; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l227; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l205; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l227: /* end floatValueOf: */; - l224: /* end loadFloatOrIntFrom: */; + l205: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); @@ -7936,7 +7925,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l222; + goto l204; } } /* begin fetchPointer:ofObject: */ @@ -7945,7 +7934,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l222: /* end case */; + l204: /* end case */; break; case 185: /* bytecodePrimDivide */ @@ -7979,7 +7968,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l231; + goto l211; } } } @@ -7993,7 +7982,7 @@ interpret(void) /* begin primitiveFloatDivide:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l237; + goto l216; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -8001,19 +7990,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l233; + goto l216; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l233: /* end floatValueOf: */; - l237: /* end loadFloatOrIntFrom: */; + l216: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l236; + goto l212; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -8021,15 +8009,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l232; + goto l212; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l232: /* end floatValueOf: */; - l236: /* end loadFloatOrIntFrom: */; + l212: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -8051,7 +8038,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l231; + goto l211; } } /* begin fetchPointer:ofObject: */ @@ -8060,7 +8047,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l231: /* end case */; + l211: /* end case */; break; case 186: /* bytecodePrimMod */ @@ -8078,7 +8065,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l240; + goto l218; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8086,7 +8073,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l240: /* end case */; + l218: /* end case */; break; case 187: /* bytecodePrimMakePoint */ @@ -8109,7 +8096,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l244; + goto l222; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8117,7 +8104,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l244: /* end case */; + l222: /* end case */; break; case 188: /* bytecodePrimBitShift */ @@ -8147,7 +8134,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -8161,7 +8148,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -8169,7 +8156,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } } else { @@ -8180,7 +8167,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l250; + goto l233; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -8189,7 +8176,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l258; + goto l234; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8212,13 +8199,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l256; + goto l228; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l256: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l228: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8229,15 +8216,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l258; + goto l234; - l258: /* end positive32BitIntegerFor: */; + l234: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l250: /* end primitiveBitShift */; + l233: /* end primitiveBitShift */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -8246,7 +8233,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l248; + goto l226; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8254,7 +8241,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l248: /* end case */; + l226: /* end case */; break; case 189: /* bytecodePrimDiv */ @@ -8272,7 +8259,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l259; + goto l236; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8280,7 +8267,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l259: /* end case */; + l236: /* end case */; break; case 190: /* bytecodePrimBitAnd */ @@ -8299,7 +8286,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l263; + goto l240; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8316,7 +8303,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l263; + goto l240; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8324,7 +8311,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l263: /* end case */; + l240: /* end case */; break; case 191: /* bytecodePrimBitOr */ @@ -8343,7 +8330,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l268; + goto l245; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8360,7 +8347,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l268; + goto l245; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -8368,7 +8355,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l268: /* end case */; + l245: /* end case */; break; case 192: /* bytecodePrimAt */ @@ -8389,10 +8376,10 @@ interpret(void) sqInt newLargeInteger; usqInt newObj; usqInt numBytes; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objFormat; sqInt objOop; sqInt objOop1; @@ -8423,21 +8410,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l273; + goto l250; } if (primitiveFunctionPointer == primitiveAt) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l288; + goto l265; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -8445,62 +8433,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l288; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l265; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l293; + totalLength = numSlots2; + goto l262; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l293; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l262; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l293; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l262; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l293; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l262; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l293; + totalLength = ((usqInt) numSlots2) >> 1; + goto l262; } totalLength = 0; - l293: /* end lengthOf:format: */; + l262: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l310; + goto l258; } if (fmt < 2) { fixedFields = totalLength; - goto l310; + goto l258; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l310: /* end fixedFieldsOf:format:length: */; + l258: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l288: /* end install:inAtCache:at:string: */; + l265: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAt) { @@ -8508,48 +8492,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l279; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l260; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l301; + totalLength1 = numSlots3; + goto l275; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l301; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l275; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l301; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l275; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l301; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l275; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l301; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l275; } totalLength1 = 0; - l301: /* end lengthOf:format: */; + l275: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -8559,12 +8540,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l279: /* end install:inAtCache:at:string: */; + l260: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l273; + goto l250; } } } @@ -8580,18 +8561,18 @@ interpret(void) fixedFields2 = GIV(atCache)[atIx + AtCacheFixedFields]; /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord()))))); - goto l283; + goto l274; } if (fmt2 < (firstByteFormat())) { /* 64, 32, & 16 bits */ if (fmt2 >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))))))) << 1) | 1); - goto l283; + goto l274; } if (fmt2 == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))))); - goto l283; + goto l274; } /* begin fetchLong32:ofObject: */ @@ -8601,7 +8582,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) result1)) <= (MaxSmallInteger)) { result = ((result1 << 1) | 1); - goto l312; + goto l274; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -8624,13 +8605,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l281; + goto l280; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l281: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l280: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -8641,10 +8622,8 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l312; + goto l274; - l312: /* end positive32BitIntegerFor: */; - goto l283; } if (fmt2 >= 32) { @@ -8665,16 +8644,16 @@ interpret(void) /* begin fetchByte:ofObject: */ result1 = byteAt((rcvr + BaseHeaderSize) + (index1 - 1)); } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (result1 << (numTagBits())) + (characterTag()); - goto l283; + goto l274; } else { if ((fmt2 < (firstCompiledMethodFormat())) || (index1 >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index1 - 1))) << 1) | 1); - goto l283; + goto l274; } } } @@ -8683,7 +8662,7 @@ interpret(void) ? PrimErrBadIndex : PrimErrBadReceiver); result = (GIV(primFailCode) = reasonCode); - l283: /* end commonVariable:at:cacheIndex: */; + l274: /* end commonVariable:at:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -8691,7 +8670,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (2 - 1) * BytesPerOop), result); - goto l273; + goto l250; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -8702,7 +8681,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l273: /* end case */; + l250: /* end case */; break; case 193: /* bytecodePrimAtPut */ @@ -8722,10 +8701,10 @@ interpret(void) sqInt index; sqInt index1; sqInt isCharacter; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objOop; sqInt objOop1; sqInt rcvr; @@ -8743,8 +8722,9 @@ interpret(void) rcvr = longAtPointer(localSP + (2 * BytesPerOop)); # if IMMUTABILITY + /* begin isOopMutable: */ correctRcvr = ((rcvr & (tagMask())) == 0) - && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)); # else /* IMMUTABILITY */ /* begin isNonImmediate: */ @@ -8766,21 +8746,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l313; + goto l282; } if (primitiveFunctionPointer == primitiveAtPut) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l319; + goto l290; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -8788,62 +8769,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l319; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l290; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l343; + totalLength = numSlots2; + goto l300; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l343; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l300; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l343; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l300; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l343; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l300; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l343; + totalLength = ((usqInt) numSlots2) >> 1; + goto l300; } totalLength = 0; - l343: /* end lengthOf:format: */; + l300: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l345; + goto l289; } if (fmt < 2) { fixedFields = totalLength; - goto l345; + goto l289; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l345: /* end fixedFieldsOf:format:length: */; + l289: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l319: /* end install:inAtCache:at:string: */; + l290: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAtPut) { @@ -8851,48 +8828,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l314; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l285; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l333; + totalLength1 = numSlots3; + goto l291; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l333; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l291; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l333; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l291; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l333; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l291; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l333; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l291; } totalLength1 = 0; - l333: /* end lengthOf:format: */; + l291: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -8902,12 +8876,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l314: /* end install:inAtCache:at:string: */; + l285: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l313; + goto l282; } } } @@ -8936,7 +8910,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord())))), value); - goto l318; + goto l292; } if (fmt2 < (firstByteFormat())) { @@ -8949,33 +8923,33 @@ interpret(void) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l318; + goto l292; } if (fmt2 == (sixtyFourBitIndexableFormat())) { val64ToPut = positive64BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))), val64ToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } valToPut = positive32BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } if (fmt2 >= 32) { @@ -8985,7 +8959,7 @@ interpret(void) if (!isCharacter) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin characterValueOf: */ valToPut = ((usqInt) (((usqInt)value))) >> (numTagBits()); @@ -8995,18 +8969,18 @@ interpret(void) assert(fmt2 != ((sixtyFourBitIndexableFormat()) + (firstStringyFakeFormat()))); /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l318; + goto l292; } else { if (!((valToPut >= 0) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l318; + goto l292; } } @@ -9016,7 +8990,7 @@ interpret(void) && (index1 < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; - goto l318; + goto l292; } valToPut = ((value & 1) ? (value >> 1) @@ -9026,18 +9000,18 @@ interpret(void) && (valToPut <= 0xFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l318; + goto l292; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index1 - 1), valToPut); - goto l318; + goto l292; } /* begin primitiveFailFor: */ reasonCode = (isIndexable(rcvr) ? PrimErrBadIndex : PrimErrBadReceiver); GIV(primFailCode) = reasonCode; - l318: /* end commonVariable:at:put:cacheIndex: */; + l292: /* end commonVariable:at:put:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -9045,7 +9019,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (3 - 1) * BytesPerOop), value); - goto l313; + goto l282; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -9056,21 +9030,23 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; } - l313: /* end case */; + l282: /* end case */; break; case 194: /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -9083,114 +9059,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l352; + goto l320; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l352; + goto l320; - l352: /* end is:instanceOf:compactClassIndex: */; + l320: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l350; + goto l322; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l350; + goto l322; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l350; + goto l322; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l350; + goto l322; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l350; + goto l322; } sz = 0; - l350: /* end lengthOf:format: */; + l322: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l347; + goto l311; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l355; + goto l323; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l355; + goto l323; - l355: /* end is:instanceOf:compactClassIndex: */; + l323: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l358; + sz = numSlots2; + goto l321; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l358; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l321; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l358; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l321; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l358; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l321; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l358; + sz = ((usqInt) numSlots2) >> 1; + goto l321; } sz = 0; - l358: /* end lengthOf:format: */; + l321: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l347; + goto l311; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -9198,7 +9168,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l347: /* end case */; + l311: /* end case */; break; case 195: case 355: /*99*/ @@ -9322,6 +9292,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9330,18 +9301,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l372; + goto l334; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l372; + goto l334; - l372: /* end is:instanceOf:compactClassIndex: */; + l334: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -9358,7 +9330,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l368; + goto l332; } GIV(primFailCode) = 0; } @@ -9367,12 +9339,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l368: /* end case */; + l332: /* end case */; break; case 202: /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -9381,18 +9354,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l378; + goto l340; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l378; + goto l340; - l378: /* end is:instanceOf:compactClassIndex: */; + l340: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -9409,7 +9383,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l374; + goto l338; } GIV(primFailCode) = 0; } @@ -9418,7 +9392,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l374: /* end case */; + l338: /* end case */; break; case 203: case 363: /*107*/ @@ -9479,9 +9453,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9497,7 +9471,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l386; + goto l350; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9506,7 +9480,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l386: /* end case */; + l350: /* end case */; break; case 207: /* bytecodePrimPointY */ @@ -9525,9 +9499,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -9543,7 +9517,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l393; + goto l358; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -9552,7 +9526,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l393: /* end case */; + l358: /* end case */; break; case 208: case 209: @@ -9731,7 +9705,7 @@ interpret(void) case 0: /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); - goto l416; + goto l382; break; case 1: @@ -9749,10 +9723,10 @@ interpret(void) if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l420; + goto l384; } context = marryFrameSP(localFP, localSP); - l420: /* end ensureFrameIsMarried:SP: */; + l384: /* end ensureFrameIsMarried:SP: */; thing = context; break; @@ -9765,10 +9739,11 @@ interpret(void) } extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), thing); } - l416: /* end case */; + l382: /* end case */; break; case 336: /*80*/ /* bytecodePrimAdd */ @@ -9796,7 +9771,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l424; + goto l390; } } else { @@ -9809,43 +9784,41 @@ interpret(void) /* begin primitiveFloatAdd:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l431; + goto l395; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l425; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l395; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l425: /* end floatValueOf: */; - l431: /* end loadFloatOrIntFrom: */; + l395: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l426; + goto l391; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l429; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l391; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l429: /* end floatValueOf: */; - l426: /* end loadFloatOrIntFrom: */; + l391: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); @@ -9859,7 +9832,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l424; + goto l390; } } /* begin fetchPointer:ofObject: */ @@ -9868,7 +9841,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l424: /* end case */; + l390: /* end case */; break; case 337: /*81*/ /* bytecodePrimSubtract */ @@ -9896,7 +9869,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l433; + goto l397; } } else { @@ -9909,43 +9882,41 @@ interpret(void) /* begin primitiveFloatSubtract:fromArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l440; + goto l402; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l434; + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l402; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l434: /* end floatValueOf: */; - l440: /* end loadFloatOrIntFrom: */; + l402: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l435; + goto l398; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l438; + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l398; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l438: /* end floatValueOf: */; - l435: /* end loadFloatOrIntFrom: */; + l398: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); @@ -9959,7 +9930,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l433; + goto l397; } } /* begin fetchPointer:ofObject: */ @@ -9968,7 +9939,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l433: /* end case */; + l397: /* end case */; break; case 338: /*82*/ /* bytecodePrimLessThanV4 */ @@ -9998,14 +9969,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l442; + goto l404; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLess:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l445; + goto l406; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10013,19 +9984,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l447; + goto l406; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l447: /* end floatValueOf: */; - l445: /* end loadFloatOrIntFrom: */; + l406: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l449; + goto l409; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10033,15 +10003,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l443; + goto l409; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l443: /* end floatValueOf: */; - l449: /* end loadFloatOrIntFrom: */; + l409: /* end loadFloatOrIntFrom: */; aBool = rcvr1 < arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10051,7 +10020,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l442; + goto l404; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10059,7 +10028,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l442: /* end case */; + l404: /* end case */; booleanCheatTrueV4: /* booleanCheatTrueV4 */ @@ -10080,7 +10049,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } if (bytecode == 244) { @@ -10089,7 +10058,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } if (bytecode == 243) { @@ -10099,7 +10068,7 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l925; + goto l853; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -10107,7 +10076,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l925: /* end case */; + l853: /* end case */; break; case 339: /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -10137,14 +10106,14 @@ interpret(void) else { /* goto booleanCheatFalseV4 */ } - goto l450; + goto l410; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreater:thanArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l453; + goto l412; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10152,19 +10121,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l455; + goto l412; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l455: /* end floatValueOf: */; - l453: /* end loadFloatOrIntFrom: */; + l412: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l457; + goto l415; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10172,15 +10140,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l451; + goto l415; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l451: /* end floatValueOf: */; - l457: /* end loadFloatOrIntFrom: */; + l415: /* end loadFloatOrIntFrom: */; aBool = rcvr1 > arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10190,7 +10157,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l450; + goto l410; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10198,7 +10165,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l450: /* end case */; + l410: /* end case */; booleanCheatFalseV4: /* booleanCheatFalseV4 */ @@ -10220,7 +10187,7 @@ interpret(void) localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l928; + goto l856; } if (bytecode == 244) { @@ -10230,14 +10197,14 @@ interpret(void) localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); - goto l928; + goto l856; } currentBytecode = bytecode + GIV(bytecodeSetSelector); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l928: /* end case */; + l856: /* end case */; break; case 340: /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -10267,14 +10234,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l458; + goto l416; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatLessOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l461; + goto l418; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10282,19 +10249,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l463; + goto l418; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l463: /* end floatValueOf: */; - l461: /* end loadFloatOrIntFrom: */; + l418: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l465; + goto l421; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10302,15 +10268,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l459; + goto l421; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l459: /* end floatValueOf: */; - l465: /* end loadFloatOrIntFrom: */; + l421: /* end loadFloatOrIntFrom: */; aBool = rcvr1 <= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10320,7 +10285,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l458; + goto l416; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10328,7 +10293,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l458: /* end case */; + l416: /* end case */; break; case 341: /*85*/ /* bytecodePrimGreaterOrEqualV4 */ @@ -10358,14 +10323,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l466; + goto l422; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatGreaterOrEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l469; + goto l424; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10373,19 +10338,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l471; + goto l424; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l471: /* end floatValueOf: */; - l469: /* end loadFloatOrIntFrom: */; + l424: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l473; + goto l427; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10393,15 +10357,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l467; + goto l427; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l467: /* end floatValueOf: */; - l473: /* end loadFloatOrIntFrom: */; + l427: /* end loadFloatOrIntFrom: */; aBool = rcvr1 >= arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10411,7 +10374,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l466; + goto l422; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10419,7 +10382,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l466: /* end case */; + l422: /* end case */; break; case 342: /*86*/ /* bytecodePrimEqualV4 */ @@ -10446,14 +10409,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l474; + goto l428; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l477; + goto l430; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10461,19 +10424,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l479; + goto l430; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l479: /* end floatValueOf: */; - l477: /* end loadFloatOrIntFrom: */; + l430: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l481; + goto l433; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10481,15 +10443,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l475; + goto l433; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l475: /* end floatValueOf: */; - l481: /* end loadFloatOrIntFrom: */; + l433: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10499,7 +10460,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l474; + goto l428; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10507,7 +10468,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l474: /* end case */; + l428: /* end case */; break; case 343: /*87*/ /* bytecodePrimNotEqualV4 */ @@ -10534,14 +10495,14 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l482; + goto l434; } /* begin initPrimCall */ GIV(primFailCode) = 0; /* begin primitiveFloatEqual:toArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l485; + goto l436; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10549,19 +10510,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result); rcvr1 = result; - goto l487; + goto l436; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l487: /* end floatValueOf: */; - l485: /* end loadFloatOrIntFrom: */; + l436: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l489; + goto l439; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10569,15 +10529,14 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l483; + goto l439; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l483: /* end floatValueOf: */; - l489: /* end loadFloatOrIntFrom: */; + l439: /* end loadFloatOrIntFrom: */; aBool = rcvr1 == arg1; if (!GIV(primFailCode)) { /* begin booleanCheatV4: */ @@ -10587,7 +10546,7 @@ interpret(void) else { goto booleanCheatFalseV4; } - goto l482; + goto l434; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10595,7 +10554,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l482: /* end case */; + l434: /* end case */; break; case 344: /*88*/ /* bytecodePrimMultiply */ @@ -10636,7 +10595,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l490; + goto l440; } } else { @@ -10649,114 +10608,7 @@ interpret(void) /* begin primitiveFloatMultiply:byArg: */ if ((rcvr & 1)) { rcvr1 = ((double) ((rcvr >> 1)) ); - goto l497; - } - /* begin floatValueOf: */ - isFloat = ((rcvr & (tagMask())) == 0) - && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); - if (isFloat) { - fetchFloatAtinto(rcvr + BaseHeaderSize, result1); - rcvr1 = result1; - goto l491; - } - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } - rcvr1 = 0.0; - l491: /* end floatValueOf: */; - l497: /* end loadFloatOrIntFrom: */; - /* begin loadFloatOrIntFrom: */ - if ((arg & 1)) { - arg1 = ((double) ((arg >> 1)) ); - goto l492; - } - /* begin floatValueOf: */ - isFloat1 = ((arg & (tagMask())) == 0) - && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); - if (isFloat1) { - fetchFloatAtinto(arg + BaseHeaderSize, result2); - arg1 = result2; - goto l495; - } - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } - arg1 = 0.0; - l495: /* end floatValueOf: */; - l492: /* end loadFloatOrIntFrom: */; - if (!GIV(primFailCode)) { - /* begin pop:thenPushFloat: */ - longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); - GIV(stackPointer) = sp; - } - /* begin internalizeIPandSP */ - localIP = pointerForOop(GIV(instructionPointer)); - localSP = pointerForOop(GIV(stackPointer)); - localFP = pointerForOop(GIV(framePointer)); - if (!GIV(primFailCode)) { - /* begin fetchNextBytecode */ - currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - - goto l490; - } - } - /* begin fetchPointer:ofObject: */ - objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); - GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); - GIV(argumentCount) = 1; - goto normalSend; - } - l490: /* end case */; - break; - case 345: /*89*/ - /* bytecodePrimDivide */ - { - sqInt arg; - double arg1; - sqInt isFloat; - sqInt isFloat1; - sqInt objOop; - sqInt rcvr; - double rcvr1; - sqInt result; - double result1; - double result2; - char *sp; - - VM_LABEL(bytecodePrimDivide1); - rcvr = longAtPointer(localSP + (1 * BytesPerOop)); - arg = longAtPointer(localSP + (0 * BytesPerOop)); - if (((rcvr & arg) & 1) != 0) { - rcvr = (rcvr >> 1); - arg = (arg >> 1); - if ((arg != 0) - && ((rcvr % arg) == 0)) { - - /* generates C / operation */ - result = rcvr / arg; - if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { - /* begin internalPop:thenPush: */ - longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); - /* begin fetchNextBytecode */ - currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - - goto l499; - } - } - } - else { - /* begin initPrimCall */ - GIV(primFailCode) = 0; - /* begin externalizeIPandSP */ - GIV(instructionPointer) = oopForPointer(localIP); - GIV(stackPointer) = localSP; - GIV(framePointer) = localFP; - /* begin primitiveFloatDivide:byArg: */ - if ((rcvr & 1)) { - rcvr1 = ((double) ((rcvr >> 1)) ); - goto l505; + goto l445; } /* begin floatValueOf: */ isFloat = ((rcvr & (tagMask())) == 0) @@ -10764,19 +10616,18 @@ interpret(void) if (isFloat) { fetchFloatAtinto(rcvr + BaseHeaderSize, result2); rcvr1 = result2; - goto l501; + goto l445; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr1 = 0.0; - l501: /* end floatValueOf: */; - l505: /* end loadFloatOrIntFrom: */; + l445: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((arg & 1)) { arg1 = ((double) ((arg >> 1)) ); - goto l504; + goto l441; } /* begin floatValueOf: */ isFloat1 = ((arg & (tagMask())) == 0) @@ -10784,15 +10635,119 @@ interpret(void) if (isFloat1) { fetchFloatAtinto(arg + BaseHeaderSize, result1); arg1 = result1; - goto l500; + goto l441; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg1 = 0.0; - l500: /* end floatValueOf: */; - l504: /* end loadFloatOrIntFrom: */; + l441: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l440; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l440: /* end case */; + break; + case 345: /*89*/ + /* bytecodePrimDivide */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimDivide1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + if ((arg != 0) + && ((rcvr % arg) == 0)) { + + /* generates C / operation */ + result = rcvr / arg; + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l447; + } + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatDivide:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l452; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l452; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l452: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l448; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l448; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l448: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg1 != 0.0)) { @@ -10814,7 +10769,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l499; + goto l447; } } /* begin fetchPointer:ofObject: */ @@ -10823,7 +10778,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l499: /* end case */; + l447: /* end case */; break; case 346: /*90*/ /* bytecodePrimMod */ @@ -10841,7 +10796,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l508; + goto l454; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10849,7 +10804,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l508: /* end case */; + l454: /* end case */; break; case 347: /*91*/ /* bytecodePrimMakePoint */ @@ -10872,7 +10827,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l512; + goto l458; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -10880,7 +10835,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l512: /* end case */; + l458: /* end case */; break; case 348: /*92*/ /* bytecodePrimBitShift */ @@ -10910,7 +10865,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); integerReceiver = positive32BitValueOf(integerReceiver); @@ -10924,7 +10879,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { @@ -10932,7 +10887,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } } else { @@ -10943,7 +10898,7 @@ interpret(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l518; + goto l469; } shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); } @@ -10952,7 +10907,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l526; + goto l470; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -10975,13 +10930,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l524; + goto l464; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l524: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l464: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -10992,15 +10947,15 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l526; + goto l470; - l526: /* end positive32BitIntegerFor: */; + l470: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); GIV(stackPointer) = sp; } - l518: /* end primitiveBitShift */; + l469: /* end primitiveBitShift */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -11009,7 +10964,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l516; + goto l462; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11017,7 +10972,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l516: /* end case */; + l462: /* end case */; break; case 349: /*93*/ /* bytecodePrimDiv */ @@ -11035,7 +10990,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l527; + goto l472; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11043,7 +10998,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l527: /* end case */; + l472: /* end case */; break; case 350: /*94*/ /* bytecodePrimBitAnd */ @@ -11062,7 +11017,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l531; + goto l476; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11079,7 +11034,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l531; + goto l476; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11087,7 +11042,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l531: /* end case */; + l476: /* end case */; break; case 351: /*95*/ /* bytecodePrimBitOr */ @@ -11106,7 +11061,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l536; + goto l481; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11123,7 +11078,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l536; + goto l481; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11131,7 +11086,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l536: /* end case */; + l481: /* end case */; break; case 352: /*96*/ /* bytecodePrimAt */ @@ -11152,10 +11107,10 @@ interpret(void) sqInt newLargeInteger; usqInt newObj; usqInt numBytes; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objFormat; sqInt objOop; sqInt objOop1; @@ -11186,21 +11141,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l541; + goto l486; } if (primitiveFunctionPointer == primitiveAt) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l556; + goto l501; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -11208,62 +11164,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l556; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l501; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l561; + totalLength = numSlots2; + goto l498; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l561; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l498; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l561; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l498; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l561; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l498; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l561; + totalLength = ((usqInt) numSlots2) >> 1; + goto l498; } totalLength = 0; - l561: /* end lengthOf:format: */; + l498: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l578; + goto l494; } if (fmt < 2) { fixedFields = totalLength; - goto l578; + goto l494; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l578: /* end fixedFieldsOf:format:length: */; + l494: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l556: /* end install:inAtCache:at:string: */; + l501: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAt) { @@ -11271,48 +11223,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l547; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l496; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l569; + totalLength1 = numSlots3; + goto l511; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l569; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l511; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l569; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l511; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l569; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l511; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l569; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l511; } totalLength1 = 0; - l569: /* end lengthOf:format: */; + l511: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -11322,12 +11271,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l547: /* end install:inAtCache:at:string: */; + l496: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 1; goto commonSendOrdinary; - goto l541; + goto l486; } } } @@ -11343,18 +11292,18 @@ interpret(void) fixedFields2 = GIV(atCache)[atIx + AtCacheFixedFields]; /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord()))))); - goto l551; + goto l510; } if (fmt2 < (firstByteFormat())) { /* 64, 32, & 16 bits */ if (fmt2 >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))))))) << 1) | 1); - goto l551; + goto l510; } if (fmt2 == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))))); - goto l551; + goto l510; } /* begin fetchLong32:ofObject: */ @@ -11364,7 +11313,7 @@ interpret(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) result1)) <= (MaxSmallInteger)) { result = ((result1 << 1) | 1); - goto l580; + goto l510; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -11387,13 +11336,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l549; + goto l516; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l549: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l516: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -11404,10 +11353,8 @@ interpret(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l580; + goto l510; - l580: /* end positive32BitIntegerFor: */; - goto l551; } if (fmt2 >= 32) { @@ -11428,16 +11375,16 @@ interpret(void) /* begin fetchByte:ofObject: */ result1 = byteAt((rcvr + BaseHeaderSize) + (index1 - 1)); } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (result1 << (numTagBits())) + (characterTag()); - goto l551; + goto l510; } else { if ((fmt2 < (firstCompiledMethodFormat())) || (index1 >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index1 - 1))) << 1) | 1); - goto l551; + goto l510; } } } @@ -11446,7 +11393,7 @@ interpret(void) ? PrimErrBadIndex : PrimErrBadReceiver); result = (GIV(primFailCode) = reasonCode); - l551: /* end commonVariable:at:cacheIndex: */; + l510: /* end commonVariable:at:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -11454,7 +11401,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (2 - 1) * BytesPerOop), result); - goto l541; + goto l486; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11465,7 +11412,7 @@ interpret(void) GIV(argumentCount) = 1; goto normalSend; } - l541: /* end case */; + l486: /* end case */; break; case 353: /*97*/ /* bytecodePrimAtPut */ @@ -11485,10 +11432,10 @@ interpret(void) sqInt index; sqInt index1; sqInt isCharacter; - usqInt numSlots1; - usqInt numSlots21; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt objOop; sqInt objOop1; sqInt rcvr; @@ -11506,8 +11453,9 @@ interpret(void) rcvr = longAtPointer(localSP + (2 * BytesPerOop)); # if IMMUTABILITY + /* begin isOopMutable: */ correctRcvr = ((rcvr & (tagMask())) == 0) - && (!(((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)); # else /* IMMUTABILITY */ /* begin isNonImmediate: */ @@ -11529,21 +11477,22 @@ interpret(void) if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l581; + goto l518; } if (primitiveFunctionPointer == primitiveAtPut) { /* begin install:inAtCache:at:string: */ assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); if (((fmt >= (firstShortFormat())) && (fmt <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l587; + goto l526; } if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -11551,62 +11500,58 @@ interpret(void) /* Contexts must not be put in the atCache, since their size is not constant */ /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l587; - } - /* begin lengthOf:baseHeader:format: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; + goto l526; } + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { - totalLength = numSlots1; - goto l611; + totalLength = numSlots2; + goto l536; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l611; + totalLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l536; } if (fmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l611; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l536; } if (fmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l611; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l536; } if (fmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l611; + totalLength = ((usqInt) numSlots2) >> 1; + goto l536; } totalLength = 0; - l611: /* end lengthOf:format: */; + l536: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l613; + goto l525; } if (fmt < 2) { fixedFields = totalLength; - goto l613; + goto l525; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l613: /* end fixedFieldsOf:format:length: */; + l525: /* end fixedFieldsOf:format:length: */; GIV(atCache)[atIx + AtCacheOop] = rcvr; GIV(atCache)[atIx + AtCacheFmt] = fmt; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields; GIV(atCache)[atIx + AtCacheSize] = (totalLength - fixedFields); - l587: /* end install:inAtCache:at:string: */; + l526: /* end install:inAtCache:at:string: */; } else { if (primitiveFunctionPointer == primitiveStringAtPut) { @@ -11614,48 +11559,45 @@ interpret(void) assert(!(isContext(rcvr))); /* begin baseHeader: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ + + /* For now the AtCache code doesn't support 16-bit indexability. */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); if (((fmt1 >= (firstShortFormat())) && (fmt1 <= ((firstByteFormat()) - 1)))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l582; - } - /* begin lengthOf:baseHeader:format: */ - numSlots21 = byteAt(rcvr + 7); - if (numSlots21 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots4 = numSlots21; + goto l521; } + /* begin lengthOf:format: */ + numSlots12 = byteAt(rcvr + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots12); if (fmt1 <= 5) { - totalLength1 = numSlots4; - goto l601; + totalLength1 = numSlots3; + goto l527; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength1 = (numSlots4 << (shiftForWord())) - (fmt1 & 7); - goto l601; + totalLength1 = (numSlots3 << (shiftForWord())) - (fmt1 & 7); + goto l527; } if (fmt1 >= (firstShortFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l601; + totalLength1 = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l527; } if (fmt1 >= (firstLongFormat())) { - totalLength1 = (numSlots4 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l601; + totalLength1 = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l527; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - totalLength1 = ((usqInt) numSlots4) >> 1; - goto l601; + totalLength1 = ((usqInt) numSlots3) >> 1; + goto l527; } totalLength1 = 0; - l601: /* end lengthOf:format: */; + l527: /* end lengthOf:format: */; fixedFields1 = 0; /* special flag for strings */ @@ -11665,12 +11607,12 @@ interpret(void) GIV(atCache)[atIx + AtCacheFmt] = fmt1; GIV(atCache)[atIx + AtCacheFixedFields] = fixedFields1; GIV(atCache)[atIx + AtCacheSize] = (totalLength1 - fixedFields1); - l582: /* end install:inAtCache:at:string: */; + l521: /* end install:inAtCache:at:string: */; } else { GIV(argumentCount) = 2; goto commonSendOrdinary; - goto l581; + goto l518; } } } @@ -11699,7 +11641,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index1 + fixedFields2) - 1)) << (shiftForWord())))), value); - goto l586; + goto l528; } if (fmt2 < (firstByteFormat())) { @@ -11712,33 +11654,33 @@ interpret(void) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l586; + goto l528; } if (fmt2 == (sixtyFourBitIndexableFormat())) { val64ToPut = positive64BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 3))), val64ToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } valToPut = positive32BitValueOf(value); if (!GIV(primFailCode)) { /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } if (fmt2 >= 32) { @@ -11748,7 +11690,7 @@ interpret(void) if (!isCharacter) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin characterValueOf: */ valToPut = ((usqInt) (((usqInt)value))) >> (numTagBits()); @@ -11758,18 +11700,18 @@ interpret(void) assert(fmt2 != ((sixtyFourBitIndexableFormat()) + (firstStringyFakeFormat()))); /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 2))), valToPut); - goto l586; + goto l528; } else { if (!((valToPut >= 0) && (valToPut <= 0xFFFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index1 - 1)) << 1))), valToPut); - goto l586; + goto l528; } } @@ -11779,7 +11721,7 @@ interpret(void) && (index1 < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; - goto l586; + goto l528; } valToPut = ((value & 1) ? (value >> 1) @@ -11789,18 +11731,18 @@ interpret(void) && (valToPut <= 0xFF))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l586; + goto l528; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index1 - 1), valToPut); - goto l586; + goto l528; } /* begin primitiveFailFor: */ reasonCode = (isIndexable(rcvr) ? PrimErrBadIndex : PrimErrBadReceiver); GIV(primFailCode) = reasonCode; - l586: /* end commonVariable:at:put:cacheIndex: */; + l528: /* end commonVariable:at:put:cacheIndex: */; } if (!GIV(primFailCode)) { /* begin fetchNextBytecode */ @@ -11808,7 +11750,7 @@ interpret(void) /* begin internalPop:thenPush: */ longAtPointerput((localSP += (3 - 1) * BytesPerOop), value); - goto l581; + goto l518; } /* begin initPrimCall */ GIV(primFailCode) = 0; @@ -11819,21 +11761,23 @@ interpret(void) GIV(argumentCount) = 2; goto normalSend; } - l581: /* end case */; + l518: /* end case */; break; case 354: /*98*/ /* bytecodePrimSize */ { sqInt ccIndex; sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; sqInt fmt; sqInt fmt1; sqInt isArray; sqInt isString; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt objOop; sqInt rcvr; sqInt sz; @@ -11846,114 +11790,108 @@ interpret(void) here. Both of these have compact class indices and neither has any added fields. */ rcvr = longAtPointer(localSP); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (rcvr & (tagMask())) { isString = 0; - goto l620; + goto l556; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l620; + goto l556; - l620: /* end is:instanceOf:compactClassIndex: */; + l556: /* end is:instanceOf:compactClassIndex: */; if (isString) { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(rcvr + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l618; + goto l558; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l618; + goto l558; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l618; + goto l558; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l618; + goto l558; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l618; + goto l558; } sz = 0; - l618: /* end lengthOf:format: */; + l558: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l615; + goto l547; } /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (rcvr & (tagMask())) { isArray = 0; - goto l623; + goto l559; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex1 = (longAt(rcvr)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex1; - goto l623; + goto l559; - l623: /* end is:instanceOf:compactClassIndex: */; + l559: /* end is:instanceOf:compactClassIndex: */; if (isArray) { /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(rcvr + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - sz = numSlots1; - goto l626; + sz = numSlots2; + goto l557; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - sz = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l626; + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l557; } if (fmt1 >= (firstShortFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l626; + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l557; } if (fmt1 >= (firstLongFormat())) { - sz = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l626; + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l557; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - sz = ((usqInt) numSlots1) >> 1; - goto l626; + sz = ((usqInt) numSlots2) >> 1; + goto l557; } sz = 0; - l626: /* end lengthOf:format: */; + l557: /* end lengthOf:format: */; longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l615; + goto l547; } /* begin fetchPointer:ofObject: */ objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); @@ -11961,7 +11899,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l615: /* end case */; + l547: /* end case */; break; case 358: /*102*/ /* bytecodePrimIdenticalV4 */ @@ -12019,6 +11957,7 @@ interpret(void) /* bytecodePrimValue */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -12027,18 +11966,19 @@ interpret(void) rcvr = longAtPointer(localSP); GIV(argumentCount) = 0; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l640; + goto l570; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l640; + goto l570; - l640: /* end is:instanceOf:compactClassIndex: */; + l570: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12055,7 +11995,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l636; + goto l568; } GIV(primFailCode) = 0; } @@ -12064,12 +12004,13 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); goto normalSend; } - l636: /* end case */; + l568: /* end case */; break; case 362: /*106*/ /* bytecodePrimValueWithArg */ { sqInt ccIndex; + sqInt classOop; sqInt isBlock; sqInt objOop; sqInt rcvr; @@ -12078,18 +12019,19 @@ interpret(void) rcvr = longAtPointer(localSP + (1 * BytesPerOop)); GIV(argumentCount) = 1; /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); if (rcvr & (tagMask())) { isBlock = 0; - goto l646; + goto l576; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(rcvr))); /* begin classIndexOf: */ ccIndex = (longAt(rcvr)) & (classIndexMask()); isBlock = ClassBlockClosureCompactIndex == ccIndex; - goto l646; + goto l576; - l646: /* end is:instanceOf:compactClassIndex: */; + l576: /* end is:instanceOf:compactClassIndex: */; if (isBlock) { /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12106,7 +12048,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l642; + goto l574; } GIV(primFailCode) = 0; } @@ -12115,7 +12057,7 @@ interpret(void) GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); goto normalSend; } - l642: /* end case */; + l574: /* end case */; break; case 366: /*110*/ /* bytecodePrimPointX */ @@ -12134,9 +12076,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -12152,7 +12094,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l654; + goto l586; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -12161,7 +12103,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l654: /* end case */; + l586: /* end case */; break; case 367: /*111*/ /* bytecodePrimPointY */ @@ -12180,9 +12122,9 @@ interpret(void) /* begin isNonImmediate: */ ok = (rcvr & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(rcvr)); ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); - } /* begin success: */ if (!ok) { @@ -12198,7 +12140,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l661; + goto l594; } GIV(primFailCode) = 0; /* begin fetchPointer:ofObject: */ @@ -12207,7 +12149,7 @@ interpret(void) GIV(argumentCount) = 0; goto normalSend; } - l661: /* end case */; + l594: /* end case */; break; case 416: /*160*/ case 417: /*161*/ @@ -12262,7 +12204,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(rcvr)))); - if (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), rcvr); /* begin internalPush: */ @@ -12273,7 +12215,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l675; + goto l609; } # endif /* IMMUTABILITY */ @@ -12293,7 +12235,7 @@ interpret(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); - l675: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l609: /* end storePointerImmutabilityCheck:ofObject:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12329,7 +12271,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l683; + goto l618; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12337,7 +12279,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l683: /* end jumplfTrueBy: */; + l618: /* end jumplfTrueBy: */; } break; case 464: /*208*/ @@ -12370,7 +12312,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l687; + goto l622; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12378,7 +12320,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l687: /* end jumplfFalseBy: */; + l622: /* end jumplfFalseBy: */; } break; case 472: /*216*/ @@ -12397,12 +12339,12 @@ interpret(void) if (extA == 0) { localReturnValue = longAtPointer(localSP); goto commonCallerReturn; - goto l691; + goto l626; } error("shouldBeImplemented"); extA = 0; } - l691: /* end case */; + l626: /* end case */; break; case 477: /*221*/ /* extNopBytecode */ @@ -12411,7 +12353,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extA = (extB = 0); + numExtB = (extA = (extB = 0)); } break; case 478: /*222*/ @@ -12446,10 +12388,11 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - extB = ((extB == 0) + extB = ((numExtB == 0) && (byte > 0x7F) ? byte - 256 : (((usqInt) extB << 8)) + byte); + numExtB += 1; } break; case 482: /*226*/ @@ -12479,7 +12422,7 @@ interpret(void) if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { /* begin fetchPointer:ofObject: */ object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l699; + goto l632; } /* begin writeBackHeadFramePointers */ assert(GIV(stackPage) == (mostRecentlyUsedPage())); @@ -12495,7 +12438,7 @@ interpret(void) if (isWidowedContext(obj)) { /* begin fetchPointer:ofObject: */ object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - goto l699; + goto l632; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12509,30 +12452,30 @@ interpret(void) /* base frame, context in saved ip slot (or base of stack in Cog) */ object = longAt(spouseFP + FoxCallerContext); - goto l699; + goto l632; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); object = longAt(callerFP + FoxThisContext); - goto l699; + goto l632; } object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); - goto l699; + goto l632; } if (index == StackPointerIndex) { assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); - goto l699; + goto l632; } if (index == InstructionPointerIndex) { object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); - goto l699; + goto l632; } error("bad index"); object = 0; - l699: /* end instVar:ofContext: */; + l632: /* end instVar:ofContext: */; longAtPointerput((localSP -= BytesPerOop), object); } else { @@ -12605,6 +12548,7 @@ interpret(void) currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); extB = 0; + numExtB = 0; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 1) | 1)); } @@ -12636,7 +12580,6 @@ interpret(void) sqInt i; usqInt newObj; usqInt numBytes; - sqInt objFormat; int popValues; sqInt size; sqInt valuePointer; @@ -12655,12 +12598,9 @@ interpret(void) GIV(stackPointer) = localSP; GIV(framePointer) = localFP; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((size >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(size < (numSlotsMask())); newObj = GIV(freeStart); @@ -12678,13 +12618,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); array = 0; - goto l710; + goto l645; } } - long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; array = newObj; - l710: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l645: /* end eeInstantiateSmallClassIndex:format:numSlots: */; if (popValues) { for (i = 0; i < size; i += 1) { @@ -12765,7 +12705,7 @@ interpret(void) longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); if (variableIndex == StackPointerIndex) { } - goto l717; + goto l655; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -12786,7 +12726,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l717; + goto l655; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -12816,14 +12756,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l717: /* end instVar:ofContext:put: */; + l655: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -12834,7 +12774,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l720; + goto l657; } # endif /* IMMUTABILITY */ @@ -12854,7 +12794,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); - l720: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l657: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12899,7 +12839,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -12910,7 +12850,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l730; + goto l660; } # endif /* IMMUTABILITY */ @@ -12930,7 +12870,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), anObject); - l730: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l660: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -12948,6 +12888,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (index < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); } @@ -13012,7 +12953,7 @@ interpret(void) longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); if (variableIndex == StackPointerIndex) { } - goto l736; + goto l674; } /* begin frameOfMarriedContext: */ senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); @@ -13033,7 +12974,7 @@ interpret(void) else { markStackPageMostRecentlyUsed(GIV(stackPage)); } - goto l736; + goto l674; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13063,14 +13004,14 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); markStackPageMostRecentlyUsed(GIV(stackPage)); assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); - l736: /* end instVar:ofContext:put: */; + l674: /* end instVar:ofContext:put: */; } else { /* begin storePointerImmutabilityCheck:ofObject:withValue: */ # if IMMUTABILITY assert(!((isImmediate(obj)))); - if (((((usqInt) (longAt(obj))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), obj); /* begin internalPush: */ @@ -13081,7 +13022,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l739; + goto l676; } # endif /* IMMUTABILITY */ @@ -13101,7 +13042,7 @@ interpret(void) } } longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); - l739: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l676: /* end storePointerImmutabilityCheck:ofObject:withValue: */; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13148,7 +13089,7 @@ interpret(void) # if IMMUTABILITY assert(!((isImmediate(litVar)))); - if (((((usqInt) (longAt(litVar))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { /* begin cannotAssign:to:withIndex: */ longAtPointerput((localSP -= BytesPerOop), litVar); /* begin internalPush: */ @@ -13159,7 +13100,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); GIV(argumentCount) = 2; goto normalSend; - goto l749; + goto l679; } # endif /* IMMUTABILITY */ @@ -13179,7 +13120,7 @@ interpret(void) } } longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); - l749: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + l679: /* end storeLiteralVariable:withValue: */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13197,6 +13138,7 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + /* begin temporary:in:put: */ if (index < ((frameNumArgs = byteAt((localFP + FoxFrameFlags) + 1)))) { longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); } @@ -13223,6 +13165,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); GIV(lkupClassTag) = (((tagBits = rcvr & (tagMask()))) != 0 ? ((tagBits & 1) != 0 @@ -13246,9 +13189,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; goto superclassSend; } - l756: /* end case */; + l690: /* end case */; break; case 496: /*240*/ /* extSendAbsentImplicitBytecode */ @@ -13264,6 +13208,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendImplicitReceiver */ } @@ -13275,7 +13220,6 @@ interpret(void) sqInt candidateMixin; sqInt candidateMixinApplication; sqInt candidateReceiver; - sqInt classIndex; sqInt classTablePage; sqInt dictionary; sqInt errorCode; @@ -13305,8 +13249,6 @@ interpret(void) sqInt objOop5; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -13316,9 +13258,7 @@ interpret(void) VM_LABEL(commonSendImplicitReceiver); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodImplicitReceiver */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -13350,21 +13290,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l935; + goto l876; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l935: /* end classAtIndex: */; + l876: /* end classAtIndex: */; /* begin lookupImplicitReceiverSend */ GIV(messageSelector) = (((GIV(messageSelector) & (tagMask())) == 0) && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) @@ -13378,8 +13317,8 @@ interpret(void) while (1) { assert(!((isForwarded(candidateMixin)))); assert(!((isForwarded(candidateReceiver)))); - candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits2 = candidateReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) + candidateMixinApplication = findApplicationOfTargetMixinstartingAtBehavior(candidateMixin, (((tagBits1 = candidateReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) : fetchClassOfNonImm(candidateReceiver))); assert(!((candidateMixinApplication == 0))); assert(!((candidateMixinApplication == (nilObject())))); @@ -13395,13 +13334,9 @@ interpret(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -13426,19 +13361,19 @@ interpret(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; - goto l959; + goto l866; } index += 1; } found = 0; - goto l959; + goto l866; } /* It is assumed that there are some nils in this dictionary, and search will @@ -13449,13 +13384,13 @@ interpret(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -13464,7 +13399,7 @@ interpret(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l959; + goto l866; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -13472,12 +13407,12 @@ interpret(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -13486,24 +13421,24 @@ interpret(void) } GIV(newMethod) = objOop4; found = 1; - goto l959; + goto l866; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l959; + goto l866; } wrapAround = 1; index = SelectorStart; } } found = 0; - l959: /* end lookupMethodInDictionary: */; + l866: /* end lookupMethodInDictionary: */; if (found) { GIV(localAbsentReceiver) = candidateReceiver; actualLookupRule = lookupLexicalfromrule(GIV(messageSelector), candidateMixin, LookupRuleImplicit); - goto l945; + goto l886; } /* begin followObjField:ofObject: */ objOop1 = longAt((candidateMixin + BaseHeaderSize) + (((int)((usqInt)(EnclosingMixinIndex) << (shiftForWord()))))); @@ -13518,13 +13453,12 @@ interpret(void) } GIV(localAbsentReceiverOrZero) = 0; GIV(localAbsentReceiver) = methodReceiver; - - /* MNU lookup starts here. */ - GIV(lkupClass) = (((tagBits1 = methodReceiver & (tagMask()))) != 0 - ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))) + /* begin fetchClassOf: */ + GIV(lkupClass) = (((tagBits2 = methodReceiver & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord()))))) : fetchClassOfNonImm(methodReceiver)); actualLookupRule = lookupProtectedstartingAtrule(GIV(messageSelector), GIV(lkupClass), LookupRuleImplicit); - l945: /* end lookupImplicitReceiverSend */; + l886: /* end lookupImplicitReceiverSend */; /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -13555,29 +13489,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l965; + goto l857; } if (localPrimIndex == 256) { - goto l965; + goto l857; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l965; + goto l857; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l965; + goto l857; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l965; + goto l857; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l965: /* end internalQuickPrimitiveResponse */; - goto l955; + goto l857; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13613,7 +13546,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l955; + goto l857; } } /* begin internalActivateNewMethod */ @@ -13624,8 +13557,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13649,7 +13582,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13673,11 +13606,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l957; + goto l870; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l957: /* end getErrorObjectFromPrimFailCode */; + l870: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -13697,7 +13630,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l955: /* end internalExecuteNewMethod */; + l857: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -13717,6 +13650,7 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* goto commonSendDynamicSuper */ } @@ -13725,7 +13659,6 @@ interpret(void) { sqInt actualLookupRule; sqInt aValue; - sqInt classIndex; sqInt classTablePage; sqInt errorCode; sqInt fieldIndex; @@ -13743,8 +13676,6 @@ interpret(void) sqInt oop; sqInt probe1; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -13752,9 +13683,7 @@ interpret(void) VM_LABEL(commonSendDynamicSuper); /* begin sendBreakpoint:receiver: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodDynamicSuper */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -13774,7 +13703,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } /* second probe */ @@ -13786,7 +13715,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } probe1 = (((usqInt) hash1) >> 2) & NSMethodCacheMask; if (((((GIV(nsMethodCache)[probe1 + NSMethodCacheSelector]) == GIV(messageSelector)) @@ -13796,7 +13725,7 @@ interpret(void) GIV(newMethod) = GIV(nsMethodCache)[probe1 + NSMethodCacheTargetMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(nsMethodCache)[probe1 + NSMethodCachePrimFunction])); GIV(localAbsentReceiverOrZero) = GIV(nsMethodCache)[probe1 + NSMethodCacheActualReceiver]; - goto l986; + goto l898; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13814,20 +13743,19 @@ interpret(void) } } /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l989; + goto l900; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l989: /* end classAtIndex: */; + l900: /* end classForClassTag: */; /* begin lookupDynamicSuperSend */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -13848,7 +13776,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); addNewMethodToNSCache(actualLookupRule); - l986: ; + l898: ; /* begin shuffleArgumentsAndStoreAbsentReceiver: */ @@ -13874,29 +13802,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l984; + goto l896; } if (localPrimIndex == 256) { - goto l984; + goto l896; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l984; + goto l896; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l984; + goto l896; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l984; + goto l896; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l984: /* end internalQuickPrimitiveResponse */; - goto l979; + goto l896; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -13932,7 +13859,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l979; + goto l896; } } /* begin internalActivateNewMethod */ @@ -13943,8 +13870,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -13968,7 +13895,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -13992,11 +13919,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l977; + goto l908; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l977: /* end getErrorObjectFromPrimFailCode */; + l908: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14016,7 +13943,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l979: /* end internalExecuteNewMethod */; + l896: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14032,6 +13959,7 @@ interpret(void) byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); extB = 0; + numExtB = 0; localIP += offset; /* begin ifBackwardsCheckForEvents: */ if ((offset < 0) @@ -14062,7 +13990,7 @@ interpret(void) VM_LABEL(extJumpIfTrue); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfTrueBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(trueObj)) { @@ -14077,7 +14005,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l763; + goto l697; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14085,7 +14013,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l763: /* end jumplfTrueBy: */; + l697: /* end jumplfTrueBy: */; } break; case 500: /*244*/ @@ -14098,7 +14026,7 @@ interpret(void) VM_LABEL(extJumpIfFalse); byte = byteAtPointer(++localIP); offset = byte + (((sqInt)((usqInt)(extB) << 8))); - extB = (extA = 0); + numExtB = (extB = (extA = 0)); /* begin jumplfFalseBy: */ boolean = longAtPointer(localSP); if (boolean == GIV(falseObj)) { @@ -14113,7 +14041,7 @@ interpret(void) GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); GIV(argumentCount) = 0; goto normalSend; - goto l767; + goto l701; } /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14121,7 +14049,7 @@ interpret(void) } /* begin internalPop: */ localSP += 1 * BytesPerOop; - l767: /* end jumplfFalseBy: */; + l701: /* end jumplfFalseBy: */; } break; case 501: /*245*/ @@ -14130,7 +14058,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt errorCode; @@ -14146,8 +14073,6 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -14163,10 +14088,9 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOuter: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -14198,21 +14122,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l784; + goto l703; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l784: /* end classAtIndex: */; + l703: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14263,29 +14186,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l786; + goto l708; } if (localPrimIndex == 256) { - goto l786; + goto l708; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l786; + goto l708; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l786; + goto l708; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l786; + goto l708; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l786: /* end internalQuickPrimitiveResponse */; - goto l781; + goto l708; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -14321,7 +14243,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l781; + goto l708; } } /* begin internalActivateNewMethod */ @@ -14332,8 +14254,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14357,7 +14279,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14381,11 +14303,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l779; + goto l716; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l779: /* end getErrorObjectFromPrimFailCode */; + l716: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14405,7 +14327,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l781: /* end internalExecuteNewMethod */; + l708: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -14429,15 +14351,15 @@ interpret(void) /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); - goto l793; + goto l725; } else { goto respondToUnknownBytecode; - goto l793; + goto l725; } } - l793: /* end case */; + l725: /* end case */; break; case 509: /*253*/ /* extPushClosureBytecode */ @@ -14463,15 +14385,15 @@ interpret(void) numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8); extA = 0; blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); - extB = 0; + numExtB = (extB = 0); /* begin pushClosureNumArgs:copiedValues:blockSize: */ if ((byteAt((localFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(localFP))); context = longAt(localFP + FoxThisContext); - goto l823; + goto l754; } context = marryFrameSP(localFP, localSP + (numCopied * BytesPerOop)); - l823: /* end ensureFrameIsMarried:SP: */; + l754: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ @@ -14499,13 +14421,13 @@ interpret(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l817; + goto l746; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; - l817: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l746: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); @@ -14544,7 +14466,6 @@ interpret(void) sqInt actualLookupRule; sqInt aValue; sqInt byte; - sqInt classIndex; sqInt classTablePage; sqInt count; sqInt depth; @@ -14561,8 +14482,6 @@ interpret(void) sqInt objOop; sqInt oop; sqInt rcvr; - sqInt rcvr1; - sqInt selector; sqInt succeeded; sqInt table; sqInt tagBits; @@ -14578,11 +14497,10 @@ interpret(void) extA = 0; GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); extB = 0; + numExtB = 0; depth = byteAtPointer(++localIP); /* begin commonSendOuter: */ - selector = GIV(messageSelector); - rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); /* begin internalFindNewMethodOuter: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); assert(!((isOopForwarded(GIV(localAbsentReceiver))))); @@ -14614,21 +14532,20 @@ interpret(void) GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag)); } } - /* begin classForClassTag: */ - classIndex = GIV(lkupClassTag); - assert((classIndex <= (tagMask())) - || (classIndex >= (arrayClassIndexPun()))); + /* begin classAtIndex: */ + assert((GIV(lkupClassTag) <= (tagMask())) + || (GIV(lkupClassTag) >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ - fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift()); + fieldIndex = ((usqInt) GIV(lkupClassTag)) >> (classTableMajorIndexShift()); classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l840; + goto l756; } /* begin fetchPointer:ofObject: */ - fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1); + fieldIndex1 = GIV(lkupClassTag) & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l840: /* end classAtIndex: */; + l756: /* end classAtIndex: */; /* begin lookupOuterSend: */ GIV(localAbsentReceiver) = longAt(localFP + FoxReceiver); GIV(localAbsentReceiverOrZero) = 0; @@ -14679,29 +14596,28 @@ interpret(void) /* begin internalStackTopPut: */ aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); longAtPointerput(localSP, aValue); - goto l842; + goto l761; } if (localPrimIndex == 256) { - goto l842; + goto l761; } if (localPrimIndex == 257) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(trueObj)); - goto l842; + goto l761; } if (localPrimIndex == 258) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(falseObj)); - goto l842; + goto l761; } if (localPrimIndex == 259) { /* begin internalStackTopPut: */ longAtPointerput(localSP, GIV(nilObj)); - goto l842; + goto l761; } longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); - l842: /* end internalQuickPrimitiveResponse */; - goto l837; + goto l761; } /* begin externalizeIPandSP */ GIV(instructionPointer) = oopForPointer(localIP); @@ -14737,7 +14653,7 @@ interpret(void) localFP = pointerForOop(GIV(framePointer)); if (succeeded) { browserPluginReturnIfNeeded(); - goto l837; + goto l761; } } /* begin internalActivateNewMethod */ @@ -14748,8 +14664,8 @@ interpret(void) assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader))); /* could new rcvr be set at point of send? */ - rcvr1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); - assert(!(isOopForwarded(rcvr1))); + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), localIP); /* begin internalPush: */ @@ -14773,7 +14689,7 @@ interpret(void) /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); /* begin internalPush: */ - longAtPointerput((localSP -= BytesPerOop), rcvr1); + longAtPointerput((localSP -= BytesPerOop), rcvr); for (i1 = (GIV(argumentCount) + 1); i1 <= numTemps; i1 += 1) { /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); @@ -14797,11 +14713,11 @@ interpret(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l835; + goto l769; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l835: /* end getErrorObjectFromPrimFailCode */; + l769: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -14821,7 +14737,7 @@ interpret(void) localSP = pointerForOop(GIV(stackPointer)); localFP = pointerForOop(GIV(framePointer)); } - l837: /* end internalExecuteNewMethod */; + l761: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); @@ -15137,16 +15053,16 @@ cStringOrNullFor(sqInt oop) classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); if (oop & (tagMask())) { isString = 0; - goto l3; + goto l2; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); isString = ClassByteStringCompactIndex == ccIndex; - goto l3; + goto l2; -l3: /* end is:instanceOf:compactClassIndex: */; +l2: /* end is:instanceOf:compactClassIndex: */; if (!isString) { if (oop != GIV(nilObj)) { GIV(primFailCode) = PrimErrBadArgument; @@ -15157,37 +15073,33 @@ cStringOrNullFor(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { len = numSlots; - goto l1; + goto l4; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ len = (numSlots << (shiftForWord())) - (fmt & 7); - goto l1; + goto l4; } if (fmt >= (firstShortFormat())) { len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l1; + goto l4; } if (fmt >= (firstLongFormat())) { len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l1; + goto l4; } if (fmt == (sixtyFourBitIndexableFormat())) { len = ((usqInt) numSlots) >> 1; - goto l1; + goto l4; } len = 0; -l1: /* end lengthOf:format: */; +l4: /* end lengthOf:format: */; if (len == 0) { return 0; } @@ -15912,14 +15824,14 @@ primitiveArctan(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = atan(rcvr); @@ -16100,68 +16012,63 @@ primitiveAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -16170,23 +16077,23 @@ primitiveAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l16; + goto l13; } } else { @@ -16200,19 +16107,19 @@ primitiveAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l16; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l16; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l16; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l16; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -16221,7 +16128,7 @@ primitiveAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l16; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -16250,7 +16157,7 @@ primitiveAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -16261,7 +16168,7 @@ primitiveAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l16; + goto l13; } /* begin primitiveFailFor: */ @@ -16270,13 +16177,13 @@ primitiveAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l16: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveAtPut */ @@ -16311,79 +16218,75 @@ primitiveAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ hdr1 = long64At(rcvr); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(rcvr + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l29; + goto l21; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l29; + goto l21; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l29; + goto l21; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l29; + goto l21; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l29; + goto l21; } totalLength1 = 0; -l29: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l16; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l16; } class1 = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l27: /* end fixedFieldsOf:format:length: */; +l16: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -16392,23 +16295,23 @@ primitiveAtPut(void) sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(rcvr))); stSize1 = sp3; - goto l18; + goto l17; } /* begin fetchStackPointerOf: */ sp11 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l18; + goto l17; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr))); stSize1 = (sp11 >> 1); - l18: /* end stackPointerForMaybeMarriedContext: */; + l17: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value); - goto l33; + goto l29; } } else { @@ -16435,37 +16338,37 @@ primitiveAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l21; + goto l28; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l21; + goto l28; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l21; + goto l28; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -16473,7 +16376,7 @@ primitiveAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l21; + goto l28; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -16481,7 +16384,7 @@ primitiveAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l21: /* end subscript:with:storing:format: */; + l28: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -16490,14 +16393,14 @@ primitiveAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode1; } -l33: /* end stObject:at:put: */; +l29: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -16884,10 +16787,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -16895,7 +16798,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -16911,7 +16814,7 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -16923,18 +16826,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -16945,10 +16848,10 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -16956,23 +16859,23 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -16984,18 +16887,18 @@ primitiveBitAnd(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue); @@ -17064,10 +16967,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -17075,7 +16978,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); @@ -17091,7 +16994,7 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -17103,18 +17006,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } -l5: /* end positiveMachineIntegerValueOf: */; +l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ((oop2 & 1)) { @@ -17125,10 +17028,10 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (oop2 & (tagMask())) { /* begin primitiveFail */ @@ -17136,23 +17039,23 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop2))); /* begin classIndexOf: */ ccIndex1 = (longAt(oop2)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); @@ -17164,18 +17067,18 @@ primitiveBitOr(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } -l10: /* end positiveMachineIntegerValueOf: */; +l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue); @@ -17275,7 +17178,7 @@ primitiveBitShift(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { shifted = (((usqInt)shifted << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -17298,13 +17201,13 @@ primitiveBitShift(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -17315,9 +17218,9 @@ primitiveBitShift(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); shifted = newLargeInteger; - goto l6; + goto l5; - l6: /* end positive32BitIntegerFor: */; + l5: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); @@ -17444,10 +17347,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) null); - goto l5; + goto l4; } integerArgumentValue = ((usqIntptr_t) value); - goto l5; + goto l4; } if (integerArgument & (tagMask())) { /* begin primitiveFail */ @@ -17455,7 +17358,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerArgument))); @@ -17471,7 +17374,7 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask()); @@ -17483,18 +17386,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerArgumentValue = ((usqIntptr_t) 0); - goto l5; + goto l4; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3)))))); - goto l5; + goto l4; } else { integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2)))))))); - goto l5; + goto l4; } - l5: /* end positiveMachineIntegerValueOf: */; + l4: /* end positiveMachineIntegerValueOf: */; /* begin positiveMachineIntegerValueOf: */ if ((integerReceiver & 1)) { value1 = (integerReceiver >> 1); @@ -17504,10 +17407,10 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) null); - goto l10; + goto l8; } integerReceiverValue = ((usqIntptr_t) value1); - goto l10; + goto l8; } if (integerReceiver & (tagMask())) { /* begin primitiveFail */ @@ -17515,23 +17418,23 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(integerReceiver))); /* begin classIndexOf: */ ccIndex1 = (longAt(integerReceiver)) & (classIndexMask()); ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; - goto l9; + goto l7; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok1) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } /* begin numBytesOfBytes: */ fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask()); @@ -17543,18 +17446,18 @@ primitiveBitXor(void) GIV(primFailCode) = 1; } integerReceiverValue = ((usqIntptr_t) 0); - goto l10; + goto l8; } if (((sizeof(usqIntptr_t)) == 8) && (bs1 > 4)) { integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3)))))); - goto l10; + goto l8; } else { integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2)))))))); - goto l10; + goto l8; } - l10: /* end positiveMachineIntegerValueOf: */; + l8: /* end positiveMachineIntegerValueOf: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue); @@ -17805,7 +17708,7 @@ primitiveClipboardText(void) sqInt fmt; sqInt formatField; usqInt newObj; - usqInt numBytes; + usqInt numBytes1; sqInt numSlots; sqInt s; char *sp; @@ -17841,23 +17744,23 @@ primitiveClipboardText(void) formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? (/* begin allocationUnit */ 8) : (numSlots + (numSlots & 1)) * BytesPerOop)); } - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); - goto l6; + s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex); + goto l4; } if (numSlots >= (numSlotsMask())) { @@ -17870,11 +17773,11 @@ primitiveClipboardText(void) else { long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex); } - assert((numBytes % (allocationUnit())) == 0); + assert((numBytes1 % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); - GIV(freeStart) += numBytes; + GIV(freeStart) += numBytes1; s = newObj; - l6: /* end allocateSlots:format:classIndex: */; + l4: /* end allocateBytes:classIndex: */; if (!(s)) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -17967,7 +17870,7 @@ primitiveClockLogAddresses(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)usecs)))) <= (MaxSmallInteger)) { v1 = (((((usqInt)usecs)) << 1) | 1); - goto l13; + goto l9; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -17990,13 +17893,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l8; + goto l7; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l8: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l7: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -18007,15 +17910,15 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); v1 = newLargeInteger; - goto l13; + goto l9; -l13: /* end positive32BitIntegerFor: */; +l9: /* end positive32BitIntegerFor: */; /* begin positive32BitIntegerFor: */ /* begin maybeInlinePositive32BitIntegerFor: */ assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) (((usqInt)msecs)))) <= (MaxSmallInteger)) { v2 = (((((usqInt)msecs)) << 1) | 1); - goto l19; + goto l14; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -18038,13 +17941,13 @@ primitiveClockLogAddresses(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l14; + goto l12; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; -l14: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l12: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -18055,9 +17958,9 @@ primitiveClockLogAddresses(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); v2 = newLargeInteger1; - goto l19; + goto l14; -l19: /* end positive32BitIntegerFor: */; +l14: /* end positive32BitIntegerFor: */; if (GIV(primFailCode)) { /* begin popRemappableOop */ oop = GIV(remapBuffer)[GIV(remapBufferCount)]; @@ -18401,13 +18304,9 @@ primitiveClosureValueWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { @@ -18567,73 +18466,63 @@ primitiveCompareBytes(void) /* begin byteSizeOf: */ if (arg1 & (tagMask())) { len1 = 0; - goto l1; + goto l2; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(arg1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(arg1 - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(arg1 - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len1 = numBytes - (fmt & 7); - goto l5; + goto l2; } if (fmt <= (sixtyFourBitIndexableFormat())) { len1 = numBytes; - goto l5; + goto l2; } if (fmt >= (firstShortFormat())) { len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l2; } len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l1: /* end byteSizeOf: */; +l2: /* end byteSizeOf: */; /* begin byteSizeOf: */ if (arg2 & (tagMask())) { len2 = 0; - goto l2; + goto l4; } /* begin numBytesOf: */ fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(arg2 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes1 = longAt(arg2 - BaseHeaderSize); - } - else { - numBytes1 = numSlots1; - } + numBytes1 = (numSlots1 == (numSlotsMask()) + ? longAt(arg2 - BaseHeaderSize) + : numSlots1); numBytes1 = numBytes1 << (shiftForWord()); if (fmt1 >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ len2 = numBytes1 - (fmt1 & 7); - goto l8; + goto l4; } if (fmt1 <= (sixtyFourBitIndexableFormat())) { len2 = numBytes1; - goto l8; + goto l4; } if (fmt1 >= (firstShortFormat())) { len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); - goto l8; + goto l4; } len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); -l8: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l4: /* end byteSizeOf: */; if (!(len1 == len2)) { /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); @@ -18681,7 +18570,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } if (format >= (firstShortFormat())) { if (format >= (firstByteFormat())) { @@ -18691,7 +18580,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24); oddBytes = format & 7; @@ -18702,7 +18591,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 16; oddBytes = ((sqInt)((usqInt)((format & 3)) << 1)); @@ -18719,7 +18608,7 @@ primitiveConstantFill(void) if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } - goto l2; + goto l5; } fillValue += fillValue << 32; oddBytes = ((sqInt)((usqInt)((format & 1)) << 2)); @@ -18727,13 +18616,9 @@ primitiveConstantFill(void) } /* begin addressAfter: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -18754,7 +18639,7 @@ primitiveConstantFill(void) } /* begin pop: */ GIV(stackPointer) += 1 * BytesPerWord; -l2: /* end primitiveConstantFillSpur */; +l5: /* end primitiveConstantFillSpur */; } @@ -18861,30 +18746,26 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots1; - } + numBytes = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ length = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { length = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask()))) && (length == (numBytesOf(arg))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -18900,13 +18781,9 @@ primitiveCopyObject(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(rcvr - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); if (!((isAppropriateForCopyObject(arg)) && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) { GIV(primFailCode) = PrimErrBadArgument; @@ -18955,11 +18832,11 @@ primitiveCrashVM(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { crashInThisThread = 1; - goto l2; + goto l1; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { crashInThisThread = 0; - goto l2; + goto l1; } /* begin success: */ @@ -18969,7 +18846,7 @@ primitiveCrashVM(void) } crashInThisThread = null; - l2: /* end booleanValueOf: */; + l1: /* end booleanValueOf: */; } if (GIV(primFailCode) || (GIV(argumentCount) != 1)) { @@ -19409,14 +19286,14 @@ primitiveExp(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = exp(rcvr); @@ -19456,14 +19333,14 @@ primitiveExponent(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { /* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */ @@ -19562,14 +19439,13 @@ primitiveFloatAdd(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -19582,14 +19458,13 @@ primitiveFloatAdd(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -19641,7 +19516,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l7; + goto l6; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -19664,13 +19539,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -19681,9 +19556,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l7; + goto l6; - l7: /* end positive32BitIntegerFor: */; + l6: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -19699,7 +19574,7 @@ primitiveFloatAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { result = ((integerValue1 << 1) | 1); - goto l13; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -19722,13 +19597,13 @@ primitiveFloatAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l8; + goto l9; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l8: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -19739,9 +19614,9 @@ primitiveFloatAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger1; - goto l13; + goto l11; - l13: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp1; @@ -19784,7 +19659,8 @@ primitiveFloatAtPut(void) index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -19850,14 +19726,13 @@ primitiveFloatDivide(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -19870,14 +19745,13 @@ primitiveFloatDivide(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; /* begin success: */ if (!(arg != 0.0)) { @@ -19900,57 +19774,50 @@ primitiveFloatEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -19968,57 +19835,50 @@ primitiveFloatGreaterOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreaterOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr >= arg; if (!GIV(primFailCode)) { @@ -20036,57 +19896,50 @@ primitiveFloatGreaterThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatGreater:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr > arg; if (!GIV(primFailCode)) { @@ -20104,57 +19957,50 @@ primitiveFloatLessOrEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLessOrEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr <= arg; if (!GIV(primFailCode)) { @@ -20172,57 +20018,50 @@ primitiveFloatLessThan(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatLess:thanArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr < arg; if (!GIV(primFailCode)) { @@ -20262,14 +20101,13 @@ primitiveFloatMultiply(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -20282,14 +20120,13 @@ primitiveFloatMultiply(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -20304,57 +20141,50 @@ primitiveFloatNotEqual(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt aBool; double arg; - sqInt argOop; sqInt isFloat; sqInt isFloat1; double rcvr; - sqInt rcvrOop; double result; double result1; char *sp; /* begin primitiveFloatEqual:toArg: */ - rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - argOop = longAt(GIV(stackPointer)); - /* begin loadFloatOrIntFrom: */ - if ((rcvrOop & 1)) { - rcvr = ((double) ((rcvrOop >> 1)) ); + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); goto l1; } /* begin floatValueOf: */ - isFloat = ((rcvrOop & (tagMask())) == 0) - && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat) { - fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); rcvr = result; - goto l4; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l4: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ - if ((argOop & 1)) { - arg = ((double) ((argOop >> 1)) ); + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); goto l2; } /* begin floatValueOf: */ - isFloat1 = ((argOop & (tagMask())) == 0) - && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); if (isFloat1) { - fetchFloatAtinto(argOop + BaseHeaderSize, result1); + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); arg = result1; - goto l5; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l5: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; aBool = rcvr == arg; if (!GIV(primFailCode)) { @@ -20394,14 +20224,13 @@ primitiveFloatSubtract(void) if (isFloat) { fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; l1: /* end loadFloatOrIntFrom: */; /* begin loadFloatOrIntFrom: */ if ((argOop & 1)) { @@ -20414,14 +20243,13 @@ primitiveFloatSubtract(void) if (isFloat1) { fetchFloatAtinto(argOop + BaseHeaderSize, result1); arg = result1; - goto l4; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } arg = 0.0; -l4: /* end floatValueOf: */; l2: /* end loadFloatOrIntFrom: */; if (!GIV(primFailCode)) { /* begin pop:thenPushFloat: */ @@ -20466,10 +20294,10 @@ primitiveFlushExternalPrimitives(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -20491,8 +20319,8 @@ primitiveFlushExternalPrimitives(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -20508,37 +20336,33 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -20553,32 +20377,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -20600,32 +20420,28 @@ primitiveFlushExternalPrimitives(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } flushMethodCache(); /* begin flushExternalPrimitiveTable */ @@ -20681,11 +20497,11 @@ primitiveFormPrint(void) /* begin booleanValueOf: */ if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { landscapeFlag = 1; - goto l5; + goto l2; } if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { landscapeFlag = 0; - goto l5; + goto l2; } /* begin success: */ @@ -20695,7 +20511,7 @@ primitiveFormPrint(void) } landscapeFlag = null; -l5: /* end booleanValueOf: */; +l2: /* end booleanValueOf: */; /* begin floatValueOf: */ oop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); isFloat = ((oop & (tagMask())) == 0) @@ -20703,14 +20519,14 @@ primitiveFormPrint(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); vScale = result; - goto l6; + goto l5; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } vScale = 0.0; -l6: /* end floatValueOf: */; +l5: /* end floatValueOf: */; /* begin floatValueOf: */ oop1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); isFloat1 = ((oop1 & (tagMask())) == 0) @@ -20718,14 +20534,14 @@ primitiveFormPrint(void) if (isFloat1) { fetchFloatAtinto(oop1 + BaseHeaderSize, result1); hScale = result1; - goto l7; + goto l6; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } hScale = 0.0; -l7: /* end floatValueOf: */; +l6: /* end floatValueOf: */; rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord)); if (!((((rcvr & (tagMask())) == 0) && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) @@ -20756,36 +20572,32 @@ primitiveFormPrint(void) pixelsPerWord = 32 / depth; wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord; if (((bitsArray & (tagMask())) == 0) - && (isWordsOrBytesNonImm(bitsArray))) { + && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) { /* begin numBytesOf: */ fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(bitsArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(bitsArray - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(bitsArray - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ bitsArraySize = numBytes - (fmt & 7); - goto l3; + goto l4; } if (fmt <= (sixtyFourBitIndexableFormat())) { bitsArraySize = numBytes; - goto l3; + goto l4; } if (fmt >= (firstShortFormat())) { bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l3; + goto l4; } bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); - l3: /* end numBytesOf: */; + l4: /* end numBytesOf: */; /* begin success: */ if (!(bitsArraySize == ((wordsPerLine * h) * 4))) { @@ -20845,14 +20657,14 @@ primitiveFractionalPart(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { frac = modf(rcvr, (&trunc)); /* begin pushFloat: */ @@ -20922,7 +20734,7 @@ primitiveGetImmutability(void) rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin pop:thenPushBool: */ trueOrFalse = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); @@ -21134,7 +20946,6 @@ primitiveGetWindowLabel(void) EXPORT(sqInt) primitiveGetWindowSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt h; sqInt knownClassIndex; @@ -21158,8 +20969,7 @@ primitiveGetWindowSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -21182,13 +20992,13 @@ primitiveGetWindowSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l6; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l6: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 1) | 1)); @@ -21347,7 +21157,7 @@ primitiveHeartbeatFrequency(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop = ((integerValue << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -21370,13 +21180,13 @@ primitiveHeartbeatFrequency(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21387,9 +21197,9 @@ primitiveHeartbeatFrequency(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; return 0; @@ -21515,7 +21325,7 @@ primitiveImageFormatVersion(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) 6521)) <= (MaxSmallInteger)) { oop = (((usqInt)6521 << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -21538,13 +21348,13 @@ primitiveImageFormatVersion(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -21555,9 +21365,9 @@ primitiveImageFormatVersion(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; return 0; @@ -21573,6 +21383,7 @@ primitiveImageFormatVersion(void) static void primitiveImageName(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOop; sqInt ok; sqInt okToRename; sqInt s; @@ -21597,11 +21408,13 @@ primitiveImageName(void) } s = longAt(GIV(stackPointer)); /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + /* begin isNonImmediate: */ ok = (s & (tagMask())) == 0; if (ok) { + /* begin isClassOfNonImm:equalTo: */ assert(isNonImmediate(s)); - ok = ((longAt(s)) & (classIndexMask())) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord())))))) + 4)) & (identityHashHalfWordMask())); - + ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); } /* begin success: */ if (!ok) { @@ -21775,37 +21588,33 @@ primitiveIntegerAt(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l4; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l6; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l6; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l4; + goto l6; } sz = 0; -l4: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -21819,12 +21628,12 @@ primitiveIntegerAt(void) /* begin signed32BitIntegerFor: */ if ((((sqInt)((((usqInt)intValue)) ^ ((((usqInt)intValue)) << 1)))) >= 0) { result = (((usqInt)intValue << 1) | 1); - goto l5; + goto l4; } result = noInlineSigned32BitIntegerGutsFor(intValue); - goto l5; + goto l4; -l5: /* end signed32BitIntegerFor: */; +l4: /* end signed32BitIntegerFor: */; /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; @@ -21869,12 +21678,12 @@ primitiveIntegerAtPut(void) /* begin signed32BitValueOf: */ if ((valueOop & 1)) { value = (valueOop >> 1); - goto l7; + goto l9; } value = noInlineSigned32BitValueGutsOf(valueOop); - goto l7; + goto l9; -l7: /* end signed32BitValueOf: */; +l9: /* end signed32BitValueOf: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -21889,7 +21698,8 @@ primitiveIntegerAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -21902,37 +21712,33 @@ primitiveIntegerAtPut(void) fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { sz = numSlots; - goto l5; + goto l8; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ sz = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l8; } if (fmt >= (firstShortFormat())) { sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l8; } if (fmt >= (firstLongFormat())) { sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l8; } if (fmt == (sixtyFourBitIndexableFormat())) { sz = ((usqInt) numSlots) >> 1; - goto l5; + goto l8; } sz = 0; -l5: /* end lengthOf:format: */; +l8: /* end lengthOf:format: */; if (!((index >= 1) && (index <= sz))) { /* begin primitiveFailFor: */ @@ -22036,7 +21842,6 @@ primitiveInvokeObjectAsMethod(void) sqInt numArgs; sqInt numTemps; sqInt object; - sqInt objFormat; sqInt rcvr; sqInt runArgs; sqInt runReceiver; @@ -22058,13 +21863,10 @@ primitiveInvokeObjectAsMethod(void) sqInt valuePointer; /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2, ClassArrayCompactIndex); for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) { /* begin storePointerUnchecked:ofObject:withValue: */ @@ -22107,7 +21909,7 @@ primitiveInvokeObjectAsMethod(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l7; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -22134,7 +21936,7 @@ primitiveInvokeObjectAsMethod(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l7; + goto l16; } } /* begin activateNewMethod */ @@ -22202,11 +22004,11 @@ primitiveInvokeObjectAsMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -22216,7 +22018,7 @@ primitiveInvokeObjectAsMethod(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l7: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -22247,6 +22049,7 @@ primitiveIsPinned(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt obj; char *sp; + sqInt trueOrFalse; obj = longAt(GIV(stackPointer)); if ((obj & (tagMask())) @@ -22256,7 +22059,8 @@ primitiveIsPinned(void) return; } /* begin pop:thenPushBool: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((((usqInt) (longAt(obj))) >> 30) & 1) != 0 + trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse ? GIV(trueObj) : GIV(falseObj))); GIV(stackPointer) = sp; @@ -22669,14 +22473,14 @@ primitiveLogN(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = log(rcvr); @@ -22733,7 +22537,6 @@ primitiveLowSpaceSemaphore(void) static void primitiveMakePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -22761,8 +22564,7 @@ primitiveMakePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -22785,13 +22587,13 @@ primitiveMakePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pt = 0; - goto l3; + goto l2; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pt = newObj; -l3: /* end eeInstantiateSmallClass:numSlots: */; +l2: /* end eeInstantiateSmallClass:numSlots: */; assert(!(isOopForwarded(pt))); longAtput((pt + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), rcvr); @@ -22970,7 +22772,6 @@ primitiveMouseButtons(void) static void primitiveMousePoint(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -23012,8 +22813,7 @@ primitiveMousePoint(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -23036,13 +22836,13 @@ primitiveMousePoint(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l7; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l7: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 1) | 1)); @@ -23199,12 +22999,13 @@ primitiveNew(void) less than lowSpaceThreshold bytes free. This *will not* cause a GC :-) */ /* begin instantiateClass: */ classObj1 = longAt(GIV(stackPointer)); + /* begin formatOfClass: */ classFormat = ((longAt((classObj1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); if (!((instSpec <= 1) || (instSpec == 5))) { obj = null; - goto l7; + goto l9; } assert(addressCouldBeClassObj(classObj1)); classIndex = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 @@ -23219,8 +23020,9 @@ primitiveNew(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l7; + goto l9; } + /* begin fixedFieldsOfClassFormat: */ numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); /* begin allocateSlots:format:classIndex: */ if (numSlots >= (numSlotsMask())) { @@ -23241,7 +23043,7 @@ primitiveNew(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -23258,7 +23060,7 @@ primitiveNew(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; -l4: /* end allocateSlots:format:classIndex: */; +l5: /* end allocateSlots:format:classIndex: */; if (!(newObj == null)) { /* begin fillObj:numSlots:with: */ assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj))); @@ -23268,7 +23070,7 @@ primitiveNew(void) } } obj = newObj; -l7: /* end instantiateClass: */; +l9: /* end instantiateClass: */; if (obj == null) { /* begin primitiveFailFor: */ reasonCode = (isFixedSizePointerFormat(instSpecOfClass(longAt(GIV(stackPointer)))) @@ -23454,7 +23256,6 @@ primitiveNewWithArg(void) usqInt bs; sqInt ccIndex; sqInt classFormat; - sqInt classPointer; sqInt fmt; sqInt instSpec; sqInt obj; @@ -23484,10 +23285,10 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l9; } size = value; - goto l10; + goto l9; } if (oop1 & (tagMask())) { /* begin primitiveFail */ @@ -23495,23 +23296,23 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop1))); /* begin classIndexOf: */ ccIndex = (longAt(oop1)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; + goto l8; -l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l8: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } /* begin numBytesOfBytes: */ fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); @@ -23523,18 +23324,18 @@ primitiveNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l9; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))); - goto l10; + goto l9; } else { size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))); - goto l10; + goto l9; } -l10: /* end positiveMachineIntegerValueOf: */; +l9: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -23545,9 +23346,7 @@ primitiveNewWithArg(void) obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); if (obj == null) { /* begin instSpecOfClass: */ - classPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); - /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); /* begin primitiveFailFor: */ reasonCode = (((instSpec >= 2) @@ -23603,42 +23402,38 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(actualObj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (actualObj + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { actualObj = GIV(freeStart); - goto l1; + goto l5; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); actualObj = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l5: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(freeStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } if (oopisGreaterThan(GIV(pastSpaceStart), ((pastSpace()).start))) { /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - actualObj = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + actualObj = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); } @@ -23650,13 +23445,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(actualObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -23667,18 +23458,18 @@ primitiveNextInstance(void) followingWordAddress1 = (actualObj + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { actualObj = GIV(pastSpaceStart); - goto l2; + goto l10; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); actualObj = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l10: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(pastSpaceStart)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } actualObj = GIV(nilObj); @@ -23686,13 +23477,9 @@ primitiveNextInstance(void) while (1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(actualObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(actualObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(actualObj - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -23703,22 +23490,22 @@ primitiveNextInstance(void) followingWordAddress2 = (actualObj + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { actualObj = GIV(endOfMemory); - goto l3; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); actualObj = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; if (!(oopisLessThan(actualObj, GIV(endOfMemory)))) break; if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) { subsequentObject = actualObj; - goto l5; + goto l15; } } subsequentObject = null; - l5: /* end instanceAfter: */; + l15: /* end instanceAfter: */; if (!(subsequentObject == null)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), subsequentObject); @@ -23949,7 +23736,8 @@ primitiveObjectAtPut(void) thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if ( # if IMMUTABILITY - ((((usqInt) (longAt(thisReceiver))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -24009,30 +23797,28 @@ primitivePathToUsing(void) sqInt next; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; sqInt path; char *sp; sqInt stack; sqInt stackp; sqInt stackSize; - char *theSP; err = 0; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!(GIV(argumentCount) >= 2)) { /* begin primitiveFailFor: */ @@ -24050,7 +23836,7 @@ primitivePathToUsing(void) if (!(((stack & (tagMask())) == 0) && (((((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask())) == 2))) { err = PrimErrBadArgument; - goto l16; + goto l15; } assert(allObjectsUnmarked()); @@ -24060,38 +23846,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(stack + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(stack - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots11 = byteAt(stack + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(stack - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - stackSize = numSlots1; - goto l10; + stackSize = numSlots2; + goto l12; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - stackSize = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l10; + stackSize = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l12; } if (fmt1 >= (firstShortFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l10; + stackSize = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l12; } if (fmt1 >= (firstLongFormat())) { - stackSize = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l10; + stackSize = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l12; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - stackSize = ((usqInt) numSlots1) >> 1; - goto l10; + stackSize = ((usqInt) numSlots2) >> 1; + goto l12; } stackSize = 0; -l10: /* end lengthOf:format: */; +l12: /* end lengthOf:format: */; /* begin mark: */ setIsMarkedOfto(stack, 1); /* begin specialObjectsOop */ @@ -24101,38 +23883,34 @@ primitivePathToUsing(void) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(current))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(current + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(current - BaseHeaderSize); - } - else { - numSlots2 = numSlots5; - } + numSlots12 = byteAt(current + 7); + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(current - BaseHeaderSize) + : numSlots12); if (fmt2 <= 5) { - index = numSlots2; - goto l11; + index = numSlots3; + goto l14; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - index = (numSlots2 << (shiftForWord())) - (fmt2 & 7); - goto l11; + index = (numSlots3 << (shiftForWord())) - (fmt2 & 7); + goto l14; } if (fmt2 >= (firstShortFormat())) { - index = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l11; + index = (numSlots3 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l14; } if (fmt2 >= (firstLongFormat())) { - index = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l11; + index = (numSlots3 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l14; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - index = ((usqInt) numSlots2) >> 1; - goto l11; + index = ((usqInt) numSlots3) >> 1; + goto l14; } index = 0; -l11: /* end lengthOf:format: */; +l14: /* end lengthOf:format: */; stackp = 0; while(1) { while (((index -= 1)) >= -1) { @@ -24187,18 +23965,18 @@ primitivePathToUsing(void) longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(stackp) << (shiftForWord())))), current); pruneStackstackp(stack, stackp); err = 0; - goto l16; + goto l15; } if (((next & 1) == 0) && (((((((usqInt)next)) & (BytesPerWord - 1)) == 0) && ((((((usqInt)next)) >= (((usqInt)GIV(stackMemory)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages)))))) ? !(((longAt(next + FoxFrameFlags)) & 2) != 0) - : (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) + : (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) && (((((next & (tagMask())) == 0) && (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) <= 5)) || (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) && (followWeak - || (!(isWeakNonImm(next)))))))) { + || (!(isWeakFormat((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()))))))))) { if ((stackp + 2) > stackSize) { assert(freeStartAtStart == (freeStart())); unmarkAfterPathTo(); @@ -24208,7 +23986,7 @@ primitivePathToUsing(void) longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); } err = PrimErrBadIndex; - goto l16; + goto l15; } /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(stack))); @@ -24228,49 +24006,40 @@ primitivePathToUsing(void) /* begin mark: */ setIsMarkedOfto(next, 1); if (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - index = ((assert((((assert(isCompiledMethod(next)), -/* begin fetchPointer:ofObject: */ -longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(next)), -/* begin fetchPointer:ofObject: */ -longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + index = (literalCountOf(next)) + LiteralStart; } else { /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(next))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(next + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(next - BaseHeaderSize); - } - else { - numSlots = numSlots3; - } + numSlots1 = byteAt(next + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(next - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { index = numSlots; - goto l9; + goto l10; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ index = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l10; } if (fmt >= (firstShortFormat())) { index = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l10; } if (fmt >= (firstLongFormat())) { index = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l10; } if (fmt == (sixtyFourBitIndexableFormat())) { index = ((usqInt) numSlots) >> 1; - goto l9; + goto l10; } index = 0; - l9: /* end lengthOf:format: */; + l10: /* end lengthOf:format: */; } } current = next; @@ -24285,14 +24054,14 @@ longAt((next + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord( longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); } err = PrimErrNotFound; - goto l16; + goto l15; } index = ((longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 1)) << (shiftForWord())))))) >> 1); /* begin fetchPointer:ofObject: */ current = longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 2)) << (shiftForWord()))))); stackp -= 2; } -l16: /* end pathTo:using:followWeak: */; +l15: /* end pathTo:using:followWeak: */; if (err != 0) { /* begin primitiveFailFor: */ return (GIV(primFailCode) = err); @@ -24386,22 +24155,18 @@ primitivePerformInSuperclass(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l21; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l11; + goto l21; } /* Push newMethod to save it in case of failure, @@ -24459,7 +24224,7 @@ primitivePerformInSuperclass(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l11; + goto l21; } /* +2 = receiver + saved newMethod */ @@ -24473,7 +24238,7 @@ primitivePerformInSuperclass(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -24500,7 +24265,7 @@ primitivePerformInSuperclass(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l16; } } /* begin activateNewMethod */ @@ -24568,11 +24333,11 @@ primitivePerformInSuperclass(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l17; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l17: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -24582,10 +24347,10 @@ primitivePerformInSuperclass(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l6: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; -l11: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l21: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } /* InterpreterPrimitives>>#primitivePerformWithArgs */ @@ -24633,22 +24398,18 @@ primitivePerformWithArgs(void) && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l7; + goto l17; } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l7; + goto l17; } /* Push newMethod to save it in case of failure, @@ -24696,7 +24457,7 @@ primitivePerformWithArgs(void) GIV(newMethod) = top; /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadNumArgs; - goto l7; + goto l17; } /* +2 = receiver + saved newMethod */ @@ -24710,7 +24471,7 @@ primitivePerformWithArgs(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l16; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -24737,7 +24498,7 @@ primitivePerformWithArgs(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l16; } } /* begin activateNewMethod */ @@ -24805,11 +24566,11 @@ primitivePerformWithArgs(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -24819,10 +24580,10 @@ primitivePerformWithArgs(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l6: /* end executeNewMethod */; +l16: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; -l7: /* end primitiveObject:perform:withArguments:lookedUpIn: */; +l17: /* end primitiveObject:perform:withArguments:lookedUpIn: */; } @@ -25245,7 +25006,7 @@ primitiveScanCharacters(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { kernDelta = (integerPointer >> 1); - goto l10; + goto l14; } else { /* begin primitiveFail */ @@ -25253,16 +25014,16 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } kernDelta = 0; - goto l10; + goto l14; } -l10: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; stops = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { scanRightX = (integerPointer1 >> 1); - goto l11; + goto l15; } else { /* begin primitiveFail */ @@ -25270,16 +25031,16 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanRightX = 0; - goto l11; + goto l15; } -l11: /* end stackIntegerValue: */; +l15: /* end stackIntegerValue: */; sourceString = longAt(GIV(stackPointer) + (3 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (4 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { scanStopIndex = (integerPointer2 >> 1); - goto l12; + goto l16; } else { /* begin primitiveFail */ @@ -25287,15 +25048,15 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanStopIndex = 0; - goto l12; + goto l16; } -l12: /* end stackIntegerValue: */; +l16: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer3 = longAt(GIV(stackPointer) + (5 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer3 & 1)) { scanStartIndex = (integerPointer3 >> 1); - goto l13; + goto l17; } else { /* begin primitiveFail */ @@ -25303,9 +25064,9 @@ primitiveScanCharacters(void) GIV(primFailCode) = 1; } scanStartIndex = 0; - goto l13; + goto l17; } -l13: /* end stackIntegerValue: */; +l17: /* end stackIntegerValue: */; rcvr = longAt(GIV(stackPointer) + (6 * BytesPerWord)); if (GIV(primFailCode)) { return; @@ -25561,7 +25322,6 @@ primitiveScreenScaleFactor(void) static void primitiveScreenSize(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -25581,8 +25341,7 @@ primitiveScreenSize(void) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -25605,13 +25364,13 @@ primitiveScreenSize(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l5; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l5: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)((((usqInt) pointWord) >> 16) & 0xFFFF) << 1) | 1)); @@ -25645,7 +25404,7 @@ primitiveSecondsClock(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop = ((integerValue << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -25668,13 +25427,13 @@ primitiveSecondsClock(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -25685,9 +25444,9 @@ primitiveSecondsClock(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); GIV(stackPointer) = sp; } @@ -25838,7 +25597,8 @@ primitiveSetImmutability(void) } wasImmutable = # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -25850,12 +25610,12 @@ primitiveSetImmutability(void) return; } /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) | (1U << 23)); + longAtput(rcvr, (longAt(rcvr)) | (1U << (immutableBitShift()))); } else { if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { /* begin setIsImmutableOf:to: */ - longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << 23))); + longAtput(rcvr, (longAt(rcvr)) & ((unsigned int)~(1U << (immutableBitShift())))); } else { /* begin primitiveFailFor: */ @@ -25935,38 +25695,33 @@ primitiveSetLogDirectory(void) /* begin byteSizeOf: */ if (stringOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(stringOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(stringOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(stringOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(stringOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetLogDirectoryOfSize(firstIndexableField(stringOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -25994,10 +25749,10 @@ primitiveSetOrHasIdentityHash(void) hasHash = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) && ((long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask())); /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (GIV(argumentCount) == 2) { @@ -26032,7 +25787,7 @@ primitiveSetOrHasIdentityHash(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { hash = (integerPointer >> 1); - goto l4; + goto l5; } else { /* begin primitiveFail */ @@ -26040,9 +25795,9 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } hash = 0; - goto l4; + goto l5; } -l4: /* end stackIntegerValue: */; +l5: /* end stackIntegerValue: */; /* begin stackObjectValue: */ oop = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); if (oop & (tagMask())) { @@ -26051,10 +25806,10 @@ primitiveSetOrHasIdentityHash(void) GIV(primFailCode) = 1; } thisReceiver = null; - goto l5; + goto l3; } thisReceiver = oop; -l5: /* end stackObjectValue: */; +l3: /* end stackObjectValue: */; if (!GIV(primFailCode)) { /* begin hashBitsOf: */ hash1 = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask()); @@ -26079,8 +25834,8 @@ primitiveSetOrHasIdentityHash(void) allInstancesOf(thisReceiver); } /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 1) | 1)); + GIV(stackPointer) = sp1; } } @@ -26112,38 +25867,33 @@ primitiveSetWindowLabel(void) /* begin byteSizeOf: */ if (labelOop & (tagMask())) { sz = 0; - goto l2; + goto l3; } /* begin numBytesOf: */ fmt = (((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(labelOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(labelOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(labelOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(labelOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { /* bytes (the common case), including CompiledMethod */ sz = numBytes - (fmt & 7); - goto l5; + goto l3; } if (fmt <= (sixtyFourBitIndexableFormat())) { sz = numBytes; - goto l5; + goto l3; } if (fmt >= (firstShortFormat())) { sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); - goto l5; + goto l3; } sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); -l5: /* end numBytesOf: */; -l2: /* end byteSizeOf: */; +l3: /* end byteSizeOf: */; ioSetWindowLabelOfSize(firstIndexableField(labelOop), sz); if (!GIV(primFailCode)) { /* begin pop: */ @@ -26227,7 +25977,7 @@ primitiveShortAt(void) } rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; @@ -26275,14 +26025,15 @@ primitiveShortAtPut(void) } rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); if (!(((rcvr & (tagMask())) == 0) - && (isWordsOrBytesNonImm(rcvr)))) { + && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; return; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -26461,14 +26212,14 @@ primitiveSine(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; if (!GIV(primFailCode)) { /* begin pushFloat: */ f = sin(rcvr); @@ -26515,37 +26266,33 @@ primitiveSize(void) } /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l2; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l2; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l2; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l2; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l2; + goto l3; } totalLength = 0; -l2: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { @@ -26814,14 +26561,14 @@ primitiveSquareRoot(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l2; + goto l1; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l2: /* end floatValueOf: */; +l1: /* end popFloat */; /* begin success: */ if (!(rcvr >= 0.0)) { @@ -26951,68 +26698,63 @@ primitiveStringAt(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l14; } if (((index & 1) == 0) || ((GIV(argumentCount) > 1) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l14; } index = (index >> 1); /* begin stObject:at: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27021,23 +26763,23 @@ primitiveStringAt(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); - goto l16; + goto l13; } } else { @@ -27051,19 +26793,19 @@ primitiveStringAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l16; + goto l13; } if (fmt >= (firstByteFormat())) { result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l16; + goto l13; } if (fmt >= (firstShortFormat())) { result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l16; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l16; + goto l13; } /* begin positive32BitIntegerFor: */ @@ -27072,7 +26814,7 @@ primitiveStringAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { result = ((integerValue << 1) | 1); - goto l16; + goto l13; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -27101,7 +26843,7 @@ primitiveStringAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -27112,7 +26854,7 @@ primitiveStringAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); result = newLargeInteger; - goto l16; + goto l13; } /* begin primitiveFailFor: */ @@ -27121,14 +26863,14 @@ primitiveStringAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; result = 0; -l16: /* end stObject:at: */; +l13: /* end stObject:at: */; if (!GIV(primFailCode)) { if (!(((result >= 0) && (result <= ((1U << 30) - 1))))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; - goto l1; + goto l14; } - /* begin characterObjectOf: */ + /* begin characterForAscii: */ result = (((sqInt)((usqInt)(((result >> 1))) << (numTagBits())))) + (characterTag()); @@ -27136,7 +26878,7 @@ primitiveStringAt(void) longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); GIV(stackPointer) = sp; } -l1: /* end commonAt: */; +l14: /* end commonAt: */; } /* InterpreterPrimitives>>#primitiveStringAtPut */ @@ -27172,81 +26914,77 @@ primitiveStringAtPut(void) if (rcvr & (tagMask())) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrInappropriate; - goto l1; + goto l30; } if (((index & 1) == 0) || ((GIV(argumentCount) > 2) && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; - goto l1; + goto l30; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrNoModification; - goto l1; + goto l30; } index = (index >> 1); /* begin stObject:at:put: */ value1 = asciiOfCharacter(value); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -27255,23 +26993,23 @@ primitiveStringAtPut(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); stSize = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value1); - goto l17; + goto l15; } } else { @@ -27298,37 +27036,37 @@ primitiveStringAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value1); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value1 & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value1 >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value1); @@ -27336,7 +27074,7 @@ primitiveStringAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value1); @@ -27344,7 +27082,7 @@ primitiveStringAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -27353,14 +27091,14 @@ primitiveStringAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } -l17: /* end stObject:at:put: */; +l15: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp; } -l1: /* end commonAtPut: */; +l30: /* end commonAtPut: */; } @@ -27388,8 +27126,8 @@ primitiveStringReplace(void) sqInt integerPointer2; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt repl; usqLong replFmt; sqInt replInstSize; @@ -27406,7 +27144,7 @@ primitiveStringReplace(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { start = (integerPointer >> 1); - goto l15; + goto l14; } else { /* begin primitiveFail */ @@ -27414,15 +27152,15 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } start = 0; - goto l15; + goto l14; } -l15: /* end stackIntegerValue: */; +l14: /* end stackIntegerValue: */; /* begin stackIntegerValue: */ integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer1 & 1)) { stop = (integerPointer1 >> 1); - goto l16; + goto l15; } else { /* begin primitiveFail */ @@ -27430,16 +27168,16 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } stop = 0; - goto l16; + goto l15; } -l16: /* end stackIntegerValue: */; +l15: /* end stackIntegerValue: */; repl = longAt(GIV(stackPointer) + (1 * BytesPerWord)); /* begin stackIntegerValue: */ integerPointer2 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); /* begin checkedIntegerValueOf: */ if ((integerPointer2 & 1)) { replStart = (integerPointer2 >> 1); - goto l17; + goto l16; } else { /* begin primitiveFail */ @@ -27447,9 +27185,9 @@ primitiveStringReplace(void) GIV(primFailCode) = 1; } replStart = 0; - goto l17; + goto l16; } -l17: /* end stackIntegerValue: */; +l16: /* end stackIntegerValue: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadArgument; @@ -27465,7 +27203,8 @@ primitiveStringReplace(void) if ((stop >= start) && ( # if IMMUTABILITY - ((((usqInt) (longAt(array))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(array))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -27477,38 +27216,34 @@ primitiveStringReplace(void) hdr = long64At(array); arrayFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots2 = byteAt(array + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(array + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (arrayFmt <= 5) { totalLength = numSlots; - goto l12; + goto l18; } if (arrayFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (arrayFmt & 7); - goto l12; + goto l18; } if (arrayFmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (arrayFmt & 3); - goto l12; + goto l18; } if (arrayFmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (arrayFmt & 1); - goto l12; + goto l18; } if (arrayFmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l18; } totalLength = 0; -l12: /* end lengthOf:format: */; +l18: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((arrayFmt >= (sixtyFourBitIndexableFormat())) || (arrayFmt == 2)) { @@ -27534,53 +27269,49 @@ primitiveStringReplace(void) hdr = long64At(repl); replFmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); /* begin lengthOf:format: */ - numSlots3 = byteAt(repl + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(repl - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(repl + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(repl - BaseHeaderSize) + : numSlots11); if (replFmt <= 5) { - totalLength = numSlots1; - goto l13; + totalLength = numSlots2; + goto l21; } if (replFmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - totalLength = (numSlots1 << (shiftForWord())) - (replFmt & 7); - goto l13; + totalLength = (numSlots2 << (shiftForWord())) - (replFmt & 7); + goto l21; } if (replFmt >= (firstShortFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 1)) - (replFmt & 3); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 1)) - (replFmt & 3); + goto l21; } if (replFmt >= (firstLongFormat())) { - totalLength = (numSlots1 << ((shiftForWord()) - 2)) - (replFmt & 1); - goto l13; + totalLength = (numSlots2 << ((shiftForWord()) - 2)) - (replFmt & 1); + goto l21; } if (replFmt == (sixtyFourBitIndexableFormat())) { - totalLength = ((usqInt) numSlots1) >> 1; - goto l13; + totalLength = ((usqInt) numSlots2) >> 1; + goto l21; } totalLength = 0; -l13: /* end lengthOf:format: */; +l21: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((replFmt >= (sixtyFourBitIndexableFormat())) || (replFmt == 2)) { replInstSize = 0; - goto l21; + goto l22; } if (replFmt < 2) { replInstSize = totalLength; - goto l21; + goto l22; } class1 = fetchClassOfNonImm(repl); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); replInstSize = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); -l21: /* end fixedFieldsOf:format:length: */; +l22: /* end fixedFieldsOf:format:length: */; if (!((replStart >= 1) && ((((stop - start) + replStart) + replInstSize) <= totalLength))) { /* begin primitiveFailFor: */ @@ -28110,14 +27841,14 @@ primitiveTruncated(void) if (isFloat) { fetchFloatAtinto(oop + BaseHeaderSize, result); rcvr = result; - goto l3; + goto l2; } /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } rcvr = 0.0; -l3: /* end floatValueOf: */; +l2: /* end popFloat */; if (!GIV(primFailCode)) { modf(rcvr, (&trunc)); /* begin success: */ @@ -28166,10 +27897,10 @@ primitiveUnloadModule(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -28221,8 +27952,8 @@ primitiveUnloadModule(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -28238,37 +27969,33 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -28283,32 +28010,28 @@ primitiveUnloadModule(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -28330,20 +28053,16 @@ primitiveUnloadModule(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -28559,10 +28278,10 @@ primitiveVMProfileSamplesInto(void) ioNewProfileStatus((&running), (&bufferSize)); if (GIV(argumentCount) == 0) { /* begin pop:thenPushBool: */ - longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running ? GIV(trueObj) : GIV(falseObj))); - GIV(stackPointer) = sp1; + GIV(stackPointer) = sp; return; } if (!(GIV(argumentCount) == 1)) { @@ -28580,8 +28299,8 @@ primitiveVMProfileSamplesInto(void) } numSamples = ioNewProfileSamplesInto(firstFixedField(sampleBuffer)); /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); - GIV(stackPointer) = sp; + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); + GIV(stackPointer) = sp1; } /* InterpreterPrimitives>>#primitiveWait */ @@ -28852,13 +28571,9 @@ signedMachineIntegerValueOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -28925,7 +28640,6 @@ sizeOfAlienData(sqInt oop) GIV(primFailCode) = PrimErrBadArgument; return 0; } - /* begin sizeFieldOfAlien: */ size = longAt(oop + BaseHeaderSize); return SQABS(size); } @@ -29099,13 +28813,9 @@ addressAfter(sqInt objOop) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -29390,18 +29100,10 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to l16: /* end allocateOldSpaceChunkOfBytes:suchThat: */; if (!(chunk)) { chunk = allocateOldSpaceChunkOfBytes(totalBytes); - if (!(chunk == null)) { - ((segmentContainingObj(chunk))->containsPinned = 1); + if (!(chunk)) { + return null; } - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - if (!(chunk)) { - return null; + ((segmentContainingObj(chunk))->containsPinned = 1); } if (numSlots >= (numSlotsMask())) { @@ -29409,10 +29111,22 @@ allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt to flag("endianness"); longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << 30)); + long64Atput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } - long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << 30)); + long64Atput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << (pinnedBitShift()))); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -29428,12 +29142,6 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt chunk; chunk = allocateOldSpaceChunkOfBytes(totalBytes); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } if (!(chunk)) { return null; } @@ -29444,9 +29152,21 @@ allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, longAtput(chunk, numSlots); longAtput(chunk + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(chunk + BaseHeaderSize, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk + BaseHeaderSize; } long64Atput(chunk, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } return chunk; } @@ -29474,7 +29194,6 @@ bytesInObject(sqInt objOop) headerNumSlots = byteAt(objOop + 7); if (headerNumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ numSlots = longAt(objOop - BaseHeaderSize); } else { @@ -29516,7 +29235,8 @@ changeClassOfto(sqInt rcvr, sqInt argClass) if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -29530,16 +29250,16 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin classFormatForInstanceFormat: */ if (instFormat < (firstLongFormat())) { normalizedInstFormat = instFormat; - goto l2; + goto l5; } if (instFormat >= (firstByteFormat())) { normalizedInstFormat = instFormat & -8; - goto l2; + goto l5; } normalizedInstFormat = (instFormat >= (firstShortFormat()) ? instFormat & -4 : instFormat & -2); -l2: /* end classFormatForInstanceFormat: */; +l5: /* end classFormatForInstanceFormat: */; if (((assert(addressCouldBeClassObj(argClass)), (classIndex = (((hash = (long32At(argClass + 4)) & (identityHashHalfWordMask()))) != 0 ? hash @@ -29575,13 +29295,9 @@ changeClassOfto(sqInt rcvr, sqInt argClass) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(rcvr + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(rcvr - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -29774,13 +29490,13 @@ floatObjectOf(double aFloat) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newFloatObj = 0; - goto l2; + goto l1; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFloatCompactIndex); GIV(freeStart) += numBytes; newFloatObj = newObj; -l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; storeFloatAtfrom(newFloatObj + BaseHeaderSize, aFloat); return newFloatObj; } @@ -29875,16 +29591,16 @@ initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address) if (numSlots == 0) { /* short bridge for adjacent segments */ - longAtput(address, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 4, 1U << 23); + longAtput(address, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 4, 1U << (markedBitHalfShift())); } else { /* long bridge */ longAtput(address, numSlots); longAtput(address + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); - longAtput(address + 8, ((1U << 30) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); - longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << 23)); + longAtput(address + 8, ((1U << (pinnedBitShift())) + (((sqInt)((usqInt)((firstLongFormat())) << (formatShift()))))) + (segmentBridgePun())); + longAtput(address + 12, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))) + (1U << (markedBitHalfShift()))); } } @@ -30093,7 +29809,7 @@ sqInt isMarked(sqInt objOop) { flag("endianness"); - return ((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0; + return ((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0; } @@ -30110,13 +29826,9 @@ lengthOfformat(sqInt objOop, sqInt fmt) /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -30166,7 +29878,7 @@ numFreeLists(void) /* Object parsing. 1. all objects have at least a word following the header, for a forwarding - pointer. 2. objects with an overflow size have a preceeing word with a + pointer. 2. objects with an overflow size have a preceding word with a saturated numSlots. If the word following an object doesn't have a saturated numSlots field it must be a single-header object. @@ -30185,13 +29897,9 @@ objectAfterlimit(sqInt objOop, sqInt limit) /* begin addressAfter: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30217,8 +29925,8 @@ setIsMarkedOfto(sqInt objOop, sqInt aBoolean) assert(!(isFreeObject(objOop))); flag("endianness"); longAtput(objOop + 4, (aBoolean - ? (longAt(objOop + 4)) | (1U << 23) - : (longAt(objOop + 4)) & ((unsigned int)~(1U << 23)))); + ? (longAt(objOop + 4)) | (1U << (markedBitHalfShift())) + : (longAt(objOop + 4)) & ((unsigned int)~(1U << (markedBitHalfShift()))))); } @@ -30268,7 +29976,7 @@ addToEphemeronList(sqInt ephemeronCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) ephemeronListOffset) >> 5; + hash = ((usqInt) ephemeronListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(ephemeronCorpse + 4, ((((long32At(ephemeronCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -30305,7 +30013,7 @@ addToWeakList(sqInt weakCorpse) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) weakListOffset) >> 5; + hash = ((usqInt) weakListOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(weakCorpse + 4, ((((long32At(weakCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -30367,13 +30075,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -30384,14 +30088,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); @@ -30410,13 +30114,9 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -30427,14 +30127,14 @@ allNewSpaceObjectsHaveZeroRTRefCount(void) followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 1; } @@ -30460,8 +30160,8 @@ allWeakSurvivorsOnWeakList(void) prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = (GIV(futureSpace).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(futureSurvivorStart); @@ -30476,31 +30176,27 @@ allWeakSurvivorsOnWeakList(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -30629,7 +30325,6 @@ copyAndForwardMourner(sqInt mourner) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -30679,11 +30374,10 @@ copyAndForwardMourner(sqInt mourner) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(mourner, ((longAt(mourner)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(mourner); } @@ -30703,7 +30397,6 @@ copyAndForward(sqInt survivor) usqInt bytesInObj; sqInt classIndex; sqInt format; - sqInt format1; unsigned int header; sqInt newLocation; sqInt newStart; @@ -30769,11 +30462,10 @@ copyAndForward(sqInt survivor) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(survivor, ((longAt(survivor)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); if (format == (weakArrayFormat())) { addToWeakList(survivor); } @@ -30858,10 +30550,134 @@ copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSur return newOop; } + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Leave it to scavengeLoop + to remove any scavenged ephemerons that no longer have + new referents. */ + + /* SpurGenerationScavenger>>#fireEphemeronsInRememberedSet */ +static void +fireEphemeronsInRememberedSet(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt i; + sqInt key; + sqInt valuePointer; + + assert(noUnfiredEphemeronsAtEndOfRememberedSet()); + i = 0; + while (i < GIV(numRememberedEphemerons)) { + ephemeron = GIV(rememberedSet)[i]; + assert(isEphemeron(ephemeron)); + assert((isNonImmediate(ephemeron)) + && (isObjEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + if (scavengeReferentsOf(ephemeron)) { + + /* keep in set */ + i += 1; + } + else { + /* begin setIsRememberedOf:to: */ + longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(numRememberedEphemerons) -= 1; + GIV(previousRememberedSetSize) -= 1; + + /* First overwrite with last firable ephemeron (could be a noop if this is the last one). + Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). + Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); + GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + GIV(numRememberedEphemerons) = 0; +} + + +/* There are ephemerons to be fired in the remembered set. + Fire them and scavenge their keys. Be careful since copyAndForward: + can remember ephemerons (ephemerons pointing to ephemerons). */ +/* old ones for debugging */ + + /* SpurGenerationScavenger>>#fireEphemeronsOnEphemeronList */ +static void +fireEphemeronsOnEphemeronList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + usqInt ephemeronCorpse; + sqInt key; + sqInt listOffset; + sqInt oldCorpse; + sqInt oldList; + sqInt referent; + sqInt valuePointer; + + if (!(GIV(ephemeronList))) { + return; + } + oldCorpse = null; + /* begin corpseForCorpseOffset: */ + ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); + oldList = GIV(ephemeronList); + GIV(ephemeronList) = null; + while (ephemeronCorpse != null) { + assert((isYoung(ephemeronCorpse)) + && (isForwarded(ephemeronCorpse))); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(ephemeronCorpse)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + ephemeron = referent; + assert((isNonImmediate(ephemeron)) + && (isMaybeFiredEphemeron(ephemeron))); + /* begin fetchPointer:ofObject: */ + key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); + + if (!(isScavengeSurvivor(key))) { + fireEphemeron(ephemeron); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = copyAndForward(key); + assert(!(isOopForwarded(ephemeron))); + longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); + } + assert(!(((isScavengeSurvivor(key)) + && (isEphemeron(ephemeron))))); + ((void) (scavengeReferentsOf(ephemeron))); + oldCorpse = ephemeronCorpse; + /* begin nextCorpseOrNil: */ + assert(isYoung(ephemeronCorpse)); + listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + ephemeronCorpse = (listOffset != 0 + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) + : 0); + } +} + /* SpurGenerationScavenger>>#firstCorpse: */ static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList) { DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin corpseForCorpseOffset: */ return (((sqInt)((usqInt)((headOfCorpseList - 1)) << 3))) + GIV(newSpaceStart); } @@ -30891,13 +30707,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(obj - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); assert(numSlots >= 1024); /* begin allocatePinnedSlots: */ nSlots1 = numSlots * 2; @@ -30945,7 +30757,7 @@ growRememberedSet(void) for (i = 0; i < GIV(rememberedSetSize); i += 1) { base[i] = (GIV(rememberedSet)[i]); } - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { setIsMarkedOfto(newObj, 1); setIsMarkedOfto(obj, 0); } @@ -30954,13 +30766,9 @@ growRememberedSet(void) /* begin numSlotsOf: */ assert((classIndexOf(newObj)) > (isForwardedObjectClassIndexPun())); numSlots2 = byteAt(newObj + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(newObj - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots2; - } + GIV(rememberedSetLimit) = (numSlots2 == (numSlotsMask()) + ? longAt(newObj - BaseHeaderSize) + : numSlots2); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -31016,7 +30824,7 @@ isMaybeOldScavengeSurvivor(sqInt oop) return ((assert(isNonImmediate(target)), oopisGreaterThanOrEqualTo(target, GIV(oldSpaceStart))) ? (GIV(tenureCriterion) != MarkOnTenure) - || (((((usqInt) (longAt(target + 4))) >> 23) & 1) != 0) + || (((((usqInt) (longAt(target + 4))) >> (markedBitHalfShift())) & 1) != 0) : oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart())); } @@ -31069,6 +30877,7 @@ isonWeaklingList(sqInt oop, sqInt listHead) usqInt corpse; sqInt listOffset; + /* begin firstCorpse: */ corpse = (((sqInt)((usqInt)((listHead - 1)) << 3))) + GIV(newSpaceStart); while (corpse != null) { if (oop == (followForwarded(corpse))) { @@ -31076,9 +30885,10 @@ isonWeaklingList(sqInt oop, sqInt listHead) } /* begin nextCorpseOrNil: */ assert(isYoung(corpse)); - listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask())); corpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } return 0; @@ -31150,31 +30960,17 @@ printRememberedSet(void) static void processEphemerons(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt ephemeron1; - usqInt ephemeronCorpse; - sqInt format; - sqInt format1; sqInt hasNewReferents; sqInt i; - sqInt i1; - sqInt key; - sqInt key1; - sqInt listOffset; - sqInt oldCorpse; - sqInt oldList; - sqInt referent; sqInt referrer; sqInt unfiredEphemeronsScavenged; sqInt unfiredEphemeronsScavenged1; - sqInt valuePointer; - sqInt valuePointer1; /* begin scavengeUnfiredEphemeronsInRememberedSet */ unfiredEphemeronsScavenged1 = 0; - i1 = 0; - while (i1 < GIV(numRememberedEphemerons)) { - referrer = GIV(rememberedSet)[i1]; + i = 0; + while (i < GIV(numRememberedEphemerons)) { + referrer = GIV(rememberedSet)[i]; assert(isEphemeron(referrer)); if (isScavengeSurvivor((assert((isNonImmediate(referrer)) && (isObjEphemeron(referrer))), @@ -31185,7 +30981,7 @@ processEphemerons(void) /* remove from unscanned ephemerons in set by swapping with last ephemeron */ hasNewReferents = scavengeReferentsOf(referrer); GIV(numRememberedEphemerons) -= 1; - GIV(rememberedSet)[i1] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); + GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); if (hasNewReferents) { /* keep in set */ @@ -31203,7 +30999,7 @@ processEphemerons(void) } } else { - i1 += 1; + i += 1; } } unfiredEphemeronsScavenged = unfiredEphemeronsScavenged1; @@ -31211,111 +31007,8 @@ processEphemerons(void) unfiredEphemeronsScavenged = 1; } if (!unfiredEphemeronsScavenged) { - /* begin fireEphemeronsInRememberedSet */ - assert(noUnfiredEphemeronsAtEndOfRememberedSet()); - i = 0; - while (i < GIV(numRememberedEphemerons)) { - ephemeron = GIV(rememberedSet)[i]; - assert(isEphemeron(ephemeron)); - assert((isNonImmediate(ephemeron)) - && (isObjEphemeron(ephemeron))); - /* begin fetchPointer:ofObject: */ - key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer = copyAndForward(key); - assert(!(isOopForwarded(ephemeron))); - longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer); - } - assert(!(((isScavengeSurvivor(key)) - && (isEphemeron(ephemeron))))); - if (scavengeReferentsOf(ephemeron)) { - - /* keep in set */ - i += 1; - } - else { - /* begin setIsRememberedOf:to: */ - longAtput(ephemeron, (longAt(ephemeron)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(numRememberedEphemerons) -= 1; - GIV(previousRememberedSetSize) -= 1; - - /* First overwrite with last firable ephemeron (could be a noop if this is the last one). - Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop). - Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */ - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]); - GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]); - GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - GIV(numRememberedEphemerons) = 0; - /* begin fireEphemeronsOnEphemeronList */ - if (!(GIV(ephemeronList))) { - goto l12; - } - oldCorpse = null; - /* begin corpseForCorpseOffset: */ - ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3))) + GIV(newSpaceStart); - oldList = GIV(ephemeronList); - GIV(ephemeronList) = null; - while (ephemeronCorpse != null) { - assert((isYoung(ephemeronCorpse)) - && (isForwarded(ephemeronCorpse))); - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(ephemeronCorpse)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - ephemeron1 = referent; - assert((isNonImmediate(ephemeron1)) - && (isMaybeFiredEphemeron(ephemeron1))); - /* begin fetchPointer:ofObject: */ - key1 = longAt((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord()))); - - if (!(isScavengeSurvivor(key1))) { - /* begin fireEphemeron: */ - queueMourner(ephemeron1); - /* begin setFormatOf:to: */ - format1 = 1; - assert(((format1 >= 0) && (format1 <= (formatMask())))); - flag("endianness"); - longAtput(ephemeron1, ((longAt(ephemeron1)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format1) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - /* begin storePointerUnchecked:ofObject:withValue: */ - valuePointer1 = copyAndForward(key1); - assert(!(isOopForwarded(ephemeron1))); - longAtput((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1); - } - assert(!(((isScavengeSurvivor(key1)) - && (isEphemeron(ephemeron1))))); - ((void) (scavengeReferentsOf(ephemeron1))); - oldCorpse = ephemeronCorpse; - /* begin nextCorpseOrNil: */ - assert(isYoung(ephemeronCorpse)); - listOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); - ephemeronCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) - : 0); - } - l12: /* end fireEphemeronsOnEphemeronList */; + fireEphemeronsInRememberedSet(); + fireEphemeronsOnEphemeronList(); } } @@ -31359,6 +31052,7 @@ processWeaklings(void) } } if (!(GIV(weakList) == null)) { + /* begin firstCorpse: */ weakCorpse = (((sqInt)((usqInt)((GIV(weakList) - 1)) << 3))) + GIV(newSpaceStart); while (weakCorpse != null) { assert(isForwarded(weakCorpse)); @@ -31380,9 +31074,10 @@ processWeaklings(void) } /* begin nextCorpseOrNil: */ assert(isYoung(weakCorpse)); - listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); + listOffset = (((int)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask())); weakCorpse = (listOffset != 0 - ? (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart) + ? (/* begin corpseForCorpseOffset: */ + (((sqInt)((usqInt)((listOffset - 1)) << 3))) + GIV(newSpaceStart)) : 0); } GIV(weakList) = null; @@ -31461,13 +31156,7 @@ processWeakSurvivor(sqInt weakObj) } } if (weakObjShouldMourn) { - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakObj); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakObj); } return hasYoungReferents; } @@ -31522,13 +31211,9 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress) : ptr); /* begin addressAfter: */ numSlots1 = byteAt(obj + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(obj - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(obj - BaseHeaderSize) + : numSlots1); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -31584,7 +31269,6 @@ scavengeLoop(void) sqInt oop; sqInt previousFutureSurvivorStart; StackPage *thePage; - char *theSP; assert(GIV(futureSurvivorStart) == ((GIV(futureSpace).start))); GIV(weakList) = (GIV(ephemeronList) = null); @@ -31598,14 +31282,13 @@ scavengeLoop(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { @@ -31703,16 +31386,12 @@ scavengeReferentsOf(sqInt referrer) /* begin numSlotsOf: */ assert((classIndexOf(referrer)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(referrer + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(referrer - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(referrer - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (indexablePointersFormat())) { if (((longAt(referrer)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -31721,16 +31400,16 @@ scavengeReferentsOf(sqInt referrer) sp = longAt((referrer + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l4; + goto l5; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(referrer))); contextSize = (sp >> 1); - l4: /* end fetchStackPointerOf: */; + l5: /* end fetchStackPointerOf: */; numSlots = CtxtTempFrameStart + contextSize; - goto l8; + goto l9; } numSlots = numSlots2; - goto l8; + goto l9; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -31738,31 +31417,31 @@ scavengeReferentsOf(sqInt referrer) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l8; + goto l9; } assert(fmt == (ephemeronFormat())); numSlots = (isScavengeSurvivor((keyOfEphemeron(referrer))) ? numSlots2 : 0); - goto l8; + goto l9; } if (fmt == 7) { numSlots = 1; - goto l8; + goto l9; } if (fmt < (firstCompiledMethodFormat())) { numSlots = 0; - goto l8; + goto l9; } /* begin methodHeaderOf: */ assert(isCompiledMethod(referrer)); /* begin fetchPointer:ofObject: */ header = longAt((referrer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numSlots = numLiterals + LiteralStart; -l8: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; +l9: /* end numStrongSlotsOf:format:ephemeronInactiveIf: */; for (i = 0; i < numSlots; i += 1) { referent = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { @@ -31900,6 +31579,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) unfiredEphemeronsScavenged = 0; corpseOffset = GIV(ephemeronList); while (corpseOffset != 0) { + /* begin corpseForCorpseOffset: */ ephemeronCorpse = (((sqInt)((usqInt)((corpseOffset - 1)) << 3))) + GIV(newSpaceStart); assert(isForwarded(ephemeronCorpse)); /* begin followForwarded: */ @@ -31912,7 +31592,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); } ephemeron = referent; - nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << 5))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); + nextCorpseOffset = (((int)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask())); if (isScavengeSurvivor((assert((isNonImmediate(ephemeron)) && (isObjEphemeron(ephemeron))), /* begin fetchPointer:ofObject: */ @@ -31929,7 +31609,7 @@ scavengeUnfiredEphemeronsOnEphemeronList(void) /* On 64-bit gcc 4.4.7-4 the following is miscompiled at -O2; the first assignment is lost */ /* begin setHashBitsOf:to: */ - hash = ((usqInt) nextCorpseOffset) >> 5; + hash = ((usqInt) nextCorpseOffset) >> (formatFieldWidthShift()); assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); long32Atput(previousCorpse + 4, ((((long32At(previousCorpse + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); /* begin setFormatOf:to: */ @@ -31998,31 +31678,27 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objAfter + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objAfter + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) { objAfter = GIV(freeStart); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objAfter = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(freeStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -32033,8 +31709,8 @@ accessibleObjectAfter(sqInt objOop) } /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objAfter = (numSlots == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objAfter = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { @@ -32044,13 +31720,9 @@ accessibleObjectAfter(sqInt objOop) while (1) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objAfter + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots11); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -32061,14 +31733,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress1 = (objAfter + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { objAfter = GIV(pastSpaceStart); - goto l2; + goto l9; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objAfter = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l9: /* end objectAfter:limit: */; if (!(oopisLessThan(objAfter, GIV(pastSpaceStart)))) break; if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) { return objAfter; @@ -32079,13 +31751,9 @@ accessibleObjectAfter(sqInt objOop) while(1) { /* begin objectAfter:limit: */ numSlots12 = byteAt(objAfter + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objAfter - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objAfter - BaseHeaderSize) + : numSlots12); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -32096,14 +31764,14 @@ accessibleObjectAfter(sqInt objOop) followingWordAddress2 = (objAfter + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objAfter = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objAfter = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; if (objAfter == GIV(endOfMemory)) { return null; } @@ -32129,7 +31797,7 @@ activeAndDeferredScan(sqInt anEphemeron) && (isObjEphemeron(anEphemeron))), /* begin fetchPointer:ofObject: */ (key = longAt((anEphemeron + BaseHeaderSize) + (0U << (shiftForWord()))))))) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } return pushOnUnscannedEphemeronsStack(anEphemeron); @@ -32224,7 +31892,7 @@ addressCouldBeObj(sqInt address) && ((oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))))); } @@ -32403,7 +32071,6 @@ allInstancesOf(sqInt aClass) usqInt followingWordAddress2; usqInt followingWordAddress21; usqInt followingWordAddress3; - sqInt format; sqInt freeChunk; sqInt i; sqInt i1; @@ -32424,9 +32091,7 @@ allInstancesOf(sqInt aClass) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots131; usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; @@ -32434,7 +32099,9 @@ allInstancesOf(sqInt aClass) usqInt numSlots4; usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; + usqInt numSlots7; sqInt obj; sqInt obj1; sqInt objOop; @@ -32478,7 +32145,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } freeChunk = allocateSlotsInOldSpacebytesformatclassIndex(0, numBytes, 2, ClassArrayCompactIndex); - goto l5; + goto l6; } long64Atput(newObj, (((((usqLong) 0)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); @@ -32486,20 +32153,16 @@ allInstancesOf(sqInt aClass) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; freeChunk = newObj; - l5: /* end allocateSlots:format:classIndex: */; + l6: /* end allocateSlots:format:classIndex: */; return freeChunk; } freeChunk = allocateLargestFreeChunk(); start = freeChunk + BaseHeaderSize; /* begin addressAfter: */ numSlots1 = byteAt(freeChunk + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -32539,32 +32202,28 @@ allInstancesOf(sqInt aClass) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l20; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l20: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -32574,8 +32233,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots5 = byteAt(address + 7); - objOop = (numSlots5 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -32599,37 +32258,33 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l17; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop = (numSlots14 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -32652,32 +32307,28 @@ allInstancesOf(sqInt aClass) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l23; + goto l20; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l23: /* end objectAfter:limit: */; + l20: /* end objectAfter:limit: */; } count = count1; ptr = ptr1; @@ -32722,32 +32373,28 @@ allInstancesOf(sqInt aClass) prevPrevObj11 = prevObj11; prevObj11 = objOop11; /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { + numSlots121 = byteAt(objOop11 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes4 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes4; + followingWordAddress21 = (objOop11 + BaseHeaderSize) + slotBytes21; if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l31; + goto l36; } flag("endianness"); followingWord21 = longAt(followingWordAddress21 + 4); objOop11 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress21 + BaseHeaderSize : followingWordAddress21); - l31: /* end objectAfter:limit: */; + l36: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -32757,8 +32404,8 @@ allInstancesOf(sqInt aClass) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots6 = byteAt(address2 + 7); - objOop2 = (numSlots6 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit11 = GIV(pastSpaceStart); @@ -32789,37 +32436,33 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop2 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { + numSlots14 = byteAt(objOop2 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes11; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes4; if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit11)) { objOop2 = limit11; - goto l27; + goto l24; } flag("endianness"); followingWord3 = longAt(followingWordAddress3 + 4); objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress3 + BaseHeaderSize : followingWordAddress3); - l27: /* end objectAfter:limit: */; + l24: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address11 = ((eden()).start); - numSlots15 = byteAt(address11 + 7); - objOop2 = (numSlots15 == (numSlotsMask()) + numSlots41 = byteAt(address11 + 7); + objOop2 = (numSlots41 == (numSlotsMask()) ? address11 + BaseHeaderSize : address11); while (oopisLessThan(objOop2, GIV(freeStart))) { @@ -32849,32 +32492,28 @@ allInstancesOf(sqInt aClass) prevPrevObj2 = prevObj2; prevObj2 = objOop2; /* begin objectAfter:limit: */ - numSlots131 = byteAt(objOop2 + 7); - if (numSlots131 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots41 = numSlots131; - } - if (numSlots41 == 0) { + numSlots111 = byteAt(objOop2 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ - slotBytes21 = ((sqInt) 8); + slotBytes11 = ((sqInt) 8); } else { - slotBytes21 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } - followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes21; + followingWordAddress11 = (objOop2 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { objOop2 = GIV(freeStart); - goto l36; + goto l32; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop2 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l36: /* end objectAfter:limit: */; + l32: /* end objectAfter:limit: */; } /* begin purgeDuplicateClassTableEntriesFor: */ expectedIndex1 = (long32At(aClass + 4)) & (identityHashHalfWordMask()); @@ -32933,7 +32572,7 @@ allInstancesOf(sqInt aClass) forceInterruptCheck(); } smallObj = allocateSlotsInOldSpacebytesformatclassIndex(count, numBytes1, 2, ClassArrayCompactIndex); - goto l7; + goto l8; } if (count >= (numSlotsMask())) { @@ -32950,7 +32589,7 @@ allInstancesOf(sqInt aClass) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; smallObj = newObj1; - l7: /* end allocateSlots:format:classIndex: */; + l8: /* end allocateSlots:format:classIndex: */; for (i = 0; i < count; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(smallObj))); @@ -32968,21 +32607,18 @@ allInstancesOf(sqInt aClass) } return smallObj; } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -33018,7 +32654,6 @@ allObjects(void) usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress2; - sqInt format; sqInt freeChunk; usqInt limit; usqInt limit1; @@ -33027,11 +32662,11 @@ allObjects(void) usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; - usqInt numSlots14; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -33049,22 +32684,18 @@ allObjects(void) freeChunk = allocateLargestFreeChunk(); ptr = (start = freeChunk + BaseHeaderSize); /* begin addressAfter: */ - numSlots13 = byteAt(freeChunk + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - limit = (freeChunk + BaseHeaderSize) + slotBytes2; + limit = (freeChunk + BaseHeaderSize) + slotBytes; count = 0; /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -33091,32 +32722,28 @@ allObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop1 + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots14; - } + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes3 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes3; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l16; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l16: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -33126,8 +32753,8 @@ allObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit1 = GIV(pastSpaceStart); @@ -33149,37 +32776,33 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots13 = byteAt(objOop + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { objOop = limit1; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -33200,32 +32823,28 @@ allObjects(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); @@ -33247,21 +32866,18 @@ allObjects(void) } return (((usqInt)count << 1) | 1); } - /* begin largeObjectBytesForSlots: */ bytes = (BaseHeaderSize + BaseHeaderSize) + ((count + (count & 1)) * BytesPerOop); start = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); freeChunkWithBytesat((limit - start) - bytes, start + bytes); GIV(totalFreeOldSpace) -= bytes; - /* begin rawOverflowSlotsOf:put: */ longAtput(freeChunk - BaseHeaderSize, count); /* begin set:classIndexTo:formatTo: */ - format = 2; assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((2 >= 0) && (2 <= (formatMask())))); flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift())))); /* begin possibleRootStoreInto: */ if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { remember(freeChunk); @@ -33293,10 +32909,10 @@ allObjectsUnmarked(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -33318,14 +32934,14 @@ allObjectsUnmarked(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33333,42 +32949,38 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33376,32 +32988,28 @@ allObjectsUnmarked(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -33412,7 +33020,7 @@ allObjectsUnmarked(void) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } @@ -33421,32 +33029,28 @@ allObjectsUnmarked(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return 1; } @@ -33474,7 +33078,7 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; assert((long64At(objOop)) != 0); if ((isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()))) - && (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) { + && (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { if (!(isonObjStack(objOop, GIV(weaklingStack)))) { return 0; } @@ -33484,13 +33088,9 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -33501,14 +33101,14 @@ allOldMarkedWeakObjectsOnWeaklingStack(void) followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } return 1; } @@ -33568,7 +33168,6 @@ allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt c if (numSlots >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - /* begin largeObjectBytesForSlots: */ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); } else { @@ -33836,7 +33435,7 @@ allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling) classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) { referent = longAt((aWeakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -33858,7 +33457,7 @@ allUnscannedEphemeronsAreActive(void) key = longAt(((longAt(p)) + BaseHeaderSize) + (0U << (shiftForWord()))); if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -33924,7 +33523,6 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt errCode; sqInt fieldOffset; sqInt fmt; - sqInt format; sqInt hash; sqInt header; sqInt i; @@ -33941,21 +33539,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sqInt obj21; sqInt objOop; sqInt objOop1; + sqInt objOop11; sqInt objOop2; + sqInt objOop21; sqInt objOop3; sqInt objOop4; - sqInt objOop5; - sqInt objOop6; sqInt oop1; sqInt oop2; sqInt referent; sqInt referent1; + sqInt referent11; sqInt referent2; sqInt referent3; - sqInt referent4; sqInt size; sqInt sp; - char *theSP; assert(GIV(becomeEffectsFlags) == 0); runLeakCheckerFor(GCModeBecome); @@ -33980,20 +33577,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop sp = longAt((array1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l35; + goto l40; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array1))); contextSize = (sp >> 1); - l35: /* end fetchStackPointerOf: */; + l40: /* end fetchStackPointerOf: */; fieldOffset = (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l30; } fieldOffset = (((numSlotsOf(array1)) - 1) * BytesPerOop) + BaseHeaderSize; - goto l40; + goto l30; } if (fmt < (firstCompiledMethodFormat())) { fieldOffset = 0; - goto l40; + goto l30; } assert(isCompiledMethod(array1)); /* begin fetchPointer:ofObject: */ @@ -34002,7 +33599,7 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop fieldOffset = (((((assert((header & 1)), /* begin literalCountOfAlternateHeader: */ ((header >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize; -l40: /* end lastPointerOf: */; +l30: /* end lastPointerOf: */; /* array1 is known to be the same size as array2 */ effectsFlags = (size = 0); @@ -34013,41 +33610,42 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop1 = referent1; + oop1 = referent3; longAtput(array1 + fieldOffset, oop1); } /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop1 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l41; - goto l27; + goto l39; } - if (((((usqInt) (longAt(oop1))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l41; - goto l27; + goto l39; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop1))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop1))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l41; - goto l27; + goto l39; } - l27: /* end ifOopInvalidForBecome:errorCodeInto: */; + l39: /* end ifOopInvalidForBecome:errorCodeInto: */; effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop1)); oop2 = longAt(array2 + fieldOffset); if (((oop2 & (tagMask())) == 0) @@ -34055,42 +33653,43 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(oop2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - oop2 = referent2; + oop2 = referent11; longAtput(array2 + fieldOffset, oop2); } if (twoWayFlag) { /* begin ifOopInvalidForBecome:errorCodeInto: */ if (oop2 & (tagMask())) { ec = PrimErrInappropriate; - goto l19; + goto l41; - goto l26; + goto l36; } - if (((((usqInt) (longAt(oop2))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0) { ec = PrimErrObjectIsPinned; - goto l19; + goto l41; - goto l26; + goto l36; } if ( # if IMMUTABILITY - ((((usqInt) (longAt(oop2))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ ) { ec = PrimErrNoModification; - goto l19; + goto l41; - goto l26; + goto l36; } - l26: /* end ifOopInvalidForBecome:errorCodeInto: */; + l36: /* end ifOopInvalidForBecome:errorCodeInto: */; size = (size + (bytesInObject(oop1))) + (bytesInObject(oop2)); effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop2)); } @@ -34098,18 +33697,18 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop if (copyHashFlag && (oop2 & (tagMask()))) { ec = PrimErrInappropriate; - goto l19; + goto l41; } } fieldOffset -= BytesPerOop; } if (size >= (GIV(totalFreeOldSpace) + (GIV(scavengeThreshold) - GIV(freeStart)))) { ec = PrimErrNoMemory; - goto l19; + goto l41; } GIV(becomeEffectsFlags) = effectsFlags; ec = 0; -l19: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; +l41: /* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */; if (ec != 0) { GIV(becomeEffectsFlags) = 0; return ec; @@ -34120,14 +33719,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } if (twoWayFlag) { @@ -34169,11 +33767,11 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop && ((o1ClassIndex == 0) && (o2ClassIndex == 0))) { inPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); - goto l1; + goto l15; } outOfPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag); if (copyHashFlag) { - goto l1; + goto l15; } if (o1ClassIndex != 0) { if (o2ClassIndex != 0) { @@ -34186,13 +33784,13 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj2 = referent3; + newObj2 = referent2; assert((rawHashBitsOf(newObj2)) == 0); /* begin setHashBitsOf:to: */ assert(((o1ClassIndex >= 0) && (o1ClassIndex <= (identityHashHalfWordMask())))); @@ -34206,20 +33804,20 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - newObj1 = referent4; + newObj1 = referent1; assert((rawHashBitsOf(newObj1)) == 0); /* begin setHashBitsOf:to: */ assert(((o2ClassIndex >= 0) && (o2ClassIndex <= (identityHashHalfWordMask())))); long32Atput(newObj1 + 4, ((((long32At(newObj1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o2ClassIndex); } } - l1: /* end doBecome:and:copyHash: */; + l15: /* end doBecome:and:copyHash: */; /* begin followField:ofObject: */ objOop = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if (((objOop & (tagMask())) == 0) @@ -34245,31 +33843,30 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop appear in the other array. So the enumeration could encounter an object already becommed earlier in the same enumeration. */ /* begin followField:ofObject: */ - objOop5 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop5 & (tagMask())) == 0) - && (((longAt(objOop5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop5 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop5); + objOop11 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop11); } - obj11 = objOop5; + obj11 = objOop11; /* begin followField:ofObject: */ - objOop6 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop6 & (tagMask())) == 0) - && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop6 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop6); + objOop21 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop21 & (tagMask())) == 0) + && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop21 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop21); } - obj21 = objOop6; + obj21 = objOop21; if (obj11 != obj21) { /* begin doBecome:to:copyHash: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj11, ((longAt(obj11)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << 23))); + longAtput(obj11, (longAt(obj11)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -34404,13 +34001,9 @@ byteSizeOf(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(oop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(oop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -34496,10 +34089,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -34511,8 +34104,10 @@ checkHeapFreeSpaceIntegrity(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; + usqInt total; ok = 1; + total = 0; for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { if ((GIV(freeLists)[i]) != 0) { if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) == 0) { @@ -34534,8 +34129,8 @@ checkHeapFreeSpaceIntegrity(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -34571,37 +34166,33 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -34636,32 +34227,28 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -34711,6 +34298,7 @@ checkHeapFreeSpaceIntegrity(void) } } } + total += bytesInObject(objOop1); } else { for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { @@ -34735,32 +34323,37 @@ checkHeapFreeSpaceIntegrity(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l14; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l14: /* end objectAfter:limit: */; + } + if (total != GIV(totalFreeOldSpace)) { + print("incorrect totalFreeOldSpace; expected "); + printNum(GIV(totalFreeOldSpace)); + print(" found "); + printNum(total); + /* begin cr */ + printf("\n"); + ok = 0; } return ok; } @@ -34778,7 +34371,7 @@ checkHeapFreeSpaceIntegrity(void) /* SpurMemoryManager>>#checkHeapIntegrity:classIndicesShouldBeValid: */ static sqInt NoDbgRegParms -checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; sqInt address1; @@ -34817,10 +34410,10 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -34859,8 +34452,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -34874,8 +34467,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -34950,37 +34543,33 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -34993,8 +34582,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!((!(((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0)) - && (excludeUnmarkedNewSpaceObjs))) { + if (!((!(((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0)) + && (excludeUnmarkedObjs))) { if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) { print("young object "); printHex(objOop); @@ -35069,32 +34658,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -35146,96 +34731,99 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } } else { - containsYoung = 0; - if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { - numRememberedObjectsInHeap += 1; - if (!(isInRememberedSet(objOop1))) { - print("remembered object "); - printHex(objOop1); - print(" is not in remembered table"); - /* begin cr */ - printf("\n"); - ok = 0; - } - } - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in forwarder "); - printHex(objOop1); - print(" to unmapped "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { - containsYoung = 1; - } - } - else { - /* begin classOrNilAtIndex: */ - classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); - assert((classIndex3 <= (tagMask())) - || (classIndex3 >= (arrayClassIndexPun()))); - /* begin fetchPointer:ofObject: */ - fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); - classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); - if (classTablePage2 == GIV(nilObj)) { - classOop = GIV(nilObj); - goto l27; + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { + containsYoung = 0; + if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) { + numRememberedObjectsInHeap += 1; + if (!(isInRememberedSet(objOop1))) { + print("remembered object "); + printHex(objOop1); + print(" is not in remembered table"); + /* begin cr */ + printf("\n"); + ok = 0; + } } - /* begin fetchPointer:ofObject: */ - fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); - classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); - l27: /* end classOrNilAtIndex: */; - if (classIndicesShouldBeValid - && ((classOop == GIV(nilObj)) - && (classIndex > (lastClassIndexPun())))) { - print("object leak in "); - printHex(objOop1); - print(" invalid class index "); - printHex(classIndex); - print(" -> "); - print((classOop == null - ? "nil" - : "nilObj")); - /* begin cr */ - printf("\n"); - ok = 0; + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in forwarder "); + printHex(objOop1); + print(" to unmapped "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { + containsYoung = 1; + } } - for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { - fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); - if ((fieldOop & (tagMask())) == 0) { - if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { - print("object leak in "); - printHex(objOop1); - print(" @ "); - printNum(fi); - print(" = "); - printHex(fieldOop); - /* begin cr */ - printf("\n"); - ok = 0; - } - if (((fieldOop & (tagMask())) == 0) - && ((assert(isNonImmediate(fieldOop)), - oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { - containsYoung = 1; + else { + /* begin classOrNilAtIndex: */ + classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask())); + assert((classIndex3 <= (tagMask())) + || (classIndex3 >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift()); + classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord()))))); + if (classTablePage2 == GIV(nilObj)) { + classOop = GIV(nilObj); + goto l27; + } + /* begin fetchPointer:ofObject: */ + fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1); + classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + l27: /* end classOrNilAtIndex: */; + if (classIndicesShouldBeValid + && ((classOop == GIV(nilObj)) + && (classIndex > (lastClassIndexPun())))) { + print("object leak in "); + printHex(objOop1); + print(" invalid class index "); + printHex(classIndex); + print(" -> "); + print((classOop == null + ? "nil" + : "nilObj")); + /* begin cr */ + printf("\n"); + ok = 0; + } + for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) { + fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord()))))); + if ((fieldOop & (tagMask())) == 0) { + if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) { + print("object leak in "); + printHex(objOop1); + print(" @ "); + printNum(fi); + print(" = "); + printHex(fieldOop); + /* begin cr */ + printf("\n"); + ok = 0; + } + if (((fieldOop & (tagMask())) == 0) + && ((assert(isNonImmediate(fieldOop)), + oopisLessThan(fieldOop, GIV(newSpaceLimit))))) { + containsYoung = 1; + } } } } - } - if (containsYoung) { - if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { - print("unremembered object "); - printHex(objOop1); - print(" contains young oop(s)"); - /* begin cr */ - printf("\n"); - ok = 0; + if (containsYoung) { + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + print("unremembered object "); + printHex(objOop1); + print(" contains young oop(s)"); + /* begin cr */ + printf("\n"); + ok = 0; + } } } } @@ -35243,32 +34831,28 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l6; + goto l23; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l23: /* end objectAfter:limit: */; } if (numRememberedObjectsInHeap != (rememberedSetSize())) { print("root count mismatch. #heap roots "); @@ -35318,7 +34902,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s } /* begin objStack:do: */ if (GIV(mournQueue) == GIV(nilObj)) { - goto l9; + goto l14; } eassert(isValidObjStack(GIV(mournQueue))); objStackPage = GIV(mournQueue); @@ -35339,10 +34923,8 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s ok = 0; } else { - if (!(excludeUnmarkedNewSpaceObjs - && ((((obj & (tagMask())) == 0) - && (oopisLessThan(obj, GIV(newSpaceLimit)))) - && (!(((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0))))) { + if (!(excludeUnmarkedObjs + && (!(((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0)))) { if ((heapMapAtWord(pointerForOop(obj))) == 0) { print("object leak in mournQueue @ "); printNum(i2); @@ -35361,7 +34943,7 @@ checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedNewSpaceObjs, s /* begin fetchPointer:ofObject: */ objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } -l9: /* end objStack:do: */; +l14: /* end objStack:do: */; for (ri = 1; ri <= GIV(remapBufferCount); ri += 1) { obj = GIV(remapBuffer)[ri]; if ((obj & (BytesPerWord - 1)) != 0) { @@ -35475,7 +35057,7 @@ checkOkayOop(usqInt oop) print(" has some unused header bits set; should be zero"); return 0; } - unusedBitsInYoungObjects = (1U << 0x1F) | ((1U << 30) | (1U << (rememberedBitShift()))); + unusedBitsInYoungObjects = (1U << (greyBitShift())) | ((1U << (pinnedBitShift())) | (1U << (rememberedBitShift()))); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { print("oop "); printHex(oop); @@ -35535,7 +35117,6 @@ checkOopHasOkayClass(usqInt obj) objFormat = ((((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) | 7) - 7); } else { - /* begin formatOf: */ objFormat = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask()); } if ((instSpecOfClassFormat(((longAt((objClass + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) != objFormat) { @@ -35950,13 +35531,9 @@ clearLeakMapAndMapAccessibleFreeSpace(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -35967,14 +35544,14 @@ clearLeakMapAndMapAccessibleFreeSpace(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } } @@ -35999,10 +35576,10 @@ clearLeakMapAndMapAccessibleObjects(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -36025,8 +35602,8 @@ clearLeakMapAndMapAccessibleObjects(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -36038,37 +35615,33 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -36079,32 +35652,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -36122,32 +35691,28 @@ clearLeakMapAndMapAccessibleObjects(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -36167,13 +35732,9 @@ cloneInOldSpaceForPinning(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); newObj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(numSlots, ((numSlots == 0 ? 8 @@ -36251,13 +35812,9 @@ clone(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { /* begin allocateSlotsInOldSpace:format:classIndex: */ @@ -36289,7 +35846,7 @@ clone(sqInt objOop) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, fmt, classIndex1); - goto l4; + goto l5; } if (numSlots >= (numSlotsMask())) { @@ -36306,7 +35863,7 @@ clone(sqInt objOop) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l4: /* end allocateSlots:format:classIndex: */; + l5: /* end allocateSlots:format:classIndex: */; } if (!(newObj)) { return 0; @@ -36480,10 +36037,10 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -36506,14 +36063,14 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -36530,42 +36087,38 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop1); @@ -36582,32 +36135,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -36618,7 +36167,7 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - if (((((usqInt) (longAt(objOop11 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { nm += 1; if (printFlags & 1) { shortPrintOop(objOop11); @@ -36636,32 +36185,28 @@ countMarkedAndUnmarkdObjects(sqInt printFlags) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } print("n marked: "); printNum(nm); @@ -36820,7 +36365,7 @@ doScavenge(sqInt tenuringCriterion) sqInt p; SpurNewSpaceSpace temp; - GIV(scavengeInProgress) = 1; + GIV(gcPhaseInProgress) = ScavengeInProgress; /* begin scavenge: */ GIV(statSurvivorCount) = 0; GIV(tenureCriterion) = tenuringCriterion; @@ -36858,7 +36403,7 @@ doScavenge(sqInt tenuringCriterion) } } } - GIV(scavengeInProgress) = 0; + GIV(gcPhaseInProgress) = 0; } @@ -37161,9 +36706,9 @@ existInstancesInNewSpaceOf(sqInt classObj) usqInt numSlots; usqInt numSlots1; usqInt numSlots11; - usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37181,8 +36726,8 @@ existInstancesInNewSpaceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37196,37 +36741,33 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37239,32 +36780,28 @@ existInstancesInNewSpaceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return 0; } @@ -37444,10 +36981,10 @@ findStringBeginningWith(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37470,8 +37007,8 @@ findStringBeginningWith(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37495,37 +37032,33 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37548,32 +37081,28 @@ findStringBeginningWith(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -37603,32 +37132,28 @@ findStringBeginningWith(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -37655,10 +37180,10 @@ findString(char *aCString) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -37681,8 +37206,8 @@ findString(char *aCString) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -37703,37 +37228,33 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -37753,32 +37274,28 @@ findString(char *aCString) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -37805,35 +37322,44 @@ findString(char *aCString) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#fireAllUnscannedEphemerons */ +static void +fireAllUnscannedEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt p; + + assert(!(noUnscannedEphemerons())); + assert(allUnscannedEphemeronsAreActive()); + for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { + fireEphemeron(longAt(p)); + } +} + /* SpurMemoryManager>>#firstAccessibleObject */ static sqInt firstAccessibleObject(void) @@ -38427,7 +37953,9 @@ freeObject(sqInt objOop) usqLong NeverInline fullGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - char *theSP; + sqInt i; + sqInt index; + sqInt obj; GIV(needGCFlag) = 0; GIV(gcStartUsecs) = ioUTCMicrosecondsNow(); @@ -38438,14 +37966,13 @@ fullGC(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } flushMethodCache(); @@ -38455,10 +37982,38 @@ fullGC(void) assert(isEmptyObjStack(GIV(markStack))); assert(isEmptyObjStack(GIV(weaklingStack))); markObjects(1); - /* begin freeUnmarkedObjectsAndPrepareFreeSpace */ - freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); - runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin forgetUnmarkedRememberedObjects */ + index = 0; + while (index < GIV(rememberedSetSize)) { + obj = GIV(rememberedSet)[index]; + if (((((usqInt) (longAt(obj + 4))) >> (markedBitHalfShift())) & 1) != 0) { + index += 1; + } + else { + + /* unmarked; remove by overwriting with last element. */ + /* begin setIsRememberedOf:to: */ + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); + GIV(rememberedSetSize) -= 1; + GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); + } + } + assert(GIV(rememberedSetSize) >= 0); + doScavenge(MarkOnTenure); + runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(GCModeFull, 1, 1); + /* begin prepareForGlobalSweep */ + GIV(sweepIndex) = 0; + for (i = 0; i < GIV(numSegments); i += 1) { + ((GIV(segments)[i]).containsPinned = 0); + } + setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); compact(); + /* begin attemptToShrink */ + if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) + && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { + GIV(statShrinkMemory) += 1; + shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); + } /* begin setHeapSizeAtPreviousGC */ GIV(heapSizeAtPreviousGC) = (GIV(endOfMemory) - GIV(nilObj)) - GIV(totalFreeOldSpace); assert(validObjStacks()); @@ -38466,12 +38021,6 @@ fullGC(void) assert(isEmptyObjStack(GIV(weaklingStack))); assert(allObjectsUnmarked()); runLeakCheckerFor(GCModeFull); - /* begin attemptToShrink */ - if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold)) - && (GIV(totalFreeOldSpace) > GIV(growHeadroom))) { - GIV(statShrinkMemory) += 1; - shrinkObjectMemory(GIV(totalFreeOldSpace) - GIV(growHeadroom)); - } /* begin postGCAction: */ signalSemaphoreWithIndex(GIV(gcSemaphoreIndex)); GIV(statFullGCs) += 1; @@ -38499,13 +38048,9 @@ goodContextSize(sqInt oop) /* begin numSlotsOf: */ assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); return (numSlots == SmallContextSlots) || (numSlots == LargeContextSlots); } @@ -38690,7 +38235,7 @@ imageSegmentVersion(void) sqInt immutableBitMask(void) { - return 1U << 23; + return 1U << (immutableBitShift()); } #endif /* IMMUTABILITY */ @@ -38784,10 +38329,10 @@ initialInstanceOf(sqInt classObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -38825,8 +38370,8 @@ initialInstanceOf(sqInt classObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -38840,37 +38385,33 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -38883,32 +38424,28 @@ initialInstanceOf(sqInt classObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -38928,20 +38465,16 @@ initialInstanceOf(sqInt classObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -39046,21 +38579,17 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(classTableRoot)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classTableRoot + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(numClassTablePages) = longAt(classTableRoot - BaseHeaderSize); - } - else { - GIV(numClassTablePages) = numSlots1; - } + GIV(numClassTablePages) = (numSlots1 == (numSlotsMask()) + ? longAt(classTableRoot - BaseHeaderSize) + : numSlots1); assert(GIV(numClassTablePages) == ((classTableRootSlots()) + (hiddenRootSlots()))); for (i1 = 2; i1 < GIV(numClassTablePages); i1 += 1) { if ((longAt((classTableRoot + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))))) == nilObjPreSwizzle) { GIV(numClassTablePages) = i1; - goto l11; + goto l8; } } -l11: /* end countNumClassPagesPreSwizzle: */; +l8: /* end countNumClassPagesPreSwizzle: */; if ((bytesToShift != 0) || ((numSegments()) > 1)) { /* begin objectStartingAt: */ @@ -39136,16 +38665,17 @@ initializeObjectMemory(sqInt bytesToShift) flag("endianness"); longAtput(GIV(classTableFirstPage), ((longAt(GIV(classTableFirstPage))) & ((unsigned int)~(classIndexMask()))) + classIndex1); } + /* begin classTableRootSlots */ GIV(numClassTablePages) = 1U << (22 - (classTableMajorIndexShift())); for (i2 = 2; i2 < GIV(numClassTablePages); i2 += 1) { if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))))) == GIV(nilObj)) { GIV(numClassTablePages) = i2; GIV(classTableIndex) = ((sqInt)((usqInt)(((((GIV(numClassTablePages) - 1) < 1) ? 1 : (GIV(numClassTablePages) - 1)))) << (classTableMajorIndexShift()))); - goto l13; + goto l14; } } GIV(classTableIndex) = 1U << (classTableMajorIndexShift()); -l13: /* end setHiddenRootsObj: */; +l14: /* end setHiddenRootsObj: */; GIV(markStack) = swizzleObjStackAt(MarkStackRootIndex); GIV(weaklingStack) = swizzleObjStackAt(WeaklingStackRootIndex); GIV(mournQueue) = swizzleObjStackAt(MournQueueRootIndex); @@ -39213,13 +38743,9 @@ initializeObjectMemory(sqInt bytesToShift) /* begin numSlotsOf: */ assert((classIndexOf(obj2)) > (isForwardedObjectClassIndexPun())); numSlots3 = byteAt(obj2 + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(rememberedSetLimit) = longAt(obj2 - BaseHeaderSize); - } - else { - GIV(rememberedSetLimit) = numSlots3; - } + GIV(rememberedSetLimit) = (numSlots3 == (numSlotsMask()) + ? longAt(obj2 - BaseHeaderSize) + : numSlots3); /* begin setRememberedSetRedZone */ fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024; GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4)); @@ -39334,7 +38860,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o1HasYoung && ((assert(isNonImmediate(obj1)), oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj1))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -39347,7 +38872,6 @@ inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) if (o2HasYoung && ((assert(isNonImmediate(obj2)), oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart))))) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(obj2))) >> (formatShift())) & (formatMask()); if (!((fmt >= (sixtyFourBitIndexableFormat())) && (fmt < (firstCompiledMethodFormat())))) { @@ -39449,7 +38973,6 @@ isBytes(sqInt oop) sqInt isCharacterObject(sqInt oop) { - /* begin isImmediateCharacter: */ return (oop & (tagMask())) == (characterTag()); } @@ -39665,7 +39188,6 @@ isIndexable(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); return (fmt >= 2) && ((fmt <= (weakArrayFormat())) @@ -39699,7 +39221,7 @@ isInMemory(sqInt address) && (oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))) { return (oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart))) || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart))) - || (GIV(scavengeInProgress) + || ((GIV(gcPhaseInProgress) == ScavengeInProgress) && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart())))); } /* begin isInSegments: */ @@ -39772,7 +39294,8 @@ isObjImmutable(sqInt anOop) { return # if IMMUTABILITY - ((((usqInt) (longAt(anOop))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(anOop))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -39814,7 +39337,7 @@ sqInt isOopImmutable(sqInt oop) { return (oop & (tagMask())) - || (((((usqInt) (longAt(oop))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0); } /* SpurMemoryManager>>#isOopMutable: */ @@ -39822,14 +39345,14 @@ sqInt isOopMutable(sqInt oop) { return ((oop & (tagMask())) == 0) - && (!(((((usqInt) (longAt(oop))) >> 23) & 1) != 0)); + && (!(((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0)); } /* SpurMemoryManager>>#isPinned: */ sqInt isPinned(sqInt objOop) { - return ((((usqInt) (longAt(objOop))) >> 30) & 1) != 0; + return ((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0; } @@ -40007,7 +39530,7 @@ isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx) return 0; } if (GIV(marking) - && (!(((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0))) { + && (!(((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0))) { GIV(objStackInvalidBecause) = "marking but page is unmarked"; GIV(invalidObjStackPage) = objStackPage; return 0; @@ -40136,25 +39659,7 @@ sqInt isWeak(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWeakNonImm(oop)); -} - - -/* Answer if the contains only indexable words or bytes (no oops). See - comment in formatOf: - */ -/* Note: Excludes CompiledMethods. */ - - /* SpurMemoryManager>>#isWordsOrBytesNonImm: */ -static sqInt NoDbgRegParms -isWordsOrBytesNonImm(sqInt objOop) -{ - sqInt format; - - /* begin isPureBitsFormat: */ - format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); - return (format >= (sixtyFourBitIndexableFormat())) - && (format < (firstCompiledMethodFormat())); + && (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -40168,7 +39673,7 @@ sqInt isWordsOrBytes(sqInt oop) { return ((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)); + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))); } @@ -40298,7 +39803,6 @@ lastPointerOfWhileSwizzling(sqInt objOop) sqInt fmt; sqInt header; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -40329,7 +39833,6 @@ lastPointerOf(sqInt objOop) sqInt header; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt != (forwardedFormat())); if (fmt <= 5) { @@ -40341,11 +39844,11 @@ lastPointerOf(sqInt objOop) sp = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l5; + goto l4; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop))); contextSize = (sp >> 1); - l5: /* end fetchStackPointerOf: */; + l4: /* end fetchStackPointerOf: */; return (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize; } return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize; @@ -40408,13 +39911,9 @@ lengthOfMaybeImmediate(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -40452,13 +39951,9 @@ lengthOf(sqInt objOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -40524,8 +40019,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt addr1; sqInt classIndex; sqInt classIndex1; - sqInt classIndex11; sqInt classIndex2; + sqInt classIndex3; sqInt classOop; sqInt classRef; sqInt errorCode; @@ -40539,8 +40034,6 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) usqInt followingWordAddress1; usqInt followingWordAddress2; usqInt followingWordAddress3; - sqInt format; - sqInt format1; sqInt hash; sqInt i; sqInt iLimiT; @@ -40551,24 +40044,23 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) sqInt numLoadedObjects; usqInt numOutPointers; sqInt numSegObjs; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots10; usqInt numSlots11; usqInt numSlots12; usqInt numSlots13; usqInt numSlots14; usqInt numSlots15; - usqInt numSlots16; usqInt numSlots2; usqInt numSlots21; + usqInt numSlots22; usqInt numSlots3; + usqInt numSlots31; usqInt numSlots4; usqInt numSlots5; usqInt numSlots6; usqInt numSlots7; usqInt numSlots8; - usqInt numSlots9; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -40589,14 +40081,10 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin numSlotsOf: */ assert((classIndexOf(segmentWordArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(segmentWordArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - segmentLimit = longAt(segmentWordArray - BaseHeaderSize); - } - else { - segmentLimit = numSlots1; - } + numSlots = byteAt(segmentWordArray + 7); + segmentLimit = (numSlots == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots); if ((((segmentLimit == 0 ? 8 : (segmentLimit + (segmentLimit & 1)) << (shiftForWord()))) + ((segmentLimit >= (numSlotsMask()) @@ -40613,22 +40101,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots12 = byteAt(segmentWordArray + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots13 = byteAt(segmentWordArray + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes3 = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes1; + stopAddr1 = (segmentWordArray + BaseHeaderSize) + slotBytes3; addr1 = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr1, stopAddr1)) { long32Atput(addr1, SQ_SWAP_4_BYTES((long32At(addr1)))); @@ -40640,22 +40124,18 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* low 3 bytes */ /* begin reverseBytesIn32BitWordsFrom:to: */ - numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(segmentWordArray + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes; + stopAddr = (segmentWordArray + BaseHeaderSize) + slotBytes2; addr = segmentWordArray + BaseHeaderSize; while (oopisLessThan(addr, stopAddr)) { long32Atput(addr, SQ_SWAP_4_BYTES((long32At(addr)))); @@ -40680,63 +40160,59 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } /* begin mapOopsAndValidateClassRefsFrom:to:outPointers: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots8 = byteAt(outPointerArray + 7); - if (numSlots8 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numOutPointers = longAt(outPointerArray - BaseHeaderSize); - } - else { - numOutPointers = numSlots8; - } + numSlots22 = byteAt(outPointerArray + 7); + numOutPointers = (numSlots22 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots22); numSegObjs = 0; /* begin objectStartingAt: */ - numSlots9 = byteAt(segmentStart + 7); - objOop1 = (numSlots9 == (numSlotsMask()) + numSlots31 = byteAt(segmentStart + 7); + objOop2 = (numSlots31 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); - while (objOop1 < segmentLimit) { + while (objOop2 < segmentLimit) { numSegObjs += 1; - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } /* validate the class ref, but don't update it until any internal classes have been added to the class table. */ - classIndex = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); - if (classIndex & TopHashBit) { - if ((classIndex - TopHashBit) >= numOutPointers) { + classIndex3 = ((longAt(objOop2)) & (classIndexMask())) - (firstClassIndexPun()); + if (classIndex3 & TopHashBit) { + if ((classIndex3 - TopHashBit) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } /* begin fetchPointer:ofObject: */ - mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex - TopHashBit)) << (shiftForWord()))))); + mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classIndex3 - TopHashBit)) << (shiftForWord()))))); hash = (long32At(mappedOop + 4)) & (identityHashHalfWordMask()); if (!((hash > (lastClassIndexPun())) && ((classOrNilAtIndex(hash)) == mappedOop))) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } } else { /* The class is contained within the segment. */ - if (((oop1 = (classIndex * 8) + segmentStart)) >= segmentLimit) { + if (((oop1 = (classIndex3 * 8) + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } if (((long32At(oop1 + 4)) & (identityHashHalfWordMask())) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } } - for (i = 0, iLimiT = ((numPointerSlotsOf(objOop1)) - 1); i <= iLimiT; i += 1) { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop2)) - 1); i <= iLimiT; i += 1) { /* begin fetchPointer:ofObject: */ - oop1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + oop1 = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop1 & (tagMask())) == 0) { if (oop1 & TopOopBit) { if (((oop1 = (oop1 - TopOopBit) / BytesPerOop)) >= numOutPointers) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } /* begin fetchPointer:ofObject: */ mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(oop1) << (shiftForWord()))))); @@ -40744,47 +40220,43 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) else { if ((oop1 & (8 - 1)) != 0) { errorCode = PrimErrInappropriate; - goto l11; + goto l38; } if (((mappedOop = oop1 + segmentStart)) >= segmentLimit) { errorCode = PrimErrBadIndex; - goto l11; + goto l38; } } - assert(!(isOopForwarded(objOop1))); - longAtput((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), mappedOop); + assert(!(isOopForwarded(objOop2))); + longAtput((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), mappedOop); } } /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots15 = byteAt(objOop2 + 7); + numSlots8 = (numSlots15 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots15); + if (numSlots8 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes5 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes5 = (numSlots8 + (numSlots8 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { - objOop1 = segmentLimit; - goto l9; + followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; + if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { + objOop2 = segmentLimit; + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l9: /* end objectAfter:limit: */; + followingWord3 = longAt(followingWordAddress3 + 4); + objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress3 + BaseHeaderSize + : followingWordAddress3); + l29: /* end objectAfter:limit: */; } errorCode = -numSegObjs; -l11: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; +l38: /* end mapOopsAndValidateClassRefsFrom:to:outPointers: */; if (errorCode > 0) { return errorCode; } @@ -40808,7 +40280,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) forceInterruptCheck(); } loadedObjectsArray = allocateSlotsInOldSpacebytesformatclassIndex(numLoadedObjects, numBytes, 2, ClassArrayCompactIndex); - goto l13; + goto l14; } if (numLoadedObjects >= (numSlotsMask())) { @@ -40825,7 +40297,7 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; loadedObjectsArray = newObj; -l13: /* end allocateSlots:format:classIndex: */; +l14: /* end allocateSlots:format:classIndex: */; if (!(loadedObjectsArray)) { return PrimErrNoMemory; } @@ -40841,84 +40313,76 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) while (objOop < oop) { expungeFromClassTable(objOop); /* begin objectAfter:limit: */ - numSlots14 = byteAt(objOop + 7); - if (numSlots14 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots6 = numSlots14; - } - if (numSlots6 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots3 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes3; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segmentLimit)) { objOop = segmentLimit; - goto l3; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l3: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } errorCode = errorCode1; - goto l5; + goto l12; } /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots7 = numSlots15; - } - if (numSlots7 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes4; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, segmentLimit)) { objOop = segmentLimit; - goto l4; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l4: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } errorCode = 0; -l5: /* end enterClassesIntoClassTableFrom:to: */; +l12: /* end enterClassesIntoClassTableFrom:to: */; if (errorCode != 0) { return errorCode; } /* begin assignClassIndicesAndPinFrom:to:outPointers:filling: */ - numSlots10 = byteAt(segmentStart + 7); - objOop2 = (numSlots10 == (numSlotsMask()) + numSlots21 = byteAt(segmentStart + 7); + objOop1 = (numSlots21 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); fillIdx = 0; - while (objOop2 < segmentLimit) { + while (objOop1 < segmentLimit) { assert(!(isOopForwarded(loadedObjectsArray))); - longAtput((loadedObjectsArray + BaseHeaderSize) + (((sqInt)((usqInt)(fillIdx) << (shiftForWord())))), objOop2); + longAtput((loadedObjectsArray + BaseHeaderSize) + (((sqInt)((usqInt)(fillIdx) << (shiftForWord())))), objOop1); /* In the segment, class indices are offset indexes into the segment data, or into outPointers. See mapOopsFrom:to:outPointers:outHashes:. */ fillIdx += 1; - classRef = ((longAt(objOop2)) & (classIndexMask())) - (firstClassIndexPun()); + classRef = ((longAt(objOop1)) & (classIndexMask())) - (firstClassIndexPun()); if (classRef & TopHashBit) { /* begin fetchPointer:ofObject: */ classOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classRef - TopHashBit)) << (shiftForWord()))))); @@ -40932,97 +40396,90 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) /* begin setClassIndexOf:to: */ assert(((classIndex2 >= 0) && (classIndex2 <= (classIndexMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~(classIndexMask()))) + classIndex2); - if (((oopisLessThan(objOop2, GIV(newSpaceLimit))) - && (oopisGreaterThanOrEqualTo(objOop2, GIV(newSpaceStart)))) - && (((((usqInt) (longAt(objOop2))) >> 30) & 1) != 0)) { - oldClone = cloneInOldSpaceForPinning(objOop2); + longAtput(objOop1, ((longAt(objOop1)) & ((unsigned int)~(classIndexMask()))) + classIndex2); + if (((oopisLessThan(objOop1, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(objOop1, GIV(newSpaceStart)))) + && (((((usqInt) (longAt(objOop1))) >> (pinnedBitShift())) & 1) != 0)) { + oldClone = cloneInOldSpaceForPinning(objOop1); if (oldClone != 0) { /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ - classIndex11 = isForwardedObjectClassIndexPun(); - format1 = 7; - assert(((classIndex11 >= 0) && (classIndex11 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + classIndex1 = isForwardedObjectClassIndexPun(); + assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop2, ((longAt(objOop2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(objOop1, ((longAt(objOop1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop2, (longAt(objOop2)) & ((unsigned int)~(1U << 23))); + longAtput(objOop1, (longAt(objOop1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ /* begin storePointer:ofForwarder:withValue: */ - assert(isForwarded(objOop2)); + assert(isForwarded(objOop1)); assert(!(isOopForwarded(oldClone))); - if ((assert(isNonImmediate(objOop2)), - oopisGreaterThanOrEqualTo(objOop2, GIV(oldSpaceStart)))) { + if ((assert(isNonImmediate(objOop1)), + oopisGreaterThanOrEqualTo(objOop1, GIV(oldSpaceStart)))) { /* most stores into young objects */ if (((oldClone & (tagMask())) == 0) && (oopisLessThan(oldClone, GIV(newSpaceLimit)))) { /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(objOop2))) >> (rememberedBitShift())) & 1) != 0)) { - remember(objOop2); + if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop1); } } } - longAtput((objOop2 + BaseHeaderSize) + (0U << (shiftForWord())), oldClone); - if ((byteAt(objOop2 + 7)) == 0) { - byteAtput(objOop2 + 7, 1); + longAtput((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())), oldClone); + if ((byteAt(objOop1 + 7)) == 0) { + byteAtput(objOop1 + 7, 1); } } } /* begin objectAfter:limit: */ - numSlots16 = byteAt(objOop2 + 7); - if (numSlots16 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots21 = numSlots16; - } - if (numSlots21 == 0) { + numSlots14 = byteAt(objOop1 + 7); + numSlots7 = (numSlots14 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots14); + if (numSlots7 == 0) { /* begin allocationUnit */ - slotBytes5 = ((sqInt) 8); + slotBytes4 = ((sqInt) 8); } else { - slotBytes5 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes4 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); } - followingWordAddress3 = (objOop2 + BaseHeaderSize) + slotBytes5; - if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) { - objOop2 = segmentLimit; - goto l35; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes4; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) { + objOop1 = segmentLimit; + goto l23; } flag("endianness"); - followingWord3 = longAt(followingWordAddress3 + 4); - objOop2 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress3 + BaseHeaderSize - : followingWordAddress3); - l35: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l23: /* end objectAfter:limit: */; } if ((byteAt(segmentWordArray + 7)) == (numSlotsMask())) { /* begin rawOverflowSlotsOf:put: */ - numSlots = 8 / BytesPerOop; - longAtput(segmentWordArray - BaseHeaderSize, numSlots); + longAtput(segmentWordArray - BaseHeaderSize, 8 / BytesPerOop); } else { /* begin rawNumSlotsOf:put: */ byteAtput(segmentWordArray + 7, 8 / BytesPerOop); } /* begin forward:to: */ - classIndex1 = isForwardedObjectClassIndexPun(); - format = 7; - assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + classIndex = isForwardedObjectClassIndexPun(); + assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(segmentWordArray, ((longAt(segmentWordArray)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << 23))); + longAtput(segmentWordArray, (longAt(segmentWordArray)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -41047,8 +40504,8 @@ loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray) } runLeakCheckerFor(GCModeImageSegment); /* begin objectStartingAt: */ - numSlots2 = byteAt(segmentStart + 7); - return (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(segmentStart + 7); + return (numSlots4 == (numSlotsMask()) ? segmentStart + BaseHeaderSize : segmentStart); } @@ -41092,10 +40549,10 @@ longPrintInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -41124,32 +40581,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -41159,8 +40612,8 @@ longPrintInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -41174,37 +40627,33 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -41217,32 +40666,28 @@ longPrintInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -41269,11 +40714,11 @@ longPrintReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -41297,8 +40742,8 @@ longPrintReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -41307,12 +40752,7 @@ longPrintReferencesTo(sqInt anOop) if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41322,13 +40762,9 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41352,37 +40788,33 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -41390,12 +40822,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop1)) + LiteralStart; } else { if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41405,13 +40832,9 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41435,32 +40858,28 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -41474,12 +40893,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) <= 5) || (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart; + i = (literalCountOf(objOop11)) + LiteralStart; } else { if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41489,13 +40903,9 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); } } while (((i -= 1)) >= 0) { @@ -41520,14 +40930,10 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -41538,14 +40944,14 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l14; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l14: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -41623,11 +41029,11 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe sqInt hash2; sqInt i; sqInt iLimiT; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; - usqInt numSlots11; - usqInt numSlots2; + sqInt numSlots2; usqInt numSlots3; + usqInt numSlots4; sqInt objOop; sqInt oop; sqInt outIndex; @@ -41640,27 +41046,23 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe outIndex = 0; /* begin fillObj:numSlots:with: */ assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(outPointerArray + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(outPointerArray - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(outPointerArray))); - for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { + numSlots4 = byteAt(outPointerArray + 7); + numSlots2 = (numSlots4 == (numSlotsMask()) + ? longAt(outPointerArray - BaseHeaderSize) + : numSlots4); + assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1, addressAfter(outPointerArray))); + for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots2 * BytesPerOop)) - 1))); p += 8) { longAtput(p, GIV(nilObj)); longAtput(p + 4, GIV(nilObj)); } /* begin objectStartingAt: */ - numSlots2 = byteAt(segStart + 7); - objOop = (numSlots2 == (numSlotsMask()) + numSlots3 = byteAt(segStart + 7); + objOop = (numSlots3 == (numSlotsMask()) ? segStart + BaseHeaderSize : segStart); while (objOop < segAddr) { oop = fetchClassOfNonImm(objOop); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -41668,7 +41070,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l7; + goto l11; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -41694,7 +41096,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1); setIsMarkedOfto(oop, 1); outIndex += 1; - l7: /* end newOutPointer:at:in:hashes: */; + l11: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -41711,7 +41113,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* begin fetchPointer:ofObject: */ oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); if ((oop & (tagMask())) == 0) { - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* oop is a new outPointer; allocate its oop */ /* begin newOutPointer:at:in:hashes: */ @@ -41719,7 +41121,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe /* no room in outPointers; fail */ outIndex = 0; - goto l9; + goto l14; } /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(outPointerArray))); @@ -41745,7 +41147,7 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe long32Atput(oop + 4, ((((long32At(oop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2); setIsMarkedOfto(oop, 1); outIndex += 1; - l9: /* end newOutPointer:at:in:hashes: */; + l14: /* end newOutPointer:at:in:hashes: */; if (outIndex == 0) { /* no room in outPointers; fail */ @@ -41763,32 +41165,28 @@ mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointe } } /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, segAddr)) { objOop = segAddr; - goto l2; + goto l6; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l2: /* end objectAfter:limit: */; + l6: /* end objectAfter:limit: */; } return outIndex; } @@ -41839,7 +41237,7 @@ markAndTraceClassOf(sqInt objOop) flag("endianness"); longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~(classIndexMask()))) + realClassIndex); } - if (!(((((usqInt) (longAt(classObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(classObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { setIsMarkedOfto(classObj, 1); markAndTraceClassOf(classObj); pushonObjStack(classObj, GIV(markStack)); @@ -41907,24 +41305,8 @@ markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents) void NeverInline markAndTrace(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; - sqInt contextSize; - sqInt field; - sqInt fmt; sqInt format1; - sqInt format11; - sqInt header; - sqInt index; - sqInt numLiterals; - usqInt numSlots; - usqInt numSlots1; - sqInt numStrongSlots; - sqInt objOop1; - sqInt objToScan; - sqInt scanLargeObject; - sqInt sp; - numStrongSlots = 0; /* inline markAndShouldScan: */ if (objOop & (tagMask())) { @@ -41932,12 +41314,11 @@ markAndTrace(sqInt objOop) } assert(!(isForwarded(objOop))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { return; } setIsMarkedOfto(objOop, 1); - /* begin formatOf: */ format1 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if ((format1 >= (sixtyFourBitIndexableFormat())) && (format1 < (firstCompiledMethodFormat()))) { @@ -41963,7 +41344,88 @@ markAndTrace(sqInt objOop) } - /* begin markLoopFrom: */ + markLoopFrom(objOop); +} + + +/* Go through the unscanned ephemerons, marking the inactive ones, and + removing them from the unscanned ephemerons. Answer if any inactive + ones were found. We cannot fire the ephemerons until all are found to + be active since scan-marking an inactive ephemeron later in the set may + render a previously-observed active ephemeron as inactive. */ + + /* SpurMemoryManager>>#markInactiveEphemerons */ +static sqInt +markInactiveEphemerons(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ephemeron; + sqInt foundInactive; + sqInt key; + sqInt objOop; + sqInt oop; + usqInt ptr; + + foundInactive = 0; + ptr = (GIV(unscannedEphemerons).start); + while (ptr < ((GIV(unscannedEphemerons).top))) { + /* begin followedKeyOfEphemeron: */ + objOop = (ephemeron = longAt(ptr)); + assert((isNonImmediate(objOop)) + && (isEphemeron(objOop))); + /* begin followOopField:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); + } + key = oop; + if ((key & (tagMask())) + || (((((usqInt) (longAt(key + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + + /* Now remove the inactive ephemeron from the set, and scan-mark it. + Scan-marking it may add more ephemerons to the set. */ + foundInactive = 1; + (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); + if (((GIV(unscannedEphemerons).top)) > ptr) { + longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); + } + markAndTrace(ephemeron); + } + else { + ptr += BytesPerOop; + } + } + return foundInactive; +} + + +/* Scan objOop and all objects on the mark stack, until the mark stack is + empty. N.B. When the incremental GC is written this will probably be + refactored as + markLoopFrom: objOop while: aBlock */ +/* Now scan the object, and any remaining objects on the mark stack. */ + + /* SpurMemoryManager>>#markLoopFrom: */ +static void NoDbgRegParms +markLoopFrom(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt contextSize; + sqInt field; + sqInt fmt; + sqInt format1; + sqInt header; + sqInt index; + sqInt numLiterals; + usqInt numSlots; + usqInt numSlots1; + sqInt numStrongSlots; + sqInt objOop1; + sqInt objToScan; + sqInt scanLargeObject; + sqInt sp; + + numStrongSlots = 0; /* To avoid overflowing the mark stack when we encounter large objects, we push the obj, then its numStrongSlots, and then index the object from the stack. */ @@ -41981,16 +41443,12 @@ markAndTrace(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objToScan)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objToScan + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objToScan - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objToScan - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (indexablePointersFormat())) { if (((longAt(objToScan)) & (classIndexMask())) == ClassMethodContextCompactIndex) { @@ -41999,16 +41457,16 @@ markAndTrace(sqInt objOop) sp = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l7; + goto l5; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objToScan))); contextSize = (sp >> 1); - l7: /* end fetchStackPointerOf: */; + l5: /* end fetchStackPointerOf: */; numStrongSlots = CtxtTempFrameStart + contextSize; - goto l12; + goto l10; } numStrongSlots = numSlots; - goto l12; + goto l10; } if (fmt == (weakArrayFormat())) { /* begin fixedFieldsOfClass: */ @@ -42016,26 +41474,26 @@ markAndTrace(sqInt objOop) /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - goto l12; + goto l10; } } if (fmt == 7) { numStrongSlots = 1; - goto l12; + goto l10; } if (fmt < (firstCompiledMethodFormat())) { numStrongSlots = 0; - goto l12; + goto l10; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objToScan)); /* begin fetchPointer:ofObject: */ header = longAt((objToScan + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - numStrongSlots = numLiterals + LiteralStart; - l12: /* end numStrongSlotsOfInephemeral: */; + l10: /* end numStrongSlotsOfInephemeral: */; scanLargeObject = numStrongSlots > 64; } if (scanLargeObject) { @@ -42063,14 +41521,13 @@ markAndTrace(sqInt objOop) goto l3; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l3; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -42079,13 +41536,13 @@ markAndTrace(sqInt objOop) } goto l3; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l3; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l3; } @@ -42129,14 +41586,13 @@ markAndTrace(sqInt objOop) goto l4; } assert(!(isForwarded(field))); - if (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0) { goto l4; } setIsMarkedOfto(field, 1); - /* begin formatOf: */ - format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); - if ((format11 >= (sixtyFourBitIndexableFormat())) - && (format11 < (firstCompiledMethodFormat()))) { + format1 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask()); + if ((format1 >= (sixtyFourBitIndexableFormat())) + && (format1 < (firstCompiledMethodFormat()))) { /* avoid pushing non-pointer objects on the markStack. */ /* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */ @@ -42145,13 +41601,13 @@ markAndTrace(sqInt objOop) } goto l4; } - if (format11 == (weakArrayFormat())) { + if (format1 == (weakArrayFormat())) { /* push weaklings on the weakling stack to scan later */ pushonObjStack(field, GIV(weaklingStack)); goto l4; } - if ((format11 == 5) + if ((format1 == 5) && (activeAndDeferredScan(field))) { goto l4; } @@ -42170,57 +41626,6 @@ markAndTrace(sqInt objOop) } -/* Go through the unscanned ephemerons, marking the inactive ones, and - removing them from the unscanned ephemerons. Answer if any inactive - ones were found. We cannot fire the ephemerons until all are found to - be active since scan-marking an inactive ephemeron later in the set may - render a previously-observed active ephemeron as inactive. */ - - /* SpurMemoryManager>>#markInactiveEphemerons */ -static sqInt -markInactiveEphemerons(void) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt ephemeron; - sqInt foundInactive; - sqInt key; - sqInt objOop; - sqInt oop; - usqInt ptr; - - foundInactive = 0; - ptr = (GIV(unscannedEphemerons).start); - while (ptr < ((GIV(unscannedEphemerons).top))) { - /* begin followedKeyOfEphemeron: */ - objOop = (ephemeron = longAt(ptr)); - assert((isNonImmediate(objOop)) - && (isEphemeron(objOop))); - /* begin followOopField:ofObject: */ - oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - if (((oop & (tagMask())) == 0) - && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop); - } - key = oop; - if ((key & (tagMask())) - || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) { - - /* Now remove the inactive ephemeron from the set, and scan-mark it. - Scan-marking it may add more ephemerons to the set. */ - foundInactive = 1; - (GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop); - if (((GIV(unscannedEphemerons).top)) > ptr) { - longAtput(ptr, longAt((GIV(unscannedEphemerons).top))); - } - markAndTrace(ephemeron); - } - else { - ptr += BytesPerOop; - } - } - return foundInactive; -} - - /* for profiling */ /* Mark all accessible objects. objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged is true if all @@ -42255,7 +41660,6 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) sqInt referent4; usqInt sizeOfUnusedEden; StackPage *thePage; - char *theSP; runLeakCheckerFor(GCModeFull); /* begin shutDownIncrementalGC: */ @@ -42290,19 +41694,18 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } - for (i3 = 0; i3 < GIV(numStackPages); i3 += 1) { + for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { /* begin stackPageAt: */ - thePage = stackPageAtpages(i3, GIV(pages)); + thePage = stackPageAtpages(i1, GIV(pages)); (thePage->trace = StackPageUnreached); } /* begin markAndTraceHiddenRoots */ @@ -42312,20 +41715,20 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((int)((usqInt)(RememberedSetRootIndex) << (shiftForWord()))))), 1); setIsMarkedOfto((assert((firstIndexableField(objectAfter(GIV(trueObj)))) == GIV(freeLists)), objectAfter(GIV(trueObj))), 1); - if (isWeakNonImm(GIV(classTableFirstPage))) { + if (isWeakFormat((((usqInt) (longAt(GIV(classTableFirstPage)))) >> (formatShift())) & (formatMask()))) { markAndTrace(GIV(hiddenRootsObj)); - goto l1; + goto l2; } setIsMarkedOfto(GIV(hiddenRootsObj), 1); markAndTrace(GIV(classTableFirstPage)); for (i2 = 1; i2 < GIV(numClassTablePages); i2 += 1) { setIsMarkedOfto(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))), 1); } -l1: /* end markAndTraceHiddenRoots */; +l2: /* end markAndTraceHiddenRoots */; /* begin markAndTraceExtraRoots */ assert(GIV(remapBufferCount) == 0); - for (i = 1; i <= GIV(extraRootCount); i += 1) { - oop = (GIV(extraRoots)[i])[0]; + for (i4 = 1; i4 <= GIV(extraRootCount); i4 += 1) { + oop = (GIV(extraRoots)[i4])[0]; if (!((oop & (tagMask())) || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { markAndTrace(oop); @@ -42421,18 +41824,18 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) if (!(GIV(tempOop3) == 0)) { markAndTrace(GIV(tempOop3)); } - for (i4 = 1, iLimiT = (remapBufferCount()); i4 <= iLimiT; i4 += 1) { - oop1 = GIV(remapBuffer)[i4]; + for (i3 = 1, iLimiT = (remapBufferCount()); i3 <= iLimiT; i3 += 1) { + oop1 = GIV(remapBuffer)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } } - for (i4 = 1; i4 <= GIV(jmpDepth); i4 += 1) { - oop1 = GIV(suspendedCallbacks)[i4]; + for (i3 = 1; i3 <= GIV(jmpDepth); i3 += 1) { + oop1 = GIV(suspendedCallbacks)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } - oop1 = GIV(suspendedMethods)[i4]; + oop1 = GIV(suspendedMethods)[i3]; if (!((oop1 & 1))) { markAndTrace(oop1); } @@ -42441,13 +41844,13 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) markWeaklingsAndMarkAndFireEphemerons(); assert(validObjStacks()); /* begin expungeDuplicateAndUnmarkedClasses: */ - for (i1 = 1; i1 < GIV(numClassTablePages); i1 += 1) { + for (i = 1; i < GIV(numClassTablePages); i += 1) { /* Avoid expunging the puns by not scanning the 0th page. */ - classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) { classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord()))))); - classIndex = (((sqInt)((usqInt)(i1) << (classTableMajorIndexShift())))) + j; + classIndex = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j; assert((classOrNil == GIV(nilObj)) || (addressCouldBeClassObj(classOrNil))); if (classOrNil == GIV(nilObj)) { @@ -42457,7 +41860,7 @@ markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) } else { if ((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged - && (!(((((usqInt) (longAt(classOrNil + 4))) >> 23) & 1) != 0))) + && (!(((((usqInt) (longAt(classOrNil + 4))) >> (markedBitHalfShift())) & 1) != 0))) || (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) != classIndex)) { assert(!(isOopForwarded(classTablePage))); longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj)); @@ -42491,7 +41894,6 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt classFormat; sqInt ephemeron; sqInt field; - sqInt format; sqInt i; sqInt i1; sqInt iLimiT; @@ -42502,11 +41904,9 @@ markWeaklingsAndMarkAndFireEphemerons(void) sqInt numToEnumerateOnThisPage; sqInt numTracedWeaklings; sqInt objOop; - sqInt objStack; sqInt objStackPage; sqInt oop; sqInt oop1; - sqInt p; sqInt size; sqInt topIndex; sqInt weakling; @@ -42516,12 +41916,11 @@ markWeaklingsAndMarkAndFireEphemerons(void) markAndTraceUntracedReachableStackPages(); do { /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -42529,7 +41928,7 @@ markWeaklingsAndMarkAndFireEphemerons(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size - numTracedWeaklings; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); @@ -42554,7 +41953,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += } field = oop; if (!((field & (tagMask())) - || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(field + 4))) >> (markedBitHalfShift())) & 1) != 0))) { markAndTrace(field); } } @@ -42572,21 +41971,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += return; } if (!(markInactiveEphemerons())) { - /* begin fireAllUnscannedEphemerons */ - assert(!(noUnscannedEphemerons())); - assert(allUnscannedEphemeronsAreActive()); - for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) { - /* begin fireEphemeron: */ - queueMourner(longAt(p)); - /* begin setFormatOf:to: */ - format = 1; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(longAt(p), ((longAt(longAt(p))) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; - } + fireAllUnscannedEphemerons(); } /* begin markAllUnscannedEphemerons */ assert(!(noUnscannedEphemerons())); @@ -42598,7 +41983,6 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += longAtput((GIV(unscannedEphemerons).start), longAt(lastptr)); } (GIV(unscannedEphemerons).top = lastptr); - /* begin followedKeyOfMaybeFiredEphemeron: */ assert((isNonImmediate(ephemeron)) && (isMaybeFiredEphemeron(ephemeron))); /* begin followOopField:ofObject: */ @@ -42608,6 +41992,7 @@ classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += oop1 = fixFollowedFieldofObjectwithInitialValue(0, ephemeron, oop1); } key = oop1; + setIsMarkedOfto(ephemeron, 0); markAndTrace(key); markAndTrace(ephemeron); @@ -42669,20 +42054,6 @@ newSpaceIsEmpty(void) && (GIV(pastSpaceStart) == (((pastSpace()).start))); } - -/* Answer the next free free chunk using the xor trick to use only one field, - see e.g. - The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 - `Circular Lists', exercise. 18 - http://en.wikipedia.org/wiki/XOR_linked_list. */ - - /* SpurMemoryManager>>#nextInSortedFreeListLink:given: */ -usqInt -nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) -{ - return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); -} - /* SpurMemoryManager>>#nilObject */ sqInt nilObject(void) @@ -42708,7 +42079,6 @@ nilUnmarkedWeaklingSlots(void) sqInt numOnThisPage; sqInt numToEnumerate; sqInt numToEnumerateOnThisPage; - sqInt objStack; sqInt objStackPage; sqInt referent; sqInt size; @@ -42720,12 +42090,11 @@ nilUnmarkedWeaklingSlots(void) return; } /* begin objStack:from:do: */ - objStack = GIV(weaklingStack); eassert(isValidObjStack(GIV(weaklingStack))); /* begin fetchPointer:ofObject: */ - size = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); + size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); /* begin fetchPointer:ofObject: */ - objStackPage = longAt((objStack + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); + objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); while (objStackPage != 0) { size += ObjStackLimit; assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit); @@ -42733,30 +42102,30 @@ nilUnmarkedWeaklingSlots(void) objStackPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackNextx) << (shiftForWord()))))); } numToEnumerate = size; - objStackPage = objStack; + objStackPage = GIV(weaklingStack); while (numToEnumerate > 0) { /* begin fetchPointer:ofObject: */ numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackTopx) << (shiftForWord()))))); numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage); topIndex = (numOnThisPage + ObjStackFixedSlots) - 1; - for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) { - assert(isWeak(fetchPointerofObject(i1, objStackPage))); - weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + for (i = topIndex; i >= ((topIndex - numToEnumerateOnThisPage) + 1); i += -1) { + assert(isWeak(fetchPointerofObject(i, objStackPage))); + weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); /* begin nilUnmarkedWeaklingSlotsIn: */ anyUnmarked1 = 0; assert(allStrongSlotsOfWeaklingAreMarked(weakling)); - for (i = ((assert((formatOf(weakling)) == (weakArrayFormat())), -fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i <= iLimiT; i += 1) { + for (i1 = ((assert((formatOf(weakling)) == (weakArrayFormat())), +fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i1 <= iLimiT; i1 += 1) { /* begin fetchPointer:ofObject: */ - referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); if ((referent & (tagMask())) == 0) { if (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - referent = fixFollowedFieldofObjectwithInitialValue(i, weakling, referent); + referent = fixFollowedFieldofObjectwithInitialValue(i1, weakling, referent); } if (!((referent & (tagMask())) - || (((((usqInt) (longAt(referent + 4))) >> 23) & 1) != 0))) { + || (((((usqInt) (longAt(referent + 4))) >> (markedBitHalfShift())) & 1) != 0))) { assert(!(isOopForwarded(weakling))); - longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj)); + longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj)); anyUnmarked1 = 1; } @@ -42768,13 +42137,7 @@ fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakli /* fireFinalization: could grow the mournQueue and if so, additional pages must be marked to avoid being GC'ed. */ assert(GIV(marking)); - /* begin fireFinalization: */ - if (GIV(newFinalization)) { - queueMourner(weakling); - } - /* begin signalFinalization: */ - forceInterruptCheck(); - GIV(pendingFinalizationSignals) += 1; + fireFinalization(weakling); } } @@ -42900,13 +42263,9 @@ noInlineObjectAfterlimit(sqInt objOop, sqInt limit) /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -42950,7 +42309,6 @@ numBytesOfBytes(sqInt objOop) { sqInt fmt; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert(fmt >= (firstByteFormat())); return ((numSlotsOf(objOop)) << (shiftForWord())) - (fmt & 7); @@ -42968,18 +42326,13 @@ numBytesOf(sqInt objOop) usqInt numBytes; usqInt numSlots; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numBytes = longAt(objOop - BaseHeaderSize); - } - else { - numBytes = numSlots; - } + numBytes = (numSlots == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots); numBytes = numBytes << (shiftForWord()); if (fmt >= (firstByteFormat())) { @@ -43013,10 +42366,10 @@ numberOfForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -43044,32 +42397,28 @@ numberOfForwarders(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -43079,8 +42428,8 @@ numberOfForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -43092,37 +42441,33 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -43133,32 +42478,28 @@ numberOfForwarders(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return n; } @@ -43178,7 +42519,6 @@ numPointerSlotsOf(sqInt objOop) usqInt numSlots; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -43200,8 +42540,7 @@ numPointerSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } if (fmt == 7) { @@ -43214,9 +42553,9 @@ numPointerSlotsOf(sqInt objOop) assert(isCompiledMethod(objOop)); /* begin fetchPointer:ofObject: */ header = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -43233,8 +42572,7 @@ numSlotsOfAny(sqInt objOop) numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -43248,8 +42586,7 @@ numSlotsOf(sqInt objOop) assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop + 7); return (numSlots == (numSlotsMask()) - ? (/* begin rawOverflowSlotsOf: */ - longAt(objOop - BaseHeaderSize)) + ? longAt(objOop - BaseHeaderSize) : numSlots); } @@ -43272,7 +42609,6 @@ numStrongSlotsOfInephemeral(sqInt objOop) sqInt objOop1; sqInt sp; - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); assert((fmt != (ephemeronFormat())) || (isMarked(keyOfEphemeron(objOop)))); @@ -43280,13 +42616,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) /* begin numSlotsOf: */ assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (fmt <= 2) { return numSlots; } @@ -43324,9 +42656,9 @@ numStrongSlotsOfInephemeral(sqInt objOop) assert(isCompiledMethod(objOop)); /* begin fetchPointer:ofObject: */ header = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - return numLiterals + LiteralStart; } @@ -43387,13 +42719,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart))) { /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -43414,13 +42742,9 @@ objectAfter(sqInt objOop) if (oopisGreaterThanOrEqualToandLessThan(objOop, ((pastSpace()).start), GIV(pastSpaceStart))) { /* begin objectAfter:limit: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -43442,13 +42766,9 @@ objectAfter(sqInt objOop) limit = futureSurvivorStart(); /* begin addressAfter: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -43468,13 +42788,9 @@ objectAfter(sqInt objOop) } /* begin objectAfter:limit: */ numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } + numSlots4 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots13); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes3 = ((sqInt) 8); @@ -43510,10 +42826,10 @@ objectBefore(sqInt objOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop1; sqInt objOop2; @@ -43536,8 +42852,8 @@ objectBefore(sqInt objOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -43550,37 +42866,33 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -43592,32 +42904,28 @@ objectBefore(sqInt objOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } return prev; } @@ -43637,32 +42945,28 @@ objectBefore(sqInt objOop) prevPrevObj1 = prevObj1; prevObj1 = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop2 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop2 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop2 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return prev; } @@ -43685,6 +42989,335 @@ objectStartingAt(sqInt address) } +/* This is part of storeImageSegmentInto:outPointers:roots:. + Answer an Array of all the objects only reachable from the argument, an + Array of root objects, + starting with arrayOfRoots. If there is no space, answer a SmallInteger + whose value is the + number of slots required. This is used to collect the objects to include + in an image segment + on Spur, separate from creating the segment, hence simplifying the + implementation. Thanks to Igor Stasenko for this idea. */ + + /* SpurMemoryManager>>#objectsReachableFromRoots: */ +static sqInt NoDbgRegParms +objectsReachableFromRoots(sqInt arrayOfRoots) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt count; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt freeChunk; + sqInt i; + sqInt i1; + sqInt iLimiT; + sqInt iLimiT1; + usqInt limit; + usqInt limit1; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots13; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + usqInt numSlots6; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oop; + sqInt oop1; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + sqInt ptr; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + usqInt slotBytes3; + sqInt start; + + assert(isArray(arrayOfRoots)); + assert(allObjectsUnmarked()); + /* begin markObjectsIn: */ + setIsMarkedOfto(arrayOfRoots, 1); + for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { + /* begin followField:ofObject: */ + objOop1 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop1); + } + oop1 = objOop1; + if ((oop1 & (tagMask())) == 0) { + setIsMarkedOfto(oop1, 1); + } + } + markObjects(0); + assert(isEmptyObjStack(GIV(markStack))); + assert(isEmptyObjStack(GIV(weaklingStack))); + assert(noUnscannedEphemerons()); + freeChunk = allocateLargestFreeChunk(); + ptr = (start = freeChunk + BaseHeaderSize); + /* begin addressAfter: */ + numSlots1 = byteAt(freeChunk + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(freeChunk - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + limit = (freeChunk + BaseHeaderSize) + slotBytes; + + /* First put the arrayOfRoots; order is important. */ + count = 0; + count += 1; + if (ptr < limit) { + longAtput(ptr, arrayOfRoots); + ptr += BytesPerOop; + } + for (i = 0, iLimiT = ((numSlotsOf(arrayOfRoots)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if ((oop & (tagMask())) == 0) { + pushonObjStack(oop, GIV(markStack)); + } + } + while (!(isEmptyObjStack(GIV(markStack)))) { + objOop = popObjStack(GIV(markStack)); + count += 1; + if (ptr < limit) { + longAtput(ptr, objOop); + ptr += BytesPerOop; + } + oop = fetchClassOfNonImm(objOop); + if (!(((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0)) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + if ((((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((((longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(objOop))))) { + + /* widow now, before the loop */ + for (i = 0, iLimiT = ((numSlotsOfMarriedContext(objOop)) - 1); i <= iLimiT; i += 1) { + oop = fetchPointerofMarriedContext(i, objOop); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + else { + for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if (!((oop & (tagMask())) + || (((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0))) { + setIsMarkedOfto(objOop, 1); + pushonObjStack(oop, GIV(markStack)); + } + } + } + } + /* begin unmarkAllObjects */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (((((usqInt) (longAt(objOop11 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop11, 0); + } + else { + if (!(((longAt(objOop11)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop11, 0); + } + } + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + /* begin allNewSpaceEntitiesDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit1 = GIV(pastSpaceStart); + while (oopisLessThan(objOop2, limit1)) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots13 = byteAt(objOop2 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); + } + else { + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { + objOop2 = limit1; + goto l16; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l16: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((((usqInt) (longAt(objOop2 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) { + setIsMarkedOfto(objOop2, 0); + } + else { + if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) { + setIsMarkedOfto(objOop2, 0); + } + } + } + + prevPrevObj = prevObj; + prevObj = objOop2; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop2 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + + /* Now try and allocate the result */ + GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); + if ((count > ((ptr - start) / BytesPerOop)) + || ((limit != ptr) + && ((limit - ptr) <= 8))) { + + /* can't split a single word */ + freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) + ? freeChunk - BaseHeaderSize + : freeChunk)); + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + return (((usqInt)count << 1) | 1); + } + /* begin setFormatOf:to: */ + assert(((2 >= 0) && (2 <= (formatMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (2U << (formatShift()))); + /* begin setClassIndexOf:to: */ + assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); + flag("endianness"); + longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); + shortentoIndexableSize(freeChunk, count); + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { + remember(freeChunk); + } + /* begin checkFreeSpace: */ + assert(bitsSetInFreeSpaceMaskForAllFreeLists()); + assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); + if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { + runLeakCheckerForFreeSpace(GCModeFreeSpace); + } + runLeakCheckerFor(GCModeImageSegment); + return freeChunk; +} + + /* This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code @@ -43736,7 +43369,6 @@ okayOop(sqInt signedOop) error("oop header has overflow header word, but overflow word does not have a saturated numSlots field"); return 0; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if ((fmt == 6) || (fmt == 8)) { error("oop has an unknown format type"); @@ -43751,7 +43383,7 @@ okayOop(sqInt signedOop) error("some unused header bits are set; should be zero"); return 0; } - unusedBitsInYoungObjects = ((1U << 0x1F) | (1U << 30)) | (1U << (rememberedBitShift())); + unusedBitsInYoungObjects = ((1U << (greyBitShift())) | (1U << (pinnedBitShift()))) | (1U << (rememberedBitShift())); if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) { error("some header bits unused in young objects are set; should be zero"); return 0; @@ -43773,8 +43405,6 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) sqInt classIndex1; sqInt clone1; sqInt clone2; - sqInt format; - sqInt format1; sqInt hash; sqInt hash1; sqInt hash2; @@ -43808,15 +43438,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(obj1, ((longAt(obj1)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << 23))); + longAtput(obj1, (longAt(obj1)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -43841,15 +43470,14 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) } /* begin forward:to: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(obj2, ((longAt(obj2)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << 23))); + longAtput(obj2, (longAt(obj2)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -43892,7 +43520,6 @@ sqInt pinObject(sqInt objOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt format; sqInt i; sqInt oldClone; sqInt referent; @@ -43913,12 +43540,12 @@ pinObject(sqInt objOop) l1: /* end segmentContainingObj: */; if ((seg->containsPinned)) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); return objOop; } if (!(someSegmentContainsPinned())) { /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) | (1U << 30)); + longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift()))); (seg->containsPinned = 1); return objOop; } @@ -43927,18 +43554,17 @@ pinObject(sqInt objOop) if (oldClone != 0) { GIV(becomeEffectsFlags) = becomeEffectFlagsFor(objOop); /* begin setIsPinnedOf:to: */ - longAtput(oldClone, (longAt(oldClone)) | (1U << 30)); + longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift()))); /* begin forward:to: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(objOop, ((longAt(objOop)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); # if IMMUTABILITY /* begin setIsImmutableOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 23))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (immutableBitShift())))); # endif /* IMMUTABILITY */ @@ -44178,10 +43804,10 @@ printActivationsOf(sqInt aMethodObj) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44203,8 +43829,8 @@ printActivationsOf(sqInt aMethodObj) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44226,37 +43852,33 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -44277,32 +43899,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44330,32 +43948,28 @@ printActivationsOf(sqInt aMethodObj) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -44382,10 +43996,10 @@ printContextReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -44407,8 +44021,8 @@ printContextReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44437,90 +44051,82 @@ printContextReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { - /* begin allocationUnit */ - slotBytes = ((sqInt) 8); - } - else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l1: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop1)); - if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { - i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); - while (((i -= 1)) >= 0) { - if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { - printHex(objOop1); - print(" @ "); - printNum(i); - /* begin space */ - putchar(' '); - printOopShort(objOop1); - print(" pc "); - printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); - /* begin cr */ - printf("\n"); - i = 0; - } - } - } - - - prevPrevObj = prevObj; - prevObj = objOop1; - /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); } else { - numSlots3 = numSlots12; + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - if (numSlots3 == 0) { + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) { + i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1)); + while (((i -= 1)) >= 0) { + if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { + printHex(objOop1); + print(" @ "); + printNum(i); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + print(" pc "); + printHex(longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))); + /* begin cr */ + printf("\n"); + i = 0; + } + } + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -44555,35 +44161,92 @@ printContextReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } + /* SpurMemoryManager>>#printEntity: */ +void +printEntity(sqInt oop) +{ + sqInt isObj; + sqInt n; + + isObj = 0; + printHex(oop); + /* begin space */ + putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + return; + } + print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) + ? "free" + : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) + ? "bridge" + : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 + ? "forwarder" + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } + /* begin cr */ + printf("\n"); +} + /* SpurMemoryManager>>#printForwarders */ void printForwarders(void) @@ -44601,10 +44264,10 @@ printForwarders(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop2; @@ -44619,46 +44282,42 @@ printForwarders(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop2 = GIV(nilObj); + objOop1 = GIV(nilObj); while (1) { - assert((objOop2 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break; - assert((long64At(objOop2)) != 0); - if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop2); + assert((objOop1 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; + assert((long64At(objOop1)) != 0); + if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop1); /* begin cr */ printf("\n"); } prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop2 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop2 = GIV(endOfMemory); - goto l3; + objOop1 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop2 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -44668,90 +44327,82 @@ printForwarders(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop2 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, limit)) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop2 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop2 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l1; + objOop2 = limit; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop2 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { - if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { - printHex(objOop1); + while (oopisLessThan(objOop2, GIV(freeStart))) { + if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) { + printHex(objOop2); /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop2; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop2 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop2 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l2; + objOop2 = GIV(freeStart); + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -44777,10 +44428,10 @@ printFreeChunks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt o; sqInt objOop; sqInt objOop1; @@ -44802,8 +44453,8 @@ printFreeChunks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -44822,37 +44473,33 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -44870,32 +44517,28 @@ printFreeChunks(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceEntitiesDo: */ assert(isOldObject(GIV(nilObj))); @@ -44913,32 +44556,28 @@ printFreeChunks(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l5; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l5: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -45098,13 +44737,9 @@ printHeaderOf(sqInt objOop) print(" hdr16 slotf "); /* begin printHexnp: */ numSlots = byteAt((objOop - 8) + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n = longAt((objOop - 8) - BaseHeaderSize); - } - else { - n = numSlots; - } + n = (numSlots == (numSlotsMask()) + ? longAt((objOop - 8) - BaseHeaderSize) + : numSlots); printf("0x%lx", ((unsigned long) n)); print(" slotc "); /* begin printHexnp: */ @@ -45116,29 +44751,25 @@ printHeaderOf(sqInt objOop) print(" hdr8 slots "); /* begin printHexnp: */ numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - n1 = longAt(objOop - BaseHeaderSize); - } - else { - n1 = numSlots1; - } + n1 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); printf("0x%lx", ((unsigned long) n1)); } /* begin space */ putchar(' '); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'M' : 'm'); putchar(aByte); /* begin printChar: */ - aByte1 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte1 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'G' : 'g'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'P' : 'p'); putchar(aByte2); @@ -45148,7 +44779,7 @@ printHeaderOf(sqInt objOop) : 'r'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'I' : 'i'); putchar(aByte4); @@ -45182,7 +44813,7 @@ printHeaderTypeOf(sqInt objOop) ? " hdr16 " : " hdr8 ")); /* begin printChar: */ - aByte = (((((usqInt) (longAt(objOop))) >> 23) & 1) != 0 + aByte = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0 ? 'i' : '.'); putchar(aByte); @@ -45192,17 +44823,17 @@ printHeaderTypeOf(sqInt objOop) : '.'); putchar(aByte1); /* begin printChar: */ - aByte2 = (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0 + aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0 ? 'p' : '.'); putchar(aByte2); /* begin printChar: */ - aByte3 = (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0 + aByte3 = (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0 ? 'm' : '.'); putchar(aByte3); /* begin printChar: */ - aByte4 = (((((usqInt) (longAt(objOop))) >> 0x1F) & 1) != 0 + aByte4 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0 ? 'g' : '.'); putchar(aByte4); @@ -45247,10 +44878,10 @@ printInstancesWithClassIndex(sqInt classIndex) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45279,32 +44910,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -45314,8 +44941,8 @@ printInstancesWithClassIndex(sqInt classIndex) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -45329,37 +44956,33 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -45372,32 +44995,28 @@ printInstancesWithClassIndex(sqInt classIndex) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -45451,6 +45070,191 @@ printInvalidClassTableEntries(void) } +/* Scan the heap printing the oops of any and all methods that implement + anOop + */ + + /* SpurMemoryManager>>#printMethodImplementorsOf: */ +void +printMethodImplementorsOf(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + /* begin allObjectsDo: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop1)) == anOop)) { + printHex(objOop1); + /* begin space */ + putchar(' '); + printOopShort(objOop1); + /* begin cr */ + printf("\n"); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == anOop)) { + printHex(objOop11); + /* begin space */ + putchar(' '); + printOopShort(objOop11); + /* begin cr */ + printf("\n"); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + } + + /* Scan the heap printing the oops of any and all methods that refer to anOop */ /* SpurMemoryManager>>#printMethodReferencesTo: */ @@ -45471,10 +45275,10 @@ printMethodReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45496,20 +45300,15 @@ printMethodReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -45529,48 +45328,39 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop1)), -/* begin fetchPointer:ofObject: */ -longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop1)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -45590,32 +45380,28 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -45627,12 +45413,7 @@ longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWo assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(objOop11)) + LiteralStart) - 1; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -45653,20 +45434,16 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -45725,10 +45502,10 @@ printObjectsWithHash(sqInt hash) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -45757,32 +45534,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -45792,8 +45565,8 @@ printObjectsWithHash(sqInt hash) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -45807,37 +45580,33 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { @@ -45850,32 +45619,28 @@ printObjectsWithHash(sqInt hash) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } @@ -45962,7 +45727,7 @@ printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType) printNum(longAt((objStackPage + BaseHeaderSize) + (((int)((usqInt)(ObjStackMyx) << (shiftForWord())))))); print(" ("); printNum(myx); - print((((((usqInt) (longAt(objStackPage + 4))) >> 23) & 1) != 0 + print((((((usqInt) (longAt(objStackPage + 4))) >> (markedBitHalfShift())) & 1) != 0 ? ") mkd" : ") unmkd")); /* begin cr */ @@ -45987,7 +45752,9 @@ printObjStack(sqInt objStack) void printOopsFromto(sqInt startAddress, sqInt endAddress) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt isObj; sqInt limit; + sqInt n; sqInt oop; oop = objectBefore(startAddress); @@ -45998,20 +45765,60 @@ printOopsFromto(sqInt startAddress, sqInt endAddress) ? startAddress : oop)); while (oopisLessThan(oop, limit)) { + /* begin printEntity: */ + isObj = 0; printHex(oop); - print("/"); - printNum(oop); /* begin space */ putchar(' '); + if (!(addressCouldBeObj(oop))) { + print((oop & (tagMask()) + ? "immediate" + : "unknown")); + goto l1; + } print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()) ? "free" : (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun()) ? "bridge" : (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0 ? "forwarder" - : "object")))); + : (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun()) + ? "pun/obj stack" + : ((isObj = 1), + "object")))))); + /* begin space */ + putchar(' '); + printHex(bytesInObject(oop)); + print("/"); + printNum(bytesInObject(oop)); + if (isObj) { + /* begin space */ + putchar(' '); + print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15 + ? "f:0" + : "f:")); + /* begin printHexnpnp: */ + n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + printf("%lx", ((unsigned long) n)); + print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0 + ? " g" + : " .")); + print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0 + ? "i" + : ".")); + print((((((usqInt) (longAt(oop + 4))) >> (markedBitHalfShift())) & 1) != 0 + ? "m" + : ".")); + print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0 + ? "p" + : ".")); + print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0 + ? "r" + : ".")); + } /* begin cr */ printf("\n"); + l1: /* end printEntity: */; oop = objectAfter(oop); } } @@ -46041,11 +45848,11 @@ printReferencesTo(sqInt anOop) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -46068,8 +45875,8 @@ printReferencesTo(sqInt anOop) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots4 = byteAt(address + 7); - objOop1 = (numSlots4 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -46086,43 +45893,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l20; + goto l21; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop1))); contextSize = (sp >> 1); - l20: /* end fetchStackPointerOf: */; + l21: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l21; + goto l20; } /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l21; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); + goto l20; } if (fmt == 7) { i = 1; - goto l21; + goto l20; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l21; + goto l20; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop1)); /* begin fetchPointer:ofObject: */ header = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l21: /* end numPointerSlotsOf: */; + l20: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -46141,37 +45944,33 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l12; + goto l15; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l12: /* end objectAfter:limit: */; + l15: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -46187,43 +45986,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l22; + goto l23; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop1))); contextSize = (sp >> 1); - l22: /* end fetchStackPointerOf: */; + l23: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l23; + goto l22; } /* begin numSlotsOf: */ assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop1 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop1 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l23; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots); + goto l22; } if (fmt == 7) { i = 1; - goto l23; + goto l22; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l23; + goto l22; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop1)); /* begin fetchPointer:ofObject: */ header = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l23: /* end numPointerSlotsOf: */; + l22: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop1); @@ -46242,32 +46037,28 @@ printReferencesTo(sqInt anOop) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l15; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l15: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -46289,43 +46080,39 @@ printReferencesTo(sqInt anOop) sp = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { contextSize = 0; - goto l24; + goto l25; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(objOop11))); contextSize = (sp >> 1); - l24: /* end fetchStackPointerOf: */; + l25: /* end fetchStackPointerOf: */; i = CtxtTempFrameStart + contextSize; - goto l25; + goto l24; } /* begin numSlotsOf: */ assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(objOop11 + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - i = longAt(objOop11 - BaseHeaderSize); - } - else { - i = numSlots; - } - goto l25; + i = (numSlots == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots); + goto l24; } if (fmt == 7) { i = 1; - goto l25; + goto l24; } if (fmt < (firstCompiledMethodFormat())) { i = 0; - goto l25; + goto l24; } /* begin methodHeaderOf: */ assert(isCompiledMethod(objOop11)); /* begin fetchPointer:ofObject: */ header = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + /* begin literalCountOfMethodHeader: */ assert((header & 1)); numLiterals = ((header >> 1)) & AlternateHeaderNumLiteralsMask; - i = numLiterals + LiteralStart; - l25: /* end numPointerSlotsOf: */; + l24: /* end numPointerSlotsOf: */; while (((i -= 1)) >= 0) { if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { printHex(objOop11); @@ -46345,14 +46132,10 @@ printReferencesTo(sqInt anOop) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); @@ -46363,14 +46146,14 @@ printReferencesTo(sqInt anOop) followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l17; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l17: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } } @@ -46463,45 +46246,6 @@ rawHashBitsOf(sqInt objOop) } -/* Scavenge or simply follow objOop. Answer the new location of objOop. - The send should have been guarded by a send of shouldRemapOop:. - The method is called remapObj: for compatibility with ObjectMemory. */ - - /* SpurMemoryManager>>#remapObj: */ -sqInt -remapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt referent; - sqInt resolvedObj; - - assert(shouldRemapOop(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(objOop)); - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent & (tagMask())) == 0) - && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - /* begin fetchPointer:ofMaybeForwardedObject: */ - referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); - } - resolvedObj = referent; - } - else { - assert(!((isInFutureSpace(objOop)))); - resolvedObj = objOop; - } - if (GIV(scavengeInProgress) - && ((((resolvedObj & (tagMask())) == 0) - && ((assert(isNonImmediate(resolvedObj)), - oopisLessThan(resolvedObj, GIV(newSpaceLimit))))) - && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { - return copyAndForward(resolvedObj); - } - return resolvedObj; -} - - /* Remove the given variable location to the extra roots table. */ /* SpurMemoryManager>>#removeGCRoot: */ @@ -46573,7 +46317,7 @@ runLeakCheckerForFreeSpace(sqInt gcModes) static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -46583,18 +46327,18 @@ runLeakCheckerFor(sqInt gcModes) } clearLeakMapAndMapAccessibleObjects(); asserta(checkHeapIntegrityclassIndicesShouldBeValid(0, 1)); - asserta(checkInterpreterIntegrity()); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } return; } - /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ static void NoDbgRegParms -runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedNewSpaceObjs, sqInt classIndicesShouldBeValid) +runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid) { - /* begin inLineRunLeakCheckerFor:excludeUnmarkedNewSpaceObjs:classIndicesShouldBeValid: */ + /* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */ if (gcModes & checkForLeaks) { if (gcModes & GCModeFull) { reverseDisplayFromto(0, 7); @@ -46603,8 +46347,8 @@ runLeakCheckerForexcludeUnmarkedNewSpaceObjsclassIndicesShouldBeValid(sqInt gcMo reverseDisplayFromto(8, 15); } clearLeakMapAndMapAccessibleObjects(); - asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedNewSpaceObjs, classIndicesShouldBeValid)); - asserta(checkInterpreterIntegrity()); + asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedObjs, classIndicesShouldBeValid)); + asserta((checkInterpreterIntegrity()) == 0); asserta(checkStackIntegrity()); asserta(checkCodeIntegrity(gcModes)); } @@ -46620,7 +46364,6 @@ scavengingGCTenuringIf(sqInt tenuringCriterion) sqInt i; sqInt i1; sqInt probe; - char *theSP; assert(GIV(remapBufferCount) == 0); if (!(asserta(((((eden()).limit)) - GIV(freeStart)) > (interpreterAllocationReserveBytes())))) { @@ -46660,14 +46403,13 @@ scavengingGCTenuringIf(sqInt tenuringCriterion) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } /* begin flushMethodCacheFrom:to: */ @@ -46825,7 +46567,6 @@ shortentoIndexableSize(sqInt objOop, sqInt indexableSize) } bytesBefore = bytesInObject(objOop); if ((byteAt(objOop + 7)) == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ longAtput(objOop - BaseHeaderSize, numSlots); } else { @@ -46883,25 +46624,6 @@ shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress) } -/* Answer if the obj should be scavenged (or simply followed). The method is - called shouldRemapObj: for compatibility with ObjectMemory. We test for - being already - scavenged because mapStackPages via mapInterpreterOops may be applied - twice in the context of a global GC where a scavenge, followed by a - scan-mark-free, and - final compaction passes may result in scvenged fields being visited twice. */ - - /* SpurMemoryManager>>#shouldRemapObj: */ -sqInt -shouldRemapObj(sqInt objOop) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) - || (((assert(isNonImmediate(objOop)), - oopisLessThan(objOop, GIV(newSpaceLimit)))) - && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); -} - - /* Answer if the oop should be scavenged.. The method is called shouldRemapOop: for compatibility with ObjectMemory. */ @@ -46961,13 +46683,9 @@ slotSizeOf(sqInt oop) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -47059,35 +46777,18 @@ storeCheckBoundary(void) static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt address; - sqInt address1; sqInt arrayOfObjects; sqInt classIndex; sqInt classIndex1; - sqInt count; usqInt endSeg; sqInt fillValue; - sqInt followingWord; - sqInt followingWord1; - sqInt followingWord2; - usqInt followingWordAddress; - usqInt followingWordAddress1; - usqInt followingWordAddress2; - sqInt format; sqInt formatField; sqInt formatField1; - sqInt freeChunk; sqInt hash; sqInt here; sqInt hereLimiT; sqInt i; - sqInt i1; - sqInt i2; sqInt iLimiT; - sqInt iLimiT1; - sqInt iLimiT2; - usqInt limit; - usqInt limit1; usqInt newObj; usqInt newObj1; sqInt newSegAddrOrError; @@ -47098,360 +46799,46 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr sqInt numSlots; sqInt numSlots1; usqInt numSlots11; - usqInt numSlots111; - usqInt numSlots12; - usqInt numSlots121; - usqInt numSlots13; - usqInt numSlots14; - sqInt numSlots2; - usqInt numSlots21; + usqInt numSlots2; sqInt numSlots3; - usqInt numSlots31; - usqInt numSlots4; - usqInt numSlots41; + sqInt numSlots4; usqInt numSlots5; usqInt numSlots6; - usqInt numSlots7; - usqInt numSlots8; - sqInt obj; sqInt objOop; sqInt objOop1; - sqInt objOop11; - sqInt objOop12; - sqInt objOop2; - sqInt objOop3; - sqInt oop; - sqInt oop1; sqInt outIndex; usqInt p; usqInt p1; - sqInt prevObj; - sqInt prevObj1; - sqInt prevPrevObj; - sqInt prevPrevObj1; - sqInt ptr; sqInt savedInHashes; sqInt savedOutHashes; sqInt segAddr; sqInt segStart; usqInt slotBytes; - usqInt slotBytes1; - usqInt slotBytes11; - usqInt slotBytes2; - usqInt slotBytes3; - sqInt start; sqInt tempObjOop; sqInt there; sqInt valueWord; runLeakCheckerFor(GCModeImageSegment); - /* begin objectsReachableFromRoots: */ - assert(isArray(arrayOfRoots)); - assert(allObjectsUnmarked()); - /* begin markObjectsIn: */ - setIsMarkedOfto(arrayOfRoots, 1); - for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) { - /* begin followField:ofObject: */ - objOop11 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop11); - } - oop1 = objOop11; - if ((oop1 & (tagMask())) == 0) { - setIsMarkedOfto(oop1, 1); - } - } - markObjects(0); - assert(isEmptyObjStack(GIV(markStack))); - assert(isEmptyObjStack(GIV(weaklingStack))); - assert(noUnscannedEphemerons()); - freeChunk = allocateLargestFreeChunk(); - ptr = (start = freeChunk + BaseHeaderSize); - /* begin addressAfter: */ - numSlots12 = byteAt(freeChunk + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots7 = longAt(freeChunk - BaseHeaderSize); - } - else { - numSlots7 = numSlots12; - } - if (numSlots7 == 0) { - /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); - } - else { - slotBytes1 = (numSlots7 + (numSlots7 & 1)) << (shiftForWord()); - } - limit = (freeChunk + BaseHeaderSize) + slotBytes1; - - /* First put the arrayOfRoots; order is important. */ - count = 0; - count += 1; - if (ptr < limit) { - longAtput(ptr, arrayOfRoots); - ptr += BytesPerOop; - } - for (i2 = 0, iLimiT2 = ((numSlotsOf(arrayOfRoots)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if ((oop & (tagMask())) == 0) { - pushonObjStack(oop, GIV(markStack)); - } - } - while (!(isEmptyObjStack(GIV(markStack)))) { - objOop2 = popObjStack(GIV(markStack)); - count += 1; - if (ptr < limit) { - longAtput(ptr, objOop2); - ptr += BytesPerOop; - } - oop = fetchClassOfNonImm(objOop2); - if (!(((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0)) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - if ((((longAt(objOop2)) & (classIndexMask())) == ClassMethodContextCompactIndex) - && ((((longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) - && (!(isWidowedContext(objOop2))))) { - - /* widow now, before the loop */ - for (i2 = 0, iLimiT2 = ((numSlotsOfMarriedContext(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - oop = fetchPointerofMarriedContext(i2, objOop2); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - else { - for (i2 = 0, iLimiT2 = ((numPointerSlotsOf(objOop2)) - 1); i2 <= iLimiT2; i2 += 1) { - /* begin fetchPointer:ofObject: */ - oop = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord()))))); - if (!((oop & (tagMask())) - || (((((usqInt) (longAt(oop + 4))) >> 23) & 1) != 0))) { - setIsMarkedOfto(objOop2, 1); - pushonObjStack(oop, GIV(markStack)); - } - } - } - } - /* begin unmarkAllObjects */ - assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); - while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (((((usqInt) (longAt(objOop12 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop12)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop12, 0); - } - else { - if (!(((longAt(objOop12)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop12, 0); - } - } - } - - prevPrevObj1 = prevObj1; - prevObj1 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l30; - } - flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l30: /* end objectAfter:limit: */; - } - /* begin allNewSpaceEntitiesDo: */ - - /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are - in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ - prevPrevObj = (prevObj = null); - assert((((pastSpace()).start)) < (((eden()).start))); - /* begin objectStartingAt: */ - address = ((pastSpace()).start); - numSlots8 = byteAt(address + 7); - objOop3 = (numSlots8 == (numSlotsMask()) - ? address + BaseHeaderSize - : address); - limit1 = GIV(pastSpaceStart); - while (oopisLessThan(objOop3, limit1)) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop3 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots31 = numSlots121; - } - if (numSlots31 == 0) { - /* begin allocationUnit */ - slotBytes11 = ((sqInt) 8); - } - else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); - } - followingWordAddress = (objOop3 + BaseHeaderSize) + slotBytes11; - if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) { - objOop3 = limit1; - goto l26; - } - flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop3 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l26: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address1 = ((eden()).start); - numSlots14 = byteAt(address1 + 7); - objOop3 = (numSlots14 == (numSlotsMask()) - ? address1 + BaseHeaderSize - : address1); - while (oopisLessThan(objOop3, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop3 + 4))) >> 23) & 1) != 0) { - if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) { - setIsMarkedOfto(objOop3, 0); - } - else { - if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) { - setIsMarkedOfto(objOop3, 0); - } - } - } - - prevPrevObj = prevObj; - prevObj = objOop3; - /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop3 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots41 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots41 = numSlots13; - } - if (numSlots41 == 0) { - /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); - } - else { - slotBytes2 = (numSlots41 + (numSlots41 & 1)) << (shiftForWord()); - } - followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop3 = GIV(freeStart); - goto l35; - } - flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l35: /* end objectAfter:limit: */; - } - - /* Now try and allocate the result */ - GIV(totalFreeOldSpace) -= bytesInObject(freeChunk); - if ((count > ((ptr - start) / BytesPerOop)) - || ((limit != ptr) - && ((limit - ptr) <= 8))) { - - /* can't split a single word */ - freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask()) - ? freeChunk - BaseHeaderSize - : freeChunk)); - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - arrayOfObjects = (((usqInt)count << 1) | 1); - goto l23; - } - /* begin setFormatOf:to: */ - format = 2; - assert(((format >= 0) && (format <= (formatMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift()))))); - /* begin setClassIndexOf:to: */ - assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask())))); - flag("endianness"); - longAtput(freeChunk, ((longAt(freeChunk)) & ((unsigned int)~(classIndexMask()))) + ClassArrayCompactIndex); - shortentoIndexableSize(freeChunk, count); - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) { - remember(freeChunk); - } - /* begin checkFreeSpace: */ - assert(bitsSetInFreeSpaceMaskForAllFreeLists()); - assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())); - if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) { - runLeakCheckerForFreeSpace(GCModeFreeSpace); - } - runLeakCheckerFor(GCModeImageSegment); - arrayOfObjects = freeChunk; -l23: /* end objectsReachableFromRoots: */; + arrayOfObjects = objectsReachableFromRoots(arrayOfRoots); if (!(arrayOfObjects)) { return PrimErrNoMemory; } assert(allObjectsUnmarked()); /* begin allocateSlots:format:classIndex: */ numBytes2 = (numSlotsOf(arrayOfObjects)) * 4; - numSlots2 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; + numSlots3 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord; formatField = firstLongFormat(); classIndex = thirtyTwoBitLongsClassIndexPun(); - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { newObj = GIV(freeStart) + BaseHeaderSize; - numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots2 + (numSlots2 & 1)) * BytesPerOop); + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); } else { newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots2 <= 1 + numBytes = BaseHeaderSize + ((numSlots3 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots2 + (numSlots2 & 1)) * BytesPerOop)); + : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -47459,40 +46846,40 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots2, numBytes, formatField, classIndex); - goto l6; + savedInHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes, formatField, classIndex); + goto l9; } - if (numSlots2 >= (numSlotsMask())) { + if (numSlots3 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots2); + longAtput(GIV(freeStart), numSlots3); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)); } else { - long64Atput(newObj, (((((usqLong) numSlots2)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); + long64Atput(newObj, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex); } assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); GIV(freeStart) += numBytes; savedInHashes = newObj; -l6: /* end allocateSlots:format:classIndex: */; +l9: /* end allocateSlots:format:classIndex: */; /* begin allocateSlots:format:classIndex: */ numBytes3 = (numSlotsOf(outPointerArray)) * 4; - numSlots3 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; + numSlots4 = (numBytes3 + (BytesPerWord - 1)) / BytesPerWord; formatField1 = firstLongFormat(); classIndex1 = thirtyTwoBitLongsClassIndexPun(); - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { newObj1 = GIV(freeStart) + BaseHeaderSize; - numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots3 + (numSlots3 & 1)) * BytesPerOop); + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots4 + (numSlots4 & 1)) * BytesPerOop); } else { newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + ((numSlots3 <= 1 + numBytes1 = BaseHeaderSize + ((numSlots4 <= 1 ? (/* begin allocationUnit */ 8) - : (numSlots3 + (numSlots3 & 1)) * BytesPerOop)); + : (numSlots4 + (numSlots4 & 1)) * BytesPerOop)); } if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { @@ -47500,25 +46887,25 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr GIV(needGCFlag) = 1; forceInterruptCheck(); } - savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes1, formatField1, classIndex1); - goto l8; + savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots4, numBytes1, formatField1, classIndex1); + goto l11; } - if (numSlots3 >= (numSlotsMask())) { + if (numSlots4 >= (numSlotsMask())) { /* for header parsing we put a saturated slot count in the prepended overflow size word */ flag("endianness"); - longAtput(GIV(freeStart), numSlots3); + longAtput(GIV(freeStart), numSlots4); longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), formatField1, classIndex1)); } else { - long64Atput(newObj1, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); + long64Atput(newObj1, (((((usqLong) numSlots4)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1); } assert((numBytes1 % (allocationUnit())) == 0); assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes1; savedOutHashes = newObj1; -l8: /* end allocateSlots:format:classIndex: */; +l11: /* end allocateSlots:format:classIndex: */; if ((savedInHashes == null) || (savedOutHashes == null)) { freeObject(arrayOfObjects); @@ -47527,14 +46914,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr fillValue = (identityHashHalfWordMask()) + 1; /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedInHashes)) > (isForwardedObjectClassIndexPun())); - numSlots4 = byteAt(savedInHashes + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(savedInHashes - BaseHeaderSize); - } - else { - numSlots = numSlots4; - } + numSlots5 = byteAt(savedInHashes + 7); + numSlots = (numSlots5 == (numSlotsMask()) + ? longAt(savedInHashes - BaseHeaderSize) + : numSlots5); assert(oopisLessThan(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(savedInHashes))); for (p = (((usqInt)(savedInHashes + BaseHeaderSize))); p <= (((usqInt)(((savedInHashes + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8) { longAtput(p, fillValue); @@ -47542,14 +46925,10 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr } /* begin fillObj:numSlots:with: */ assert((classIndexOf(savedOutHashes)) > (isForwardedObjectClassIndexPun())); - numSlots5 = byteAt(savedOutHashes + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(savedOutHashes - BaseHeaderSize); - } - else { - numSlots1 = numSlots5; - } + numSlots6 = byteAt(savedOutHashes + 7); + numSlots1 = (numSlots6 == (numSlotsMask()) + ? longAt(savedOutHashes - BaseHeaderSize) + : numSlots6); assert(oopisLessThan(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(savedOutHashes))); for (p1 = (((usqInt)(savedOutHashes + BaseHeaderSize))); p1 <= (((usqInt)(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p1 += 8) { longAtput(p1, fillValue); @@ -47588,19 +46967,15 @@ storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerAr segAddr = segmentWordArray + BaseHeaderSize; /* begin addressAfter: */ numSlots11 = byteAt(segmentWordArray + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(segmentWordArray - BaseHeaderSize); - } - else { - numSlots6 = numSlots11; - } - if (numSlots6 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(segmentWordArray - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } endSeg = (segmentWordArray + BaseHeaderSize) + slotBytes; if (segAddr >= endSeg) { @@ -48120,7 +47495,7 @@ unpinObject(sqInt objOop) { assert(isNonImmediate(objOop)); /* begin setIsPinnedOf:to: */ - longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << 30))); + longAtput(objOop, (longAt(objOop)) & ((unsigned int)~(1U << (pinnedBitShift())))); return 0; } @@ -48319,13 +47694,9 @@ checkTraversableSortedFreeList(void) prevObj = objOop1; /* begin objectAfter:limit: */ numSlots1 = byteAt(objOop1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -48336,14 +47707,14 @@ checkTraversableSortedFreeList(void) followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } assert(prevFree == GIV(lastFreeChunk)); assert((nextInSortedFreeListLinkgiven(GIV(lastFreeChunk), 0)) == prevPrevFree); @@ -48358,7 +47729,7 @@ checkTraversableSortedFreeList(void) /* for profiling */ /* SpurPigCompactor>>#compact */ -static sqInt NeverInline +static void NeverInline compact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt anInteger; @@ -48373,6 +47744,7 @@ compact(void) usqInt scanAddress; usqInt slotBytes; + freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(); /* begin statCompactPassCount: */ anInteger = GIV(statCompactPassCount) + 1; GIV(statCompactPassCount) = anInteger; @@ -48386,18 +47758,15 @@ compact(void) while (free != 0) { high = (prevFree == 0 ? (endOfMemory()) - (2 * BaseHeaderSize) - : ((byteAt(prevFree + 7)) == (numSlotsMask()) - ? prevFree - BaseHeaderSize - : prevFree)); + : (/* begin startOfObject: */ + ((byteAt(prevFree + 7)) == (numSlotsMask()) + ? prevFree - BaseHeaderSize + : prevFree))); /* begin addressAfter: */ numSlots1 = byteAt(free + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(free - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(free - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -48409,7 +47778,7 @@ compact(void) while (oopisLessThan(scanAddress, high)) { scanAddress = moveARunOfObjectsStartingAtupTo(scanAddress, high); if (scanAddress == 0) { - goto l2; + goto l6; } } @@ -48434,12 +47803,11 @@ compact(void) } } assert(checkTraversableSortedFreeList()); - l2: /* end pigCompact */; + l6: /* end pigCompact */; eliminateAndFreeForwardersForPigCompact(); } assert(freeListHeadsEmpty()); rebuildFreeListsForPigCompact(); - return 0; } @@ -48447,7 +47815,7 @@ compact(void) forwarders, then free forwarders, coalescing with free space as we go. */ /* SpurPigCompactor>>#eliminateAndFreeForwardersForPigCompact */ -static sqInt +static void eliminateAndFreeForwardersForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; @@ -48572,50 +47940,46 @@ eliminateAndFreeForwardersForPigCompact(void) index += 1; } } - /* begin unmarkSurvivingObjectsForPigCompact */ - prevPrevObj1 = (prevObj1 = null); + /* begin unmarkSurvivingObjectsForCompact */ + prevPrevObj = (prevObj = null); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots3 = byteAt(address + 7); - objOop2 = (numSlots3 == (numSlotsMask()) + numSlots2 = byteAt(address + 7); + objOop1 = (numSlots2 == (numSlotsMask()) ? address + BaseHeaderSize : address); - while (oopisLessThan(objOop2, GIV(pastSpaceStart))) { - assert(isEnumerableObjectNoAssert(objOop2)); - if (((((usqInt) (longAt(objOop2 + 4))) >> 23) & 1) != 0) { - setIsMarkedOfto(objOop2, 0); + while (oopisLessThan(objOop1, GIV(pastSpaceStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { + setIsMarkedOfto(objOop1, 0); } - prevPrevObj1 = prevObj1; - prevObj1 = objOop2; + prevPrevObj = prevObj; + prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop2 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop2 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop2 + BaseHeaderSize) + slotBytes1; - if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) { - objOop2 = GIV(pastSpaceStart); - goto l18; + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(pastSpaceStart))) { + objOop1 = GIV(pastSpaceStart); + goto l4; } flag("endianness"); - followingWord1 = longAt(followingWordAddress1 + 4); - objOop2 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress1 + BaseHeaderSize - : followingWordAddress1); - l18: /* end objectAfter:limit: */; + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; } /* begin sweepToFollowForwardersForPigCompact */ assert(((freeStart()) == (((eden()).start))) @@ -48624,8 +47988,8 @@ eliminateAndFreeForwardersForPigCompact(void) prevPrevObj2 = (prevObj2 = null); /* begin objectStartingAt: */ address1 = ((pastSpace()).start); - numSlots4 = byteAt(address1 + 7); - objOop12 = (numSlots4 == (numSlotsMask()) + numSlots21 = byteAt(address1 + 7); + objOop12 = (numSlots21 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop12, GIV(pastSpaceStart))) { @@ -48658,31 +48022,27 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj2 = objOop12; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop12 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots12; - } - if (numSlots21 == 0) { + numSlots4 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots12); + if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(pastSpaceStart))) { objOop12 = GIV(pastSpaceStart); - goto l31; + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l31: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } lowestForwarder1 = 0; /* begin allOldSpaceObjectsDo: */ @@ -48740,13 +48100,9 @@ eliminateAndFreeForwardersForPigCompact(void) prevObj11 = objOop11; /* begin objectAfter:limit: */ numSlots111 = byteAt(objOop11 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots31 = numSlots111; - } + numSlots31 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots111); if (numSlots31 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); @@ -48757,14 +48113,14 @@ eliminateAndFreeForwardersForPigCompact(void) followingWordAddress11 = (objOop11 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l38; + goto l37; } flag("endianness"); followingWord11 = longAt(followingWordAddress11 + 4); objOop11 = ((((usqInt) followingWord11) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress11 + BaseHeaderSize : followingWordAddress11); - l38: /* end objectAfter:limit: */; + l37: /* end objectAfter:limit: */; } lowestForwarder = lowestForwarder1; /* begin sweepToCoallesceFreeSpaceForPigCompactFrom: */ @@ -48780,28 +48136,29 @@ eliminateAndFreeForwardersForPigCompact(void) firstOfFreeRun = (prevPrevFree = (prevFree = 0)); /* begin allOldSpaceEntitiesFrom:do: */ assert(isOldObject(lowest)); - prevPrevObj = (prevObj = null); - objOop = lowest; + prevPrevObj1 = (prevObj1 = null); + objOop3 = lowest; while (1) { - assert((objOop % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break; - assert((long64At(objOop)) != 0); - if ((((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) - || (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + assert((objOop3 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; + assert((long64At(objOop3)) != 0); + if ((((longAt(objOop3)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) + || (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { if (firstOfFreeRun == 0) { /* begin setObjectFree: */ - if ((byteAt(objOop + 7)) == 0) { + if ((byteAt(objOop3 + 7)) == 0) { /* begin rawNumSlotsOf:put: */ - byteAtput(objOop + 7, 1); + byteAtput(objOop3 + 7, 1); } /* begin setFree: */ - long32Atput(objOop, 0); - firstOfFreeRun = objOop; - startOfFreeRun = ((byteAt(objOop + 7)) == (numSlotsMask()) - ? objOop - BaseHeaderSize - : objOop); + long32Atput(objOop3, 0); + firstOfFreeRun = objOop3; + /* begin startOfObject: */ + startOfFreeRun = ((byteAt(objOop3 + 7)) == (numSlotsMask()) + ? objOop3 - BaseHeaderSize + : objOop3); } - endOfFreeRun = objOop; + endOfFreeRun = objOop3; } else { if (firstOfFreeRun != 0) { @@ -48813,9 +48170,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex1 = 0; + fieldIndex = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -48823,35 +48180,31 @@ eliminateAndFreeForwardersForPigCompact(void) } } - prevPrevObj = prevObj; - prevObj = objOop; + prevPrevObj1 = prevObj1; + prevObj1 = objOop3; /* begin objectAfter:limit: */ - numSlots1 = byteAt(objOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(objOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } - if (numSlots == 0) { + numSlots11 = byteAt(objOop3 + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop3 - BaseHeaderSize) + : numSlots11); + if (numSlots3 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; - if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { - objOop = GIV(endOfMemory); - goto l7; + followingWordAddress1 = (objOop3 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { + objOop3 = GIV(endOfMemory); + goto l15; } flag("endianness"); - followingWord = longAt(followingWordAddress + 4); - objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress + BaseHeaderSize - : followingWordAddress); - l7: /* end objectAfter:limit: */; + followingWord1 = longAt(followingWordAddress1 + 4); + objOop3 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l15: /* end objectAfter:limit: */; } if (firstOfFreeRun != 0) { bytes = (addressAfter(endOfFreeRun)) - startOfFreeRun; @@ -48862,9 +48215,9 @@ eliminateAndFreeForwardersForPigCompact(void) } else { /* begin storePointer:ofFreeChunk:withUncheckedValue: */ - fieldIndex2 = 0; + fieldIndex1 = 0; assert(isFreeObject(prevFree)); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prevPrevFree ^ firstOfFreeRun); } prevPrevFree = prevFree; prevFree = firstOfFreeRun; @@ -48872,11 +48225,11 @@ eliminateAndFreeForwardersForPigCompact(void) } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ - fieldIndex = 0; + fieldIndex2 = 0; assert(isFreeObject(prevFree)); assert((prevPrevFree == 0) || (isFreeObject(prevPrevFree))); - longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), prevPrevFree); + longAtput((prevFree + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree); } GIV(lastFreeChunk) = prevFree; /* begin inSortedFreeListLink:to:given: */ @@ -48891,7 +48244,6 @@ eliminateAndFreeForwardersForPigCompact(void) } assert(checkTraversableSortedFreeList()); assert((numberOfForwarders()) == 0); - return 0; } @@ -48911,7 +48263,7 @@ eliminateAndFreeForwardersForPigCompact(void) */ /* SpurPigCompactor>>#freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact */ -static sqInt NeverInline +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt fieldIndex; @@ -48928,20 +48280,16 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) sqInt here; sqInt here1; sqInt i; - sqInt i1; sqInt iLimiT; - sqInt index; usqInt newNumSlots; sqInt next; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; sqInt o; - sqInt obj; usqInt obj2slots; sqInt objOop; sqInt prevFree; @@ -48953,7 +48301,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes2; - sqInt sweepIndex; /* for profiling */ @@ -48963,30 +48310,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - /* begin forgetUnmarkedRememberedObjects */ - index = 0; - while (index < GIV(rememberedSetSize)) { - obj = GIV(rememberedSet)[index]; - if (((((usqInt) (longAt(obj + 4))) >> 23) & 1) != 0) { - index += 1; - } - else { - - /* unmarked; remove by overwriting with last element. */ - /* begin setIsRememberedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (rememberedBitShift())))); - GIV(rememberedSetSize) -= 1; - GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]); - } - } - assert(GIV(rememberedSetSize) >= 0); - doScavenge(MarkOnTenure); - /* begin prepareForGlobalSweep */ - sweepIndex = 0; - for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { - ((GIV(segments)[i1]).containsPinned = 0); - } - setIsMarkedOfto(objectStartingAt((((((&(GIV(segments)[GIV(numSegments) - 1])))->segSize)) + ((((&(GIV(segments)[GIV(numSegments) - 1])))->segStart))) - (2 * BaseHeaderSize)), 1); /* begin resetFreeListHeads */ for (i = 0, iLimiT = (32 - 1); i <= iLimiT; i += 1) { GIV(freeLists)[i] = 0; @@ -49002,22 +48325,22 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) rawNumSlots = byteAt(objOop + 7); assert((GIV(firstFreeChunk) == 0) || (isFreeObject(GIV(firstFreeChunk)))); - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { /* forwarders should have been followed in markAndTrace: */ assert(!(isForwarded(objOop))); setIsMarkedOfto(objOop, 0); - if (((((usqInt) (longAt(objOop))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) { /* begin notePinned: */ assert(isPinned(objOop)); if (((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun())) { setIsMarkedOfto(objOop, 1); } else { - while (((((GIV(segments)[sweepIndex]).segSize)) + (((GIV(segments)[sweepIndex]).segStart))) < objOop) { - sweepIndex += 1; + while (((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart))) < objOop) { + GIV(sweepIndex) += 1; } - ((GIV(segments)[sweepIndex]).containsPinned = 1); + ((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1); } } } @@ -49031,32 +48354,28 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) assert(isMarked(lastBridge())); /* begin objectAfter:limit: */ numSlots11 = byteAt(here1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (here1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l20; + goto l21; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); next = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l20: /* end objectAfter:limit: */; - while (!(((((usqInt) (longAt(next + 4))) >> 23) & 1) != 0)) { + l21: /* end objectAfter:limit: */; + while (!(((((usqInt) (longAt(next + 4))) >> (markedBitHalfShift())) & 1) != 0)) { /* coalescing; rare case */ assert(!(isRemembered(next))); @@ -49074,11 +48393,9 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) obj2slots += obj2slots & 1; assert((obj2slots * BytesPerWord) == (bytesInObject(next))); if (header1NumSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf:put: */ - numSlots = obj2slots + (longAt(here1 - BaseHeaderSize)); - longAtput(here1 - BaseHeaderSize, numSlots); + longAtput(here1 - BaseHeaderSize, obj2slots + (longAt(here1 - BaseHeaderSize))); here1 = here1; - goto l21; + goto l20; } header1NumSlots = (header1NumSlots == 0 ? 2 @@ -49090,7 +48407,7 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) if (newNumSlots < (numSlotsMask())) { byteAtput(here1 + 7, newNumSlots); here1 = here1; - goto l21; + goto l20; } newNumSlots -= BaseHeaderSize / BytesPerWord; longAtput(here1 + BaseHeaderSize, longAt(here1)); @@ -49098,34 +48415,30 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput(here1, newNumSlots); longAtput(here1 + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); here1 += BaseHeaderSize; - l21: /* end coalesce:and: */; + l20: /* end coalesce:and: */; /* begin objectAfter:limit: */ numSlots1 = byteAt(here1 + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(here1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots1; - } - if (numSlots2 == 0) { + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(here1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (here1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) { next = GIV(endOfMemory); - goto l22; + goto l19; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); next = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l22: /* end objectAfter:limit: */; + l19: /* end objectAfter:limit: */; } here = here1; /* begin setObjectFree: */ @@ -49160,31 +48473,27 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) prevObj = objOop; /* begin objectAfter:limit: */ numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots3 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots12); + if (numSlots3 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop = GIV(endOfMemory); - goto l6; + goto l16; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l6: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } if (prevFree != GIV(firstFreeChunk)) { /* begin storePointer:ofFreeChunk:withValue: */ @@ -49206,7 +48515,6 @@ freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void) longAtput((GIV(lastFreeChunk) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), prevPrevFree ^ 0); } assert(checkTraversableSortedFreeList()); - return 0; } @@ -49247,8 +48555,6 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) sqInt fieldIndex4; sqInt fieldIndex41; sqInt fieldIndex5; - sqInt format; - sqInt format1; usqInt freeBytes; usqInt freeChunk; usqInt here; @@ -49297,17 +48603,13 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (thisFreeChunk != 0) { /* skip any initial immobile objects */ - while (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + while (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { /* begin addressAfter: */ numSlots11 = byteAt(hereObj + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots4 = numSlots11; - } + numSlots4 = (numSlots11 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots11); if (numSlots4 == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -49333,6 +48635,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) && (isFreeObject(thisFreeChunk))); freeBytes = bytesInObject(thisFreeChunk); nextFree = ((usqInt)((longAt((thisFreeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFreeChunk)); + /* begin startOfObject: */ destination = ((byteAt(thisFreeChunk + 7)) == (numSlotsMask()) ? thisFreeChunk - BaseHeaderSize : thisFreeChunk); @@ -49344,13 +48647,9 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while (1) { /* begin addressAfter: */ numSlots12 = byteAt(hereObj + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(hereObj - BaseHeaderSize); - } - else { - numSlots5 = numSlots12; - } + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(hereObj - BaseHeaderSize) + : numSlots12); if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); @@ -49359,7 +48658,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) slotBytes1 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } there = (hereObj + BaseHeaderSize) + slotBytes1; - if (!(((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!(((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun()))) && ((freeBytes > ((there - here) + 8)) || (freeBytes == (there - here))))) break; @@ -49374,11 +48673,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex = isForwardedObjectClassIndexPun(); - format = 7; assert(((classIndex >= 0) && (classIndex <= (classIndexMask())))); - assert(((format >= 0) && (format <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(format) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift())))); destination += there - here; freeBytes -= there - here; /* begin objectStartingAt: */ @@ -49471,7 +48769,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) prevFreeChunk = thisFreeChunk; thisFreeChunk = nextFree; } - if (!((((((usqInt) hereObjHeader) >> 30) & 1) == 0) + if (!((((((usqInt) hereObjHeader) >> (pinnedBitShift())) & 1) == 0) && ((hereObjHeader & (classIndexMask())) > (isForwardedObjectClassIndexPun())))) { return (maxFreeChunk >= startAddress ? 0 @@ -49487,6 +48785,7 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) while ((freeChunk != 0) && (freeChunk < hereObj)) { next = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + /* begin startOfObject: */ dest = ((byteAt(freeChunk + 7)) == (numSlotsMask()) ? freeChunk - BaseHeaderSize : freeChunk); @@ -49505,11 +48804,10 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) /* begin set:classIndexTo:formatTo: */ classIndex1 = isForwardedObjectClassIndexPun(); - format1 = 7; assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask())))); - assert(((format1 >= 0) && (format1 <= (formatMask())))); + assert(((7 >= 0) && (7 <= (formatMask())))); flag("endianness"); - longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (((sqInt)((usqInt)(format1) << (formatShift())))))); + longAtput(hereObj, ((longAt(hereObj)) & ((unsigned int)~((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift())))); if (next != 0) { nextNext = ((usqInt)((longAt((next + BaseHeaderSize) + (0U << (shiftForWord())))) ^ freeChunk)); } @@ -49575,14 +48873,14 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } } usedChunk = freeChunk; - goto l25; + goto l27; } prevPrevFree = prevFree; prevFree = freeChunk; freeChunk = next; } usedChunk = 0; - l25: /* end tryToMovePig:at:end: */; + l27: /* end tryToMovePig:at:end: */; /* begin objectStartingAt: */ numSlots2 = byteAt(there + 7); hereObj = (numSlots2 == (numSlotsMask()) @@ -49612,10 +48910,59 @@ moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit) } +/* Answer the next free free chunk using the xor trick to use only one field, + see e.g. + The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 + `Circular Lists', exercise. 18 + http://en.wikipedia.org/wiki/XOR_linked_list. */ + + /* SpurPigCompactor>>#nextInSortedFreeListLink:given: */ +static usqInt NoDbgRegParms +nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree) +{ + return ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); +} + + /* SpurPigCompactor>>#printSortedFreeList */ +void +printSortedFreeList(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt freeChunk; + usqInt nextFree; + sqInt prevFree; + + if (!((GIV(firstFreeChunk) > 0) + && (GIV(lastFreeChunk) > GIV(firstFreeChunk)))) { + print("sorted free list empty or corrupt"); + /* begin cr */ + printf("\n"); + return; + } + freeChunk = GIV(firstFreeChunk); + prevFree = 0; + while (1) { + if (!((addressCouldBeObj(freeChunk)) + && (((longAt(freeChunk)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) { + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) freeChunk)); + print(" is not a free chunk!"); + /* begin cr */ + printf("\n"); + return; + } + printFreeChunkprintAsTreeNode(freeChunk, 0); + if (!(freeChunk != GIV(lastFreeChunk))) break; + nextFree = ((usqInt)((longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))) ^ prevFree)); + prevFree = freeChunk; + freeChunk = nextFree; + } +} + + /* Rebuild the free lists from the doubly-linked free list. */ /* SpurPigCompactor>>#rebuildFreeListsForPigCompact */ -static sqInt +static void rebuildFreeListsForPigCompact(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt bytes; @@ -49641,6 +48988,7 @@ rebuildFreeListsForPigCompact(void) assert((prevFree == 0) || (prevFree < free)); bytes = bytesInObject(free); + /* begin startOfObject: */ start = ((byteAt(free + 7)) == (numSlotsMask()) ? free - BaseHeaderSize : free); @@ -49658,7 +49006,64 @@ rebuildFreeListsForPigCompact(void) if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) { runLeakCheckerForFreeSpace(GCModeFreeSpace); } - return 0; +} + + +/* Scavenge or simply follow objOop. Answer the new location of objOop. + The send should have been guarded by a send of shouldRemapOop:. + The method is called remapObj: for compatibility with ObjectMemory. */ + + /* SpurPigCompactor>>#remapObj: */ +sqInt +remapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt referent; + sqInt resolvedObj; + + /* begin vanillaRemapObj: */ + assert(shouldRemapOop(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(objOop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + resolvedObj = referent; + } + else { + assert(!((isInFutureSpace(objOop)))); + resolvedObj = objOop; + } + if ((GIV(gcPhaseInProgress) == ScavengeInProgress) + && ((((resolvedObj & (tagMask())) == 0) + && ((assert(isNonImmediate(resolvedObj)), + oopisLessThan(resolvedObj, GIV(newSpaceLimit))))) + && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart()))))) { + return copyAndForward(resolvedObj); + } + return resolvedObj; +} + + +/* Answer if the obj should be scavenged (or simply followed). The method is + called shouldRemapObj: for compatibility with ObjectMemory. Defer to the + compactor to choose the actual test, there being a difference between the + vanilla test and + that used with a sliding compactor where objects are not marked as + forwarded. */ + + /* SpurPigCompactor>>#shouldRemapObj: */ +sqInt +shouldRemapObj(sqInt objOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(objOop)), + oopisLessThan(objOop, GIV(newSpaceLimit)))) + && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))); } /* SpurSegmentInfo>>#segLimit */ @@ -49756,19 +49161,22 @@ static sqInt allBridgesMarked(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt address; + SpurSegmentInfo *aSegment; sqInt bridgeObj; sqInt i; usqInt numSlots; for (i = 0; i < GIV(numSegments); i += 1) { + /* begin bridgeFor: */ + aSegment = ((SpurSegmentInfo *) ((&(GIV(segments)[i])))); /* begin objectStartingAt: */ - address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * BaseHeaderSize); + address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize); numSlots = byteAt(address + 7); bridgeObj = (numSlots == (numSlotsMask()) ? address + BaseHeaderSize : address); assert(isValidSegmentBridge(bridgeObj)); - if (!(((((usqInt) (longAt(bridgeObj + 4))) >> 23) & 1) != 0)) { + if (!(((((usqInt) (longAt(bridgeObj + 4))) >> (markedBitHalfShift())) & 1) != 0)) { return 0; } } @@ -49840,7 +49248,6 @@ bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil) sqInt clifton; usqInt segEnd; - /* begin segLimit */ segEnd = ((aSegment->segSize)) + ((aSegment->segStart)); /* clifton is where the Avon bridge begins... */ @@ -50104,7 +49511,7 @@ prepareForSnapshot(void) /* begin freeTreeNodesDo: */ treeNode = GIV(freeLists)[0]; if (treeNode == 0) { - goto l7; + goto l5; } cameFrom = -1; do { @@ -50132,13 +49539,9 @@ prepareForSnapshot(void) limit = endOfMemory(); /* begin addressAfter: */ numSlots1 = byteAt(node + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(node - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(node - BaseHeaderSize) + : numSlots1); if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); @@ -50195,7 +49598,7 @@ prepareForSnapshot(void) cameFrom = -1; } } while(treeNode != 0); -l7: /* end freeTreeNodesDo: */; +l5: /* end freeTreeNodesDo: */; for (i = 0; i < GIV(numSegments); i += 1) { freeChunk = ((GIV(segments)[i]).lastFreeObject); if (!(freeChunk == null)) { @@ -50309,14 +49712,14 @@ shrinkObjectMemory(usqInt delta) SpurSegmentInfo *segInfo; usqInt shrinkage; - i2 = 0; + i = 0; shrinkage = delta; while (1) { /* begin findEmptySegNearestInSizeTo: */ best = null; delta1 = shrinkage; - for (i = 0; i < GIV(numSegments); i += 1) { - seg = (&(GIV(segments)[i])); + for (i2 = 0; i2 < GIV(numSegments); i2 += 1) { + seg = (&(GIV(segments)[i2])); if (isEmptySegment(seg)) { if (best == null) { best = seg; @@ -50340,20 +49743,20 @@ shrinkObjectMemory(usqInt delta) /* begin removeSegment: */ for (i1 = 0; i1 < GIV(numSegments); i1 += 1) { if (((emptySeg->segStart)) == (((GIV(segments)[i1]).segStart))) { - i2 = i1; - goto l2; + i = i1; + goto l1; } } error("segment not found"); - l2: /* end indexOfSegment: */; - assert(i2 > 0); + l1: /* end indexOfSegment: */; + assert(i > 0); sqDeallocateMemorySegmentAtOfSize(((void *)((emptySeg->segStart))), (emptySeg->segSize)); - for (j = i2; j < GIV(numSegments); j += 1) { + for (j = i; j < GIV(numSegments); j += 1) { GIV(segments)[j] = (GIV(segments)[j + 1]); } GIV(numSegments) -= 1; - bridgeFromto((&(GIV(segments)[i2 - 1])), (i2 <= (GIV(numSegments) - 1) - ? (&(GIV(segments)[i2])) + bridgeFromto((&(GIV(segments)[i - 1])), (i <= (GIV(numSegments) - 1) + ? (&(GIV(segments)[i])) : 0)); /* begin setLastSegment: */ segInfo = ((SpurSegmentInfo *) ((&(GIV(segments)[GIV(numSegments) - 1])))); @@ -50627,6 +50030,7 @@ addNewMethodToCache(sqInt classObj) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -50714,6 +50118,7 @@ addNewMethodToNSCache(sqInt rule) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -50826,7 +50231,7 @@ void * arrayValueOf(sqInt arrayOop) { DECL_MAYBE_SQ_GLOBAL_STRUCT if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -50843,7 +50248,7 @@ arrayValueOf(sqInt arrayOop) static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj) { DECL_MAYBE_SQ_GLOBAL_STRUCT - if (isCharacterObject(characterObj)) { + if ((characterObj & (tagMask())) == (characterTag())) { return (/* begin integerObjectOfCharacterObject: */ ((usqInt) (((usqInt) characterObj))) >> 1); } @@ -51029,8 +50434,7 @@ canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader) sqInt characterForAscii(sqInt ascii) { - return (/* begin characterObjectOf: */ - (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag())); + return (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag()); } @@ -51053,10 +50457,10 @@ checkAllAccessibleObjectsOkay(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt objOop; sqInt objOop1; sqInt objOop11; @@ -51080,8 +50484,8 @@ checkAllAccessibleObjectsOkay(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -51093,37 +50497,33 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -51134,32 +50534,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -51177,32 +50573,28 @@ checkAllAccessibleObjectsOkay(void) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop11 = GIV(endOfMemory); - goto l12; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l12: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } return ok; } @@ -51276,7 +50668,6 @@ checkForEventsMayContextSwitch(sqInt mayContextSwitch) sqInt objOop1; sqInt sema; sqInt switched; - char *theSP; /* restore the stackLimit if it has been smashed. */ @@ -51288,14 +50679,13 @@ checkForEventsMayContextSwitch(sqInt mayContextSwitch) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); assert(GIV(stackPage) == (mostRecentlyUsedPage())); ioSynchronousCheckForEvents(); @@ -51469,55 +50859,55 @@ checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset) /* Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccessibleObjects has set a bit at each object's header. Check that all oops in the interpreter's state - points to a header. Answer if all checks pass. */ + points to a header. Answer 0 if all checks pass. */ /* StackInterpreter>>#checkInterpreterIntegrity */ static sqInt checkInterpreterIntegrity(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt flags; sqInt i; - sqInt ok; - ok = 1; + flags = 0; if (!(checkOopIntegritynamed(GIV(specialObjectsOop), "specialObjectsOop"))) { - ok = 0; + flags = 1; } if (!(checkOopIntegritynamed(GIV(newMethod), "newMethod"))) { - ok = 0; + flags += 2; } if (!(checkOopIntegritynamed(GIV(profileProcess), "profileProcess"))) { - ok = 0; + flags += 4; } if (!(checkOopIntegritynamed(GIV(profileMethod), "profileMethod"))) { - ok = 0; + flags += 8; } if (!(checkOopIntegritynamed(GIV(profileSemaphore), "profileSemaphore"))) { - ok = 0; + flags += 16; } if (!(GIV(tempOop) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop), "tempOop"))) { - ok = 0; + flags += 32; } } if (!(GIV(tempOop2) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop2), "tempOop2"))) { - ok = 0; + flags += 64; } } if (!(GIV(tempOop3) == 0)) { if (!(checkOopIntegritynamed(GIV(tempOop3), "tempOop3"))) { - ok = 0; + flags += 128; } } for (i = 1; i <= GIV(jmpDepth); i += 1) { if (!(checkOopIntegritynamedindex(GIV(suspendedCallbacks)[i], "suspendedCallbacks", i))) { - ok = 0; + flags += 256; } if (!(checkOopIntegritynamedindex(GIV(suspendedMethods)[i], "suspendedMethods", i))) { - ok = 0; + flags += 512; } } - return ok; + return flags; } @@ -51613,12 +51003,7 @@ checkOkayFields(sqInt oop) } hasYoung = 0; if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { - i = (((assert((((assert(isCompiledMethod(oop)), -/* begin fetchPointer:ofObject: */ -longAt((oop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(oop)), -/* begin fetchPointer:ofObject: */ -longAt((oop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1; + i = ((literalCountOf(oop)) + LiteralStart) - 1; } else { if (((oop & (tagMask())) == 0) @@ -51764,21 +51149,19 @@ checkOkayStackZone(sqInt writeBack) sqInt i; sqInt ok; StackPage *thePage; - char *theSP; if (writeBack) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } ok = 1; @@ -52075,9 +51458,9 @@ contexthasValidInversePCMappingOfin(sqInt aContext, sqInt theIP, char *theFP) /* begin fetchPointer:ofObject: */ pc = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + /* begin contextInstructionPointer:frame: */ assert(validInstructionPointerinFrame(theIP + 1, theFP)); encodedip = (((usqInt)(((theIP - (longAt(theFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1); - return (pc == encodedip) || (((methodHeader = methodHeaderOf(longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))))), ((/* begin alternateHeaderHasPrimitiveFlag: */ @@ -52195,10 +51578,6 @@ createActualMessageTo(sqInt lookupClass) usqInt numBytes; usqInt numBytes1; sqInt numSlots; - sqInt numSlots1; - sqInt objFormat; - sqInt objFormat1; - sqInt selector; char *sp; @@ -52206,22 +51585,17 @@ createActualMessageTo(sqInt lookupClass) assert((isImmediate(GIV(messageSelector))) || (addressCouldBeObj(GIV(messageSelector)))); /* begin mnuBreakpoint:receiver: */ - selector = GIV(messageSelector); - mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null); + mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), null); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = 2; assert((GIV(argumentCount) >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - numSlots1 = GIV(argumentCount); - assert(numSlots1 < (numSlotsMask())); + assert(GIV(argumentCount) < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots1 <= 1 + numBytes = BaseHeaderSize + ((GIV(argumentCount) <= 1 ? 8 - : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); + : (GIV(argumentCount) + (GIV(argumentCount) & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -52233,21 +51607,18 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); argumentArray = 0; - goto l6; + goto l4; } } - long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassArrayCompactIndex); + long64Atput(newObj, (((((usqLong) GIV(argumentCount))) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); GIV(freeStart) += numBytes; argumentArray = newObj; -l6: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = 1; numSlots = MessageLookupClassIndex + 1; assert((numSlots >= 0) && (ClassMessageCompactIndex != 0)); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); + assert((1) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); newObj1 = GIV(freeStart); @@ -52265,13 +51636,13 @@ createActualMessageTo(sqInt lookupClass) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); message = 0; - goto l7; + goto l5; } } - long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassMessageCompactIndex); + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + ClassMessageCompactIndex); GIV(freeStart) += numBytes1; message = newObj1; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) { longAtput((argumentArray + BaseHeaderSize) + i, popStack()); @@ -52420,21 +51791,19 @@ divorceAllFrames(void) sqInt activeContext; StackPage *aPage; sqInt i; - char *theSP; if (GIV(stackPage) != 0) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); } /* begin ensureFrameIsMarried:SP: */ @@ -52555,6 +51924,7 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) int posArg; int posRcvr; sqInt result; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -52603,7 +51973,8 @@ doPrimitiveDivby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -52620,6 +51991,7 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) sqInt integerArg; sqInt integerRcvr; sqInt integerResult; + sqInt successBoolean; integerArg = 0; integerRcvr = 0; @@ -52658,7 +52030,8 @@ doPrimitiveModby(sqInt rcvr, sqInt arg) } } /* begin success: */ - if (!((((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0)) { + successBoolean = (((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0; + if (!successBoolean) { /* Don't overwrite an error code that has already been set. */ if (!GIV(primFailCode)) { @@ -52795,14 +52168,14 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) sqInt followingWord1; sqInt followingWord11; sqInt followingWord2; + sqInt followingWord21; sqInt followingWord3; - sqInt followingWord4; usqInt followingWordAddress; usqInt followingWordAddress1; usqInt followingWordAddress11; usqInt followingWordAddress2; + usqInt followingWordAddress21; usqInt followingWordAddress3; - usqInt followingWordAddress4; usqInt limit; usqInt limit1; sqInt methodHeader; @@ -52813,39 +52186,39 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) usqInt numSlots12; usqInt numSlots121; usqInt numSlots13; - usqInt numSlots14; - usqInt numSlots15; usqInt numSlots2; usqInt numSlots21; usqInt numSlots3; usqInt numSlots31; usqInt numSlots4; + usqInt numSlots41; usqInt numSlots5; + usqInt numSlots51; usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; sqInt objOop11; + sqInt objOop111; sqInt objOop12; - sqInt objOop13; sqInt objOop2; + sqInt objOop21; sqInt objOop3; - sqInt objOop4; sqInt oop; sqInt prevObj; sqInt prevObj1; + sqInt prevObj11; sqInt prevObj2; - sqInt prevObj3; sqInt prevPrevObj; sqInt prevPrevObj1; + sqInt prevPrevObj11; sqInt prevPrevObj2; - sqInt prevPrevObj3; usqInt slotBytes; usqInt slotBytes1; usqInt slotBytes11; usqInt slotBytes2; + usqInt slotBytes21; usqInt slotBytes3; - usqInt slotBytes4; sqInt stopAddr; int swapFloatWords; int temp; @@ -52870,87 +52243,13 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address2 = ((pastSpace()).start); - numSlots5 = byteAt(address2 + 7); - objOop12 = (numSlots5 == (numSlotsMask()) + numSlots31 = byteAt(address2 + 7); + objOop12 = (numSlots31 == (numSlotsMask()) ? address2 + BaseHeaderSize : address2); limit1 = GIV(pastSpaceStart); while (oopisLessThan(objOop12, limit1)) { assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); - if (fmt >= (firstByteFormat())) { - - /* oop contains bytes */ - wordAddr = objOop12 + BaseHeaderSize; - if (fmt >= (firstCompiledMethodFormat())) { - - /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop12 + BaseHeaderSize); - wordAddr += (((assert((methodHeader & 1)), -((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; - } - /* begin reverseBytesFrom:to: */ - stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize); - addr1 = wordAddr; - while (oopisLessThan(addr1, stopAddr)) { - longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); - addr1 += BytesPerWord; - } - } - if (fmt == (firstLongFormat())) { - - /* Bitmap, Float etc */ - if (swapFloatWords - && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop12 + BaseHeaderSize); - longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4)); - longAtput((objOop12 + BaseHeaderSize) + 4, temp1); - } - else { - } - } - - - prevPrevObj2 = prevObj2; - prevObj2 = objOop12; - /* begin objectAfter:limit: */ - numSlots111 = byteAt(objOop12 + 7); - if (numSlots111 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots21 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots21 = numSlots111; - } - if (numSlots21 == 0) { - /* begin allocationUnit */ - slotBytes3 = ((sqInt) 8); - } - else { - slotBytes3 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); - } - followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; - if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { - objOop12 = limit1; - goto l17; - } - flag("endianness"); - followingWord3 = longAt(followingWordAddress3 + 4); - objOop12 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress3 + BaseHeaderSize - : followingWordAddress3); - l17: /* end objectAfter:limit: */; - } - /* begin objectStartingAt: */ - address11 = ((eden()).start); - numSlots14 = byteAt(address11 + 7); - objOop12 = (numSlots14 == (numSlotsMask()) - ? address11 + BaseHeaderSize - : address11); - while (oopisLessThan(objOop12, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop12)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { @@ -52988,20 +52287,84 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj2 = prevObj2; prevObj2 = objOop12; /* begin objectAfter:limit: */ - numSlots121 = byteAt(objOop12 + 7); - if (numSlots121 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots31 = longAt(objOop12 - BaseHeaderSize); + numSlots13 = byteAt(objOop12 + 7); + numSlots6 = (numSlots13 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots13); + if (numSlots6 == 0) { + /* begin allocationUnit */ + slotBytes3 = ((sqInt) 8); } else { - numSlots31 = numSlots121; + slotBytes3 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + } + followingWordAddress3 = (objOop12 + BaseHeaderSize) + slotBytes3; + if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) { + objOop12 = limit1; + goto l17; + } + flag("endianness"); + followingWord3 = longAt(followingWordAddress3 + 4); + objOop12 = ((((usqInt) followingWord3) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress3 + BaseHeaderSize + : followingWordAddress3); + l17: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address11 = ((eden()).start); + numSlots41 = byteAt(address11 + 7); + objOop12 = (numSlots41 == (numSlotsMask()) + ? address11 + BaseHeaderSize + : address11); + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); + if (fmt >= (firstByteFormat())) { + + /* oop contains bytes */ + wordAddr = objOop12 + BaseHeaderSize; + if (fmt >= (firstCompiledMethodFormat())) { + + /* compiled method; start after methodHeader and literals */ + methodHeader = longAt(objOop12 + BaseHeaderSize); + wordAddr += (((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + } + /* begin reverseBytesFrom:to: */ + stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize); + addr1 = wordAddr; + while (oopisLessThan(addr1, stopAddr)) { + longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); + addr1 += BytesPerWord; + } } - if (numSlots31 == 0) { + if (fmt == (firstLongFormat())) { + + /* Bitmap, Float etc */ + if (swapFloatWords + && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop12 + BaseHeaderSize); + longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4)); + longAtput((objOop12 + BaseHeaderSize) + 4, temp1); + } + else { + } + } + + + prevPrevObj2 = prevObj2; + prevObj2 = objOop12; + /* begin objectAfter:limit: */ + numSlots111 = byteAt(objOop12 + 7); + numSlots21 = (numSlots111 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots111); + if (numSlots21 == 0) { /* begin allocationUnit */ slotBytes11 = ((sqInt) 8); } else { - slotBytes11 = (numSlots31 + (numSlots31 & 1)) << (shiftForWord()); + slotBytes11 = (numSlots21 + (numSlots21 & 1)) << (shiftForWord()); } followingWordAddress11 = (objOop12 + BaseHeaderSize) + slotBytes11; if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) { @@ -53017,28 +52380,27 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj1 = (prevObj1 = null); - objOop11 = GIV(nilObj); + prevPrevObj11 = (prevObj11 = null); + objOop111 = GIV(nilObj); while (1) { - assert((objOop11 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; - assert((long64At(objOop11)) != 0); - if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ - fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); + assert((objOop111 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop111, GIV(endOfMemory)))) break; + assert((long64At(objOop111)) != 0); + if (isEnumerableObject(objOop111)) { + fmt = (((usqInt) (longAt(objOop111))) >> (formatShift())) & (formatMask()); if (fmt >= (firstByteFormat())) { /* oop contains bytes */ - wordAddr = objOop11 + BaseHeaderSize; + wordAddr = objOop111 + BaseHeaderSize; if (fmt >= (firstCompiledMethodFormat())) { /* compiled method; start after methodHeader and literals */ - methodHeader = longAt(objOop11 + BaseHeaderSize); + methodHeader = longAt(objOop111 + BaseHeaderSize); wordAddr += (((assert((methodHeader & 1)), ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; } /* begin reverseBytesFrom:to: */ - stopAddr = objOop11 + (((numSlotsOf(objOop11)) << (shiftForWord())) + BaseHeaderSize); + stopAddr = objOop111 + (((numSlotsOf(objOop111)) << (shiftForWord())) + BaseHeaderSize); addr1 = wordAddr; while (oopisLessThan(addr1, stopAddr)) { longAtput(addr1, SQ_SWAP_4_BYTES((longAt(addr1)))); @@ -53049,10 +52411,10 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) /* Bitmap, Float etc */ if (swapFloatWords - && ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex)) { - temp1 = longAt(objOop11 + BaseHeaderSize); - longAtput(objOop11 + BaseHeaderSize, longAt((objOop11 + BaseHeaderSize) + 4)); - longAtput((objOop11 + BaseHeaderSize) + 4, temp1); + && ((compactClassIndexOf(objOop111)) == ClassFloatCompactIndex)) { + temp1 = longAt(objOop111 + BaseHeaderSize); + longAtput(objOop111 + BaseHeaderSize, longAt((objOop111 + BaseHeaderSize) + 4)); + longAtput((objOop111 + BaseHeaderSize) + 4, temp1); } else { } @@ -53060,41 +52422,37 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) } - prevPrevObj1 = prevObj1; - prevObj1 = objOop11; + prevPrevObj11 = prevObj11; + prevObj11 = objOop111; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots121 = byteAt(objOop111 + 7); + numSlots51 = (numSlots121 == (numSlotsMask()) + ? longAt(objOop111 - BaseHeaderSize) + : numSlots121); + if (numSlots51 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes21 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes21 = (numSlots51 + (numSlots51 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; - if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop11 = GIV(endOfMemory); - goto l18; + followingWordAddress21 = (objOop111 + BaseHeaderSize) + slotBytes21; + if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) { + objOop111 = GIV(endOfMemory); + goto l29; } flag("endianness"); - followingWord2 = longAt(followingWordAddress2 + 4); - objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress2 + BaseHeaderSize - : followingWordAddress2); - l18: /* end objectAfter:limit: */; + followingWord21 = longAt(followingWordAddress21 + 4); + objOop111 = ((((usqInt) followingWord21) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress21 + BaseHeaderSize + : followingWordAddress21); + l29: /* end objectAfter:limit: */; } } else { /* begin convertFloatsToPlatformOrder */ if (VMBIGENDIAN == GIV(imageFloatsBigEndian)) { - goto l1; + goto l15; } assert(ClassFloatCompactIndex != 0); /* begin allObjectsDo: */ @@ -53105,8 +52463,8 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); @@ -53122,37 +52480,33 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { @@ -53167,81 +52521,73 @@ ensureImageFormatIsUpToDate(sqInt swapBytes) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l12; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l12: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); - prevPrevObj3 = (prevObj3 = null); - objOop13 = GIV(nilObj); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); while (1) { - assert((objOop13 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop13, GIV(endOfMemory)))) break; - assert((long64At(objOop13)) != 0); - if (isEnumerableObject(objOop13)) { - if ((compactClassIndexOf(objOop13)) == ClassFloatCompactIndex) { - temp = long32At(objOop13 + BaseHeaderSize); - long32Atput(objOop13 + BaseHeaderSize, long32At((objOop13 + BaseHeaderSize) + 4)); - long32Atput((objOop13 + BaseHeaderSize) + 4, temp); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex) { + temp = long32At(objOop11 + BaseHeaderSize); + long32Atput(objOop11 + BaseHeaderSize, long32At((objOop11 + BaseHeaderSize) + 4)); + long32Atput((objOop11 + BaseHeaderSize) + 4, temp); } } - prevPrevObj3 = prevObj3; - prevObj3 = objOop13; + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots15 = byteAt(objOop13 + 7); - if (numSlots15 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots6 = longAt(objOop13 - BaseHeaderSize); - } - else { - numSlots6 = numSlots15; - } - if (numSlots6 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes4 = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes4 = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress4 = (objOop13 + BaseHeaderSize) + slotBytes4; - if (oopisGreaterThanOrEqualTo(followingWordAddress4, GIV(endOfMemory))) { - objOop13 = GIV(endOfMemory); - goto l28; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); - followingWord4 = longAt(followingWordAddress4 + 4); - objOop13 = ((((usqInt) followingWord4) >> (numSlotsHalfShift())) == (numSlotsMask()) - ? followingWordAddress4 + BaseHeaderSize - : followingWordAddress4); - l28: /* end objectAfter:limit: */; + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; } - l1: /* end convertFloatsToPlatformOrder */; + l15: /* end convertFloatsToPlatformOrder */; } } @@ -53292,11 +52638,10 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) if ((byteAt((callerFP1 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP1))); callerCtx = longAt(callerFP1 + FoxThisContext); - goto l5; + goto l4; } callerCtx = marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l5: /* end ensureFrameIsMarried:SP: */; l4: /* end ensureCallerContext: */; if (((frameAbove = findFrameAboveinPage(theFP, thePage))) == 0) { @@ -53310,11 +52655,11 @@ externalDivorceFrameandContext(char *theFP, sqInt ctxt) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l2: /* end newStackPage */; + l1: /* end newStackPage */; theIP = oopForPointer(pointerForOop(longAt(frameAbove + FoxCallerSavedIP))); frameAbove = moveFramesInthroughtoPage(thePage, frameAbove, newPage); if (onCurrent) { @@ -53423,8 +52768,6 @@ externalEnsureIsBaseFrame(char *aFramePtr) static sqInt NoDbgRegParms externalInstVarofContext(sqInt offset, sqInt aContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - char *theSP; - assert(isContext(aContext)); assert(offset <= (ReceiverIndex + (checkStackPointerForMaybeMarriedContext(aContext)))); if (offset <= StackPointerIndex) { @@ -53432,14 +52775,13 @@ externalInstVarofContext(sqInt offset, sqInt aContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))) { @@ -53459,21 +52801,19 @@ externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) sqInt senderOop; char *theFP; StackPage *thePage; - char *theSP; assert(isContext(maybeMarriedContext)); /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); assert(!((isObjImmutable(maybeMarriedContext)))); if (!((((longAt((maybeMarriedContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -53625,7 +52965,7 @@ fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer) arrayOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); /* begin arrayValueOf: */ if (((arrayOop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(arrayOop))) { + && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) { return ((void *) (pointerForOop(arrayOop + BaseHeaderSize))); } /* begin primitiveFail */ @@ -53869,26 +53209,22 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop1 = referent1; + objOop1 = referent2; } classDict = objOop1; assert(!(isForwarded(classDict))); /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin noFixupFollowField:ofObject: */ objOop = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -53897,13 +53233,13 @@ findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(objOop)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - objOop = referent2; + objOop = referent1; } methodArray = objOop; assert(!(isForwarded(methodArray))); @@ -54140,7 +53476,7 @@ findNewMethodInClassTag(sqInt classTagArg) return null; } } - /* begin classForClassTag: */ + /* begin classAtIndex: */ assert((classTag <= (tagMask())) || (classTag >= (arrayClassIndexPun()))); /* begin fetchPointer:ofObject: */ @@ -54148,12 +53484,12 @@ findNewMethodInClassTag(sqInt classTagArg) classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); if (classTablePage == GIV(nilObj)) { GIV(lkupClass) = null; - goto l3; + goto l2; } /* begin fetchPointer:ofObject: */ fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); - l3: /* end classAtIndex: */; + l2: /* end classAtIndex: */; lookupOrdinarySend(); addNewMethodToCache(GIV(lkupClass)); @@ -54196,13 +53532,9 @@ findSelectorOfMethod(sqInt meth) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); if (classDictSize > MethodArrayIndex) { /* begin fetchPointer:ofObject: */ methodArray = longAt((classDict + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); @@ -54270,6 +53602,32 @@ findSPOfon(char *theFP, StackPage *thePage) return 0; } + /* StackInterpreter>>#fireEphemeron: */ +static void NoDbgRegParms +fireEphemeron(sqInt ephemeron) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + queueMourner(ephemeron); + /* begin setFormatOf:to: */ + assert(((1 >= 0) && (1 <= (formatMask())))); + flag("endianness"); + longAtput(ephemeron, ((longAt(ephemeron)) & ((unsigned int)~(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift()))); + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + + /* StackInterpreter>>#fireFinalization: */ +static void NoDbgRegParms +fireFinalization(sqInt weakling) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (GIV(newFinalization)) { + queueMourner(weakling); + } + /* begin signalFinalization: */ + forceInterruptCheck(); + GIV(pendingFinalizationSignals) += 1; +} + /* Like #stackFloatValue: but access method arguments left-to-right */ @@ -54460,20 +53818,18 @@ followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) char *theFP; usqInt theIPPtr; StackPage *thePage; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (theBecomeEffectsFlags & BecameCompiledMethodFlag) { if (((longAt(GIV(method))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { @@ -55046,27 +54402,26 @@ handleStackOverflow(void) /* base frame, context in saved ip slot (or base of stack in Cog) */ longAt(theFP + FoxCallerContext); - goto l1; + goto l2; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP1 + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP1))); longAt(callerFP1 + FoxThisContext); - goto l3; + goto l2; } marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l3: /* end ensureFrameIsMarried:SP: */; -l1: /* end ensureCallerContext: */; +l2: /* end ensureCallerContext: */; /* begin newStackPage */ lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l2; + goto l1; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l2: /* end newStackPage */; +l1: /* end newStackPage */; moveFramesInthroughtoPage(GIV(stackPage), theFP, newPage); /* begin setStackPageAndLimit: */ assert(newPage != 0); @@ -55095,7 +54450,6 @@ static sqInt NoDbgRegParms handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt switched; - char *theSP; /* If the stackLimit differs from the realStackLimit then the stackLimit @@ -55105,14 +54459,13 @@ handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); switched = 0; } @@ -55339,24 +54692,25 @@ instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sq fp = (thePage->headFP); if (fp == spouseFP) { theFPAbove = 0; - goto l2; + goto l1; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == spouseFP) { theFPAbove = fp; - goto l2; + goto l1; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l2: /* end findFrameAbove:inPage: */; + l1: /* end findFrameAbove:inPage: */; theIP = (theFPAbove == 0 ? longAt((thePage->headSP)) : oopForPointer(pointerForOop(longAt(theFPAbove + FoxCallerSavedIP)))); } - return (assert(validInstructionPointerinFrame(theIP + 1, spouseFP)), - (((usqInt)(((theIP - (longAt(spouseFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1)); + /* begin contextInstructionPointer:frame: */ + assert(validInstructionPointerinFrame(theIP + 1, spouseFP)); + return (((usqInt)(((theIP - (longAt(spouseFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1); } @@ -55478,6 +54832,7 @@ isKindOfInteger(sqInt oop) sqInt isLargeIntegerObject(sqInt oop) { + /* begin isLargeIntegerInstance: */ return ((oop & (tagMask())) == 0) && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1); } @@ -55486,6 +54841,7 @@ isLargeIntegerObject(sqInt oop) sqInt isLargeNegativeIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargeNegativeInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargeNegativeIntegerCompactIndex); } @@ -55494,6 +54850,7 @@ isLargeNegativeIntegerObject(sqInt oop) sqInt isLargePositiveIntegerObject(sqInt oop) { + /* begin isInstanceOfClassLargePositiveInteger: */ return ((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassLargePositiveIntegerCompactIndex); } @@ -55753,6 +55110,7 @@ isKindOfClass(sqInt oop, sqInt aClass) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55782,6 +55140,7 @@ isKindOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55810,6 +55169,7 @@ isMemberOf(sqInt oop, char *className) sqInt oopClass; sqInt tagBits; + /* begin fetchClassOf: */ oopClass = (((tagBits = oop & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(oop)); @@ -55830,13 +55190,9 @@ lengthOfNameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { return lengthOfNameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord())))))); } @@ -55849,13 +55205,9 @@ lengthOfNameOfClass(sqInt classOop) fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots11 = byteAt(objOop + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); if (fmt <= 5) { return numSlots2; } @@ -55950,8 +55302,8 @@ longPrintOop(sqInt oop) sqInt n1; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt startIP; if ((oop & (tagMask())) @@ -55980,7 +55332,6 @@ longPrintOop(sqInt oop) printf("0x%lx", ((unsigned long) class)); print(")"); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); print(" format "); /* begin printHexnp: */ @@ -55996,14 +55347,10 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(oop + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(oop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { len = numSlots; goto l5; @@ -56095,38 +55442,34 @@ longPrintOop(sqInt oop) /* begin lengthOf:format: */ fmt2 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(oop + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(oop - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(oop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots11); if (fmt2 <= 5) { - lastIndex = numSlots1; - goto l7; + lastIndex = numSlots2; + goto l8; } if (fmt2 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - lastIndex = (numSlots1 << (shiftForWord())) - (fmt2 & 7); - goto l7; + lastIndex = (numSlots2 << (shiftForWord())) - (fmt2 & 7); + goto l8; } if (fmt2 >= (firstShortFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 1)) - (fmt2 & 3); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3); + goto l8; } if (fmt2 >= (firstLongFormat())) { - lastIndex = (numSlots1 << ((shiftForWord()) - 2)) - (fmt2 & 1); - goto l7; + lastIndex = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1); + goto l8; } if (fmt2 == (sixtyFourBitIndexableFormat())) { - lastIndex = ((usqInt) numSlots1) >> 1; - goto l7; + lastIndex = ((usqInt) numSlots2) >> 1; + goto l8; } lastIndex = 0; - l7: /* end lengthOf:format: */; + l8: /* end lengthOf:format: */; if ((lastIndex - startIP) > 100) { lastIndex = startIP + 100; } @@ -56250,6 +55593,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) sqInt tagBits; sqInt wrapAround; + /* begin fetchClassOf: */ receiverClass = (((tagBits = GIV(localAbsentReceiver) & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(GIV(localAbsentReceiver))); @@ -56267,13 +55611,9 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56298,19 +55638,19 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l15; + goto l16; } index += 1; } found = 0; - goto l15; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56321,13 +55661,13 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56336,7 +55676,7 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l15; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56344,12 +55684,12 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop1 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop1)); - if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop1); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop1; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56358,20 +55698,20 @@ lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) } GIV(newMethod) = objOop4; found = 1; - goto l15; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l15; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; -l15: /* end lookupMethodInDictionary: */; +l16: /* end lookupMethodInDictionary: */; if (found && ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate)) { return rule; @@ -56428,13 +55768,9 @@ lookupMethodInClass(sqInt class) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56459,12 +55795,12 @@ lookupMethodInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop11; found = 1; goto l19; } @@ -56482,13 +55818,13 @@ lookupMethodInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56505,12 +55841,12 @@ lookupMethodInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56585,11 +55921,11 @@ lookupMNU(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; createActualMessageTo(GIV(lkupClass)); @@ -56607,13 +55943,9 @@ lookupMNU(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56638,19 +55970,19 @@ lookupMNU(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l18; + goto l16; } index += 1; } found = 0; - goto l18; + goto l16; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56661,13 +55993,13 @@ lookupMNU(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56676,7 +56008,7 @@ lookupMNU(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l18; + goto l16; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56684,12 +56016,12 @@ lookupMNU(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56698,30 +56030,30 @@ lookupMNU(void) } GIV(newMethod) = objOop4; found = 1; - goto l18; + goto l16; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l18; + goto l16; } wrapAround = 1; index = SelectorStart; } } found = 0; - l18: /* end lookupMethodInDictionary: */; + l16: /* end lookupMethodInDictionary: */; if (found) { return LookupRuleMNU; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } error("Recursive not understood error encountered"); return 0; @@ -56750,41 +56082,37 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) sqInt objOop1; sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = class; while (currentClass != GIV(nilObj)) { /* begin followObjField:ofObject: */ - objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop)); - if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop); + objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop1)); + if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1); } - dictionary = objOop; + dictionary = objOop1; if (dictionary == GIV(nilObj)) { /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop); } - GIV(lkupClass) = objOop1; + GIV(lkupClass) = objOop; return SelectorCannotInterpret; } /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56809,19 +56137,19 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop21 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop21 & (tagMask())) == 0) - && (((longAt(objOop21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop21); + objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop11 & (tagMask())) == 0) + && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11); } - GIV(newMethod) = objOop21; + GIV(newMethod) = objOop11; found = 1; - goto l19; + goto l17; } index += 1; } found = 0; - goto l19; + goto l17; } /* It is assumed that there are some nils in this dictionary, and search will @@ -56832,13 +56160,13 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -56847,7 +56175,7 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l19; + goto l17; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -56855,12 +56183,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -56869,20 +56197,20 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } GIV(newMethod) = objOop4; found = 1; - goto l19; + goto l17; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l19; + goto l17; } wrapAround = 1; index = SelectorStart; } } found = 0; - l19: /* end lookupMethodInDictionary: */; + l17: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { addNewMethodToCache(class); @@ -56895,12 +56223,12 @@ lookupOrdinaryNoMNUEtcInClass(sqInt class) } /* begin followField:ofObject: */ - objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop2; + currentClass = objOop6; } GIV(lkupClass) = class; return SelectorDoesNotUnderstand; @@ -56933,11 +56261,11 @@ lookupOrdinarySend(void) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; assert(addressCouldBeClassObj(GIV(lkupClass))); @@ -56953,13 +56281,9 @@ lookupOrdinarySend(void) /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -56984,19 +56308,19 @@ lookupOrdinarySend(void) } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -57007,13 +56331,13 @@ lookupOrdinarySend(void) ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -57022,7 +56346,7 @@ lookupOrdinarySend(void) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57030,12 +56354,12 @@ lookupOrdinarySend(void) } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -57044,20 +56368,20 @@ lookupOrdinarySend(void) } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found) { if ((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPublic) { return LookupRuleOrdinary; @@ -57067,12 +56391,12 @@ lookupOrdinarySend(void) } } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -57099,11 +56423,11 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; sqInt objOop3; sqInt objOop4; sqInt objOop5; + sqInt objOop6; sqInt wrapAround; currentClass = mixinApplication; @@ -57118,13 +56442,9 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule /* begin lookupMethodInDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); /* Use linear search on small dictionaries; its cheaper. Also the limit can be set to force linear search of all dictionaries, which supports the @@ -57149,19 +56469,19 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } methodArray = objOop5; /* begin followField:ofObject: */ - objOop2 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); - if (((objOop2 & (tagMask())) == 0) - && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop2 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop2); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop1); } - GIV(newMethod) = objOop2; + GIV(newMethod) = objOop1; found = 1; - goto l17; + goto l15; } index += 1; } found = 0; - goto l17; + goto l15; } /* It is assumed that there are some nils in this dictionary, and search will @@ -57172,13 +56492,13 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule ? (GIV(messageSelector) >> 1) : ((usqInt) (((usqInt)GIV(messageSelector)))) >> (numTagBits())) : (/* begin hashBitsOf: */ - (objOop3 = GIV(messageSelector)), - (hash = (long32At(objOop3 + 4)) & (identityHashHalfWordMask())), + (objOop2 = GIV(messageSelector)), + (hash = (long32At(objOop2 + 4)) & (identityHashHalfWordMask())), (hash == 0 ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), /* begin setHashBitsOf:to: */ assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), - long32Atput(objOop3 + 4, ((((long32At(objOop3 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + long32Atput(objOop2 + 4, ((((long32At(objOop2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) : 0), hash)))); wrapAround = 0; @@ -57187,7 +56507,7 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { found = 0; - goto l17; + goto l15; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57195,12 +56515,12 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } if (nextSelector == GIV(messageSelector)) { /* begin followObjField:ofObject: */ - objOop11 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop11); + objOop3 = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop3)); + if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop3); } - methodArray = objOop11; + methodArray = objOop3; /* begin followField:ofObject: */ objOop4 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); if (((objOop4 & (tagMask())) == 0) @@ -57209,31 +56529,31 @@ lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule } GIV(newMethod) = objOop4; found = 1; - goto l17; + goto l15; } index += 1; if (index == length) { if (wrapAround) { found = 0; - goto l17; + goto l15; } wrapAround = 1; index = SelectorStart; } } found = 0; - l17: /* end lookupMethodInDictionary: */; + l15: /* end lookupMethodInDictionary: */; if (found && (!((accessModifierOfMethod(GIV(newMethod))) == AccessModifierPrivate))) { return rule; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop6 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop6 & (tagMask())) == 0) + && (((longAt(objOop6)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop6 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop6); } - currentClass = objOop1; + currentClass = objOop6; } return lookupMNU(); } @@ -57258,8 +56578,8 @@ lookupSelectorinClass(sqInt selector, sqInt class) usqInt numSlots; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; + sqInt objOop3; sqInt wrapAround; currentClass = class; @@ -57277,13 +56597,9 @@ lookupSelectorinClass(sqInt selector, sqInt class) /* begin lookupMethodFor:InDictionary: */ assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(dictionary + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - length = longAt(dictionary - BaseHeaderSize); - } - else { - length = numSlots; - } + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); mask = (length - SelectorStart) - 1; /* It is assumed that there are some nils in this dictionary, and search will @@ -57308,7 +56624,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); if (nextSelector == GIV(nilObj)) { meth = null; - goto l11; + goto l9; } if (((nextSelector & (tagMask())) == 0) && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { @@ -57323,36 +56639,36 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); - if (((objOop11 & (tagMask())) == 0) - && (((longAt(objOop11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop11); + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); } - meth = objOop11; - goto l11; + meth = objOop1; + goto l9; } index += 1; if (index == length) { if (wrapAround) { meth = null; - goto l11; + goto l9; } wrapAround = 1; index = SelectorStart; } } meth = null; - l11: /* end lookupMethodFor:InDictionary: */; + l9: /* end lookupMethodFor:InDictionary: */; if (!(meth == null)) { return meth; } /* begin followField:ofObject: */ - objOop1 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); - if (((objOop1 & (tagMask())) == 0) - && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { - objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1); + objOop3 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop3 & (tagMask())) == 0) + && (((longAt(objOop3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop3 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop3); } - currentClass = objOop1; + currentClass = objOop3; } return null; } @@ -57392,11 +56708,11 @@ makeBaseFrameFor(sqInt aContext) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { page = lruOrFree; - goto l11; + goto l3; } divorceFramesIn(lruOrFree); page = lruOrFree; -l11: /* end newStackPage */; +l3: /* end newStackPage */; pointer = (page->baseAddress); /* begin fetchPointer:ofObject: */ theIP = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); @@ -57424,7 +56740,7 @@ makeBaseFrameFor(sqInt aContext) if (((longAt(maybeClosure)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { maybeClosure = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, aContext, maybeClosure); } - /* begin argumentCountOfClosure: */ + /* begin quickFetchInteger:ofObject: */ oop = longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); assert((oop & 1)); numArgs = (oop >> 1); @@ -57542,7 +56858,6 @@ makeContextSnapshotSafe(sqInt ctxt) sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt classFormat; sqInt classObj; sqInt knownClassIndex; usqInt newObj; @@ -57558,8 +56873,7 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) /* begin eeInstantiateSmallClassIndex:format:numSlots: */ knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); /* begin instSpecOfClassFormat: */ - classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); - objFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask()); + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); assert((numSlots >= 0) && (knownClassIndex != 0)); assert(((objFormat < (firstByteFormat()) @@ -57582,13 +56896,13 @@ makePointwithxValueyValue(sqInt xValue, sqInt yValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); pointResult = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); GIV(freeStart) += numBytes; pointResult = newObj; -l4: /* end eeInstantiateSmallClass:numSlots: */; +l3: /* end eeInstantiateSmallClass:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(pointResult))); longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)xValue << 1) | 1)); @@ -57773,9 +57087,10 @@ mapStackPages(void) && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxThisContext), ((futureSpace()).start), futureSurvivorStart()))))) { longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext))); } - assert((isMarriedOrWidowedContext(frameContext(theFP))) - && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); - + if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) { + assert((isMarriedOrWidowedContext(frameContext(theFP))) + && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); + } } if ((((longAt(longAt(theFP + FoxMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) || (((assert(isNonImmediate(longAt(theFP + FoxMethod))), @@ -58149,7 +57464,6 @@ marryFrameSP(char *theFP, char *theSP) numSlots = ((methodHeader & LargeContextBit) != 0 ? LargeContextSlots : SmallContextSlots); - /* begin eeInstantiateMethodContextSlots: */ theContext = allocateNewSpaceSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassMethodContextCompactIndex); assert((numStack + ReceiverIndex) <= numSlots); /* begin storePointerUnchecked:ofObject:withValue: */ @@ -58257,7 +57571,7 @@ maybeSelectorOfMethod(sqInt methodObj) penultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset1 + LiteralStart)) << (shiftForWord()))))); if (((penultimateLiteral & (tagMask())) == 0) - && (isWordsOrBytesNonImm(penultimateLiteral))) { + && (isPureBitsFormat((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())))) { return ((fetchClassTagOfNonImm(penultimateLiteral)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand))) ? penultimateLiteral : 0); @@ -58268,7 +57582,7 @@ maybeSelectorOfMethod(sqInt methodObj) && (((longAt((penultimateLiteral + BaseHeaderSize) + (0U << (shiftForWord())))) == methodObj) && (((maybeSelector = longAt((penultimateLiteral + BaseHeaderSize) + (1U << (shiftForWord())))), (((maybeSelector & (tagMask())) == 0) - && (isWordsOrBytesNonImm(maybeSelector))) + && (isPureBitsFormat((((usqInt) (longAt(maybeSelector))) >> (formatShift())) & (formatMask())))) && ((fetchClassTagOfNonImm(maybeSelector)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand)))))))) ? maybeSelector : 0); @@ -58307,12 +57621,7 @@ methodClassAssociationOf(sqInt methodPointer) sqInt offset; /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -58334,12 +57643,7 @@ methodClassOf(sqInt methodPointer) sqInt offset; /* begin followLiteral:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin followField:ofObject: */ objOop2 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((objOop2 & (tagMask())) == 0) @@ -58383,7 +57687,8 @@ methodPrimitiveIndex(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -58536,13 +57841,9 @@ nameOfClass(sqInt classOop) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if (numSlots == GIV(metaclassNumSlots)) { /* begin fetchPointer:ofObject: */ maybeThisClassOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))); @@ -58608,13 +57909,13 @@ noInlineSigned32BitIntegerGutsFor(sqInt integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l4; + goto l3; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l4: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l3: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong32:ofObject:withValue: */ valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(magnitude); long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); @@ -58663,7 +57964,7 @@ noMarkedContextsOnPage(StackPage *thePage) do { if ((byteAt((theFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP))); - if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt((longAt(theFP + FoxThisContext)) + 4))) >> (markedBitHalfShift())) & 1) != 0) { return 0; } } @@ -58752,12 +58053,7 @@ penultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 2; + offset = (literalCountOf(aMethodOop)) - 2; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -58842,13 +58138,13 @@ positive32BitIntegerFor(unsigned int integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -58892,33 +58188,33 @@ positive64BitIntegerFor(usqLong integerValue) return (((((unsigned int) integerValue)) << 1) | 1); } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); assert(ClassLargePositiveIntegerCompactIndex != 0); - assert(((objFormat1 < (firstByteFormat()) - ? objFormat1 - : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(1 < (numSlotsMask())); - newObj1 = GIV(freeStart); - numBytes1 = BaseHeaderSize + (8); - assert((numBytes1 % (allocationUnit())) == 0); - assert((newObj1 % (allocationUnit())) == 0); - if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l5; + goto l4; } } - long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); - GIV(freeStart) += numBytes1; - newLargeInteger1 = newObj1; - l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger1 = newObj; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -58943,37 +58239,37 @@ positive64BitIntegerFor(usqLong integerValue) } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ - objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + objFormat1 = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); numSlots = 8 / BytesPerOop; assert((numSlots >= 0) && (ClassLargePositiveIntegerCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ assert(numSlots < (numSlotsMask())); - newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + newObj1 = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 ? 8 : (numSlots + (numSlots & 1)) * BytesPerOop)); - assert((numBytes % (allocationUnit())) == 0); - assert((newObj % (allocationUnit())) == 0); - if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { if (!GIV(needGCFlag)) { /* begin scheduleScavenge */ GIV(needGCFlag) = 1; forceInterruptCheck(); } - if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l3; + goto l6; } } - long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); - GIV(freeStart) += numBytes; - newLargeInteger = newObj; -l3: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes1; + newLargeInteger = newObj1; +l6: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storeLong64:ofObject:withValue: */ value = SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue); long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), value); @@ -58996,7 +58292,7 @@ positiveMachineIntegerFor(usqIntptr_t value) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) value)) <= (MaxSmallInteger)) { resultObj = ((value << 1) | 1); - goto l6; + goto l5; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -59019,13 +58315,13 @@ positiveMachineIntegerFor(usqIntptr_t value) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -59036,9 +58332,9 @@ positiveMachineIntegerFor(usqIntptr_t value) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); resultObj = newLargeInteger; - goto l6; + goto l5; -l6: /* end positive32BitIntegerFor: */; +l5: /* end positive32BitIntegerFor: */; return resultObj; } @@ -59108,7 +58404,8 @@ primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader) sqInt firstBytecode; return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -59125,7 +58422,8 @@ primitiveIndexOf(sqInt methodPointer) /* begin fetchPointer:ofObject: */ methodHeader = longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); return (methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0); } @@ -59152,13 +58450,9 @@ printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass) /* begin numSlotsOf: */ assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classDict + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - classDictSize = longAt(classDict - BaseHeaderSize); - } - else { - classDictSize = numSlots; - } + classDictSize = (numSlots == (numSlotsMask()) + ? longAt(classDict - BaseHeaderSize) + : numSlots); i = SelectorStart; while (i < classDictSize) { if (aSelector == (longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) { @@ -59325,11 +58619,11 @@ printAllStacks(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; usqInt numSlots5; + usqInt numSlots6; sqInt obj; sqInt objOop; sqInt objOop1; @@ -59353,9 +58647,9 @@ printAllStacks(void) sqInt tagBits; /* begin activeProcess */ - objOop11 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop4 = longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - proc = longAt((objOop4 + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + proc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); printNameOfClasscount((((tagBits = proc & (tagMask()))) != 0 ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) : fetchClassOfNonImm(proc)), 5); @@ -59368,20 +58662,16 @@ printAllStacks(void) printf("\n"); printCallStackFP(GIV(framePointer)); /* begin fetchPointer:ofObject: */ - objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); - objOop = longAt((objOop2 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); - schedLists = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + objOop3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop1 = longAt((objOop3 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + schedLists = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); if (GIV(highestRunnableProcessPriority) == 0) { /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -59414,47 +58704,43 @@ printAllStacks(void) /* begin allHeapEntitiesDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop3 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop3 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop3, GIV(endOfMemory)))) break; - assert((long64At(objOop3)) != 0); + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); /* begin classIndexOf: */ - classIdx = (longAt(objOop3)) & (classIndexMask()); + classIdx = (longAt(objOop11)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop3); + printProcsOnList(objOop11); } prevPrevObj1 = prevObj1; - prevObj1 = objOop3; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop3 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop3 - BaseHeaderSize); - } - else { - numSlots3 = numSlots11; - } - if (numSlots3 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop3 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop3 = GIV(endOfMemory); - goto l10; + objOop11 = GIV(endOfMemory); + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop3 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l10: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -59464,92 +58750,84 @@ printAllStacks(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots1 = byteAt(address + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop4 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop1, limit)) { + while (oopisLessThan(objOop4, limit)) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots4 = numSlots12; - } - if (numSlots4 == 0) { + numSlots1 = byteAt(objOop4 + 7); + numSlots6 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots1); + if (numSlots6 == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes = (numSlots6 + (numSlots6 & 1)) << (shiftForWord()); } - followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop4 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop1 = limit; - goto l5; + objOop4 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l5: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots2 = byteAt(address1 + 7); - objOop1 = (numSlots2 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop4 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop1, GIV(freeStart))) { + while (oopisLessThan(objOop4, GIV(freeStart))) { /* begin classIndexOf: */ - classIdx = (longAt(objOop1)) & (classIndexMask()); + classIdx = (longAt(objOop4)) & (classIndexMask()); if ((classIdx == semaphoreClass) || (classIdx == mutexClass)) { - printProcsOnList(objOop1); + printProcsOnList(objOop4); } prevPrevObj = prevObj; - prevObj = objOop1; + prevObj = objOop4; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop1 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots5 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots5 = numSlots13; - } - if (numSlots5 == 0) { + numSlots11 = byteAt(objOop4 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop4 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop4 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop1 = GIV(freeStart); - goto l6; + objOop4 = GIV(freeStart); + goto l22; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop4 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l6: /* end objectAfter:limit: */; + l22: /* end objectAfter:limit: */; } } @@ -60050,7 +59328,7 @@ printFrame(char *theFP) assert(!(isFree(thePage))); if (startFrame == theFP) { frameAbove = null; - goto l4; + goto l3; } aFrame = startFrame; while (1) { @@ -60060,11 +59338,11 @@ printFrame(char *theFP) if (!(aFrame != 0)) break; if (theFP == aFrame) { frameAbove = prevFrame; - goto l4; + goto l3; } } frameAbove = null; - l4: /* end safeFindFrameAbove:on:startingFrom: */; + l3: /* end safeFindFrameAbove:on:startingFrom: */; theSP = (!(frameAbove == null) ? (assert(!(isBaseFrame(frameAbove))), (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord) @@ -60197,10 +59475,10 @@ printLikelyImplementorsOfSelector(sqInt selector) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -60228,28 +59506,23 @@ printLikelyImplementorsOfSelector(sqInt selector) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop11 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop12 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); - while (oopisLessThan(objOop11, limit)) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, limit)) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60277,7 +59550,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l31; + goto l30; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60288,23 +59561,23 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l31; + goto l30; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l31; + goto l30; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l31; + goto l30; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l31; + goto l30; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60320,38 +59593,38 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l31; + goto l30; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l31; + goto l30; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l31; + goto l30; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l31; + goto l30; } if (oop == GIV(nilObj)) { print("nil"); - goto l31; + goto l30; } if (oop == GIV(trueObj)) { print("true"); - goto l31; + goto l30; } if (oop == GIV(falseObj)) { print("false"); - goto l31; + goto l30; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l31; + goto l30; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60364,7 +59637,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l31; + goto l30; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60372,7 +59645,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l31; + goto l30; } } if ((nameLen == 9) @@ -60383,7 +59656,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l31; + goto l30; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60397,7 +59670,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l31; + goto l30; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60410,12 +59683,12 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l29; + goto l28; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l30; + goto l29; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60426,7 +59699,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l30: ; + l29: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60434,67 +59707,58 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l29: ; + l28: ; } - l31: /* end printOopShortInner: */; + l30: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop11 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop12 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop11 + BaseHeaderSize) + slotBytes; + followingWordAddress = (objOop12 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { - objOop11 = limit; - goto l17; + objOop12 = limit; + goto l16; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); - objOop11 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l17: /* end objectAfter:limit: */; + l16: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop11 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop12 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); - while (oopisLessThan(objOop11, GIV(freeStart))) { - assert(isEnumerableObjectNoAssert(objOop11)); - if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop11)) == selector)) { + while (oopisLessThan(objOop12, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop12)); + if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop12)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop11)), -/* begin fetchPointer:ofObject: */ -longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop12)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop11)); + printf("0x%lx", ((unsigned long) objOop12)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60522,7 +59786,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l34; + goto l33; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60533,23 +59797,23 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l34; + goto l33; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l34; + goto l33; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l34; + goto l33; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l34; + goto l33; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60565,38 +59829,38 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l34; + goto l33; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l34; + goto l33; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l34; + goto l33; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l34; + goto l33; } if (oop == GIV(nilObj)) { print("nil"); - goto l34; + goto l33; } if (oop == GIV(trueObj)) { print("true"); - goto l34; + goto l33; } if (oop == GIV(falseObj)) { print("false"); - goto l34; + goto l33; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l34; + goto l33; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60609,7 +59873,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l34; + goto l33; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60617,7 +59881,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l34; + goto l33; } } if ((nameLen == 9) @@ -60628,7 +59892,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l34; + goto l33; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60642,7 +59906,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l34; + goto l33; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60655,12 +59919,12 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l32; + goto l31; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l33; + goto l32; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60671,7 +59935,7 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l33: ; + l32: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60679,40 +59943,36 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l32: ; + l31: ; } - l34: /* end printOopShortInner: */; + l33: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } prevPrevObj = prevObj; - prevObj = objOop11; + prevObj = objOop12; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop11 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop12 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop11 + BaseHeaderSize) + slotBytes1; + followingWordAddress1 = (objOop12 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { - objOop11 = GIV(freeStart); + objOop12 = GIV(freeStart); goto l23; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); - objOop11 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop12 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); l23: /* end objectAfter:limit: */; @@ -60720,27 +59980,22 @@ longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); prevPrevObj1 = (prevObj1 = null); - objOop12 = GIV(nilObj); + objOop11 = GIV(nilObj); while (1) { - assert((objOop12 % (allocationUnit())) == 0); - if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break; - assert((long64At(objOop12)) != 0); - if (isEnumerableObject(objOop12)) { - if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) - && ((maybeSelectorOfMethod(objOop12)) == selector)) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && ((maybeSelectorOfMethod(objOop11)) == selector)) { /* try and print the key of the method class association (the name of the implementing class) */ - /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(objOop12)), -/* begin fetchPointer:ofObject: */ -longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(objOop12)), -/* begin fetchPointer:ofObject: */ -longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + /* begin methodClassAssociationOf: */ + offset = (literalCountOf(objOop11)) - 1; /* begin fetchPointer:ofObject: */ - methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); + methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); /* begin printHexnp: */ - printf("0x%lx", ((unsigned long) objOop12)); + printf("0x%lx", ((unsigned long) objOop11)); /* begin space */ putchar(' '); /* begin printOopShortInner: */ @@ -60768,7 +60023,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l37; + goto l36; } if ((oop & 1)) { printNum((oop >> 1)); @@ -60779,23 +60034,23 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar(')'); - goto l37; + goto l36; } print("unknown immediate "); /* begin printHexnp: */ printf("0x%lx", ((unsigned long) oop)); - goto l37; + goto l36; } if (!(addressCouldBeObj(oop))) { print(((oop & (8 - 1)) != 0 ? " is misaligned" : whereIs(oop))); - goto l37; + goto l36; } if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) { print(" is a free chunk"); - goto l37; + goto l36; } if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { print(" is a forwarder to "); @@ -60811,38 +60066,38 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW n1 = referent; printf("0x%lx", ((unsigned long) n1)); - goto l37; + goto l36; } if (((oop & (tagMask())) == 0) && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) { printFloat(dbgFloatValueOf(oop)); - goto l37; + goto l36; } classOop = fetchClassOfNonImm(oop); if (!(addressCouldBeObj(classOop))) { print("a ??"); - goto l37; + goto l36; } if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) { printNameOfClasscount(oop, 5); - goto l37; + goto l36; } if (oop == GIV(nilObj)) { print("nil"); - goto l37; + goto l36; } if (oop == GIV(trueObj)) { print("true"); - goto l37; + goto l36; } if (oop == GIV(falseObj)) { print("false"); - goto l37; + goto l36; } nameLen = lengthOfNameOfClass(classOop); if (nameLen == 0) { print("a ??"); - goto l37; + goto l36; } name = nameOfClass(classOop); if (nameLen == 10) { @@ -60855,7 +60110,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('\''); - goto l37; + goto l36; } if ((strncmp(name, "ByteSymbol", 10)) == 0) { @@ -60863,7 +60118,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printChar: */ putchar('#'); printStringOf(oop); - goto l37; + goto l36; } } if ((nameLen == 9) @@ -60874,7 +60129,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 1); putchar(aByte1); - goto l37; + goto l36; } print("a(n) "); for (i = 0; i < nameLen; i += 1) { @@ -60888,7 +60143,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation)); while (1) { if (classLookupKey == GIV(nilObj)) { - goto l37; + goto l36; } if (((assert(addressCouldBeClassObj(classLookupKey)), (((longAt((classLookupKey + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break; @@ -60901,12 +60156,12 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW classLookupKey = objOop; } if (classLookupKey == GIV(nilObj)) { - goto l35; + goto l34; } theClass1 = classOop; while (1) { if (theClass1 == classLookupKey) { - goto l36; + goto l35; } if (!(theClass1 != GIV(nilObj))) break; /* begin followField:ofObject: */ @@ -60917,7 +60172,7 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } theClass1 = objOop1; } - l36: ; + l35: ; /* begin space */ putchar(' '); printOopShort(longAt((oop + BaseHeaderSize) + (((int)((usqInt)(KeyIndex) << (shiftForWord())))))); @@ -60925,9 +60180,9 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW /* begin printHexnp: */ n2 = longAt((oop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); printf("0x%lx", ((unsigned long) n2)); - l35: ; + l34: ; } - l37: /* end printOopShortInner: */; + l36: /* end printOopShortInner: */; /* begin cr */ printf("\n"); } @@ -60935,34 +60190,30 @@ longAt((objOop12 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForW } prevPrevObj1 = prevObj1; - prevObj1 = objOop12; + prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop12 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop12 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop12 + BaseHeaderSize) + slotBytes2; + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { - objOop12 = GIV(endOfMemory); - goto l26; + objOop11 = GIV(endOfMemory); + goto l27; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); - objOop12 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l26: /* end objectAfter:limit: */; + l27: /* end objectAfter:limit: */; } } @@ -61141,13 +60392,9 @@ printNameOfClasscount(sqInt classOop, sqInt cnt) /* begin numSlotsOf: */ assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(classOop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(classOop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(classOop - BaseHeaderSize) + : numSlots1); if ((numSlots == GIV(metaclassNumSlots)) && (GIV(metaclassNumSlots) > GIV(thisClassIndex))) { printNameOfClasscount(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))), cnt - 1); @@ -61429,7 +60676,6 @@ printOop(sqInt oop) /* begin cr */ printf("\n")); } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt > 5) { print(" nbytes "); @@ -61498,13 +60744,9 @@ printOop(sqInt oop) fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt1 <= 5) { lastIndex = numSlots; goto l3; @@ -61916,7 +61158,6 @@ printStringOf(sqInt oop) if (!(addressCouldBeObj(oop))) { return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); if (fmt < (firstByteFormat())) { return; @@ -62307,21 +61548,21 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea sqInt oop; sqInt seed; sqInt swapBytes; - int w; + sqInt w; int w1; - sqInt w10; - sqInt w11; + unsigned short w10; + unsigned short w11; sqInt w12; sqInt w13; sqInt w14; - unsigned short w2; - unsigned short w3; - int w4; - unsigned short w5; - unsigned short w6; - sqInt w7; - sqInt w8; - sqInt w9; + sqInt w2; + sqInt w3; + sqInt w4; + sqInt w5; + int w6; + unsigned short w7; + unsigned short w8; + int w9; /* guess Metaclass instSize */ @@ -62334,69 +61575,69 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* record header start position */ headerStart = (sqImageFilePosition(f)) - 4; /* begin getWord32FromFile:swap: */ - w = 0; - sqImageFileRead((&w), sizeof(int), 1, f); + w1 = 0; + sqImageFileRead((&w1), sizeof(int), 1, f); headerSize = (swapBytes - ? SQ_SWAP_4_BYTES(w) - : w); + ? SQ_SWAP_4_BYTES(w1) + : w1); /* begin getLongFromFile:swap: */ - w8 = 0; - sqImageFileRead((&w8), sizeof(w8), 1, f); + w2 = 0; + sqImageFileRead((&w2), sizeof(w2), 1, f); dataSize = ((sqInt) ((swapBytes ? (/* begin byteSwapped: */ - SQ_SWAP_4_BYTES(w8)) - : w8))); + SQ_SWAP_4_BYTES(w2)) + : w2))); /* begin getLongFromFile:swap: */ - w9 = 0; - sqImageFileRead((&w9), sizeof(w9), 1, f); + w3 = 0; + sqImageFileRead((&w3), sizeof(w3), 1, f); if (swapBytes) { /* begin byteSwapped: */ - oldBaseAddr = SQ_SWAP_4_BYTES(w9); + oldBaseAddr = SQ_SWAP_4_BYTES(w3); } else { - oldBaseAddr = w9; + oldBaseAddr = w3; } /* begin specialObjectsOop: */ - w10 = 0; - sqImageFileRead((&w10), sizeof(w10), 1, f); + w13 = 0; + sqImageFileRead((&w13), sizeof(w13), 1, f); if (swapBytes) { /* begin byteSwapped: */ - anObject = SQ_SWAP_4_BYTES(w10); + anObject = SQ_SWAP_4_BYTES(w13); } else { - anObject = w10; + anObject = w13; } GIV(specialObjectsOop) = anObject; /* begin lastHash: */ - w11 = 0; - sqImageFileRead((&w11), sizeof(w11), 1, f); + w14 = 0; + sqImageFileRead((&w14), sizeof(w14), 1, f); if (swapBytes) { /* begin byteSwapped: */ - seed = SQ_SWAP_4_BYTES(w11); + seed = SQ_SWAP_4_BYTES(w14); } else { - seed = w11; + seed = w14; } GIV(lastHash) = seed; /* begin getLongFromFile:swap: */ - w12 = 0; - sqImageFileRead((&w12), sizeof(w12), 1, f); + w4 = 0; + sqImageFileRead((&w4), sizeof(w4), 1, f); if (swapBytes) { /* begin byteSwapped: */ - GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w12); + GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w4); } else { - GIV(savedWindowSize) = w12; + GIV(savedWindowSize) = w4; } /* begin getLongFromFile:swap: */ - w13 = 0; - sqImageFileRead((&w13), sizeof(w13), 1, f); + w5 = 0; + sqImageFileRead((&w5), sizeof(w5), 1, f); if (swapBytes) { /* begin byteSwapped: */ - headerFlags = SQ_SWAP_4_BYTES(w13); + headerFlags = SQ_SWAP_4_BYTES(w5); } else { - headerFlags = w13; + headerFlags = w5; } /* begin setImageHeaderFlagsFrom: */ @@ -62409,17 +61650,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(preemptionYields) = (headerFlags & 16) == 0; GIV(newFinalization) = (headerFlags & 64) != 0; /* begin getWord32FromFile:swap: */ - w1 = 0; - sqImageFileRead((&w1), sizeof(int), 1, f); + w6 = 0; + sqImageFileRead((&w6), sizeof(int), 1, f); extraVMMemory = (swapBytes - ? SQ_SWAP_4_BYTES(w1) - : w1); + ? SQ_SWAP_4_BYTES(w6) + : w6); /* begin getShortFromFile:swap: */ - w2 = 0; - sqImageFileRead((&w2), sizeof(unsigned short), 1, f); + w7 = 0; + sqImageFileRead((&w7), sizeof(unsigned short), 1, f); hdrNumStackPages = (swapBytes - ? ((((usqInt) w2) >> 8) & 0xFF) | (((int)((usqInt)((w2 & 0xFF)) << 8))) - : w2); + ? ((((usqInt) w7) >> 8) & 0xFF) | (((int)((usqInt)((w7 & 0xFF)) << 8))) + : w7); GIV(numStackPages) = (desiredNumStackPages != 0 ? desiredNumStackPages : (hdrNumStackPages == 0 @@ -62430,17 +61671,17 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea It is used for the cog code size in Cog. Preserve it to be polite to other VMs. */ desiredNumStackPages = hdrNumStackPages; /* begin getShortFromFile:swap: */ - w3 = 0; - sqImageFileRead((&w3), sizeof(unsigned short), 1, f); + w8 = 0; + sqImageFileRead((&w8), sizeof(unsigned short), 1, f); GIV(theUnknownShort) = (swapBytes - ? ((((usqInt) w3) >> 8) & 0xFF) | (((int)((usqInt)((w3 & 0xFF)) << 8))) - : w3); + ? ((((usqInt) w8) >> 8) & 0xFF) | (((int)((usqInt)((w8 & 0xFF)) << 8))) + : w8); /* begin getWord32FromFile:swap: */ - w4 = 0; - sqImageFileRead((&w4), sizeof(int), 1, f); + w9 = 0; + sqImageFileRead((&w9), sizeof(int), 1, f); hdrEdenBytes = (swapBytes - ? SQ_SWAP_4_BYTES(w4) - : w4); + ? SQ_SWAP_4_BYTES(w9) + : w9); /* begin edenBytes: */ bytes = (desiredEdenBytes != 0 ? desiredEdenBytes @@ -62450,45 +61691,45 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea GIV(edenBytes) = bytes; desiredEdenBytes = hdrEdenBytes; /* begin getShortFromFile:swap: */ - w5 = 0; - sqImageFileRead((&w5), sizeof(unsigned short), 1, f); + w10 = 0; + sqImageFileRead((&w10), sizeof(unsigned short), 1, f); hdrMaxExtSemTabSize = (swapBytes - ? ((((usqInt) w5) >> 8) & 0xFF) | (((int)((usqInt)((w5 & 0xFF)) << 8))) - : w5); + ? ((((usqInt) w10) >> 8) & 0xFF) | (((int)((usqInt)((w10 & 0xFF)) << 8))) + : w10); if (hdrMaxExtSemTabSize != 0) { /* begin setMaxExtSemSizeTo: */ GIV(maxExtSemTabSizeSet) = 1; ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize); } /* begin getShortFromFile:swap: */ - w6 = 0; - sqImageFileRead((&w6), sizeof(unsigned short), 1, f); + w11 = 0; + sqImageFileRead((&w11), sizeof(unsigned short), 1, f); GIV(the2ndUnknownShort) = (swapBytes - ? ((((usqInt) w6) >> 8) & 0xFF) | (((int)((usqInt)((w6 & 0xFF)) << 8))) - : w6); + ? ((((usqInt) w11) >> 8) & 0xFF) | (((int)((usqInt)((w11 & 0xFF)) << 8))) + : w11); /* begin getLongFromFile:swap: */ - w14 = 0; - sqImageFileRead((&w14), sizeof(w14), 1, f); + w12 = 0; + sqImageFileRead((&w12), sizeof(w12), 1, f); if (swapBytes) { /* begin byteSwapped: */ - firstSegSize = SQ_SWAP_4_BYTES(w14); + firstSegSize = SQ_SWAP_4_BYTES(w12); } else { - firstSegSize = w14; + firstSegSize = w12; } /* begin firstSegmentSize: */ GIV(firstSegmentSize) = firstSegSize; allocationReserve = interpreterAllocationReserveBytes(); minimumMemory = (dataSize + GIV(edenBytes)) + allocationReserve; /* begin getLongFromFile:swap: */ - w7 = 0; - sqImageFileRead((&w7), sizeof(w7), 1, f); + w = 0; + sqImageFileRead((&w), sizeof(w), 1, f); if (swapBytes) { /* begin byteSwapped: */ - freeOldSpaceInImage = SQ_SWAP_4_BYTES(w7); + freeOldSpaceInImage = SQ_SWAP_4_BYTES(w); } else { - freeOldSpaceInImage = w7; + freeOldSpaceInImage = w; } /* begin initialHeadroom:givenFreeOldSpaceInImage: */ headroom1 = (extraVMMemory == 0 @@ -62498,26 +61739,26 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea : extraVMMemory); if (freeOldSpaceInImage >= headroom1) { headroom = 0; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) { headroom = headroom1 / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) { headroom = headroom1 / 4; - goto l1; + goto l2; } if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) { headroom = (headroom1 * 3) / 8; - goto l1; + goto l2; } if (freeOldSpaceInImage >= (headroom1 / 2)) { headroom = headroom1 / 2; - goto l1; + goto l2; } headroom = headroom1; -l1: /* end initialHeadroom:givenFreeOldSpaceInImage: */; +l2: /* end initialHeadroom:givenFreeOldSpaceInImage: */; /* begin roundUpHeapSize: */ heapSize1 = ((dataSize + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve ? 0 @@ -62591,13 +61832,9 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea /* begin numSlotsOf: */ assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(classArrayClass + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - GIV(metaclassNumSlots) = longAt(classArrayClass - BaseHeaderSize); - } - else { - GIV(metaclassNumSlots) = numSlots; - } + GIV(metaclassNumSlots) = (numSlots == (numSlotsMask()) + ? longAt(classArrayClass - BaseHeaderSize) + : numSlots); /* default */ GIV(thisClassIndex) = 5; @@ -62655,7 +61892,6 @@ reestablishContextPriorToCallback(sqInt callbackContext) char *sp; char *theFP; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -62677,14 +61913,13 @@ reestablishContextPriorToCallback(sqInt callbackContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (isSingleContext(callbackContext)) { /* begin markContextAsDead: */ @@ -62966,6 +62201,7 @@ retryPrimitiveOnFailure(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -63043,7 +62279,6 @@ retryPrimitiveOnFailure(void) EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt aMethodObj; sqInt calloutMethodContext; sqInt index; sqInt senderOop; @@ -63051,7 +62286,6 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac char *sp; char *theFP; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -63073,14 +62307,13 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (isSingleContext(callbackMethodContext)) { /* begin markContextAsDead: */ @@ -63111,8 +62344,7 @@ returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbac /* begin frameCallerFP: */ GIV(framePointer) = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP)); /* begin setMethod: */ - aMethodObj = longAt(GIV(framePointer) + FoxMethod); - GIV(method) = aMethodObj; + GIV(method) = longAt(GIV(framePointer) + FoxMethod); assert(isOopCompiledMethod(GIV(method))); GIV(bytecodeSetSelector) = (methodUsesAlternateBytecodeSet(GIV(method)) ? 256 @@ -63283,12 +62515,7 @@ safeMethodClassOf(sqInt methodPointer) sqInt referent1; /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(methodPointer)), -/* begin fetchPointer:ofObject: */ -longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(methodPointer)) - 1; /* begin fetchPointer:ofObject: */ literal = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); if (((literal & (tagMask())) == 0) @@ -63389,7 +62616,6 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) char *sp6; char *sp7; sqInt table; - char *theSP; /* begin fetchClassTagOfNonImm: */ obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); @@ -63492,11 +62718,11 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -63506,14 +62732,13 @@ sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin checkForStackOverflow */ if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { @@ -63561,7 +62786,6 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg char *sp6; char *sp7; sqInt table; - char *theSP; /* begin fetchClassTagOfNonImm: */ obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); @@ -63664,11 +62888,11 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l6; + goto l10; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l6: /* end getErrorObjectFromPrimFailCode */; + l10: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -63678,14 +62902,13 @@ sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt reg assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin checkForStackOverflow */ if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { @@ -64187,13 +63410,13 @@ signed64BitIntegerFor(sqLong integerValue) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l5; + goto l4; } } long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); GIV(freeStart) += numBytes; newLargeInteger = newObj; -l5: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ /* begin storeLong64:ofObject:withValue: */ @@ -64249,7 +63472,7 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) oop = (oopForPointer(cPtr)) - BaseHeaderSize; if (!(((oop & (tagMask())) == 0) - && (isWordsOrBytesNonImm(oop)))) { + && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; @@ -64260,13 +63483,9 @@ sizeOfSTArrayFromCPrimitive(void *cPtr) fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { return numSlots; } @@ -64490,11 +63709,11 @@ snapshot(sqInt embedded) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l11; + goto l12; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l11: /* end getErrorObjectFromPrimFailCode */; + l12: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -64692,13 +63911,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent11 & (tagMask())) == 0) - && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent21 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent21 & (tagMask())) == 0) + && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj1 = referent11; + obj1 = referent21; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64721,13 +63940,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent21 & (tagMask())) == 0) - && (((longAt(referent21)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent31 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent31 & (tagMask())) == 0) + && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj2 = referent21; + obj2 = referent31; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64750,13 +63969,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj3)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent31 & (tagMask())) == 0) - && (((longAt(referent31)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent4 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent4 & (tagMask())) == 0) + && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj3 = referent31; + obj3 = referent4; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64779,13 +63998,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj4)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent4 & (tagMask())) == 0) - && (((longAt(referent4)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent5 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent5 & (tagMask())) == 0) + && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj4 = referent4; + obj4 = referent5; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(GIV(specialObjectsOop)))); if ((assert(isNonImmediate(GIV(specialObjectsOop))), @@ -64838,13 +64057,13 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj)); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent5 & (tagMask())) == 0) - && (((longAt(referent5)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent11 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent11 & (tagMask())) == 0) + && (((longAt(referent11)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord()))); } - obj = referent5; + obj = referent11; /* begin storePointer:ofObject:withValue: */ assert(!(isForwarded(xArray))); if ((assert(isNonImmediate(xArray)), @@ -64869,37 +64088,37 @@ spurPostBecomeAction(sqInt theBecomeEffectsFlags) /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileProcess))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent1 & (tagMask())) == 0) - && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent3 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent3 & (tagMask())) == 0) + && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileProcess) = referent1; + GIV(profileProcess) = referent3; } if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileMethod))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent2 & (tagMask())) == 0) - && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileMethod) = referent2; + GIV(profileMethod) = referent1; } if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(profileSemaphore))); /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); - while (((referent3 & (tagMask())) == 0) - && (((longAt(referent3)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { /* begin fetchPointer:ofMaybeForwardedObject: */ - referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord()))); + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); } - GIV(profileSemaphore) = referent3; + GIV(profileSemaphore) = referent2; } } } @@ -65214,12 +64433,7 @@ stackValue(sqInt offset) sqInt startPCOfMethod(sqInt aCompiledMethod) { - return (((assert((((assert(isCompiledMethod(aCompiledMethod)), -/* begin fetchPointer:ofObject: */ -longAt((aCompiledMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aCompiledMethod)), -/* begin fetchPointer:ofObject: */ -longAt((aCompiledMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + return ((literalCountOf(aCompiledMethod)) + LiteralStart) * BytesPerOop; } @@ -65250,56 +64464,51 @@ stObjectat(sqInt array, sqInt index) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -65308,17 +64517,17 @@ stObjectat(sqInt array, sqInt index) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -65382,7 +64591,7 @@ stObjectat(sqInt array, sqInt index) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -65428,56 +64637,51 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin baseHeader: */ hdr = long64At(array); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(array + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(array - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(array - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l14; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l14; + goto l7; } class = fetchClassOfNonImm(array); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l14: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((fmt == (indexablePointersFormat())) && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -65486,17 +64690,17 @@ stObjectatput(sqInt array, sqInt index, sqInt value) sp = stackPointerIndexForFrame(frameOfMarriedContext(array)); assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array))); stSize = sp; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((array + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { stSize = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array))); stSize = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize)) && ((((longAt((array + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -65528,37 +64732,37 @@ stObjectatput(sqInt array, sqInt index, sqInt value) } } longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l12; + goto l13; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeByte:ofObject:withValue: */ byteAtput((array + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l12; + goto l13; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l12; + goto l13; } /* begin storeShort16:ofObject:withValue: */ shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l12; + goto l13; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -65566,7 +64770,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong64:ofObject:withValue: */ long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l12; + goto l13; } unsignedValueToStore = positive32BitValueOf(value); @@ -65574,7 +64778,7 @@ stObjectatput(sqInt array, sqInt index, sqInt value) /* begin storeLong32:ofObject:withValue: */ long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l12: /* end subscript:with:storing:format: */; + l13: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -65638,18 +64842,17 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) /* base frame, context in saved ip slot (or base of stack in Cog) */ longAt(theFP + FoxCallerContext); - goto l3; + goto l4; } /* begin ensureFrameIsMarried:SP: */ if ((byteAt((callerFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(callerFP))); longAt(callerFP + FoxThisContext); - goto l6; + goto l4; } marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))), (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)); -l6: /* end ensureFrameIsMarried:SP: */; -l3: /* end ensureCallerContext: */; +l4: /* end ensureCallerContext: */; /* begin stackPageFor: */ index = pageIndexForstackMemorybytesPerPage(theFP, GIV(stackMemory), GIV(bytesPerPage)); thePage = stackPageAtpages(index, GIV(pages)); @@ -65664,11 +64867,11 @@ storeSenderOfFramewithValue(char *theFP, sqInt anOop) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l5; + goto l2; } divorceFramesIn(lruOrFree); newPage = lruOrFree; -l5: /* end newStackPage */; +l2: /* end newStackPage */; theMovedFP = moveFramesInthroughtoPage(thePage, theFP, newPage); if (onCurrentPage) { /* begin setStackPageAndLimit: */ @@ -65709,56 +64912,51 @@ stSizeOf(sqInt oop) /* begin baseHeader: */ hdr = long64At(oop); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(oop + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(oop - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l4; + goto l3; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l4; + goto l3; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l4; + goto l3; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l4; + goto l3; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l4; + goto l3; } totalLength = 0; -l4: /* end lengthOf:format: */; +l3: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l6; + goto l4; } if (fmt < 2) { fixedFields = totalLength; - goto l6; + goto l4; } class = fetchClassOfNonImm(oop); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l6: /* end fixedFieldsOf:format:length: */; +l4: /* end fixedFieldsOf:format:length: */; if (fmt == (indexablePointersFormat())) { assert(!(isContextHeader(hdr))); } @@ -65897,7 +65095,6 @@ transferTo(sqInt newProc) char *sp; char *theFrame; StackPage *thePage; - char *theSP; sqInt top; sqInt valuePointer; sqInt valuePointer1; @@ -65910,14 +65107,13 @@ transferTo(sqInt newProc) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin assertValidExecutionPointe:r:s: */ lip = GIV(instructionPointer) + 1; @@ -65996,11 +65192,11 @@ transferTo(sqInt newProc) lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); if (((lruOrFree->baseFP)) == 0) { newPage = lruOrFree; - goto l11; + goto l12; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l11: /* end newStackPage */; + l12: /* end newStackPage */; moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage); /* begin markStackPageLeastMostRecentlyUsed: */ assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage))); @@ -66009,7 +65205,7 @@ transferTo(sqInt newProc) lastUsedPage = (lastUsedPage->nextPage); } if (((lastUsedPage->nextPage)) == newPage) { - goto l14; + goto l15; } (((newPage->prevPage))->nextPage = (newPage->nextPage)); (((newPage->nextPage))->prevPage = (newPage->prevPage)); @@ -66018,7 +65214,7 @@ transferTo(sqInt newProc) (newPage->nextPage = lastUsedPage); (lastUsedPage->prevPage = newPage); assert(pageListIsWellFormed()); - l14: /* end markStackPageLeastMostRecentlyUsed: */; + l15: /* end markStackPageLeastMostRecentlyUsed: */; } assert(((thePage->headFP)) == theFrame); } @@ -66060,12 +65256,7 @@ ultimateLiteralOf(sqInt aMethodOop) assert(isOopCompiledMethod(aMethodOop)); /* begin literal:ofMethod: */ - offset = ((assert((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), -((((assert(isCompiledMethod(aMethodOop)), -/* begin fetchPointer:ofObject: */ -longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) - 1; + offset = (literalCountOf(aMethodOop)) - 1; /* begin fetchPointer:ofObject: */ return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord()))))); } @@ -66187,12 +65378,8 @@ updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP) static sqInt NoDbgRegParms validInstructionPointerinFrame(usqInt anInstrPointer, char *fp) { - usqInt aMethod; - - /* begin validInstructionPointer:inMethod:framePointer: */ - aMethod = longAt(fp + FoxMethod); - return (anInstrPointer >= (((aMethod + (lastPointerOf(aMethod))) + BytesPerOop) - 1)) - && (anInstrPointer < (((aMethod + (numBytesOfBytes(aMethod))) + BaseHeaderSize) - 1)); + return (anInstrPointer >= ((((longAt(fp + FoxMethod)) + (lastPointerOf(longAt(fp + FoxMethod)))) + BytesPerOop) - 1)) + && (anInstrPointer < ((((longAt(fp + FoxMethod)) + (numBytesOfBytes(longAt(fp + FoxMethod)))) + BaseHeaderSize) - 1)); } @@ -66303,10 +65490,10 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -66329,14 +65516,13 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop1 = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop1, limit)) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66351,42 +65537,37 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ slotBytes = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop1 = limit; - goto l11; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l11: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop1 = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop1, GIV(freeStart))) { assert(isEnumerableObjectNoAssert(objOop1)); - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66401,32 +65582,28 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj = prevObj; prevObj = objOop1; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop1 + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ slotBytes1 = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop1 = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } /* begin allOldSpaceObjectsDo: */ assert(isOldObject(GIV(nilObj))); @@ -66437,7 +65614,6 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; assert((long64At(objOop11)) != 0); if (isEnumerableObject(objOop11)) { - /* begin formatOf: */ fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); if ((fmt == (indexablePointersFormat())) && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { @@ -66453,20 +65629,16 @@ voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) prevPrevObj1 = prevObj1; prevObj1 = objOop11; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop11 + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop11 - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ slotBytes2 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { @@ -66503,20 +65675,18 @@ wakeHighestPriority(void) sqInt proc; sqInt processList; sqInt schedLists; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin fetchPointer:ofObject: */ objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); @@ -66526,13 +65696,9 @@ wakeHighestPriority(void) /* begin numSlotsOf: */ assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(schedLists + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - p = longAt(schedLists - BaseHeaderSize); - } - else { - p = numSlots; - } + p = (numSlots == (numSlotsMask()) + ? longAt(schedLists - BaseHeaderSize) + : numSlots); } else { p = GIV(highestRunnableProcessPriority); @@ -66570,39 +65736,39 @@ whereIs(sqInt anOop) && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) { if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) { where = " is in eden"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) { where = " is in future space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) { where = " is in past space"; - goto l2; + goto l1; } where = " is in new space"; - goto l2; + goto l1; } if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) { if (!((segmentContainingObj(anOop)) == null)) { where = " is in old space"; - goto l2; + goto l1; } where = " is between old space segments"; - goto l2; + goto l1; } where = null; -l2: /* end whereIsMaybeHeapThing: */; +l1: /* end whereIsMaybeHeapThing: */; if (!(where == null)) { return where; } /* begin whereIsMaybeStackThing: */ if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackMemory), GIV(pages))) { where = " is in the stack zone"; - goto l1; + goto l2; } where = null; -l1: /* end whereIsMaybeStackThing: */; +l2: /* end whereIsMaybeStackThing: */; if (!(where == null)) { return where; } @@ -66654,7 +65820,6 @@ writeImageFileIO(void) } return null; } - /* begin imageSizeToWrite */ assert(newSpaceIsEmpty()); /* begin totalBytesInNonEmptySegments */ total = 0; @@ -66664,6 +65829,7 @@ writeImageFileIO(void) } } imageBytes = total; + headerStart = sqImageFileStartLocation(f, imageName, headerSize + imageBytes); /* Note: on Unix systems one could put an exec command here, padded to 512 bytes */; sqImageFileSeek(f, headerStart); @@ -66737,14 +65903,9 @@ cloneContext(sqInt aContext) /* begin numSlotsOf: */ assert((classIndexOf(aContext)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(aContext + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - sz = longAt(aContext - BaseHeaderSize); - } - else { - sz = numSlots; - } - /* begin eeInstantiateMethodContextSlots: */ + sz = (numSlots == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots); cloned = allocateNewSpaceSlotsformatclassIndex(sz, indexablePointersFormat(), ClassMethodContextCompactIndex); if (cloned != 0) { for (i = 0; i <= StackPointerIndex; i += 1) { @@ -66832,6 +65993,7 @@ fieldofFrame(sqInt index, char *theFP) { DECL_MAYBE_SQ_GLOBAL_STRUCT char *callerFP; sqInt frameNumArgs; + sqInt numArgs; switch (index) { @@ -66858,7 +66020,8 @@ fieldofFrame(sqInt index, char *theFP) case ClosureIndex: return ((byteAt((theFP + FoxFrameFlags) + 3)) != 0 ? (/* begin frameStackedReceiver:numArgs: */ - longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFP + FoxFrameFlags) + 1))) << (shiftForWord()))))))) + (numArgs = byteAt((theFP + FoxFrameFlags) + 1)), + longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))))))) : (/* begin nilObject */ GIV(nilObj))); @@ -66868,6 +66031,7 @@ fieldofFrame(sqInt index, char *theFP) default: assert((((index - CtxtTempFrameStart) >= 0) && ((index - CtxtTempFrameStart) <= (stackPointerIndexForFrame(theFP))))); + /* begin temporary:in: */ return ((index - CtxtTempFrameStart) < ((frameNumArgs = byteAt((theFP + FoxFrameFlags) + 1))) ? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord)) : longAt(((theFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord))); @@ -66936,7 +66100,6 @@ primitiveClone(void) static void primitiveClosureCopyWithCopiedValues(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt context; sqInt copiedValues; sqInt i; sqInt initialIP; @@ -66947,8 +66110,8 @@ primitiveClosureCopyWithCopiedValues(void) sqInt numArgs; usqInt numBytes; usqInt numCopied; - sqInt numSlots; - usqInt numSlots1; + usqInt numSlots; + sqInt numSlots1; sqInt objFormat; char *sp; sqInt valuePointer; @@ -66977,33 +66140,28 @@ primitiveClosureCopyWithCopiedValues(void) return; } /* begin closureIn:numArgs:instructionPointer:copiedValues: */ - context = longAt(GIV(stackPointer) + (2 * BytesPerWord)); initialIP = (GIV(instructionPointer) + 2) - (GIV(method) + BaseHeaderSize); copiedValues = longAt(GIV(stackPointer)); /* begin numSlotsOf: */ assert((classIndexOf(copiedValues)) > (isForwardedObjectClassIndexPun())); - numSlots1 = byteAt(copiedValues + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numCopied = longAt(copiedValues - BaseHeaderSize); - } - else { - numCopied = numSlots1; - } + numSlots = byteAt(copiedValues + 7); + numCopied = (numSlots == (numSlotsMask()) + ? longAt(copiedValues - BaseHeaderSize) + : numSlots); /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = indexablePointersFormat(); - numSlots = ClosureFirstCopiedValueIndex + numCopied; - assert((numSlots >= 0) + numSlots1 = ClosureFirstCopiedValueIndex + numCopied; + assert((numSlots1 >= 0) && (ClassBlockClosureCompactIndex != 0)); assert(((objFormat < (firstByteFormat()) ? objFormat : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex)))); /* begin allocateSmallNewSpaceSlots:format:classIndex: */ - assert(numSlots < (numSlotsMask())); + assert(numSlots1 < (numSlotsMask())); newObj = GIV(freeStart); - numBytes = BaseHeaderSize + ((numSlots <= 1 + numBytes = BaseHeaderSize + ((numSlots1 <= 1 ? 8 - : (numSlots + (numSlots & 1)) * BytesPerOop)); + : (numSlots1 + (numSlots1 & 1)) * BytesPerOop)); assert((numBytes % (allocationUnit())) == 0); assert((newObj % (allocationUnit())) == 0); if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { @@ -67015,17 +66173,17 @@ primitiveClosureCopyWithCopiedValues(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newClosure1 = 0; - goto l7; + goto l6; } } - long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); + long64Atput(newObj, (((((usqLong) numSlots1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); GIV(freeStart) += numBytes; newClosure1 = newObj; -l7: /* end allocateSmallNewSpaceSlots:format:classIndex: */; +l6: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); - longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), longAt(GIV(stackPointer) + (2 * BytesPerWord))); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isOopForwarded(newClosure1))); longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 1) | 1)); @@ -67090,7 +66248,6 @@ primitiveContextAt(void) char *spouseFP; sqInt stSize; sqInt stSize1; - char *theSP; sqInt totalLength; sqInt totalLength1; sqInt value; @@ -67114,56 +66271,51 @@ primitiveContextAt(void) /* might be an instance of a subclass */ /* begin stObject:at: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l33; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l33; + goto l24; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l33; + goto l24; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l33; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l33; + goto l24; } totalLength1 = 0; - l33: /* end lengthOf:format: */; + l24: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l27; + goto l20; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l27; + goto l20; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l27: /* end fixedFieldsOf:format:length: */; + l20: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -67172,23 +66324,23 @@ primitiveContextAt(void) sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext)); assert((ReceiverIndex + ((sp4 >> 1))) < (lengthOf(aContext))); stSize1 = sp4; - goto l23; + goto l21; } /* begin fetchStackPointerOf: */ sp11 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp11 & 1))) { stSize1 = 0; - goto l23; + goto l21; } assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(aContext))); stSize1 = (sp11 >> 1); - l23: /* end stackPointerForMaybeMarriedContext: */; + l21: /* end stackPointerForMaybeMarriedContext: */; if ((oopisGreaterThanOrEqualTo(index, 1)) && ((oopisLessThanOrEqualTo(index, stSize1)) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { value = noInlineTemporaryin(index - 1, frameOfMarriedContext(aContext)); - goto l37; + goto l31; } } else { @@ -67202,19 +66354,19 @@ primitiveContextAt(void) if (fmt1 <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord()))))); - goto l37; + goto l31; } if (fmt1 >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1))) << 1) | 1); - goto l37; + goto l31; } if (fmt1 >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))))))) << 1) | 1); - goto l37; + goto l31; } if (fmt1 == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))))); - goto l37; + goto l31; } /* begin positive32BitIntegerFor: */ @@ -67223,7 +66375,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { value = ((integerValue1 << 1) | 1); - goto l37; + goto l31; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -67246,13 +66398,13 @@ primitiveContextAt(void) if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger1 = 0; - goto l35; + goto l30; } } long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes1; newLargeInteger1 = newObj1; - l35: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l30: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -67263,7 +66415,7 @@ primitiveContextAt(void) long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger1; - goto l37; + goto l31; } /* begin primitiveFailFor: */ @@ -67272,7 +66424,7 @@ primitiveContextAt(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; value = 0; - l37: /* end stObject:at: */; + l31: /* end stObject:at: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -67284,76 +66436,70 @@ primitiveContextAt(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l9; + goto l11; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l9; + goto l11; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l9; + goto l11; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l9; + goto l11; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l9; + goto l11; } totalLength = 0; - l9: /* end lengthOf:format: */; + l11: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l16; + goto l12; } if (fmt < 2) { fixedFields = totalLength; - goto l16; + goto l12; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l16: /* end fixedFieldsOf:format:length: */; + l12: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp3 & 1))) { stSize = 0; - goto l11; + goto l14; } assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); stSize = (sp3 >> 1); - l11: /* end fetchStackPointerOf: */; + l14: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -67363,19 +66509,19 @@ primitiveContextAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); - goto l12; + goto l19; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); - goto l12; + goto l19; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); - goto l12; + goto l19; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); - goto l12; + goto l19; } /* begin positive32BitIntegerFor: */ @@ -67384,7 +66530,7 @@ primitiveContextAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l22; + goto l19; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -67413,7 +66559,7 @@ primitiveContextAt(void) long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l17: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l17: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -67424,10 +66570,9 @@ primitiveContextAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l22; + goto l19; - l22: /* end positive32BitIntegerFor: */; - l12: /* end subscript:with:format: */; + l19: /* end subscript:with:format: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp1; @@ -67443,6 +66588,7 @@ primitiveContextAt(void) GIV(primFailCode) = PrimErrBadIndex; return; } + /* begin temporary:in: */ value = ((index - 1) < ((frameNumArgs = byteAt((spouseFP + FoxFrameFlags) + 1))) ? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord)) : longAt(((spouseFP + FoxReceiver) - BytesPerWord) + ((frameNumArgs - (index - 1)) * BytesPerWord))); @@ -67489,7 +66635,6 @@ primitiveContextAtPut(void) char *spouseFP; sqInt stSize; sqInt stSize1; - char *theSP; sqInt totalLength; sqInt totalLength1; usqLong unsigned64BitValueToStore; @@ -67517,56 +66662,51 @@ primitiveContextAtPut(void) /* might be an instance of a subclass */ /* begin stObject:at:put: */ hdr1 = long64At(aContext); - /* begin formatOfHeader: */ fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots11 = byteAt(aContext + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(aContext - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { totalLength1 = numSlots2; - goto l34; + goto l27; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); - goto l34; + goto l27; } if (fmt1 >= (firstShortFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l34; + goto l27; } if (fmt1 >= (firstLongFormat())) { totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l34; + goto l27; } if (fmt1 == (sixtyFourBitIndexableFormat())) { totalLength1 = ((usqInt) numSlots2) >> 1; - goto l34; + goto l27; } totalLength1 = 0; - l34: /* end lengthOf:format: */; + l27: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt1 >= (sixtyFourBitIndexableFormat())) || (fmt1 == 2)) { fixedFields1 = 0; - goto l32; + goto l22; } if (fmt1 < 2) { fixedFields1 = totalLength1; - goto l32; + goto l22; } class1 = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - l32: /* end fixedFieldsOf:format:length: */; + l22: /* end fixedFieldsOf:format:length: */; if ((fmt1 == (indexablePointersFormat())) && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { /* begin stackPointerForMaybeMarriedContext: */ @@ -67591,7 +66731,7 @@ primitiveContextAtPut(void) && ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext)))))) { noInlineTemporaryinput(index - 1, frameOfMarriedContext(aContext), value); - goto l38; + goto l35; } } else { @@ -67618,37 +66758,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); - goto l26; + goto l34; } if (fmt1 >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); - goto l26; + goto l34; } if (fmt1 >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } signedValueToStore1 = (value >> 1); if (!((signedValueToStore1 >= 0) && (signedValueToStore1 <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l26; + goto l34; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); - goto l26; + goto l34; } if (fmt1 == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore1 = positive64BitValueOf(value); @@ -67656,7 +66796,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); } - goto l26; + goto l34; } unsignedValueToStore1 = positive32BitValueOf(value); @@ -67664,7 +66804,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); } - l26: /* end subscript:with:storing:format: */; + l34: /* end subscript:with:storing:format: */; } else { /* begin primitiveFailFor: */ @@ -67673,7 +66813,7 @@ primitiveContextAtPut(void) : PrimErrBadIndex); GIV(primFailCode) = reasonCode; } - l38: /* end stObject:at:put: */; + l35: /* end stObject:at:put: */; if (!GIV(primFailCode)) { /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -67685,76 +66825,70 @@ primitiveContextAtPut(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if (!((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(aContext))))) { - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(aContext + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(aContext - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(aContext - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l10; + goto l12; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l10; + goto l12; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l10; + goto l12; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l10; + goto l12; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l10; + goto l12; } totalLength = 0; - l10: /* end lengthOf:format: */; + l12: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l22; + goto l13; } if (fmt < 2) { fixedFields = totalLength; - goto l22; + goto l13; } class = fetchClassOfNonImm(aContext); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - l22: /* end fixedFieldsOf:format:length: */; + l13: /* end fixedFieldsOf:format:length: */; /* begin fetchStackPointerOf: */ sp3 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp3 & 1))) { stSize = 0; - goto l12; + goto l15; } assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(aContext))); stSize = (sp3 >> 1); - l12: /* end fetchStackPointerOf: */; + l15: /* end fetchStackPointerOf: */; if (!(((index >= 1) && (index <= stSize)))) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadIndex; @@ -67777,37 +66911,37 @@ primitiveContextAtPut(void) } } longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value); - goto l17; + goto l21; } if (fmt >= (firstByteFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } /* begin storeByte:ofObject:withValue: */ byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore); - goto l17; + goto l21; } if (fmt >= (firstShortFormat())) { if (!((value & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } signedValueToStore = (value >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l17; + goto l21; } /* begin storeShort16:ofObject:withValue: */ shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore); - goto l17; + goto l21; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(value); @@ -67815,7 +66949,7 @@ primitiveContextAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore); } - goto l17; + goto l21; } unsignedValueToStore = positive32BitValueOf(value); @@ -67823,7 +66957,7 @@ primitiveContextAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore); } - l17: /* end subscript:with:storing:format: */; + l21: /* end subscript:with:storing:format: */; /* begin pop:thenPush: */ longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); GIV(stackPointer) = sp1; @@ -67839,6 +66973,7 @@ primitiveContextAtPut(void) GIV(primFailCode) = PrimErrBadIndex; return; } + /* begin temporary:in:put: */ if ((index - 1) < ((frameNumArgs = byteAt((spouseFP + FoxFrameFlags) + 1)))) { longAtput((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord), value); } @@ -67870,76 +67005,69 @@ primitiveContextSize(void) sqInt sp1; sqInt sp2; sqInt sz; - char *theSP; sqInt totalLength; /* begin stackTop */ rcvr = longAt(GIV(stackPointer)); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l5; + goto l6; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l5; + goto l6; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l5; + goto l6; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l5; + goto l6; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l5; + goto l6; } totalLength = 0; -l5: /* end lengthOf:format: */; +l6: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l7; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l7; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l7: /* end fixedFieldsOf:format:length: */; if ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin stackPointerForMaybeMarriedContext: */ if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -67947,17 +67075,17 @@ primitiveContextSize(void) sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); sz = sp2; - goto l7; + goto l4; } /* begin fetchStackPointerOf: */ sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp1 & 1))) { sz = 0; - goto l7; + goto l4; } assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); sz = (sp1 >> 1); - l7: /* end stackPointerForMaybeMarriedContext: */; + l4: /* end stackPointerForMaybeMarriedContext: */; } else { sz = totalLength - fixedFields; @@ -68051,6 +67179,7 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt argumentArray; usqInt arraySize; sqInt ccIndex; + sqInt classOop; sqInt firstBytecode; sqInt fmt; sqInt fmt1; @@ -68063,18 +67192,17 @@ primitiveDoNamedPrimitiveWithArgs(void) sqInt moduleLength; sqInt moduleName; sqInt nItems; - sqInt numSlots; + usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; usqInt numSlots3; - usqInt numSlots4; - usqInt numSlots5; + sqInt numSlots4; sqInt object; sqInt object1; sqInt object2; sqInt object3; sqInt object4; - sqInt objFormat; sqInt primRcvr; char *sp; char *sp1; @@ -68106,14 +67234,10 @@ primitiveDoNamedPrimitiveWithArgs(void) } /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); - numSlots2 = byteAt(argumentArray + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots2; - } + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -2); @@ -68132,22 +67256,24 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin fetchPointer:ofObject: */ spec = longAt((methodArg + BaseHeaderSize) + (1U << (shiftForWord()))); /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); if (spec & (tagMask())) { isArray = 0; - goto l24; + goto l22; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(spec))); /* begin classIndexOf: */ ccIndex = (longAt(spec)) & (classIndexMask()); isArray = ClassArrayCompactIndex == ccIndex; - goto l24; + goto l22; -l24: /* end is:instanceOf:compactClassIndex: */; +l22: /* end is:instanceOf:compactClassIndex: */; if (!(isArray && (((numSlotsOf(spec)) == 4) && (((methodHeader & AlternateHeaderHasPrimFlag - ? ((firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), + ? (/* begin firstBytecodeOfAlternateHeader:method: */ + (firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize), (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)))) : 0)) == PrimNumberExternalCall)))) { /* begin primitiveFailFor: */ @@ -68178,38 +67304,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots4 = byteAt(moduleName + 7); - if (numSlots4 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots1 = numSlots4; - } + numSlots1 = byteAt(moduleName + 7); + numSlots2 = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { - moduleLength = numSlots1; - goto l14; + moduleLength = numSlots2; + goto l18; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - moduleLength = (numSlots1 << (shiftForWord())) - (fmt & 7); - goto l14; + moduleLength = (numSlots2 << (shiftForWord())) - (fmt & 7); + goto l18; } if (fmt >= (firstShortFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt & 3); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3); + goto l18; } if (fmt >= (firstLongFormat())) { - moduleLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt & 1); - goto l14; + moduleLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1); + goto l18; } if (fmt == (sixtyFourBitIndexableFormat())) { - moduleLength = ((usqInt) numSlots1) >> 1; - goto l14; + moduleLength = ((usqInt) numSlots2) >> 1; + goto l18; } moduleLength = 0; - l14: /* end lengthOf:format: */; + l18: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((spec + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -68226,38 +67348,34 @@ primitiveDoNamedPrimitiveWithArgs(void) /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots5 = byteAt(functionName + 7); - if (numSlots5 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots3 = numSlots5; - } + numSlots11 = byteAt(functionName + 7); + numSlots3 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { functionLength = numSlots3; - goto l17; + goto l24; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ functionLength = (numSlots3 << (shiftForWord())) - (fmt1 & 7); - goto l17; + goto l24; } if (fmt1 >= (firstShortFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l17; + goto l24; } if (fmt1 >= (firstLongFormat())) { functionLength = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l17; + goto l24; } if (fmt1 == (sixtyFourBitIndexableFormat())) { functionLength = ((usqInt) numSlots3) >> 1; - goto l17; + goto l24; } functionLength = 0; -l17: /* end lengthOf:format: */; +l24: /* end lengthOf:format: */; if (GIV(primFailCode)) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -3); @@ -68270,14 +67388,11 @@ primitiveDoNamedPrimitiveWithArgs(void) return; } /* begin eeInstantiateClassIndex:format:numSlots: */ - objFormat = 2; - numSlots = 5; - assert((numSlots >= 0) + numSlots4 = 5; + assert((numSlots4 >= 0) && (ClassArrayCompactIndex != 0)); - assert(((objFormat < (firstByteFormat()) - ? objFormat - : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); - GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots, objFormat, ClassArrayCompactIndex); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(numSlots4, 2, ClassArrayCompactIndex); /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = (argumentArray = popStack()); assert(!(isOopForwarded(GIV(tempOop)))); @@ -68409,13 +67524,9 @@ primitiveDoPrimitiveWithArgs(void) /* begin numSlotsOf: */ assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); numSlots = byteAt(argumentArray + 7); - if (numSlots == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - arraySize = longAt(argumentArray - BaseHeaderSize); - } - else { - arraySize = numSlots; - } + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); if (!(roomToPushNArgs(arraySize))) { /* begin primitiveFailFor: */ (GIV(primFailCode) = -PrimErrLimitExceeded); @@ -68590,6 +67701,7 @@ primitiveExecuteMethod(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -68606,7 +67718,7 @@ primitiveExecuteMethod(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l6; + goto l17; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -68633,16 +67745,16 @@ primitiveExecuteMethod(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l6; + goto l17; } } /* begin activateNewMethod */ assert(isCompiledMethod(GIV(newMethod))); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15; + numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -68660,8 +67772,8 @@ primitiveExecuteMethod(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader2); - GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader1); + GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 ? 256 : 0); @@ -68682,16 +67794,16 @@ primitiveExecuteMethod(void) longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp; } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), -((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), +((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader2 & AlternateHeaderHasPrimFlag)) { + methodHeader1 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ GIV(instructionPointer) += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader2)) < 0 + if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader1)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -68701,21 +67813,21 @@ primitiveExecuteMethod(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l13; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l13: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; } } - methodHeader1 = methodHeader2; + methodHeader2 = methodHeader1; if (GIV(stackPointer) < GIV(stackLimit)) { - handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader1)); + handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); } -l6: /* end executeNewMethod */; +l17: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -68812,6 +67924,7 @@ primitiveExecuteMethodArgsArray(void) /* begin fetchPointer:ofObject: */ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); } @@ -68828,7 +67941,7 @@ primitiveExecuteMethodArgsArray(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l9; + goto l22; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -68855,16 +67968,16 @@ primitiveExecuteMethodArgsArray(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l9; + goto l22; } } /* begin activateNewMethod */ assert(isCompiledMethod(GIV(newMethod))); /* begin fetchPointer:ofObject: */ - methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); - numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + numTemps = (((usqInt) methodHeader1) >> MethodHeaderTempCountShift) & 0x3F; /* begin argumentCountOfMethodHeader: */ - numArgs = (((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15; + numArgs = (((usqInt) methodHeader1) >> MethodHeaderArgCountShift) & 15; /* could new rcvr be set at point of send? */ rcvr1 = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); @@ -68882,8 +67995,8 @@ primitiveExecuteMethodArgsArray(void) /* begin setMethod:methodHeader: */ GIV(method) = GIV(newMethod); assert(isOopCompiledMethod(GIV(method))); - assert((methodHeaderOf(GIV(method))) == methodHeader2); - GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 + assert((methodHeaderOf(GIV(method))) == methodHeader1); + GIV(bytecodeSetSelector) = ((((int) methodHeader1)) < 0 ? 256 : 0); @@ -68904,16 +68017,16 @@ primitiveExecuteMethodArgsArray(void) longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); GIV(stackPointer) = sp7; } - GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), -((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader1 & 1)), +((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; if ((/* begin alternateHeaderHasPrimitiveFlag: */ - methodHeader2 & AlternateHeaderHasPrimFlag)) { + methodHeader1 & AlternateHeaderHasPrimFlag)) { /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ GIV(instructionPointer) += 3; if (GIV(primFailCode) != 0) { - if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader2)) < 0 + if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader1)) < 0 ? AltLongStoreBytecode : LongStoreBytecode))) { /* begin getErrorObjectFromPrimFailCode */ @@ -68923,21 +68036,21 @@ primitiveExecuteMethodArgsArray(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l18; + goto l16; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l18: /* end getErrorObjectFromPrimFailCode */; + l16: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; } } - methodHeader1 = methodHeader2; + methodHeader2 = methodHeader1; if (GIV(stackPointer) < GIV(stackLimit)) { - handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader1)); + handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); } -l9: /* end executeNewMethod */; +l22: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -68985,8 +68098,8 @@ primitiveExternalCall(void) sqInt moduleName; usqInt numSlots; usqInt numSlots1; + usqInt numSlots11; usqInt numSlots2; - usqInt numSlots3; sqInt val; @@ -68997,12 +68110,7 @@ primitiveExternalCall(void) val = 0; if (!((((GIV(newMethod) & (tagMask())) == 0) && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) - && ((((assert((((assert(isCompiledMethod(GIV(newMethod))), -/* begin fetchPointer:ofObject: */ -longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) & 1)), - ((((assert(isCompiledMethod(GIV(newMethod))), -/* begin fetchPointer:ofObject: */ -longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))) >> 1)) & AlternateHeaderNumLiteralsMask)) > 0) + && (((literalCountOf(GIV(newMethod))) > 0) && (((lit = literalofMethod(0, GIV(newMethod))), (((lit & (tagMask())) == 0) && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) @@ -69072,38 +68180,34 @@ longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shi /* begin lengthOf:format: */ fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots2 = byteAt(moduleName + 7); - if (numSlots2 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(moduleName - BaseHeaderSize); - } - else { - numSlots = numSlots2; - } + numSlots1 = byteAt(moduleName + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(moduleName - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { moduleLength = numSlots; - goto l13; + goto l14; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ moduleLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l13; + goto l14; } if (fmt >= (firstShortFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l13; + goto l14; } if (fmt >= (firstLongFormat())) { moduleLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l13; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { moduleLength = ((usqInt) numSlots) >> 1; - goto l13; + goto l14; } moduleLength = 0; - l13: /* end lengthOf:format: */; + l14: /* end lengthOf:format: */; } /* begin fetchPointer:ofObject: */ functionName = longAt((lit + BaseHeaderSize) + (1U << (shiftForWord()))); @@ -69115,38 +68219,34 @@ longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shi /* begin lengthOf:format: */ fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask()); /* begin numSlotsOfAny: */ - numSlots3 = byteAt(functionName + 7); - if (numSlots3 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots1 = longAt(functionName - BaseHeaderSize); - } - else { - numSlots1 = numSlots3; - } + numSlots11 = byteAt(functionName + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(functionName - BaseHeaderSize) + : numSlots11); if (fmt1 <= 5) { - functionLength = numSlots1; - goto l14; + functionLength = numSlots2; + goto l17; } if (fmt1 >= (firstByteFormat())) { /* bytes, including CompiledMethod */ - functionLength = (numSlots1 << (shiftForWord())) - (fmt1 & 7); - goto l14; + functionLength = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l17; } if (fmt1 >= (firstShortFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 1)) - (fmt1 & 3); - goto l14; + functionLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l17; } if (fmt1 >= (firstLongFormat())) { - functionLength = (numSlots1 << ((shiftForWord()) - 2)) - (fmt1 & 1); - goto l14; + functionLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l17; } if (fmt1 == (sixtyFourBitIndexableFormat())) { - functionLength = ((usqInt) numSlots1) >> 1; - goto l14; + functionLength = ((usqInt) numSlots2) >> 1; + goto l17; } functionLength = 0; -l14: /* end lengthOf:format: */; +l17: /* end lengthOf:format: */; addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&accessorDepth)); if (addr == 0) { index = -1; @@ -69211,20 +68311,18 @@ primitiveFindHandlerContext(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt handlerOrNilOrZero; char *sp; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(199, longAt(GIV(stackPointer)), GIV(nilObj)); if (handlerOrNilOrZero == 0) { @@ -69260,7 +68358,6 @@ primitiveFindNextUnwindContext(void) char *theFPAbove; sqInt theMethod; char *theSP; - char *theSP1; /* begin stackTop */ stopContext = longAt(GIV(stackPointer)); @@ -69280,14 +68377,13 @@ primitiveFindNextUnwindContext(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((calleeContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(calleeContext)))) { @@ -69314,11 +68410,11 @@ primitiveFindNextUnwindContext(void) theMethod = longAt(theFP1 + FoxMethod); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { if (theFP1 == theFPAbove) { - theSP1 = findSPOfon(theFP1, stackPageFor(theFP1)); + theSP = findSPOfon(theFP1, stackPageFor(theFP1)); } else { assert(!(isBaseFrame(theFPAbove))); - theSP1 = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord; + theSP = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord; } /* begin ensureFrameIsMarried:SP: */ @@ -69327,7 +68423,7 @@ primitiveFindNextUnwindContext(void) handlerOrNilOrZero = longAt(theFP1 + FoxThisContext); goto l7; } - handlerOrNilOrZero = marryFrameSP(theFP1, theSP1); + handlerOrNilOrZero = marryFrameSP(theFP1, theSP); goto l7; } } @@ -69444,20 +68540,18 @@ primitiveFullGC(void) sqInt integerVal1; char *sp; char *sp1; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin pop:thenPushInteger: */ integerVal = ((sqInt) (fullGC())); @@ -69492,20 +68586,18 @@ primitiveIncrementalGC(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt integerVal; char *sp; - char *theSP; /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); /* begin scavengingGC */ scavengingGCTenuringIf(TenureByAge); @@ -69559,56 +68651,51 @@ primitiveInstVarAt(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l7; + goto l10; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l7; + goto l10; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l7; + goto l10; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l7; + goto l10; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l7; + goto l10; } totalLength = 0; -l7: /* end lengthOf:format: */; +l10: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l9; + goto l11; } if (fmt < 2) { fixedFields = totalLength; - goto l9; + goto l11; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l9: /* end fixedFieldsOf:format:length: */; +l11: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -69624,19 +68711,19 @@ primitiveInstVarAt(void) if (fmt <= 5) { /* begin fetchPointer:ofObject: */ value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))); - goto l6; + goto l8; } if (fmt >= (firstByteFormat())) { value = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l6; + goto l8; } if (fmt >= (firstShortFormat())) { value = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))))))) << 1) | 1); - goto l6; + goto l8; } if (fmt == (sixtyFourBitIndexableFormat())) { value = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))))); - goto l6; + goto l8; } /* begin positive32BitIntegerFor: */ @@ -69645,7 +68732,7 @@ primitiveInstVarAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { value = ((integerValue << 1) | 1); - goto l15; + goto l8; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -69668,13 +68755,13 @@ primitiveInstVarAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l10; + goto l4; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l10: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -69685,10 +68772,9 @@ primitiveInstVarAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); value = newLargeInteger; - goto l15; + goto l8; - l15: /* end positive32BitIntegerFor: */; - l6: /* end subscript:with:format: */; + l8: /* end subscript:with:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); @@ -69736,7 +68822,8 @@ primitiveInstVarAtPut(void) } if ( # if IMMUTABILITY - ((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0 + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) # else /* IMMUTABILITY */ 0 # endif /* IMMUTABILITY */ @@ -69748,56 +68835,51 @@ primitiveInstVarAtPut(void) index = (index >> 1); /* begin baseHeader: */ hdr = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); - /* begin lengthOf:baseHeader:format: */ + /* begin lengthOf:format: */ numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if (fmt <= 5) { totalLength = numSlots; - goto l12; + goto l7; } if (fmt >= (firstByteFormat())) { /* bytes, including CompiledMethod */ totalLength = (numSlots << (shiftForWord())) - (fmt & 7); - goto l12; + goto l7; } if (fmt >= (firstShortFormat())) { totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); - goto l12; + goto l7; } if (fmt >= (firstLongFormat())) { totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); - goto l12; + goto l7; } if (fmt == (sixtyFourBitIndexableFormat())) { totalLength = ((usqInt) numSlots) >> 1; - goto l12; + goto l7; } totalLength = 0; -l12: /* end lengthOf:format: */; +l7: /* end lengthOf:format: */; /* begin fixedFieldsOf:format:length: */ if ((fmt >= (sixtyFourBitIndexableFormat())) || (fmt == 2)) { fixedFields = 0; - goto l15; + goto l8; } if (fmt < 2) { fixedFields = totalLength; - goto l15; + goto l8; } class = fetchClassOfNonImm(rcvr); /* begin fixedFieldsOfClassFormat: */ classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); -l15: /* end fixedFieldsOf:format:length: */; +l8: /* end fixedFieldsOf:format:length: */; if (!((index >= 1) && (index <= fixedFields))) { /* begin primitiveFailFor: */ @@ -69826,37 +68908,37 @@ primitiveInstVarAtPut(void) } } longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue); - goto l11; + goto l14; } if (fmt >= (firstByteFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeByte:ofObject:withValue: */ byteAtput((rcvr + BaseHeaderSize) + (index - 1), signedValueToStore); - goto l11; + goto l14; } if (fmt >= (firstShortFormat())) { if (!((newValue & 1))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } signedValueToStore = (newValue >> 1); if (!((signedValueToStore >= 0) && (signedValueToStore <= 0xFFFF))) { GIV(primFailCode) = PrimErrBadArgument; - goto l11; + goto l14; } /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), signedValueToStore); - goto l11; + goto l14; } if (fmt == (sixtyFourBitIndexableFormat())) { unsigned64BitValueToStore = positive64BitValueOf(newValue); @@ -69864,7 +68946,7 @@ primitiveInstVarAtPut(void) /* begin storeLong64:ofObject:withValue: */ long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))), unsigned64BitValueToStore); } - goto l11; + goto l14; } unsignedValueToStore = positive32BitValueOf(newValue); @@ -69872,7 +68954,7 @@ primitiveInstVarAtPut(void) /* begin storeLong32:ofObject:withValue: */ long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))), unsignedValueToStore); } - l11: /* end subscript:with:storing:format: */; + l14: /* end subscript:with:storing:format: */; } /* begin pop:thenPush: */ longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue); @@ -70011,7 +69093,6 @@ primitiveObjectPointsTo(void) char *sp4; char *sp5; sqInt thang; - char *theSP; sqInt trueOrFalse; /* begin stackTop */ @@ -70026,7 +69107,6 @@ primitiveObjectPointsTo(void) } /* begin baseHeader: */ header = long64At(rcvr); - /* begin formatOfHeader: */ fmt = (((unsigned sqLong)header) >> (formatShift())) & (formatMask()); if (fmt <= 5) { if ((fmt == (indexablePointersFormat())) @@ -70036,14 +69116,13 @@ primitiveObjectPointsTo(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(rcvr)))) { @@ -70062,13 +69141,9 @@ primitiveObjectPointsTo(void) /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); } } else { @@ -70175,7 +69250,7 @@ primitivePerform(void) if (primitiveFunctionPointer != 0) { if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { externalQuickPrimitiveResponse(); - goto l4; + goto l13; } /* begin slowPrimitiveResponse */ assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); @@ -70202,7 +69277,7 @@ primitivePerform(void) /* begin successful */ !GIV(primFailCode); if (!GIV(primFailCode)) { - goto l4; + goto l13; } } /* begin activateNewMethod */ @@ -70270,11 +69345,11 @@ primitivePerform(void) if (GIV(primFailCode) <= (numSlotsOf(table))) { /* begin fetchPointer:ofObject: */ errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); - goto l10; + goto l9; } } errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); - l10: /* end getErrorObjectFromPrimFailCode */; + l9: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(GIV(stackPointer), errorCode); } GIV(primFailCode) = 0; @@ -70284,7 +69359,7 @@ primitivePerform(void) if (GIV(stackPointer) < GIV(stackLimit)) { handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); } -l4: /* end executeNewMethod */; +l13: /* end executeNewMethod */; /* begin initPrimCall */ GIV(primFailCode) = 0; } @@ -70320,12 +69395,12 @@ primitivePin(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - if (((((usqInt) (longAt(obj))) >> 30) & 1) != 0) { + if (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0) { /* begin trueObject */ wasPinned = GIV(trueObj); if (boolean != wasPinned) { /* begin setIsPinnedOf:to: */ - longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << 30))); + longAtput(obj, (longAt(obj)) & ((unsigned int)~(1U << (pinnedBitShift())))); } } else { @@ -70563,7 +69638,6 @@ primitiveSlotAt(void) char *sp2; char *sp3; char *sp4; - char *theSP; sqInt value; sqInt valueWord; @@ -70581,34 +69655,28 @@ primitiveSlotAt(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { /* begin externalWriteBackHeadFramePointers */ assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); numLiveSlots = (stackPointerForMaybeMarriedContext(rcvr)) + CtxtTempFrameStart; if ((((usqInt)index)) < numLiveSlots) { @@ -70654,8 +69722,7 @@ primitiveSlotAt(void) return; } if (fmt >= (firstShortFormat())) { - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPushInteger: */ integerVal1 = ((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1)))))); @@ -70668,8 +69735,7 @@ primitiveSlotAt(void) return; } if (fmt == (sixtyFourBitIndexableFormat())) { - /* begin num64BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 3)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ oop = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 3))))); @@ -70682,7 +69748,6 @@ primitiveSlotAt(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin pop:thenPush: */ @@ -70691,7 +69756,7 @@ primitiveSlotAt(void) assert(!((hasSixtyFourBitImmediates()))); if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { oop1 = ((integerValue << 1) | 1); - goto l17; + goto l11; } /* begin eeInstantiateSmallClassIndex:format:numSlots: */ objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); @@ -70714,13 +69779,13 @@ primitiveSlotAt(void) if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); newLargeInteger = 0; - goto l12; + goto l9; } } long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); GIV(freeStart) += numBytes; newLargeInteger = newObj; - l12: /* end allocateSmallNewSpaceSlots:format:classIndex: */; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ /* eem 4/28/2016 questionable; they should never be read */ @@ -70731,9 +69796,9 @@ primitiveSlotAt(void) long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); oop1 = newLargeInteger; - goto l17; + goto l11; - l17: /* end positive32BitIntegerFor: */; + l11: /* end positive32BitIntegerFor: */; longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop1); GIV(stackPointer) = sp4; return; @@ -70793,8 +69858,9 @@ primitiveSlotAtPut(void) } # if IMMUTABILITY + /* begin isOopImmutable: */ badRcvr = (rcvr & (tagMask())) - || (((((usqInt) (longAt(rcvr))) >> 23) & 1) != 0); + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); # else /* IMMUTABILITY */ /* begin isImmediate: */ @@ -70807,20 +69873,15 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadReceiver); return; } - /* begin formatOf: */ fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); index = ((index >> 1)) - 1; if (fmt <= 5) { /* begin numSlotsOf: */ assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); numSlots1 = byteAt(rcvr + 7); - if (numSlots1 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots = longAt(rcvr - BaseHeaderSize); - } - else { - numSlots = numSlots1; - } + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); if ((((usqInt)index)) < numSlots) { if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) { externalInstVarofContextput(index, rcvr, newValue); @@ -70860,10 +69921,10 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = null; - goto l21; + goto l16; } value = value1; - goto l21; + goto l16; } if (newValue & (tagMask())) { /* begin primitiveFail */ @@ -70871,23 +69932,23 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(newValue))); /* begin classIndexOf: */ ccIndex = (longAt(newValue)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l20; + goto l15; -l20: /* end isClassOfNonImm:equalTo:compactClassIndex: */; +l15: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } /* begin numBytesOfBytes: */ fmt2 = (((usqInt) (longAt(newValue))) >> (formatShift())) & (formatMask()); @@ -70899,18 +69960,18 @@ primitiveSlotAtPut(void) GIV(primFailCode) = 1; } value = 0; - goto l21; + goto l16; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((newValue + BaseHeaderSize) + (0U << 3)))); - goto l21; + goto l16; } else { value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((newValue + BaseHeaderSize) + (0U << 2)))))); - goto l21; + goto l16; } -l21: /* end positiveMachineIntegerValueOf: */; +l16: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { GIV(primFailCode) = PrimErrBadArgument; return; @@ -70948,8 +70009,7 @@ primitiveSlotAtPut(void) (GIV(primFailCode) = PrimErrBadArgument); return; } - /* begin num16BitUnitsOf: */ - numSlots = ((sqInt) (((usqInt) (numBytesOf(rcvr))) >> 1)); + numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1; if ((((usqInt)index)) < numSlots) { /* begin storeShort16:ofObject:withValue: */ shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value); @@ -70963,7 +70023,6 @@ primitiveSlotAtPut(void) return; } if (fmt >= (firstLongFormat())) { - /* begin num32BitUnitsOf: */ numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2; if ((((usqInt)index)) < numSlots) { /* begin storeLong32:ofObject:withValue: */ @@ -71001,7 +70060,6 @@ primitiveStoreStackp(void) sqInt stackp; char *theFP; StackPage *thePage; - char *theSP; sqInt valuePointer; /* begin stackValue: */ @@ -71011,7 +70069,7 @@ primitiveStoreStackp(void) /* begin checkedIntegerValueOf: */ if ((integerPointer & 1)) { newStackp = (integerPointer >> 1); - goto l10; + goto l8; } else { /* begin primitiveFail */ @@ -71019,9 +70077,9 @@ primitiveStoreStackp(void) GIV(primFailCode) = 1; } newStackp = 0; - goto l10; + goto l8; } -l10: /* end stackIntegerValue: */; +l8: /* end stackIntegerValue: */; if (!((!GIV(primFailCode)) && (((newStackp >= 0) && (newStackp <= ((numSlotsOf(ctxt)) - CtxtTempFrameStart)))))) { /* begin primitiveFail */ @@ -71034,14 +70092,13 @@ primitiveStoreStackp(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((((longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) && (!(isWidowedContext(ctxt)))) { @@ -71075,11 +70132,11 @@ primitiveStoreStackp(void) sp = longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); if (!((sp & 1))) { stackp = 0; - goto l8; + goto l10; } assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(ctxt))); stackp = (sp >> 1); -l8: /* end fetchStackPointerOf: */; +l10: /* end fetchStackPointerOf: */; for (i = (stackp + 1); i <= newStackp; i += 1) { /* begin storePointerUnchecked:ofObject:withValue: */ valuePointer = GIV(nilObj); @@ -71139,7 +70196,6 @@ primitiveTerminateTo(void) char *theFP; char *theFP1; StackPage *thePage; - char *theSP; sqInt thisCtx; sqInt valuePointer; sqInt valuePointer1; @@ -71171,14 +70227,13 @@ primitiveTerminateTo(void) assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); assert(GIV(stackPage) == (mostRecentlyUsedPage())); /* begin setHeadFP:andSP:inPage: */ - theSP = GIV(stackPointer); - assert(theSP < GIV(framePointer)); - assert((theSP < ((GIV(stackPage)->baseAddress))) - && (theSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); (GIV(stackPage)->headFP = GIV(framePointer)); - (GIV(stackPage)->headSP = theSP); + (GIV(stackPage)->headSP = GIV(stackPointer)); assert(pageListIsWellFormed()); if ((aContextOrNil != GIV(nilObj)) && ((((longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) @@ -71212,18 +70267,18 @@ primitiveTerminateTo(void) fp = (pageToStopOn->headFP); if (fp == contextsFP) { frameAbove = 0; - goto l16; + goto l4; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == contextsFP) { frameAbove = fp; - goto l16; + goto l4; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l16: /* end findFrameAbove:inPage: */; + l4: /* end findFrameAbove:inPage: */; contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)))); assert(!(isBaseFrame(frameAbove))); newSP = (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord; @@ -71301,18 +70356,18 @@ primitiveTerminateTo(void) fp1 = (thePage->headFP); if (fp1 == theFP) { frameAbove = 0; - goto l25; + goto l16; } while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) { if (callerFP1 == theFP) { frameAbove = fp1; - goto l25; + goto l16; } fp1 = callerFP1; } error("did not find theFP in stack page"); frameAbove = 0; - l25: /* end findFrameAbove:inPage: */; + l16: /* end findFrameAbove:inPage: */; assert(frameAbove != 0); /* May cause a GC!! May also reclaim aContextOrNil's page, hence... */ @@ -71343,18 +70398,18 @@ primitiveTerminateTo(void) fp2 = (thePage->headFP); if (fp2 == contextsFP) { frameAbove = 0; - goto l26; + goto l17; } while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) { if (callerFP2 == contextsFP) { frameAbove = fp2; - goto l26; + goto l17; } fp2 = callerFP2; } error("did not find theFP in stack page"); frameAbove = 0; - l26: /* end findFrameAbove:inPage: */; + l17: /* end findFrameAbove:inPage: */; if (frameAbove != 0) { contextsSP = ((assert(!(isBaseFrame(frameAbove))), (frameAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((frameAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord)) - BytesPerWord; @@ -72337,11 +71392,11 @@ GIV(statScavengeGCUsecs))) + 500) / 1000) << 1) | 1); if ((((usqInt)arg)) > 0x1F) { /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; - goto l79; + goto l70; } GIV(preemptionYields) = (arg & 4) == 0; GIV(newFinalization) = (arg & 16) != 0; - l79: /* end setCogVMFlags: */; + l70: /* end setCogVMFlags: */; } } if (index == 49) { @@ -72444,6 +71499,7 @@ pruneStackstackp(sqInt stack, sqInt stackp) char *theFP; char *theFPAbove; StackPage *thePage; + char *theSP; sqInt theStack; sqInt valuePointer; @@ -72489,27 +71545,29 @@ pruneStackstackp(sqInt stack, sqInt stackp) fp = (thePage->headFP); if (fp == theFP) { theFPAbove = 0; - goto l10; + goto l6; } while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { if (callerFP == theFP) { theFPAbove = fp; - goto l10; + goto l6; } fp = callerFP; } error("did not find theFP in stack page"); theFPAbove = 0; - l10: /* end findFrameAbove:inPage: */; + l6: /* end findFrameAbove:inPage: */; /* begin ensureFrameIsMarried:SP: */ + assert(!(isBaseFrame(theFPAbove))); + theSP = (theFPAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFPAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord; + if ((byteAt((theFP + FoxFrameFlags) + 2)) != 0) { assert(isContext(frameContext(theFP))); objOrFP = longAt(theFP + FoxThisContext); - goto l11; + goto l7; } - objOrFP = marryFrameSP(theFP, (assert(!(isBaseFrame(theFPAbove))), - (theFPAbove + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)((byteAt((theFPAbove + FoxFrameFlags) + 1))) << (shiftForWord())))))) + BytesPerWord)); - l11: /* end ensureFrameIsMarried:SP: */; + objOrFP = marryFrameSP(theFP, theSP); + l7: /* end ensureFrameIsMarried:SP: */; /* begin topRemappableOop */ theStack = GIV(remapBuffer)[GIV(remapBufferCount)]; /* begin storePointer:ofObject:withValue: */ @@ -72551,10 +71609,10 @@ unmarkAfterPathTo(void) usqInt numSlots1; usqInt numSlots11; usqInt numSlots12; - usqInt numSlots13; usqInt numSlots2; usqInt numSlots3; usqInt numSlots4; + usqInt numSlots5; sqInt obj; sqInt objOop; sqInt objOop1; @@ -72575,7 +71633,7 @@ unmarkAfterPathTo(void) assert((objOop1 % (allocationUnit())) == 0); if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break; assert((long64At(objOop1)) != 0); - if (((((usqInt) (longAt(objOop1 + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop1 + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop1, 0); } @@ -72589,32 +71647,28 @@ unmarkAfterPathTo(void) prevPrevObj1 = prevObj1; prevObj1 = objOop1; /* begin objectAfter:limit: */ - numSlots11 = byteAt(objOop1 + 7); - if (numSlots11 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots2 = longAt(objOop1 - BaseHeaderSize); - } - else { - numSlots2 = numSlots11; - } - if (numSlots2 == 0) { + numSlots12 = byteAt(objOop1 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { /* begin allocationUnit */ - slotBytes = ((sqInt) 8); + slotBytes2 = ((sqInt) 8); } else { - slotBytes = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); } - followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes; + followingWordAddress2 = (objOop1 + BaseHeaderSize) + slotBytes2; if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { objOop1 = GIV(endOfMemory); - goto l3; + goto l13; } flag("endianness"); followingWord2 = longAt(followingWordAddress2 + 4); objOop1 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress2 + BaseHeaderSize : followingWordAddress2); - l3: /* end objectAfter:limit: */; + l13: /* end objectAfter:limit: */; } /* begin allNewSpaceEntitiesDo: */ @@ -72624,13 +71678,13 @@ unmarkAfterPathTo(void) assert((((pastSpace()).start)) < (((eden()).start))); /* begin objectStartingAt: */ address = ((pastSpace()).start); - numSlots = byteAt(address + 7); - objOop = (numSlots == (numSlotsMask()) + numSlots3 = byteAt(address + 7); + objOop = (numSlots3 == (numSlotsMask()) ? address + BaseHeaderSize : address); limit = GIV(pastSpaceStart); while (oopisLessThan(objOop, limit)) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -72644,41 +71698,37 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots12 = byteAt(objOop + 7); - if (numSlots12 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots3 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots3 = numSlots12; - } - if (numSlots3 == 0) { + numSlots1 = byteAt(objOop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { /* begin allocationUnit */ - slotBytes1 = ((sqInt) 8); + slotBytes = ((sqInt) 8); } else { - slotBytes1 = (numSlots3 + (numSlots3 & 1)) << (shiftForWord()); + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); } - followingWordAddress = (objOop + BaseHeaderSize) + slotBytes1; + followingWordAddress = (objOop + BaseHeaderSize) + slotBytes; if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { objOop = limit; - goto l1; + goto l4; } flag("endianness"); followingWord = longAt(followingWordAddress + 4); objOop = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress + BaseHeaderSize : followingWordAddress); - l1: /* end objectAfter:limit: */; + l4: /* end objectAfter:limit: */; } /* begin objectStartingAt: */ address1 = ((eden()).start); - numSlots1 = byteAt(address1 + 7); - objOop = (numSlots1 == (numSlotsMask()) + numSlots4 = byteAt(address1 + 7); + objOop = (numSlots4 == (numSlotsMask()) ? address1 + BaseHeaderSize : address1); while (oopisLessThan(objOop, GIV(freeStart))) { - if (((((usqInt) (longAt(objOop + 4))) >> 23) & 1) != 0) { + if (((((usqInt) (longAt(objOop + 4))) >> (markedBitHalfShift())) & 1) != 0) { if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) { setIsMarkedOfto(objOop, 0); } @@ -72692,32 +71742,28 @@ unmarkAfterPathTo(void) prevPrevObj = prevObj; prevObj = objOop; /* begin objectAfter:limit: */ - numSlots13 = byteAt(objOop + 7); - if (numSlots13 == (numSlotsMask())) { - /* begin rawOverflowSlotsOf: */ - numSlots4 = longAt(objOop - BaseHeaderSize); - } - else { - numSlots4 = numSlots13; - } - if (numSlots4 == 0) { + numSlots11 = byteAt(objOop + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { /* begin allocationUnit */ - slotBytes2 = ((sqInt) 8); + slotBytes1 = ((sqInt) 8); } else { - slotBytes2 = (numSlots4 + (numSlots4 & 1)) << (shiftForWord()); + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); } - followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes2; + followingWordAddress1 = (objOop + BaseHeaderSize) + slotBytes1; if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { objOop = GIV(freeStart); - goto l2; + goto l8; } flag("endianness"); followingWord1 = longAt(followingWordAddress1 + 4); objOop = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) ? followingWordAddress1 + BaseHeaderSize : followingWordAddress1); - l2: /* end objectAfter:limit: */; + l8: /* end objectAfter:limit: */; } } diff --git a/nsspurstacksrc/vm/interp.h b/nsspurstacksrc/vm/interp.h index ae07a3bf81..38dd98b715 100644 --- a/nsspurstacksrc/vm/interp.h +++ b/nsspurstacksrc/vm/interp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1992 uuid: 6feb3008-c996-4d53-b572-55c31a5b58dc + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ #define VM_PROXY_MAJOR 1 diff --git a/nsspurstacksrc/vm/vmCallback.h b/nsspurstacksrc/vm/vmCallback.h index 48d07f100f..c8ed21d69e 100644 --- a/nsspurstacksrc/vm/vmCallback.h +++ b/nsspurstacksrc/vm/vmCallback.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1992 uuid: 6feb3008-c996-4d53-b572-55c31a5b58dc + CCodeGeneratorGlobalStructure VMMaker.oscog-rsf.2077 uuid: d009eb6f-01c9-4fb4-b022-2f73c6e8ca5c */ #define VM_CALLBACK_INC 1 diff --git a/platforms/unix/vm/sqConfig.h b/platforms/unix/vm/sqConfig.h index a248eff649..fe0ee090e1 100644 --- a/platforms/unix/vm/sqConfig.h +++ b/platforms/unix/vm/sqConfig.h @@ -25,7 +25,7 @@ * functions that have been optimized to use register arguments. */ # if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386) -# define PlatformNoDbgRegParms __attribute__ ((regparm (0))) +/*# define PlatformNoDbgRegParms __attribute__ ((regparm (0)))*/ # endif # define NeverInline __attribute__ ((noinline)) #endif diff --git a/specs/lowcode.xml b/specs/lowcode.xml index 102e70f474..deb5327c2e 100644 --- a/specs/lowcode.xml +++ b/specs/lowcode.xml @@ -1957,7 +1957,7 @@ self ssPushNativeRegister: value. - result := self cCoerce: value to: 'uintptr_t'. + result := self cCoerce: (self cCoerce: value to: 'uintptr_t') to: 'char*'. diff --git a/spurlowcodesrc/examplePlugins.ext b/spurlowcodesrc/examplePlugins.ext new file mode 100644 index 0000000000..699ebbf2fb --- /dev/null +++ b/spurlowcodesrc/examplePlugins.ext @@ -0,0 +1,2 @@ +# Automatically generated makefile include for external plugins +EXTERNAL_PLUGINS = diff --git a/spurlowcodesrc/examplePlugins.int b/spurlowcodesrc/examplePlugins.int new file mode 100644 index 0000000000..318fde7b5c --- /dev/null +++ b/spurlowcodesrc/examplePlugins.int @@ -0,0 +1,2 @@ +# Automatically generated makefile include for internal plugins +INTERNAL_PLUGINS = diff --git a/spurlowcodesrc/vm/cogit.c b/spurlowcodesrc/vm/cogit.c new file mode 100644 index 0000000000..048400166a --- /dev/null +++ b/spurlowcodesrc/vm/cogit.c @@ -0,0 +1,20 @@ +/* Automatically generated by + Cogit * VMMaker.oscog-eem.2033 uuid: dacd8710-6751-4d27-ba92-6653560eb15a + */ + +#if defined(__ARM_ARCH__) || defined(__arm__) || defined(__arm32__) || defined(ARM32) || defined(_M_ARM) + +# include "cogitARMv5.c" + +#elif defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386) + +# include "cogitIA32.c" + +#elif defined(__MIPSEL__) + +# include "cogitMIPSEL.c" + +#else +# error As yet no Cogit implementation appears to exist for your platform. +# error Consider implementing it, starting by adding a subclass of CogAbstractInstruction. +#endif diff --git a/spurlowcodesrc/vm/cogit.h b/spurlowcodesrc/vm/cogit.h new file mode 100644 index 0000000000..276413f668 --- /dev/null +++ b/spurlowcodesrc/vm/cogit.h @@ -0,0 +1,163 @@ +/* Automatically generated by + CCodeGenerator VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ + + +/*** Function Prototypes ***/ + + +#if !PRODUCTION && defined(PlatformNoDbgRegParms) +# define NoDbgRegParms PlatformNoDbgRegParms +#endif + +#if !defined(NoDbgRegParms) +# define NoDbgRegParms /*empty*/ +#endif + + + +#if !defined(NeverInline) +# define NeverInline /*empty*/ +#endif + +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 void ceFree(void*pointer); +extern void* ceMalloc(size_t size); +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 CogMethod * cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied); +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 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 void printCogMethodFor(void *address); +extern void printPCMapPairsFor(CogMethod *cogMethod); +extern void printTrampolineTable(void); +extern sqInt recordPrimTraceFunc(void); +extern void setBreakMethod(sqInt anObj); +extern void setPostCompileHook(void (*aFunction)(CogMethod *)); +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 methodsCompiledToMachineCodeInto(sqInt arrayObj); +extern sqInt numMethods(void); +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 sqInt mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj); +extern void recordCallOffsetIn(CogMethod *cogMethod); +extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)); +extern void voidCogCompiledCode(void); +extern void callCogCodePopReceiverArg0Regs(void); +extern void callCogCodePopReceiverArg1Arg0Regs(void); + + +/*** Global Variables ***/ +VM_EXPORT sqInt blockNoContextSwitchOffset; +VM_EXPORT sqInt breakPC; +VM_EXPORT void * CFramePointer; +VM_EXPORT void * CStackPointer; +VM_EXPORT sqInt cbEntryOffset; +VM_EXPORT sqInt cbNoSwitchEntryOffset; +VM_EXPORT sqInt ceBaseFrameReturnTrampoline; +VM_EXPORT void (*ceCall0ArgsPIC)(void); +VM_EXPORT void (*ceCall1ArgsPIC)(void); +VM_EXPORT void (*ceCall2ArgsPIC)(void); +VM_EXPORT void (*ceCallCogCodePopReceiverAndClassRegs)(void); +VM_EXPORT void (*ceCallCogCodePopReceiverArg0Regs)(void); +VM_EXPORT void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void); +VM_EXPORT void (*ceCallCogCodePopReceiverReg)(void); +VM_EXPORT sqInt ceCannotResumeTrampoline; +VM_EXPORT void (*ceCaptureCStackPointers)(void); +VM_EXPORT sqInt ceCheckForInterruptTrampoline; +VM_EXPORT void (*ceEnterCogCodePopReceiverReg)(void); +VM_EXPORT usqIntptr_t (*ceGetFP)(void); +VM_EXPORT usqIntptr_t (*ceGetSP)(void); +VM_EXPORT sqInt ceReturnToInterpreterTrampoline; +VM_EXPORT usqIntptr_t (*ceTryLockVMOwner)(void); +VM_EXPORT void (*ceUnlockVMOwner)(void); +VM_EXPORT sqInt cFramePointerInUse; +VM_EXPORT sqInt cmEntryOffset; +VM_EXPORT sqInt cmNoCheckEntryOffset; +VM_EXPORT usqIntptr_t debugPrimCallStackOffset; +VM_EXPORT sqInt missOffset; +VM_EXPORT void (*realCECallCogCodePopReceiverAndClassRegs)(void); +VM_EXPORT void (*realCECallCogCodePopReceiverArg0Regs)(void); +VM_EXPORT void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void); +VM_EXPORT void (*realCECallCogCodePopReceiverReg)(void); +VM_EXPORT void (*realCEEnterCogCodePopReceiverReg)(void); +VM_EXPORT int traceFlags ; +VM_EXPORT sqInt traceStores; + + +/*** Macros ***/ +#define blockAlignment(self) 8 +#define breakOnImplicitReceiver() (traceFlags & 64) +#define ceBaseFrameReturnPC() ceBaseFrameReturnTrampoline +#define ceCannotResumePC() ((usqInt)ceCannotResumeTrampoline) +#define ceReturnToInterpreterPC() ((usqInt)ceReturnToInterpreterTrampoline) +#define entryOffset() cmEntryOffset +#define getCFramePointer() CFramePointer +#define getCStackPointer() CStackPointer +#define interpretOffset() missOffset +#define noCheckEntryOffset() cmNoCheckEntryOffset +#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset +#define printOnTrace() (traceFlags & 1) +#define recordBlockTrace() (traceFlags & 4) +#define recordEventTrace() (traceFlags & 16) +#define recordOverflowTrace() (traceFlags & 32) +#define recordPrimTrace() (traceFlags & 8) +#define recordSendTrace() (traceFlags & 2) +#define setCFramePointer(theFP) (CFramePointer = (void *)(theFP)) +#define setCStackPointer(theSP) (CStackPointer = (void *)(theSP)) +#define tryLockVMOwner() (ceTryLockVMOwner() != 0) +#define unlockVMOwner() ceUnlockVMOwner() +#define fullBlockEntryOffset() cbEntryOffset +#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset + diff --git a/spurlowcodesrc/vm/cogitARMv5.c b/spurlowcodesrc/vm/cogitARMv5.c new file mode 100644 index 0000000000..1d58a38deb --- /dev/null +++ b/spurlowcodesrc/vm/cogitARMv5.c @@ -0,0 +1,43929 @@ +/* Automatically generated by + CCodeGenerator VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + from + StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a " __DATE__ ; +char *__cogitBuildInfo = __buildInfo; + + + +#include +#include "sq.h" +#include "sqCogStackAlignment.h" +#include "dispdbg.h" +#include "cogmethod.h" +#if COGMTVM +#include "cointerpmt.h" +#else +#include "cointerp.h" +#endif +#include "cogit.h" + + +/*** Constants ***/ +#define AddCqR 105 +#define AddCwR 113 +#define AddcCqR 119 +#define AddcRR 118 +#define AddOpcode 4 +#define AddRdRd 123 +#define AddRR 99 +#define AddRsRs 130 +#define AL 14 +#define AlignmentNops 3 +#define AltBlockCreationBytecodeSize 3 +#define AltFirstSpecialSelector 96 +#define AltNumSpecialSelectors 32 +#define AndCqR 107 +#define AndCqRR 121 +#define AndCwR 115 +#define AndOpcode 0 +#define AndRR 101 +#define AnnotationShift 5 +#define Arg0Reg 3 +#define Arg1Reg 4 +#define ArithmeticShiftRightCqR 90 +#define ArithmeticShiftRightRR 91 +#define BadRegisterSet 1 +#define BicOpcode 14 +#define BlockCreationBytecodeSize 4 +#define BytecodeSetHasDirectedSuperSend 1 +#define CArg0Reg 0 +#define CArg1Reg 1 +#define CArg2Reg 2 +#define CArg3Reg 3 +#define Call 6 +#define CallerSavedRegisterMask 0x120C +#define CallFull 7 +#define CallR 8 +#define CC 3 +#if !defined(CheckRememberedInTrampoline) /* Allow this to be overridden on the compiler command line */ +# define CheckRememberedInTrampoline 0 +#endif +#define ClassArrayCompactIndex 51 +#define ClassBlockClosureCompactIndex 37 +#define ClassFloatCompactIndex 34 +#define ClassFullBlockClosureCompactIndex 38 +#define ClassLargeNegativeInteger 42 +#define ClassLargePositiveInteger 13 +#define ClassMethodContextCompactIndex 36 +#define ClassReg 2 +#define ClosureFirstCopiedValueIndex 3 +#define ClosureIndex 4 +#define ClosureNumArgsIndex 2 +#define ClosureOuterContextIndex 0 +#define ClosureStartPCIndex 1 +#define CMBlock 3 +#define CMClosedPIC 4 +#define CMFree 1 +#define CMMaxUsageCount 7 +#define CMMethod 2 +#define CMOpenPIC 5 +#define CMPSMULL 153 +#define CmpC32R 112 +#define CmpCqR 104 +#define CmpCwR 111 +#define CmpNotOpcode 11 +#define CmpOpcode 10 +#define CmpRdRd 122 +#define CmpRR 98 +#define CmpRsRs 129 +#define CompletePrimitive 4 +#define ConcreteIPReg 12 +#define ConcreteVarBaseReg 10 +#define ConstZero 1 +#define ConvertRdR 137 +#define ConvertRdRs 139 +#define ConvertRRd 136 +#define ConvertRRs 141 +#define ConvertRsR 140 +#define ConvertRsRd 138 +#define CS 2 +#define Debug DEBUGVM +#define DisplacementMask 0x1F +#define DisplacementX2N 0 +#define DivRdRd 126 +#define DivRsRs 133 +#define DPFPReg0 0 +#define DPFPReg1 1 +#define DPFPReg2 2 +#define DPFPReg3 3 +#define DPFPReg4 4 +#define DPFPReg5 5 +#define DPFPReg6 6 +#define DPFPReg7 7 +#define EncounteredUnknownBytecode -6 +#define EQ 0 +#define Extra0Reg 7 +#define Extra1Reg 8 +#define Extra2Reg 9 +#define Fill32 4 +#define FirstAnnotation 64 +#define FirstJump 12 +#define FirstSpecialSelector 176 +#define FoxCallerSavedIP 4 +#define FoxMethod -4 +#define FoxMFReceiver -12 +#define FoxSavedFP 0 +#define FoxThisContext -8 +#define FPReg 11 +#define FullClosureCompiledBlockIndex 1 +#define FullClosureFirstCopiedValueIndex 4 +#define FullClosureReceiverIndex 3 +#define GCModeBecome 8 +#define GCModeFull 1 +#define GCModeNewSpace 2 +#define GE 10 +#define GT 12 +#define HasBytecodePC 5 +#define HeaderIndex 0 +#define HI 8 +#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ +# define IMMUTABILITY 0 +#endif +#define InFullBlock 2 +#define InstanceSpecificationIndex 2 +#define InstructionPointerIndex 1 +#define InsufficientCodeSpace -2 +#define InVanillaBlock 1 +#define IsAbsPCReference 3 +#define IsAnnotationExtension 1 +#define IsDirectedSuperSend 9 +#define IsDisplacementX2N 0 +#define IsNSDynamicSuperSend null +#define IsNSImplicitReceiverSend null +#define IsNSSelfSend null +#define IsNSSendCall null +#define IsObjectReference 2 +#define IsRelativeCall 4 +#define IsSendCall 7 +#define IsSuperSend 8 +#define Jump 16 +#define JumpAbove 31 +#define JumpAboveOrEqual 30 +#define JumpBelow 29 +#define JumpBelowOrEqual 32 +#define JumpCarry 23 +#define JumpFPEqual 33 +#define JumpFPGreater 37 +#define JumpFPGreaterOrEqual 38 +#define JumpFPLess 35 +#define JumpFPLessOrEqual 36 +#define JumpFPNotEqual 34 +#define JumpFPOrdered 39 +#define JumpFPUnordered 40 +#define JumpFull 12 +#define JumpGreater 27 +#define JumpGreaterOrEqual 26 +#define JumpLess 25 +#define JumpLessOrEqual 28 +#define JumpLong 13 +#define JumpLongNonZero 15 +#define JumpLongZero 14 +#define JumpNegative 19 +#define JumpNoCarry 24 +#define JumpNonNegative 20 +#define JumpNonZero 18 +#define JumpNoOverflow 22 +#define JumpOverflow 21 +#define JumpR 10 +#define JumpZero 17 +#define Label 1 +#define LargeContextSlots 62 +#define LastJump 40 +#define LE 13 +#define LinkReg 14 +#define Literal 2 +#define LiteralStart 1 +#define LoadEffectiveAddressMwrR 86 +#define LogicalShiftLeftCqR 94 +#define LogicalShiftLeftRR 95 +#define LogicalShiftRightCqR 92 +#define LogicalShiftRightRR 93 +#define LowcodeContextMark 60 +#define LowcodeVM 1 +#define LR 14 +#define LS 9 +#define LT 11 +#define MapEnd 0 +#define MaxCompiledPrimitiveIndex 222 +#define MaxCPICCases 6 +#define MaxMethodSize 65535 +#define MaxNegativeErrorCode -8 +#define MaxNumArgs 15 +#define MaxStackAllocSize 1572864 +#define MaxStackCheckOffset 0xFFF +#define MaxX2NDisplacement 992 +#define MethodCacheClass 2 +#define MethodCacheMask 0xFFC +#define MethodCacheMethod 3 +#define MethodCacheSelector 1 +#define MethodIndex 3 +#define MethodTooBig -4 +#define MFMethodFlagHasContextFlag 1 +#define MFMethodFlagIsBlockFlag 2 +#define MI 4 +#define MoveAbR 46 +#define MoveAwR 42 +#define MoveC32R 71 +#define MoveCqR 69 +#define MoveCwR 70 +#define MoveM16rR 57 +#define MoveM32rR 61 +#define MoveM32rRs 79 +#define MoveM64rRd 76 +#define MoveM8rR 54 +#define MoveMbrR 65 +#define MoveMwrR 48 +#define MoveNotOpcode 15 +#define MoveOpcode 13 +#define MoveRAb 47 +#define MoveRAw 44 +#define MoveRdM64r 77 +#define MoveRdRd 75 +#define MoveRM16r 58 +#define MoveRM32r 62 +#define MoveRM8r 56 +#define MoveRMbr 66 +#define MoveRMwr 49 +#define MoveRR 41 +#define MoveRsM32r 80 +#define MoveRsRs 78 +#define MoveRXbrR 68 +#define MoveRXwrR 51 +#define MoveXbrRR 67 +#define MoveXwrRR 50 +#define MSR 147 +#define MULTIPLEBYTECODESETS 1 +#define MulRdRd 125 +#define MulRsRs 132 +#define NE 1 +#define NeedsMergeFixupFlag 2 +#define NeedsNonMergeFixupFlag 1 +#define NegateR 88 +#define NewspeakVM 0 +#define Nop 5 +#define NoReg -1 +#define NotFullyInitialized -1 +#define NotR 89 +#define NumObjRefsInRuntime 0 +#define NumOopsPerNSC 6 +#define NumSendTrampolines 4 +#define NumSpecialSelectors 32 +#define NumStoreTrampolines 5 +#define NumTrampolines (IMMUTABILITY ? 82 : 77) +#define OrCqR 108 +#define OrCwR 116 +#define OrOpcode 12 +#define OrRR 102 +#define PC 15 +#define PCReg 15 +#define PL 5 +#define PopLDM 149 +#define PopR 81 +#define PrefetchAw 85 +#define PrimCallCollectsProfileSamples 8 +#define PrimCallDoNotJIT 32 +#define PrimCallMayCallBack 4 +#define PrimCallNeedsNewMethod 1 +#define PrimCallNeedsPrimitiveFunction 2 +#define PrimErrNoMemory 9 +#define PrimErrWritePastObject 17 +#define PushCq 83 +#define PushCw 84 +#define PushR 82 +#define PushSTM 150 +#define R0 0 +#define ReceiverIndex 5 +#define ReceiverResultReg 5 +#define RetN 9 +#define RISCTempReg 12 +#define RsbOpcode 3 +#define SelectorCannotInterpret 34 +#define SelectorDoesNotUnderstand 20 +#define SenderIndex 0 +#define SendNumArgsReg 6 +#define ShouldNotJIT -8 +#define SignExtend16RR 143 +#define SignExtend8RR 142 +#define SistaV1BytecodeSet 1 +#define SistaVM 1 +#define SMULL 146 +#define SmallContextSlots 22 +#define SP 13 +#define SPReg 13 +#define SPURVM 1 +#define SqrtRd 127 +#define SqrtRs 134 +#define SSBaseOffset 1 +#define SSConstant 2 +#define SSConstantFloat32 15 +#define SSConstantFloat64 16 +#define SSConstantInt32 13 +#define SSConstantInt64 14 +#define SSConstantNativePointer 17 +#define SSNativeRegister 5 +#define SSRegister 3 +#define SSRegisterDoubleFloat 7 +#define SSRegisterPair 6 +#define SSRegisterSingleFloat 8 +#define SSSpill 4 +#define SSSpillFloat32 11 +#define SSSpillFloat64 12 +#define SSSpillInt64 10 +#define SSSpillNative 9 +#define StackPointerIndex 2 +#define Stop 11 +#define SubbRR 120 +#define SubCqR 106 +#define SubCwR 114 +#define SubOpcode 2 +#define SubRdRd 124 +#define SubRR 100 +#define SubRsRs 131 +#define TempReg 0 +#define TstCqR 109 +#define TstOpcode 8 +#define UnfailingPrimitive 3 +#define UnimplementedPrimitive -7 +#define UnknownSimStackPtrFlag -2 +#define ValueIndex 1 +#define VarBaseReg 10 +#define VC 7 +#define VS 6 +#define XorCqR 110 +#define XorCwR 117 +#define XorOpcode 1 +#define XorRdRd 128 +#define XorRR 103 +#define XorRsRs 135 +#define YoungSelectorInPIC -5 +#define ZeroExtend16RR 145 +#define ZeroExtend8RR 144 + +typedef struct _AbstractInstruction { + unsigned char opcode; + unsigned char machineCodeSize; + unsigned char maxSize; + unsigned char annotation; + unsigned char conditionOrNil; + usqIntptr_t operands [3]; + usqIntptr_t address; + struct _AbstractInstruction *dependent; + usqIntptr_t machineCode [5]; + } AbstractInstruction; + +#define CogOutOfLineLiteralsARMCompiler AbstractInstruction +#define CogARMCompiler AbstractInstruction +#define CogAbstractInstruction AbstractInstruction + + +typedef struct { + AbstractInstruction *fakeHeader; + AbstractInstruction *fillInstruction; + sqInt numArgs; + sqInt numCopied; + sqInt numInitialNils; + sqInt startpc; + AbstractInstruction *entryLabel; + AbstractInstruction *stackCheckLabel; + sqInt span; + sqInt hasInstVarRef; + } BlockStart; + +#define CogBlockStart BlockStart + + +typedef struct _BytecodeDescriptor { + sqInt (*generator )(void); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); + signed char stackDelta; + unsigned char opcode; + unsigned char numBytes; + unsigned isBranchTrue : 1; + unsigned isBranchFalse : 1; + unsigned isReturn : 1; + unsigned isBlockCreation : 1; + unsigned isMapped : 1; + unsigned isMappedInBlock : 1; + unsigned isExtension : 1; + unsigned isInstVarRef : 1; + unsigned is1ByteInstVarStore : 1; + unsigned isCallPrimitive : 1; + } BytecodeDescriptor; + +#define CogBytecodeDescriptor BytecodeDescriptor + + +typedef struct { + sqInt (*primitiveGenerator )(void); + sqInt primNumArgs; + } PrimitiveDescriptor; + +#define CogPrimitiveDescriptor PrimitiveDescriptor + + +typedef struct { + char type; + char spilled; + sqInt annotateUse; + sqInt registerr; + sqInt offset; + sqInt constant; + sqInt bcptr; + } SimStackEntry; + +#define CogSimStackEntry SimStackEntry + + +typedef struct { + AbstractInstruction *targetInstruction; + sqInt instructionIndex; + sqInt simStackPtr; + sqInt simNativeStackPtr; + sqInt simNativeStackSize; + } BytecodeFixup; + +#define CogSSBytecodeFixup BytecodeFixup +#define CogBytecodeFixup BytecodeFixup + + +typedef struct { + sqInt isReceiverResultRegLive; + CogSimStackEntry *ssEntry; + } CogSSOptStatus; + + +typedef struct { + char type; + char spilled; + sqInt registerr; + sqInt registerSecond; + sqInt offset; + sqInt constant; + sqInt constantInt32; + sqLong constantInt64; + float constantFloat32; + double constantFloat64; + sqInt constantNativePointer; + sqInt bcptr; + } CogSimStackNativeEntry; + + + +/*** Function Prototypes ***/ + + +#if !PRODUCTION && defined(PlatformNoDbgRegParms) +# define NoDbgRegParms PlatformNoDbgRegParms +#endif + +#if !defined(NoDbgRegParms) +# define NoDbgRegParms /*empty*/ +#endif + + + +#if !defined(NeverInline) +# define NeverInline /*empty*/ +#endif + +static AbstractInstruction * NoDbgRegParms addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction); +static sqInt NoDbgRegParms availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask); +static AbstractInstruction * NoDbgRegParms cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral); +static AbstractInstruction * NoDbgRegParms genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms getJmpTarget(AbstractInstruction * self_in_getJmpTarget); +static sqInt NoDbgRegParms inCurrentCompilation(AbstractInstruction * self_in_inCurrentCompilation, sqInt operand); +static AbstractInstruction * NoDbgRegParms initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal); +static AbstractInstruction * NoDbgRegParms initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal); +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 isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress); +static AbstractInstruction * NoDbgRegParms jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction); +static usqIntptr_t NoDbgRegParms labelOffset(AbstractInstruction * self_in_labelOffset); +static sqInt NoDbgRegParms literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress); +static AbstractInstruction * NoDbgRegParms relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget); +static sqInt NoDbgRegParms rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject); +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); +static usqInt NoDbgRegParms aeabiDivModFunctionAddr(AbstractInstruction * self_in_aeabiDivModFunctionAddr); +static sqInt NoDbgRegParms andsrnimmror(AbstractInstruction * self_in_andsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms andrnimmror(AbstractInstruction * self_in_andrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask); +static sqInt NoDbgRegParms bicsrnimmror(AbstractInstruction * self_in_bicsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms bl(AbstractInstruction * self_in_bl, sqInt offset); +static sqInt NoDbgRegParms b(AbstractInstruction * self_in_b, sqInt offset); +static sqInt NoDbgRegParms callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize); +static sqInt NoDbgRegParms callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress); +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 concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress); +static usqInt NoDbgRegParms concretizeCMPSMULL(AbstractInstruction * self_in_concretizeCMPSMULL); +static void NoDbgRegParms concretizeConditionalInstruction(AbstractInstruction * self_in_concretizeConditionalInstruction); +static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32); +static usqInt NoDbgRegParms concretizeMSR(AbstractInstruction * self_in_concretizeMSR); +static usqInt NoDbgRegParms concretizePushOrPopMultipleRegisters(AbstractInstruction * self_in_concretizePushOrPopMultipleRegisters, sqInt doPush); +static usqInt NoDbgRegParms concretizeSMULL(AbstractInstruction * self_in_concretizeSMULL); +static sqInt NoDbgRegParms conditionIsNotNever(AbstractInstruction * self_in_conditionIsNotNever, sqInt instr); +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 usqInt NoDbgRegParms fmsrFromto(AbstractInstruction * self_in_fmsrFromto, sqInt regA, sqInt regB); +static usqInt NoDbgRegParms fsitodFromto(AbstractInstruction * self_in_fsitodFromto, sqInt regA, sqInt regB); +static sqInt NoDbgRegParms fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative); +static AbstractInstruction * NoDbgRegParms genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder); +static sqInt NoDbgRegParms genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer); +static sqInt NoDbgRegParms genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers); +static sqInt NoDbgRegParms genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers); +static AbstractInstruction * NoDbgRegParms genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored); +static sqInt NoDbgRegParms genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n); +static AbstractInstruction * NoDbgRegParms genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg); +static sqInt NoDbgRegParms genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers); +static AbstractInstruction * NoDbgRegParms genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc); +static sqInt NoDbgRegParms instructionBeforeAddress(AbstractInstruction * self_in_instructionBeforeAddress, sqInt followingAddress); +static sqInt NoDbgRegParms instructionIsBLX(AbstractInstruction * self_in_instructionIsBLX, sqInt instr); +static sqInt NoDbgRegParms instructionIsBL(AbstractInstruction * self_in_instructionIsBL, sqInt instr); +static sqInt NoDbgRegParms instructionIsBX(AbstractInstruction * self_in_instructionIsBX, sqInt instr); +static sqInt NoDbgRegParms instructionIsB(AbstractInstruction * self_in_instructionIsB, sqInt instr); +static sqInt NoDbgRegParms instructionIsCMP(AbstractInstruction * self_in_instructionIsCMP, sqInt instr); +static sqInt NoDbgRegParms instructionIsLDR(AbstractInstruction * self_in_instructionIsLDR, sqInt instr); +static sqInt NoDbgRegParms instructionIsOR(AbstractInstruction * self_in_instructionIsOR, sqInt instr); +static sqInt NoDbgRegParms instructionIsPush(AbstractInstruction * self_in_instructionIsPush, sqInt instr); +static sqInt NoDbgRegParms instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc); +static sqInt NoDbgRegParms inverseOpcodeFor(AbstractInstruction * self_in_inverseOpcodeFor, sqInt armOpcode); +static sqInt NoDbgRegParms isAddressRelativeToVarBase(AbstractInstruction * self_in_isAddressRelativeToVarBase, usqInt varAddress); +static sqInt NoDbgRegParms isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc); +static sqInt NoDbgRegParms isInImmediateJumpRange(AbstractInstruction * self_in_isInImmediateJumpRange, usqIntptr_t operand); +static sqInt NoDbgRegParms isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc); +static sqInt NoDbgRegParms isPCRelativeValueLoad(AbstractInstruction * self_in_isPCRelativeValueLoad, unsigned int instr); +static sqInt NoDbgRegParms jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize); +static sqInt NoDbgRegParms jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize); +static sqInt NoDbgRegParms jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc); +static usqInt NoDbgRegParms jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc); +static sqInt NoDbgRegParms ldrbrnplusimm(AbstractInstruction * self_in_ldrbrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue); +static sqInt NoDbgRegParms ldrbrnrm(AbstractInstruction * self_in_ldrbrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms ldrhrnplusimm(AbstractInstruction * self_in_ldrhrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate8bitValue); +static sqInt NoDbgRegParms ldrhrnrm(AbstractInstruction * self_in_ldrhrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms ldrrnplusImm(AbstractInstruction * self_in_ldrrnplusImm, sqInt destReg, sqInt baseReg, sqInt immediate12bitValue); +static sqInt NoDbgRegParms ldrrnplusimm(AbstractInstruction * self_in_ldrrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue); +static sqInt NoDbgRegParms ldrrnrm(AbstractInstruction * self_in_ldrrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms loadCwInto(AbstractInstruction * self_in_loadCwInto, sqInt destReg); +static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize); +static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes); +static sqInt NoDbgRegParms machineCodeWords(AbstractInstruction * self_in_machineCodeWords); +static sqInt NoDbgRegParms memM16xrregbasepuwloffset(AbstractInstruction * self_in_memM16xrregbasepuwloffset, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offset8); +static sqInt NoDbgRegParms memM16xrregbasepuwlrm(AbstractInstruction * self_in_memM16xrregbasepuwlrm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg); +static sqInt NoDbgRegParms memMxrregbasepubwlimm(AbstractInstruction * self_in_memMxrregbasepubwlimm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offset); +static sqInt NoDbgRegParms memMxrregbasepubwlrmLsl2(AbstractInstruction * self_in_memMxrregbasepubwlrmLsl2, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg); +static sqInt NoDbgRegParms memMxrregbasepubwlrm(AbstractInstruction * self_in_memMxrregbasepubwlrm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg); +static sqInt NoDbgRegParms memMxrregbaseublimm(AbstractInstruction * self_in_memMxrregbaseublimm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt updown, sqInt byteword, sqInt loadstore, sqInt immediate12bitValue); +static sqInt NoDbgRegParms movsrn(AbstractInstruction * self_in_movsrn, sqInt destReg, sqInt srcReg); +static sqInt NoDbgRegParms movimmror(AbstractInstruction * self_in_movimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot); +static sqInt NoDbgRegParms movrn(AbstractInstruction * self_in_movrn, sqInt destReg, sqInt srcReg); +static sqInt NoDbgRegParms msr(AbstractInstruction * self_in_msr, sqInt flags); +static sqInt NoDbgRegParms mvnimmror(AbstractInstruction * self_in_mvnimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot); +static sqInt NoDbgRegParms numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs); +static sqInt NoDbgRegParms orrimmror(AbstractInstruction * self_in_orrimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot); +static AbstractInstruction * NoDbgRegParms padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr); +static sqInt NoDbgRegParms popR(AbstractInstruction * self_in_popR, sqInt dstReg); +static sqInt NoDbgRegParms pushLinkRegisterByteSize(AbstractInstruction * self_in_pushLinkRegisterByteSize); +static sqInt NoDbgRegParms pushR(AbstractInstruction * self_in_pushR, sqInt srcReg); +static AbstractInstruction * NoDbgRegParms relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta); +static sqInt NoDbgRegParms rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteTransferAttarget(AbstractInstruction * self_in_rewriteTransferAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static sqInt NoDbgRegParms setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode); +static sqInt NoDbgRegParms shiftSetsConditionCodesFor(AbstractInstruction * self_in_shiftSetsConditionCodesFor, sqInt aConditionalJumpOpcode); +static sqInt NoDbgRegParms stackPageInterruptHeadroomBytes(AbstractInstruction * self_in_stackPageInterruptHeadroomBytes); +static AbstractInstruction * NoDbgRegParms stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr); +static sqInt NoDbgRegParms strbrnplusimm(AbstractInstruction * self_in_strbrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue); +static sqInt NoDbgRegParms strbrnrm(AbstractInstruction * self_in_strbrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms strhrnplusimm(AbstractInstruction * self_in_strhrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate8bitValue); +static sqInt NoDbgRegParms strhrnrm(AbstractInstruction * self_in_strhrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms strrnplusImm(AbstractInstruction * self_in_strrnplusImm, sqInt srcReg, sqInt baseReg, sqInt immediate12bitValue); +static sqInt NoDbgRegParms strrnplusimm(AbstractInstruction * self_in_strrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue); +static sqInt NoDbgRegParms strrnrm(AbstractInstruction * self_in_strrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg); +static sqInt NoDbgRegParms subsrnimmror(AbstractInstruction * self_in_subsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms subrnimmror(AbstractInstruction * self_in_subrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms tstrnimmror(AbstractInstruction * self_in_tstrnimmror, sqInt ignored, sqInt srcReg, sqInt immediate, sqInt rot); +static sqInt NoDbgRegParms zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative); +static CogMethod * NoDbgRegParms cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod); +static sqInt NoDbgRegParms isBranch(BytecodeDescriptor * self_in_isBranch); +static sqInt NoDbgRegParms isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch); +static AbstractInstruction * NoDbgRegParms gAddCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gArithmeticShiftRightRR(sqInt reg1, sqInt reg2); +extern sqInt abortOffset(void); +static void addCleanBlockStarts(void); +extern void addCogMethodsToHeapMap(void); +static sqInt NoDbgRegParms addressIsInCurrentCompilation(sqInt address); +static sqInt NoDbgRegParms addressIsInFixups(AbstractInstruction *address); +static sqInt NoDbgRegParms addressIsInInstructions(AbstractInstruction *address); +static sqInt NoDbgRegParms addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC); +static sqInt NoDbgRegParms alignUptoRoutineBoundary(sqInt anAddress); +static sqInt allMachineCodeObjectReferencesValid(void); +static sqInt allMethodsHaveCorrectHeader(void); +static AbstractInstruction * NoDbgRegParms annotateAbsolutePCRef(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); +static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); +static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); +extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +static AbstractInstruction * NoDbgRegParms CallFullRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved); +static AbstractInstruction * NoDbgRegParms CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved); +static AbstractInstruction * NoDbgRegParms gCall(sqInt callTarget); +static AbstractInstruction * NoDbgRegParms gCmpCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpRR(sqInt reg1, sqInt reg2); +extern void callCogCodePopReceiver(void); +extern void callCogCodePopReceiverAndClassRegs(void); +extern sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver); +extern void ceFree(void*pointer); +extern void* ceMalloc(size_t size); +extern sqInt ceSICMiss(sqInt receiver); +extern void checkAssertsEnabledInCogit(void); +static sqInt NoDbgRegParms checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes); +static sqInt NoDbgRegParms checkMaybeObjRefInClosedPIC(sqInt maybeObject); +static sqInt NoDbgRegParms checkValidObjectReferencesInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms closedPICRefersToUnmarkedObject(CogMethod *cPIC); +extern char * codeEntryFor(char *address); +extern char * codeEntryNameFor(char *address); +extern sqInt cogCodeBase(void); +extern sqInt cogCodeConstituents(void); +static sqInt NoDbgRegParms cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase); +extern CogMethod * cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied); +extern void cogitPostGCAction(sqInt gcMode); +extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod); +extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs); +static CogMethod * NoDbgRegParms cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs); +static CogMethod * NoDbgRegParms cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase); +extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop); +extern void compactCogCompiledCode(void); +static void compactPICsWithFreedTargets(void); +static AbstractInstruction * compileAbort(void); +static sqInt NoDbgRegParms compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex); +static void NoDbgRegParms compileBlockEntry(BlockStart *blockStart); +static void NoDbgRegParms compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static AbstractInstruction * compileCPICEntry(void); +static sqInt NoDbgRegParms compileEntireFullBlockMethod(sqInt numCopied); +static void compileEntry(void); +static sqInt compileFullBlockEntry(void); +static sqInt compileMethodBody(void); +static sqInt NoDbgRegParms compilePICAbort(sqInt numArgs); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone); +static void NoDbgRegParms compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void computeEntryOffsets(void); +static void computeFullBlockEntryOffsets(void); +static void computeMaximumSizes(void); +static sqInt NoDbgRegParms configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms cPICCompactAndIsNowEmpty(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasForwardedClass(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasFreedTargets(CogMethod *cPIC); +static usqInt cPICPrototypeCaseOffset(void); +static sqInt NoDbgRegParms cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod); +static AbstractInstruction * NoDbgRegParms gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder); +extern sqInt defaultCogCodeSize(void); +static sqInt NoDbgRegParms deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader); +static sqInt NoDbgRegParms endPCOf(sqInt aMethod); +extern void enterCogCodePopReceiver(void); +static sqInt NoDbgRegParms expectedClosedPICPrototype(CogMethod *cPIC); +static sqInt extABytecode(void); +static sqInt extBBytecode(void); +static sqInt NoDbgRegParms fillInBlockHeadersAt(sqInt startAddress); +static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector); +static sqInt NoDbgRegParms findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc); +static usqInt NoDbgRegParms findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc); +static sqInt NoDbgRegParms findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod); +extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod); +static sqInt NoDbgRegParms findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc); +static usqInt NoDbgRegParms firstMappedPCFor(CogMethod *cogMethod); +static sqInt firstPrototypeMethodOop(void); +extern void followForwardedLiteralsIn(CogMethod *cogMethod); +extern void followForwardedMethods(void); +static sqInt NoDbgRegParms followMaybeObjRefInClosedPICAt(sqInt mcpc); +static sqInt NoDbgRegParms followMethodReferencesInClosedPIC(CogMethod *cPIC); +extern void freeUnmarkedMachineCode(void); +static AbstractInstruction * NoDbgRegParms genCallMustBeBooleanFor(sqInt boolean); +static sqInt genCheckForInterruptsTrampoline(void); +static AbstractInstruction * NoDbgRegParms genConditionalBranchoperand(sqInt opcode, sqInt operandOne); +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) ; +static void NoDbgRegParms genEnilopmartReturn(sqInt forCall); +static void NoDbgRegParms generateCaptureCStackPointers(sqInt captureFramePointer); +static void generateClosedPICPrototype(void); +static CogMethod * generateCogFullBlock(void); +static CogMethod * NoDbgRegParms generateCogMethod(sqInt selector); +static sqInt NoDbgRegParms generateInstructionsAt(sqInt eventualAbsoluteAddress); +static sqInt NoDbgRegParms generateMapAtstart(sqInt addressOrNull, sqInt startAddress); +static void generateOpenPICPrototype(void); +static void generateRunTimeTrampolines(void); +static void generateStackPointerCapture(void); +static void generateTrampolines(void); +static sqInt genFFICalloutTrampoline(void); +static void genGetLeafCallStackPointer(void); +static sqInt NoDbgRegParms genInnerPICAbortTrampoline(char *name); +static sqInt genLoadCStackPointersForPrimCall(void); +static void NoDbgRegParms genLoadInlineCacheWithSelector(sqInt selectorIndex); +static sqInt genNonLocalReturnTrampoline(void); +static sqInt NoDbgRegParms genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genSmalltalkToCStackSwitch(sqInt pushLinkReg); +static sqInt NoDbgRegParms genTrampolineForcalled(void *aRoutine, char *aString); +static sqInt NoDbgRegParms genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2); +static sqInt NoDbgRegParms genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask); +static AbstractInstruction * NoDbgRegParms gen(sqInt opcode); +static AbstractInstruction * NoDbgRegParms genoperand(sqInt opcode, sqInt operand); +static AbstractInstruction * NoDbgRegParms genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo); +static AbstractInstruction * NoDbgRegParms genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree); +static sqInt NoDbgRegParms getLiteral(sqInt litIndex); +static sqInt getOpcodeIndex(void); +static sqInt NoDbgRegParms incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc); +static sqInt initialClosedPICUsageCount(void); +static void initializeBackend(void); +extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress); +static sqInt initialMethodUsageCount(void); +static sqInt initialOpenPICUsageCount(void); +static sqInt NoDbgRegParms inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc); +static sqInt NoDbgRegParms inverseBranchFor(sqInt opcode); +static sqInt NoDbgRegParms isPCMappedAnnotation(sqInt annotation); +extern sqInt isPCWithinMethodZone(void *address); +extern sqInt isSendReturnPC(sqInt retpc); +static AbstractInstruction * NoDbgRegParms gJumpFPEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreaterOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreater(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLessOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLess(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPNotEqual(void *jumpTarget); +static AbstractInstruction * gLabel(void); +static AbstractInstruction * NoDbgRegParms gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * lastOpcode(void); +extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver); +static BytecodeDescriptor * loadBytesAndGetDescriptor(void); +static void NoDbgRegParms loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc); +static AbstractInstruction * NoDbgRegParms gMoveAwR(sqInt address, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg); +static AbstractInstruction * NoDbgRegParms gMoveRR(sqInt reg1, sqInt reg2); +static sqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); +static sqInt NoDbgRegParms mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg); +static sqInt NoDbgRegParms mapObjectReferencesInClosedPIC(CogMethod *cPIC); +static void mapObjectReferencesInGeneratedRuntime(void); +static void mapObjectReferencesInMachineCodeForBecome(void); +static void mapObjectReferencesInMachineCodeForFullGC(void); +static void mapObjectReferencesInMachineCodeForYoungGC(void); +extern void mapObjectReferencesInMachineCode(sqInt gcMode); +extern void markAndTraceMachineCodeOfMarkedMethods(void); +static void markAndTraceObjectReferencesInGeneratedRuntime(void); +static sqInt NoDbgRegParms markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit); +static sqInt NoDbgRegParms markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC); +static sqInt NoDbgRegParms markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern void markMethodAndReferents(CogBlockMethod *aCogMethod); +extern usqInt maxCogMethodAddress(void); +static sqInt maybeAllocAndInitIRCs(void); +static sqInt NoDbgRegParms maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod); +static void NoDbgRegParms maybeMarkCountersIn(CogMethod *cogMethod); +static sqInt mclassIsSmallInteger(void); +extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +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); +static sqInt noCogMethodsMaximallyMarked(void); +static sqInt NoDbgRegParms noTargetsFreeInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms outputInstructionsAt(sqInt startAddress); +static sqInt NoDbgRegParms outputInstructionsForGeneratedRuntimeAt(sqInt startAddress); +static AbstractInstruction * NoDbgRegParms gPopR(sqInt reg); +static AbstractInstruction * NoDbgRegParms gPushCw(sqInt wordConstant); +extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver); +static sqInt picAbortDiscriminatorValue(void); +static sqInt picInterpretAbortOffset(void); +static AbstractInstruction * previousInstruction(void); +extern void printCogMethodFor(void *address); +extern void printPCMapPairsFor(CogMethod *cogMethod); +extern void printTrampolineTable(void); +static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(void); +static sqInt processorHasMultiplyAndMClassIsSmallInteger(void); +static void NoDbgRegParms recordGeneratedRunTimeaddress(char *aString, sqInt address); +extern sqInt recordPrimTraceFunc(void); +static void recordRunTimeObjectReferences(void); +static sqInt NoDbgRegParms registerMaskFor(sqInt reg); +static void NoDbgRegParms relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod); +static void NoDbgRegParms relocateCallsInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta); +static sqInt NoDbgRegParms remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr); +static sqInt NoDbgRegParms remapMaybeObjRefInClosedPICAt(sqInt mcpc); +static void NoDbgRegParms rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget); +static AbstractInstruction * NoDbgRegParms gSubCwR(sqInt wordConstant, sqInt reg); +static sqInt scanForCleanBlocks(void); +extern void setBreakMethod(sqInt anObj); +extern void setPostCompileHook(void (*aFunction)(CogMethod *)); +extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop); +static sqInt NoDbgRegParms spanForCleanBlockStartingAt(sqInt startPC); +static sqInt subsequentPrototypeMethodOop(void); +extern sqInt traceLinkedSendOffset(void); +static sqInt NoDbgRegParms trampolineArgConstant(sqInt booleanOrInteger); +static char * NoDbgRegParms trampolineNamenumArgs(char *routinePrefix, sqInt numArgs); +static char * NoDbgRegParms trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit); +static char * NoDbgRegParms trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs); +static sqInt unknownBytecode(void); +extern void unlinkAllSends(void); +static sqInt NoDbgRegParms unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector); +static sqInt NoDbgRegParms unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod); +extern void unlinkSendsLinkedForInvalidClasses(void); +extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector); +extern void unlinkSendsToFree(void); +extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue); +static AbstractInstruction * NoDbgRegParms gXorCwR(sqInt wordConstant, sqInt reg); +static void zeroOpcodeIndex(void); +static void zeroOpcodeIndexForNewOpcodes(void); +extern void addAllToYoungReferrers(void); +static void NoDbgRegParms addToOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms addToYoungReferrers(CogMethod *cogMethod); +static sqInt NoDbgRegParms allocate(sqInt numBytes); +static void clearCogCompiledCode(void); +static void NoDbgRegParms clearSavedPICUsageCount(CogMethod *cogMethod); +static void compactCompiledCode(void); +static void NoDbgRegParms ensureInYoungReferrers(CogMethod *cogMethod); +static void followForwardedLiteralsInOpenPICList(void); +extern void freeMethod(CogMethod *cogMethod); +static void freeOlderMethodsForCompaction(void); +static sqInt kosherYoungReferrers(void); +static void NoDbgRegParms manageFromto(sqInt theStartAddress, sqInt theLimitAddress); +extern CogMethod * methodFor(void *address); +extern sqInt methodsCompiledToMachineCodeInto(sqInt arrayObj); +extern sqInt numMethods(void); +extern sqInt numMethodsOfType(sqInt cogMethodType); +static sqInt NoDbgRegParms occurrencesInYoungReferrers(CogMethod *cogMethod); +static CogMethod * NoDbgRegParms openPICWithSelector(sqInt aSelector); +static void planCompaction(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 NoDbgRegParms removeFromOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms restorePICUsageCount(CogMethod *cogMethod); +static void NoDbgRegParms savePICUsageCount(CogMethod *cogMethod); +static void voidYoungReferrersPostTenureAll(void); +extern char * whereIsMaybeCodeThing(sqInt anOop); +static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop); +static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg); +static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg); +static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)); +static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison); +static sqInt NoDbgRegParms genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg); +static void NoDbgRegParms genLcByteSizeOfto(sqInt oop, sqInt resultRegister); +static void NoDbgRegParms genLcFloat32toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcFloat64toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcInstantiateOop(sqInt classOop); +static void NoDbgRegParms genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInt64ToOop(sqInt value); +static void NoDbgRegParms genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOopToInt64(sqInt value); +static void NoDbgRegParms genLcOopToPointer(sqInt object); +static void NoDbgRegParms genLcOopToUInt64(sqInt value); +static void NoDbgRegParms genLcOoptoFloat32(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoFloat64(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcPointerToOopclass(sqInt pointer, sqInt pointerClass); +static void NoDbgRegParms genLcUInt64ToOop(sqInt value); +static void NoDbgRegParms genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +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 * NoDbgRegParms (*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); +static sqInt NoDbgRegParms genClearAndSetSmallIntegerTagsIn(sqInt scratchReg); +static void NoDbgRegParms genConvertCharacterToSmallIntegerInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToSmallIntegerInReg(sqInt reg); +static void NoDbgRegParms genConvertSmallIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertSmallIntegerToIntegerInReg(sqInt reg); +static void generateLowcodeObjectTrampolines(void); +static sqInt NoDbgRegParms genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg); +static sqInt NoDbgRegParms genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg); +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 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 void NoDbgRegParms genLcInt32ToOop(sqInt value); +static void NoDbgRegParms genLcOopToInt32(sqInt value); +static void NoDbgRegParms genLcOopToUInt32(sqInt value); +static void NoDbgRegParms genLcUInt32ToOop(sqInt value); +static sqInt genPrimitiveAt(void); +static sqInt genPrimitiveAtPut(void); +static sqInt genPrimitiveIdentityHash(void); +static sqInt genPrimitiveImmediateAsInteger(void); +static sqInt genPrimitiveNew(void); +static sqInt genPrimitiveNewWithArg(void); +static sqInt genPrimitiveShallowCopy(void); +static sqInt genPrimitiveStringAt(void); +static sqInt genPrimitiveStringAtPut(void); +static sqInt NoDbgRegParms genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg); +static sqInt NoDbgRegParms inlineCacheTagForInstance(sqInt oop); +static AbstractInstruction * NoDbgRegParms jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static sqInt numSmallIntegerBits(void); +static sqInt NoDbgRegParms validInlineCacheTag(usqInt classIndexOrTagPattern); +static sqInt NoDbgRegParms cacheTagIsMarked(sqInt cacheTag); +static sqInt NoDbgRegParms checkValidOopReference(sqInt anOop); +static sqInt NoDbgRegParms couldBeObject(sqInt literal); +static sqInt NoDbgRegParms genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString); +static AbstractInstruction * NoDbgRegParms genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt scratch1, sqInt scratch2); +static AbstractInstruction * NoDbgRegParms genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg); +static sqInt NoDbgRegParms genConvertCharacterToCodeInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock); +static sqInt NoDbgRegParms genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock); +static sqInt NoDbgRegParms genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg); +static void generateObjectRepresentationTrampolines(void); +static sqInt NoDbgRegParms genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock); +static sqInt NoDbgRegParms genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock); +static sqInt NoDbgRegParms genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver); +static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg); +static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg); +static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg); +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 AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister); +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +static AbstractInstruction * NoDbgRegParms genJumpNotCharacterInScratchReg(sqInt reg); +static void NoDbgRegParms genLcFirstFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcFirstIndexableFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcIsBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIndexableto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsPointersto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcLoadObjectat(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcLoadObjectfield(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex); +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 NoDbgRegParms genPrimitiveIdenticalOrNotIf(sqInt orNot); +static sqInt genPrimitiveObjectAt(void); +static sqInt genPrimitiveSize(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 genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg); +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +static sqInt getActiveContextAllocatesInMachineCode(void); +static sqInt NoDbgRegParms inlineCacheTagIsYoung(sqInt cacheTag); +static AbstractInstruction * NoDbgRegParms jumpNotCharacterUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static void NoDbgRegParms markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address); +static void NoDbgRegParms markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil); +static sqInt NoDbgRegParms maybeCompileRetryOnPrimitiveFail(sqInt primIndex); +static sqInt NoDbgRegParms maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg); +static sqInt numCharacterBits(void); +extern sqInt numRegArgs(void); +static sqInt NoDbgRegParms remapObject(sqInt objOop); +static sqInt NoDbgRegParms remapOop(sqInt objOop); +static sqInt NoDbgRegParms shouldAnnotateObjectReference(sqInt anOop); +static sqInt NoDbgRegParms slotOffsetOfInstVarIndex(sqInt index); +static sqInt NoDbgRegParms cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize); +static AbstractInstruction * NoDbgRegParms concretizeLiteral(AbstractInstruction * self_in_concretizeLiteral); +static sqInt NoDbgRegParms inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms isPCDependent(AbstractInstruction * self_in_isPCDependent); +static sqInt NoDbgRegParms literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress); +static sqInt NoDbgRegParms literalLoadInstructionBytes(AbstractInstruction * self_in_literalLoadInstructionBytes); +static sqInt NoDbgRegParms loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize); +static sqInt NoDbgRegParms nsSendCacheAt(AbstractInstruction * self_in_nsSendCacheAt, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms outOfLineLiteralOpcodeLimit(AbstractInstruction * self_in_outOfLineLiteralOpcodeLimit); +static sqInt NoDbgRegParms pcRelativeAddressAt(AbstractInstruction * self_in_pcRelativeAddressAt, sqInt instrAddress); +static AbstractInstruction * NoDbgRegParms relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta); +static sqInt NoDbgRegParms rewriteFullTransferAttargetexpectedInstruction(AbstractInstruction * self_in_rewriteFullTransferAttargetexpectedInstruction, usqInt callSiteReturnAddress, usqInt callTargetAddress, sqInt expectedInstruction); +static sqInt NoDbgRegParms rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, sqInt callSiteReturnAddress); +static usqInt NoDbgRegParms sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress); +static AbstractInstruction * NoDbgRegParms storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress); +static AbstractInstruction * NoDbgRegParms updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction); +static sqInt NoDbgRegParms usesOutOfLineLiteral(AbstractInstruction * self_in_usesOutOfLineLiteral); +static SimStackEntry * NoDbgRegParms ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister); +static SimStackEntry * NoDbgRegParms popToReg(SimStackEntry * self_in_popToReg, sqInt reg); +static sqInt NoDbgRegParms registerMask(SimStackEntry * self_in_registerMask); +static sqInt NoDbgRegParms registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone); +static sqInt NoDbgRegParms registerOrNone(SimStackEntry * self_in_registerOrNone); +static SimStackEntry * NoDbgRegParms storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled); +static CogSimStackNativeEntry * NoDbgRegParms ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister); +static sqInt NoDbgRegParms nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister); +static sqInt NoDbgRegParms stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize); +static sqInt NoDbgRegParms isMergeFixup(BytecodeFixup * self_in_isMergeFixup); +static AbstractInstruction * NoDbgRegParms allocateLiteral(sqInt aLiteral); +static AbstractInstruction * NoDbgRegParms checkLiteralforInstruction(sqInt literal, AbstractInstruction *anInstruction); +static sqInt NoDbgRegParms dumpLiterals(sqInt generateBranchAround); +static sqInt endSizeOffset(void); +static sqInt NoDbgRegParms literalInstructionInRange(AbstractInstruction *litInst); +static AbstractInstruction * NoDbgRegParms locateLiteral(sqInt aLiteral); +static sqInt resetForBlockCompile(void); +static sqInt saveForBlockCompile(void); +static sqInt compileBlockDispatch(void); +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); +static sqInt frameOffsetOfNativeFrameMark(void); +static sqInt frameOffsetOfNativeFramePointer(void); +static sqInt frameOffsetOfNativeStackPointer(void); +static sqInt frameOffsetOfPreviousNativeStackPointer(void); +static sqInt NoDbgRegParms frameOffsetOfTemporary(sqInt index); +static AbstractInstruction * NoDbgRegParms genDoubleFailIfZeroArgRcvrarg(int rcvrReg, int argReg); +static sqInt genExtendedSendBytecode(void); +static sqInt genExtendedSuperBytecode(void); +static sqInt genExtJumpIfFalse(void); +static sqInt genExtJumpIfNotInstanceOfBehaviorsBytecode(void); +static sqInt genExtJumpIfTrue(void); +static sqInt genExtNopBytecode(void); +static sqInt genExtPushCharacterBytecode(void); +static sqInt genExtPushIntegerBytecode(void); +static sqInt genExtPushLiteralBytecode(void); +static sqInt genExtPushLitVarDirSupBytecode(void); +static sqInt genExtPushPseudoVariable(void); +static sqInt genExtPushReceiverVariableBytecode(void); +static sqInt genExtSendBytecode(void); +static sqInt genExtSendSuperBytecode(void); +static sqInt genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtStoreRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtUnconditionalJump(void); +static sqInt genFastPrimFail(void); +static void NoDbgRegParms genFastPrimTraceUsingand(sqInt r1, sqInt r2); +static sqInt genLongJumpIfFalse(void); +static sqInt genLongJumpIfTrue(void); +static sqInt genLongPushTemporaryVariableBytecode(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); +static sqInt genLongStoreTemporaryVariableBytecode(void); +static sqInt genLongUnconditionalBackwardJump(void); +static sqInt genLongUnconditionalForwardJump(void); +static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg); +static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName); +static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling); +static sqInt genPushClosureTempsBytecode(void); +static sqInt genPushConstantFalseBytecode(void); +static sqInt genPushConstantNilBytecode(void); +static sqInt genPushConstantOneBytecode(void); +static sqInt genPushConstantTrueBytecode(void); +static sqInt genPushConstantZeroBytecode(void); +static sqInt genPushLiteralConstantBytecode(void); +static sqInt NoDbgRegParms genPushLiteralIndex(sqInt literalIndex); +static sqInt genPushLiteralVariableBytecode(void); +static sqInt genPushLitVarDirSup16CasesBytecode(void); +static sqInt genPushQuickIntegerConstantBytecode(void); +static sqInt genPushReceiverVariableBytecode(void); +static sqInt genPushTemporaryVariableBytecode(void); +extern sqInt genQuickReturnConst(void); +extern sqInt genQuickReturnInstVar(void); +extern sqInt genQuickReturnSelf(void); +static sqInt genReturnFalse(void); +static sqInt genReturnNil(void); +static sqInt genReturnNilFromBlock(void); +static sqInt genReturnTrue(void); +static sqInt genSecondExtendedSendBytecode(void); +static sqInt genSendLiteralSelector0ArgsBytecode(void); +static sqInt genSendLiteralSelector1ArgBytecode(void); +static sqInt genSendLiteralSelector2ArgsBytecode(void); +static sqInt genShortJumpIfFalse(void); +static sqInt genShortJumpIfTrue(void); +static sqInt genShortUnconditionalJump(void); +static sqInt genSistaExtStoreAndPopLiteralVariableBytecode(void); +static sqInt genSistaExtStoreAndPopReceiverVariableBytecode(void); +static sqInt genSistaExtStoreLiteralVariableBytecode(void); +static sqInt genSistaExtStoreReceiverVariableBytecode(void); +static sqInt genSpecialSelectorEqualsEquals(void); +static sqInt genSpecialSelectorNotEqualsEquals(void); +static sqInt genSpecialSelectorSend(void); +static sqInt genStoreAndPopReceiverVariableBytecode(void); +static sqInt genStoreAndPopRemoteTempLongBytecode(void); +static sqInt genStoreAndPopTemporaryVariableBytecode(void); +static sqInt genStoreRemoteTempLongBytecode(void); +static sqInt genUnconditionalTrapBytecode(void); +static void NoDbgRegParms loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg); +static void NoDbgRegParms loadNativeFramePointerInto(sqInt reg); +static void NoDbgRegParms loadNativeLocalAddressto(sqInt baseOffset, sqInt reg); +extern sqInt mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj); +static void maybeCompileAllocFillerCheck(void); +static sqInt numSpecialSelectors(void); +static usqInt NoDbgRegParms pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod); +static sqInt NoDbgRegParms pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg); +static PrimitiveDescriptor * primitiveGeneratorOrNil(void); +extern void recordCallOffsetIn(CogMethod *cogMethod); +extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)); +static sqInt NoDbgRegParms v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +extern void voidCogCompiledCode(void); +static BlockStart * NoDbgRegParms addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span); +static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs); +static sqInt NoDbgRegParms allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask); +static sqInt NoDbgRegParms allocateRegNotConflictingWith(sqInt regMask); +static sqInt NoDbgRegParms anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n); +static void NoDbgRegParms beginHighLevelCall(sqInt alignment); +extern void callCogCodePopReceiverArg0Regs(void); +extern void callCogCodePopReceiverArg1Arg0Regs(void); +static sqInt callSwitchToCStack(void); +static void callSwitchToSmalltalkStack(void); +static sqInt NoDbgRegParms compileAbstractInstructionsFromthrough(sqInt start, sqInt end); +static sqInt compileBlockBodies(void); +static void NoDbgRegParms compileBlockFrameBuild(BlockStart *blockStart); +static void NoDbgRegParms compileBlockFramelessEntry(BlockStart *blockStart); +static CogMethod * NoDbgRegParms compileCogFullBlockMethod(sqInt numCopied); +static CogMethod * NoDbgRegParms compileCogMethod(sqInt selector); +static sqInt compileEntireMethod(void); +static void compileFrameBuild(void); +static void NoDbgRegParms compileFullBlockFramelessEntry(sqInt numCopied); +static void NoDbgRegParms compileFullBlockMethodFrameBuild(sqInt numCopied); +#if IMMUTABILITY +static void compileTwoPathFrameBuild(void); +#endif /* IMMUTABILITY */ +static void compileTwoPathFramelessInit(void); +static sqInt NoDbgRegParms cPICMissTrampolineFor(sqInt numArgs); +static sqInt doubleExtendedDoAnythingBytecode(void); +static sqInt duplicateTopBytecode(void); +static void endHighLevelCallWithCleanup(void); +static void endHighLevelCallWithoutCleanup(void); +static BytecodeFixup * NoDbgRegParms ensureFixupAt(sqInt targetIndex); +static BytecodeFixup * NoDbgRegParms ensureNonMergeFixupAt(sqInt targetIndex); +static void ensureReceiverResultRegContainsSelf(void); +static void NoDbgRegParms evaluateat(BytecodeDescriptor *descriptor, sqInt pc); +static sqInt NoDbgRegParms freeAnyRegNotConflictingWith(sqInt regMask); +static sqInt genBlockReturn(void); +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) ; +static sqInt genCallPrimitiveBytecode(void); +static sqInt genExternalizePointersForPrimitiveCall(void); +static sqInt genExtPushClosureBytecode(void); +static sqInt genExtPushFullClosureBytecode(void); +static sqInt genExtPushRemoteTempOrInstVarLongBytecode(void); +static sqInt NoDbgRegParms genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean); +static void generateEnilopmarts(void); +static void generateMissAbortTrampolines(void); +static void generateSendTrampolines(void); +static void generateTracingTrampolines(void); +static sqInt NoDbgRegParms genForwardersInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot); +static sqInt NoDbgRegParms genInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genJumpBackTo(sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpIfto(sqInt boolean, sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpTo(sqInt targetBytecodePC); +static void NoDbgRegParms genLoadTempin(sqInt objectIndex, sqInt destReg); +static sqInt genLowcodeAdd32(void); +static sqInt genLowcodeAdd64(void); +static sqInt genLowcodeAlloca32(void); +static sqInt genLowcodeAlloca64(void); +static sqInt genLowcodeAnd32(void); +static sqInt genLowcodeAnd64(void); +static sqInt genLowcodeArithmeticRightShift32(void); +static sqInt genLowcodeArithmeticRightShift64(void); +static sqInt genLowcodeBeginCall(void); +static sqInt NoDbgRegParms genLowcodeBinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeBoolean32ToOop(void); +static sqInt genLowcodeBoolean64ToOop(void); +static sqInt genLowcodeByteSizeOf(void); +static sqInt genLowcodeCallArgumentFloat32(void); +static sqInt genLowcodeCallArgumentFloat64(void); +static sqInt genLowcodeCallArgumentInt32(void); +static sqInt genLowcodeCallArgumentInt64(void); +static sqInt genLowcodeCallArgumentPointer(void); +static sqInt genLowcodeCallArgumentSpace(void); +static sqInt genLowcodeCallArgumentStructure(void); +static sqInt genLowcodeCallInstruction(void); +static sqInt genLowcodeCallPhysical(void); +static sqInt genLowcodeCheckSessionIdentifier(void); +static sqInt genLowcodeCompareAndSwap32(void); +static sqInt genLowcodeDiv32(void); +static sqInt genLowcodeDiv64(void); +static sqInt genLowcodeDuplicateFloat32(void); +static sqInt genLowcodeDuplicateFloat64(void); +static sqInt genLowcodeDuplicateInt32(void); +static sqInt genLowcodeDuplicateInt64(void); +static sqInt genLowcodeDuplicatePointer(void); +static sqInt genLowcodeEffectiveAddress32(void); +static sqInt genLowcodeEffectiveAddress64(void); +static sqInt genLowcodeEndCall(void); +static sqInt genLowcodeEndCallNoCleanup(void); +static sqInt genLowcodeFirstFieldPointer(void); +static sqInt genLowcodeFirstIndexableFieldPointer(void); +static sqInt genLowcodeFloat32Add(void); +static sqInt genLowcodeFloat32Div(void); +static sqInt genLowcodeFloat32Equal(void); +static sqInt genLowcodeFloat32Great(void); +static sqInt genLowcodeFloat32GreatEqual(void); +static sqInt genLowcodeFloat32Less(void); +static sqInt genLowcodeFloat32LessEqual(void); +static sqInt genLowcodeFloat32Mul(void); +static sqInt genLowcodeFloat32Neg(void); +static sqInt genLowcodeFloat32NotEqual(void); +static sqInt genLowcodeFloat32Sqrt(void); +static sqInt genLowcodeFloat32Sub(void); +static sqInt genLowcodeFloat32ToFloat64(void); +static sqInt genLowcodeFloat32ToInt32(void); +static sqInt genLowcodeFloat32ToInt64(void); +static sqInt genLowcodeFloat32ToOop(void); +static sqInt genLowcodeFloat32ToUInt32(void); +static sqInt genLowcodeFloat32ToUInt64(void); +static sqInt genLowcodeFloat64Add(void); +static sqInt genLowcodeFloat64Div(void); +static sqInt genLowcodeFloat64Equal(void); +static sqInt genLowcodeFloat64Great(void); +static sqInt genLowcodeFloat64GreatEqual(void); +static sqInt genLowcodeFloat64Less(void); +static sqInt genLowcodeFloat64LessEqual(void); +static sqInt genLowcodeFloat64Mul(void); +static sqInt genLowcodeFloat64Neg(void); +static sqInt genLowcodeFloat64NotEqual(void); +static sqInt genLowcodeFloat64Sqrt(void); +static sqInt genLowcodeFloat64Sub(void); +static sqInt genLowcodeFloat64ToFloat32(void); +static sqInt genLowcodeFloat64ToInt32(void); +static sqInt genLowcodeFloat64ToInt64(void); +static sqInt genLowcodeFloat64ToOop(void); +static sqInt genLowcodeFloat64ToUInt32(void); +static sqInt genLowcodeFloat64ToUInt64(void); +static sqInt genLowcodeFree(void); +static sqInt genLowcodeInstantiateIndexable32Oop(void); +static sqInt genLowcodeInstantiateIndexableOop(void); +static sqInt genLowcodeInstantiateOop(void); +static sqInt genLowcodeInt32Equal(void); +static sqInt genLowcodeInt32Great(void); +static sqInt genLowcodeInt32GreatEqual(void); +static sqInt genLowcodeInt32Less(void); +static sqInt genLowcodeInt32LessEqual(void); +static sqInt genLowcodeInt32NotEqual(void); +static sqInt genLowcodeInt32ToFloat32(void); +static sqInt genLowcodeInt32ToFloat64(void); +static sqInt genLowcodeInt32ToOop(void); +static sqInt genLowcodeInt32ToPointer(void); +static sqInt genLowcodeInt64Equal(void); +static sqInt genLowcodeInt64Great(void); +static sqInt genLowcodeInt64GreatEqual(void); +static sqInt genLowcodeInt64Less(void); +static sqInt genLowcodeInt64LessEqual(void); +static sqInt genLowcodeInt64NotEqual(void); +static sqInt genLowcodeInt64ToFloat32(void); +static sqInt genLowcodeInt64ToFloat64(void); +static sqInt genLowcodeInt64ToOop(void); +static sqInt genLowcodeInt64ToPointer(void); +static sqInt genLowcodeIsBytes(void); +static sqInt genLowcodeIsFloatObject(void); +static sqInt genLowcodeIsIndexable(void); +static sqInt genLowcodeIsIntegerObject(void); +static sqInt genLowcodeIsPointers(void); +static sqInt genLowcodeIsWords(void); +static sqInt genLowcodeIsWordsOrBytes(void); +static sqInt genLowcodeLeftShift32(void); +static sqInt genLowcodeLeftShift64(void); +static sqInt genLowcodeLoadArgumentAddress(void); +static sqInt genLowcodeLoadArgumentFloat32(void); +static sqInt genLowcodeLoadArgumentFloat64(void); +static sqInt genLowcodeLoadArgumentInt16(void); +static sqInt genLowcodeLoadArgumentInt32(void); +static sqInt genLowcodeLoadArgumentInt64(void); +static sqInt genLowcodeLoadArgumentInt8(void); +static sqInt genLowcodeLoadArgumentPointer(void); +static sqInt genLowcodeLoadArgumentUInt16(void); +static sqInt genLowcodeLoadArgumentUInt32(void); +static sqInt genLowcodeLoadArgumentUInt64(void); +static sqInt genLowcodeLoadArgumentUInt8(void); +static sqInt genLowcodeLoadFloat32FromMemory(void); +static sqInt genLowcodeLoadFloat64FromMemory(void); +static sqInt genLowcodeLoadInt16FromMemory(void); +static sqInt genLowcodeLoadInt32FromMemory(void); +static sqInt genLowcodeLoadInt64FromMemory(void); +static sqInt genLowcodeLoadInt8FromMemory(void); +static sqInt genLowcodeLoadLocalAddress(void); +static sqInt genLowcodeLoadLocalFloat32(void); +static sqInt genLowcodeLoadLocalFloat64(void); +static sqInt genLowcodeLoadLocalInt16(void); +static sqInt genLowcodeLoadLocalInt32(void); +static sqInt genLowcodeLoadLocalInt64(void); +static sqInt genLowcodeLoadLocalInt8(void); +static sqInt genLowcodeLoadLocalPointer(void); +static sqInt genLowcodeLoadLocalUInt16(void); +static sqInt genLowcodeLoadLocalUInt32(void); +static sqInt genLowcodeLoadLocalUInt64(void); +static sqInt genLowcodeLoadLocalUInt8(void); +static sqInt genLowcodeLoadObjectAt(void); +static sqInt genLowcodeLoadObjectField(void); +static sqInt genLowcodeLoadPointerFromMemory(void); +static sqInt genLowcodeLoadUInt16FromMemory(void); +static sqInt genLowcodeLoadUInt32FromMemory(void); +static sqInt genLowcodeLoadUInt64FromMemory(void); +static sqInt genLowcodeLoadUInt8FromMemory(void); +static sqInt genLowcodeLocalFrameSize(void); +static sqInt genLowcodeLockRegisters(void); +static sqInt genLowcodeLockVM(void); +static sqInt genLowcodeMalloc32(void); +static sqInt genLowcodeMalloc64(void); +static sqInt genLowcodeMemcpy32(void); +static sqInt genLowcodeMemcpy64(void); +static sqInt genLowcodeMemcpyFixed(void); +static sqInt genLowcodeMoveFloat32ToPhysical(void); +static sqInt genLowcodeMoveFloat64ToPhysical(void); +static sqInt genLowcodeMoveInt32ToPhysical(void); +static sqInt genLowcodeMoveInt64ToPhysical(void); +static sqInt genLowcodeMovePointerToPhysical(void); +static sqInt genLowcodeMul32(void); +static sqInt genLowcodeMul64(void); +static sqInt genLowcodeNeg32(void); +static sqInt genLowcodeNeg64(void); +static sqInt genLowcodeNot32(void); +static sqInt genLowcodeNot64(void); +static sqInt NoDbgRegParms genLowcodeNullaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeOopEqual(void); +static sqInt genLowcodeOopNotEqual(void); +static sqInt genLowcodeOopSmallIntegerToInt32(void); +static sqInt genLowcodeOopSmallIntegerToInt64(void); +static sqInt genLowcodeOopToBoolean32(void); +static sqInt genLowcodeOopToBoolean64(void); +static sqInt genLowcodeOopToFloat32(void); +static sqInt genLowcodeOopToFloat64(void); +static sqInt genLowcodeOopToInt32(void); +static sqInt genLowcodeOopToInt64(void); +static sqInt genLowcodeOopToPointer(void); +static sqInt genLowcodeOopToPointerReinterpret(void); +static sqInt genLowcodeOopToUInt32(void); +static sqInt genLowcodeOopToUInt64(void); +static sqInt genLowcodeOr32(void); +static sqInt genLowcodeOr64(void); +static sqInt genLowcodePerformCallFloat32(void); +static sqInt genLowcodePerformCallFloat64(void); +static sqInt genLowcodePerformCallIndirectFloat32(void); +static sqInt genLowcodePerformCallIndirectFloat64(void); +static sqInt genLowcodePerformCallIndirectInt32(void); +static sqInt genLowcodePerformCallIndirectInt64(void); +static sqInt genLowcodePerformCallIndirectPointer(void); +static sqInt genLowcodePerformCallIndirectStructure(void); +static sqInt genLowcodePerformCallIndirectVoid(void); +static sqInt genLowcodePerformCallInt32(void); +static sqInt genLowcodePerformCallInt64(void); +static sqInt genLowcodePerformCallPointer(void); +static sqInt genLowcodePerformCallStructure(void); +static sqInt genLowcodePerformCallVoid(void); +static sqInt genLowcodePin(void); +static sqInt genLowcodePlaftormCode(void); +static sqInt genLowcodePointerAddConstantOffset(void); +static sqInt genLowcodePointerAddOffset32(void); +static sqInt genLowcodePointerAddOffset64(void); +static sqInt genLowcodePointerEqual(void); +static sqInt genLowcodePointerNotEqual(void); +static sqInt genLowcodePointerToInt32(void); +static sqInt genLowcodePointerToInt64(void); +static sqInt genLowcodePointerToOop(void); +static sqInt genLowcodePointerToOopReinterprer(void); +static sqInt genLowcodePopFloat32(void); +static sqInt genLowcodePopFloat64(void); +static sqInt genLowcodePopInt32(void); +static sqInt genLowcodePopInt64(void); +static sqInt genLowcodePopMultipleNative(void); +static sqInt genLowcodePopPointer(void); +static sqInt genLowcodePushConstantUInt32(void); +static sqInt genLowcodePushConstantUInt64(void); +static sqInt genLowcodePushNullPointer(void); +static sqInt genLowcodePushOne32(void); +static sqInt genLowcodePushOne64(void); +static sqInt genLowcodePushOneFloat32(void); +static sqInt genLowcodePushOneFloat64(void); +static sqInt genLowcodePushPhysicalFloat32(void); +static sqInt genLowcodePushPhysicalFloat64(void); +static sqInt genLowcodePushPhysicalInt32(void); +static sqInt genLowcodePushPhysicalInt64(void); +static sqInt genLowcodePushPhysicalPointer(void); +static sqInt genLowcodePushSessionIdentifier(void); +static sqInt genLowcodePushZero32(void); +static sqInt genLowcodePushZero64(void); +static sqInt genLowcodePushZeroFloat32(void); +static sqInt genLowcodePushZeroFloat64(void); +static sqInt genLowcodeRem32(void); +static sqInt genLowcodeRem64(void); +static sqInt genLowcodeRightShift32(void); +static sqInt genLowcodeRightShift64(void); +static sqInt genLowcodeSignExtend32From16(void); +static sqInt genLowcodeSignExtend32From8(void); +static sqInt genLowcodeSignExtend64From16(void); +static sqInt genLowcodeSignExtend64From32(void); +static sqInt genLowcodeSignExtend64From8(void); +static sqInt genLowcodeSmallInt32ToOop(void); +static sqInt genLowcodeStoreFloat32ToMemory(void); +static sqInt genLowcodeStoreFloat64ToMemory(void); +static sqInt genLowcodeStoreInt16ToMemory(void); +static sqInt genLowcodeStoreInt32ToMemory(void); +static sqInt genLowcodeStoreInt64ToMemory(void); +static sqInt genLowcodeStoreInt8ToMemory(void); +static sqInt genLowcodeStoreLocalFloat32(void); +static sqInt genLowcodeStoreLocalFloat64(void); +static sqInt genLowcodeStoreLocalInt16(void); +static sqInt genLowcodeStoreLocalInt32(void); +static sqInt genLowcodeStoreLocalInt64(void); +static sqInt genLowcodeStoreLocalInt8(void); +static sqInt genLowcodeStoreLocalPointer(void); +static sqInt genLowcodeStoreObjectField(void); +static sqInt genLowcodeStoreObjectFieldAt(void); +static sqInt genLowcodeStorePointerToMemory(void); +static sqInt genLowcodeSub32(void); +static sqInt genLowcodeSub64(void); +static sqInt NoDbgRegParms genLowcodeTrinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeTruncate32To16(void); +static sqInt genLowcodeTruncate32To8(void); +static sqInt genLowcodeTruncate64To16(void); +static sqInt genLowcodeTruncate64To32(void); +static sqInt genLowcodeTruncate64To8(void); +static sqInt genLowcodeUdiv32(void); +static sqInt genLowcodeUdiv64(void); +static sqInt genLowcodeUint32Great(void); +static sqInt genLowcodeUint32GreatEqual(void); +static sqInt genLowcodeUint32Less(void); +static sqInt genLowcodeUint32LessEqual(void); +static sqInt genLowcodeUint32ToFloat32(void); +static sqInt genLowcodeUint32ToFloat64(void); +static sqInt genLowcodeUint32ToOop(void); +static sqInt genLowcodeUint64Great(void); +static sqInt genLowcodeUint64GreatEqual(void); +static sqInt genLowcodeUint64Less(void); +static sqInt genLowcodeUint64LessEqual(void); +static sqInt genLowcodeUint64ToFloat32(void); +static sqInt genLowcodeUint64ToFloat64(void); +static sqInt genLowcodeUint64ToOop(void); +static sqInt genLowcodeUmul32(void); +static sqInt genLowcodeUmul64(void); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive2(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive3(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive4(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive5(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeUnlockVM(void); +static sqInt genLowcodeUnpin(void); +static sqInt genLowcodeUrem32(void); +static sqInt genLowcodeUrem64(void); +static sqInt genLowcodeXor32(void); +static sqInt genLowcodeXor64(void); +static sqInt genLowcodeZeroExtend32From16(void); +static sqInt genLowcodeZeroExtend32From8(void); +static sqInt genLowcodeZeroExtend64From16(void); +static sqInt genLowcodeZeroExtend64From32(void); +static sqInt genLowcodeZeroExtend64From8(void); +static sqInt NoDbgRegParms genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable); +static sqInt NoDbgRegParms genMethodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICMissTrampolineFor(sqInt numArgs); +static sqInt genPopStackBytecode(void); +static sqInt genPrimitiveClosureValue(void); +static sqInt genPrimitiveFullClosureValue(void); +static sqInt genPrimitivePerform(void); +static sqInt genPushActiveContextBytecode(void); +static sqInt genPushClosureCopyCopiedValuesBytecode(void); +static sqInt NoDbgRegParms genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteralVariable(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteral(sqInt literal); +static sqInt NoDbgRegParms genPushMaybeContextReceiverVariable(sqInt slotIndex); +static sqInt NoDbgRegParms genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index); +static sqInt genPushNewArrayBytecode(void); +static sqInt genPushReceiverBytecode(void); +static sqInt NoDbgRegParms genPushReceiverVariable(sqInt index); +static void genPushRegisterArgs(void); +static sqInt NoDbgRegParms genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex); +static sqInt genPushRemoteTempLongBytecode(void); +static sqInt NoDbgRegParms genPushTemporaryVariable(sqInt index); +static sqInt genReturnReceiver(void); +static sqInt genReturnTopFromBlock(void); +static sqInt genReturnTopFromMethod(void); +static sqInt NoDbgRegParms genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs); +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 genSpecialSelectorArithmetic(void); +static sqInt genSpecialSelectorClass(void); +static sqInt genSpecialSelectorComparison(void); +static sqInt genStaticallyResolvedSpecialSelectorComparison(void); +static sqInt NoDbgRegParms genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex); +static sqInt genUpArrowReturn(void); +static BytecodeFixup * NoDbgRegParms initializeFixupAt(sqInt targetIndex); +static void NoDbgRegParms initSimStackForFramefulMethod(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessBlock(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessMethod(sqInt startpc); +static void leaveNativeFrame(void); +static sqInt liveFloatRegisters(void); +static sqInt liveRegisters(void); +static sqInt NoDbgRegParms mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor); +static void NoDbgRegParms marshallSendArguments(sqInt numArgs); +static sqInt maybeCompilingFirstPassOfBlockWithInitialPushNil(void); +static sqInt NoDbgRegParms mergeWithFixupIfRequired(BytecodeFixup *fixup); +static sqInt NoDbgRegParms methodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms needsFrameIfMod16GENumArgs(sqInt stackDelta); +static sqInt NoDbgRegParms needsFrameIfStackGreaterThanOne(sqInt stackDelta); +static sqInt NoDbgRegParms numberOfSpillsInTopNItems(sqInt n); +static sqInt NoDbgRegParms picAbortTrampolineFor(sqInt numArgs); +static sqInt prevInstIsPCAnnotated(void); +static sqInt NoDbgRegParms pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static void NoDbgRegParms reinitializeFixupsFromthrough(sqInt start, sqInt end); +static sqInt NoDbgRegParms scanBlock(BlockStart *blockStart); +static sqInt scanMethod(void); +static sqInt NoDbgRegParms squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static sqInt NoDbgRegParms squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static void NoDbgRegParms ssAllocateCallReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3); +static void NoDbgRegParms ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredFloatReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr); +static void ssFlushAll(void); +static void NoDbgRegParms ssFlushTo(sqInt index); +static void NoDbgRegParms ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex); +static void NoDbgRegParms ssFlushUpThroughReceiverVariable(sqInt slotIndex); +static void NoDbgRegParms ssFlushUpThroughTemporaryVariable(sqInt tempIndex); +static void NoDbgRegParms ssNativeFlushTo(sqInt index); +static void NoDbgRegParms ssNativePop(sqInt n); +static void NoDbgRegParms ssNativePush(sqInt n); +static CogSimStackNativeEntry * ssNativeTop(void); +static void NoDbgRegParms ssPopNativeSize(sqInt popSize); +static void NoDbgRegParms ssPop(sqInt n); +static sqInt NoDbgRegParms ssPushAnnotatedConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushBaseoffset(sqInt reg, sqInt offset); +static sqInt NoDbgRegParms ssPushConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushDesc(SimStackEntry simStackEntry); +static sqInt NoDbgRegParms ssPushNativeConstantFloat32(float aFloat32); +static sqInt NoDbgRegParms ssPushNativeConstantFloat64(double aFloat64); +static sqInt NoDbgRegParms ssPushNativeConstantInt32(sqInt anInt32); +static sqInt NoDbgRegParms ssPushNativeConstantInt64(sqLong anInt64); +static sqInt NoDbgRegParms ssPushNativeConstantPointer(sqInt aNativePointer); +static sqInt NoDbgRegParms ssPushNativeRegisterDoubleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegisterSingleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegister(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg); +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); +static SimStackEntry ssTopDescriptor(void); +static CogSimStackEntry * NoDbgRegParms ssValue(sqInt n); +static sqInt NoDbgRegParms tryCollapseTempVectorInitializationOfSize(sqInt slots); +static void updateSimSpillBase(void); +static void voidReceiverResultRegContainsSelf(void); + + +/*** Variables ***/ +static AbstractInstruction * abstractOpcodes; +static AbstractInstruction aMethodLabel; +static AbstractInstruction * const backEnd = &aMethodLabel; +static usqInt baseAddress; +static sqInt blockCount; +static AbstractInstruction * blockEntryLabel; +static AbstractInstruction * blockEntryNoContextSwitch; +sqInt blockNoContextSwitchOffset; +static sqInt blockPass; +static BlockStart * blockStarts; +static sqInt breakBlock; +static sqInt breakMethod; +sqInt breakPC; +static sqInt byte0; +static sqInt byte1; +static sqInt byte2; +static sqInt byte3; +static sqInt bytecodePC; +static sqInt bytecodeSetOffset; +void * CFramePointer; +void * CStackPointer; +sqInt cbEntryOffset; +sqInt cbNoSwitchEntryOffset; +sqInt ceBaseFrameReturnTrampoline; +static sqInt ceByteSizeOfTrampoline; +void (*ceCall0ArgsPIC)(void); +void (*ceCall1ArgsPIC)(void); +void (*ceCall2ArgsPIC)(void); +void (*ceCallCogCodePopReceiverAndClassRegs)(void); +void (*ceCallCogCodePopReceiverArg0Regs)(void); +void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void); +void (*ceCallCogCodePopReceiverReg)(void); +sqInt ceCannotResumeTrampoline; +void (*ceCaptureCStackPointers)(void); +static usqIntptr_t (*ceCheckFeaturesFunction)(void); +sqInt ceCheckForInterruptTrampoline; +static sqInt ceCPICMissTrampoline; +void (*ceEnterCogCodePopReceiverReg)(void); +static sqInt ceFetchContextInstVarTrampoline; +static sqInt ceFFICalloutTrampoline; +static sqInt ceFloatObjectOfTrampoline; +static sqInt ceFloatValueOfTrampoline; +static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to); +static sqInt ceFreeTrampoline; +usqIntptr_t (*ceGetFP)(void); +usqIntptr_t (*ceGetSP)(void); +static sqInt ceInstantiateClassIndexableSizeTrampoline; +static sqInt ceInstantiateClassTrampoline; +static sqInt ceLargeActiveContextInBlockTrampoline; +static sqInt ceLargeActiveContextInFullBlockTrampoline; +static sqInt ceLargeActiveContextInMethodTrampoline; +static sqInt ceMallocTrampoline; +static sqInt ceMethodAbortTrampoline; +static sqInt ceNonLocalReturnTrampoline; +static sqInt cePICAbortTrampoline; +static sqInt cePositive32BitIntegerTrampoline; +static sqInt cePositive32BitValueOfTrampoline; +static sqInt cePositive64BitIntegerTrampoline; +static sqInt cePositive64BitValueOfTrampoline; +static sqInt cePrimReturnEnterCogCode; +static sqInt cePrimReturnEnterCogCodeProfiling; +sqInt ceReturnToInterpreterTrampoline; +static sqInt ceScheduleScavengeTrampoline; +static sqInt ceSendMustBeBooleanAddFalseTrampoline; +static sqInt ceSendMustBeBooleanAddTrueTrampoline; +static sqInt ceSigned32BitIntegerTrampoline; +static sqInt ceSigned32BitValueOfTrampoline; +static sqInt ceSigned64BitIntegerTrampoline; +static sqInt ceSigned64BitValueOfTrampoline; +static sqInt ceSmallActiveContextInBlockTrampoline; +static sqInt ceSmallActiveContextInFullBlockTrampoline; +static sqInt ceSmallActiveContextInMethodTrampoline; +static sqInt ceStoreCheckContextReceiverTrampoline; +static sqInt ceStoreCheckTrampoline; +static sqInt ceStoreContextInstVarTrampoline; +#if IMMUTABILITY +sqInt ceStoreTrampolines[5]; +#endif +static sqInt ceTraceBlockActivationTrampoline; +static sqInt ceTraceLinkedSendTrampoline; +static sqInt ceTraceStoreTrampoline; +usqIntptr_t (*ceTryLockVMOwner)(void); +void (*ceUnlockVMOwner)(void); +sqInt cFramePointerInUse; +static sqInt checkedEntryAlignment; +static sqInt closedPICSize; +sqInt cmEntryOffset; +sqInt cmNoCheckEntryOffset; +static sqInt codeBase; +static sqInt codeModified; +static sqInt compilationTrace; +static sqInt cPICCaseSize; +static sqInt cPICEndOfCodeOffset; +static sqInt cPICEndSize; +static sqInt cPICPrototype; +static const int cStackAlignment = STACK_ALIGN_BYTES; +static sqInt currentCallCleanUpSize; +static sqInt deadCode; +static sqInt debugBytecodePointers; +static sqInt debugFixupBreaks; +static sqInt debugOpcodeIndices; +usqIntptr_t debugPrimCallStackOffset; +static sqInt debugStackPointers; +static sqInt directedSuperSendTrampolines[NumSendTrampolines]; +static sqInt disassemblingMethod; +static AbstractInstruction * endCPICCase0; +static sqInt endPC; +static AbstractInstruction * entry; +static sqInt entryPointMask; +static CogMethod * enumeratingCogMethod; +static sqInt expectedFPAlignment; +static sqInt expectedSPAlignment; +static sqInt extA; +static sqInt extB; +static sqInt externalPrimCallOffsets[MaxNumArgs + 1]; +static sqInt externalPrimJumpOffsets[MaxNumArgs + 1]; +static sqInt externalSetPrimOffsets[MaxNumArgs + 1]; +static sqInt firstCPICCaseOffset; +static sqInt firstOpcodeIndex; +static sqInt firstSend; +static BytecodeFixup * fixups; +static AbstractInstruction * fullBlockEntry; +static AbstractInstruction * fullBlockNoContextSwitchEntry; +static BytecodeDescriptor generatorTable[512] = { + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extendedPushBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { extendedStoreBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { extendedStoreAndPopBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { doubleExtendedDoAnythingBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtendedSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, + { genSecondExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushActiveContextBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushClosureCopyCopiedValuesBytecode, v3BlockCodeSize, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantZeroBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantOneBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushPseudoVariable, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNilFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genExtNopBytecode, 0, needsFrameNever, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genUnconditionalTrapBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extABytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extBBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtPushReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genExtPushLitVarDirSupBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushLiteralBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongPushTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushIntegerBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushCharacterBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtSendSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtUnconditionalJump, v4LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfTrue, v4LongBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfFalse, v4LongBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSistaExtStoreAndPopReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreAndPopLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSistaExtStoreReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushFullClosureBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushClosureBytecode, v4BlockCodeSize, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genExtPushRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtStoreRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtStoreAndPopRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtJumpIfNotInstanceOfBehaviorsBytecode, v4LongBranchIfNotInstanceOfDistance, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 } +}; +static sqInt guardPageSize; +static sqInt hasNativeFrame; +static sqInt hasYoungReferent; +static sqInt inBlock; +static sqInt initialPC; +static sqInt introspectionData; +static sqInt introspectionDataIndex; +static int labelCounter; +static sqInt lastDumpedLiteralIndex; +static sqInt lastSend; +static usqInt limitAddress; +static AbstractInstruction * literals; +static sqInt literalsSize; +static sqInt maxCPICCases; +static sqInt maxLitIndex; +static sqInt methodAbortTrampolines[4]; +static sqInt methodBytesFreedSinceLastCompaction; +static sqInt methodCount; +static sqInt methodHeader; +static AbstractInstruction * const methodLabel = &aMethodLabel; +static sqInt methodObj; +static sqInt methodOrBlockNumArgs; +static sqInt methodOrBlockNumTemps; +static sqInt methodZoneBase; +static usqIntptr_t minValidCallAddress; +sqInt missOffset; +static usqInt mzFreeStart; +static sqInt needsFrame; +static sqInt nextLiteralIndex; +static AbstractInstruction * noCheckEntry; +static sqInt numAbstractOpcodes; +static sqInt numExtB; +static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; +static sqInt opcodeIndex; +static CogMethod *openPICList = 0; +static sqInt openPICSize; +static CogSSOptStatus optStatus; +static sqInt ordinarySendTrampolines[NumSendTrampolines]; +static sqInt picAbortTrampolines[4]; +static AbstractInstruction * picInterpretAbort; +static sqInt picMissTrampolines[4]; +static void (*postCompileHook)(CogMethod *); +static BytecodeDescriptor * prevBCDescriptor; +static AbstractInstruction * primInvokeInstruction; +static sqInt primitiveIndex; +static AbstractInstruction * primSetFunctionLabel; +void (*realCECallCogCodePopReceiverAndClassRegs)(void); +void (*realCECallCogCodePopReceiverArg0Regs)(void); +void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void); +void (*realCECallCogCodePopReceiverReg)(void); +void (*realCEEnterCogCodePopReceiverReg)(void); +static sqInt regArgsHaveBeenPushed; +static sqInt runtimeObjectRefIndex; +static sqInt savedFirstOpcodeIndex; +static sqInt savedLastDumpedLiteralIndex; +static sqInt savedNextLiteralIndex; +static AbstractInstruction * sendMiss; +static sqInt simNativeSpillBase; +static CogSimStackNativeEntry simNativeStack[19]; +static sqInt simNativeStackPtr; +static sqInt simNativeStackSize; +static CogSimStackEntry simSelf; +static sqInt simSpillBase; +static SimStackEntry simStack[70]; +static sqInt simStackPtr; +static AbstractInstruction * stackCheckLabel; +static AbstractInstruction * stackOverflowCall; +static sqInt superSendTrampolines[NumSendTrampolines]; +static sqInt tempOop; +int traceFlags = 8 /* prim trace log on by default */; +sqInt traceStores; +static char *trampolineAddresses[NumTrampolines*2]; +static sqInt trampolineTableIndex; +static sqInt uncheckedEntryAlignment; +static usqInt unpairedMethodList; +static sqInt useTwoPaths; +static usqInt youngReferrers; + + +/*** Macros ***/ +#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 +#define abstractInstructionAt(index) (&abstractOpcodes[index]) +#define allocateBlockStarts(numBlocks) do { \ + blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \ +} while (0) +#define backEnd() backEnd +#define blockAlignment(self) 8 +#define blockStartAt(index) (&blockStarts[index]) +#define breakOnImplicitReceiver() (traceFlags & 64) +#define ceBaseFrameReturnPC() ceBaseFrameReturnTrampoline +#define ceCannotResumePC() ((usqInt)ceCannotResumeTrampoline) +#define ceCheckFeatures() ceCheckFeaturesFunction() +#define ceReturnToInterpreterPC() ((usqInt)ceReturnToInterpreterTrampoline) +#define cFramePointerAddress() ((usqIntptr_t)&CFramePointer) +#define compileSendTrace() ((traceFlags & 258) == 258) +#define cr() putchar('\n') +#define cStackPointerAddress() ((usqIntptr_t)&CStackPointer) +#define entryOffset() cmEntryOffset +#define generatorAt(index) (&generatorTable[index]) +#define getCFramePointer() CFramePointer +#define getCStackPointer() CStackPointer +#define getIsObjectReference() 2 +#define halt() warning("halt") +#define haltmsg(msg) warning("halt: " msg) +#define interpretOffset() missOffset +#define methodLabel() methodLabel +#define methodZoneBase() methodZoneBase +#define minCallAddress() minValidCallAddress +#define noCheckEntryOffset() cmNoCheckEntryOffset +#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset +#define notYetImplemented() warning("not yet implemented") +#define printNum(n) printf("%ld", (long) n) +#define printOnTrace() (traceFlags & 1) +#define print(aString) printf(aString) +#define recordBlockTrace() (traceFlags & 4) +#define recordEventTrace() (traceFlags & 16) +#define recordOverflowTrace() (traceFlags & 32) +#define recordPrimTrace() (traceFlags & 8) +#define recordSendTrace() (traceFlags & 2) +#define reportError(n) warning("compilation error") +#define setCFramePointer(theFP) (CFramePointer = (void *)(theFP)) +#define setCStackPointer(theSP) (CStackPointer = (void *)(theSP)) +#define tryLockVMOwner() (ceTryLockVMOwner() != 0) +#define unlockVMOwner() ceUnlockVMOwner() +#define nextOpenPIC methodObject +#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work +#define freeStart() mzFreeStart +#define limitZony() ((CogMethod *)mzFreeStart) +#define methodBytesFreedSinceLastCompaction() methodBytesFreedSinceLastCompaction +#define roundUpLength(numBytes) ((numBytes) + 7 & -8) +#define youngReferrers() youngReferrers +#define maybeConstant(sse) ((sse)->constant) +#define literalInstructionAt(index) (&literals[index]) +#define fullBlockEntryOffset() cbEntryOffset +#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset +#define fixupAt(index) (&fixups[index]) +#define simNativeStackAt(index) (simNativeStack + (index)) +#define simStackAt(index) (simStack + (index)) +#define traceDescriptor(ign) 0 +#define traceFixup(ign) 0 +#define traceMerge(ign) 0 +#define traceSimStack() 0 +#define traceSpill(ign) 0 +#define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType)) +#define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0])) +#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop)) +#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop)) +#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop)) +#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop)) +#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop)) + + + /* CogAbstractInstruction>>#addDependent: */ +static AbstractInstruction * NoDbgRegParms +addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) +{ + if (!(((self_in_addDependent->dependent)) == null)) { + (anInstruction->dependent = (self_in_addDependent->dependent)); + } + return ((self_in_addDependent->dependent) = anInstruction); +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. */ + + /* CogAbstractInstruction>>#availableFloatRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << DPFPReg0))) { + return DPFPReg0; + } + if (!(liveRegsMask & (1U << DPFPReg1))) { + return DPFPReg1; + } + if (!(liveRegsMask & (1U << DPFPReg2))) { + return DPFPReg2; + } + if (!(liveRegsMask & (1U << DPFPReg3))) { + return DPFPReg3; + } + if (!(liveRegsMask & (1U << DPFPReg4))) { + return DPFPReg4; + } + if (!(liveRegsMask & (1U << DPFPReg5))) { + return DPFPReg5; + } + if (!(liveRegsMask & (1U << DPFPReg6))) { + return DPFPReg6; + } + if (!(liveRegsMask & (1U << DPFPReg7))) { + return DPFPReg7; + } + return NoReg; +} + + +/* For out-of-line literal support, clone a literal from a literal. */ + + /* CogAbstractInstruction>>#cloneLiteralFrom: */ +static AbstractInstruction * NoDbgRegParms +cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) +{ + assert((((existingLiteral->opcode)) == Literal) + && ((((self_in_cloneLiteralFrom->dependent)) == null) + && (((self_in_cloneLiteralFrom->address)) == null))); + (self_in_cloneLiteralFrom->opcode) = Literal; + (self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation); + ((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]); + ((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]); + ((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]); + return self_in_cloneLiteralFrom; +} + + /* CogAbstractInstruction>>#genWriteCResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = R0; + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCResultIntoReg; +} + + /* CogAbstractInstruction>>#genWriteCSecondResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = cResultRegisterHigh(); + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCSecondResultIntoReg; +} + + +/* Get the target of a jump instruction. Jumps have the target in the first + operand. + */ + + /* CogAbstractInstruction>>#getJmpTarget */ +static AbstractInstruction * NoDbgRegParms +getJmpTarget(AbstractInstruction * self_in_getJmpTarget) +{ + return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0])); +} + + +/* Answer if operand is in the current compilation; and henced could be a + candidate for pc-relative addressing. + */ + + /* CogAbstractInstruction>>#inCurrentCompilation: */ +static sqInt NoDbgRegParms +inCurrentCompilation(AbstractInstruction * self_in_inCurrentCompilation, sqInt operand) +{ + return ((addressIsInInstructions(((AbstractInstruction *) operand))) + || ((((AbstractInstruction *) operand)) == (methodLabel()))) + || (((((usqInt)operand)) >= ((methodLabel->address))) + && ((((usqInt)operand)) < (youngReferrers()))); +} + + +/* For out-of-line literal support, initialize a sharable literal. */ + + /* CogAbstractInstruction>>#initializeSharableLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) +{ + (self_in_initializeSharableLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeSharableLiteral->annotation) = null; + (self_in_initializeSharableLiteral->address) = null; + (self_in_initializeSharableLiteral->dependent) = null; + ((self_in_initializeSharableLiteral->operands))[0] = literal; + ((self_in_initializeSharableLiteral->operands))[1] = 1; + ((self_in_initializeSharableLiteral->operands))[2] = -1; + return self_in_initializeSharableLiteral; +} + + +/* For out-of-line literal support, initialize an unsharable literal. */ + + /* CogAbstractInstruction>>#initializeUniqueLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) +{ + (self_in_initializeUniqueLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeUniqueLiteral->annotation) = null; + (self_in_initializeUniqueLiteral->address) = null; + (self_in_initializeUniqueLiteral->dependent) = null; + ((self_in_initializeUniqueLiteral->operands))[0] = literal; + ((self_in_initializeUniqueLiteral->operands))[1] = 0; + ((self_in_initializeUniqueLiteral->operands))[2] = -1; + return self_in_initializeUniqueLiteral; +} + + /* CogAbstractInstruction>>#isAFixup: */ +static sqInt NoDbgRegParms +isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) +{ + return addressIsInFixups(fixupOrAddress); +} + + /* CogAbstractInstruction>>#isAnInstruction: */ +static sqInt NoDbgRegParms +isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) +{ + return (addressIsInInstructions(addressOrInstruction)) + || (addressOrInstruction == (methodLabel())); +} + + /* CogAbstractInstruction>>#isJump */ +static sqInt NoDbgRegParms +isJump(AbstractInstruction * self_in_isJump) +{ + return ((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump)); +} + + +/* 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 + to answer false + for values in the interpreter or the object memory. */ + + /* CogAbstractInstruction>>#isWithinMwOffsetRange: */ +static sqInt NoDbgRegParms +isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress) +{ + return 1; +} + + +/* Set the target of a jump instruction. These all have the target in the + first operand. */ + + /* CogAbstractInstruction>>#jmpTarget: */ +static AbstractInstruction * NoDbgRegParms +jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction) +{ + ((self_in_jmpTarget->operands))[0] = (((usqInt)anAbstractInstruction)); + return anAbstractInstruction; +} + + +/* 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 usqIntptr_t NoDbgRegParms +labelOffset(AbstractInstruction * self_in_labelOffset) +{ + return ((self_in_labelOffset->operands))[1]; +} + + +/* Answer the constant loaded by the instruction sequence just before this + address: + */ + + /* CogAbstractInstruction>>#literal32BeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress) +{ + return literalBeforeFollowingAddress(self_in_literal32BeforeFollowingAddress, followingAddress); +} + + +/* We assume here that calls and jumps look the same as regards their + displacement. This works on at least x86, ARM and x86_64. Processors on + which that isn't the + case can override as necessary. */ + + /* CogAbstractInstruction>>#relocateJumpLongBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + relocateCallBeforeReturnPCby(self_in_relocateJumpLongBeforeFollowingAddressby, pc, delta); + return self_in_relocateJumpLongBeforeFollowingAddressby; +} + + +/* Relocate a long conditional jump before pc. Default to relocating a + non-conditional jump. + Processors that have different formats for conditional and unconditional + jumps override. */ + + /* CogAbstractInstruction>>#relocateJumpLongConditionalBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + relocateJumpLongBeforeFollowingAddressby(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc, delta); + return self_in_relocateJumpLongConditionalBeforeFollowingAddressby; +} + + /* CogAbstractInstruction>>#resolveJumpTarget */ +static AbstractInstruction * NoDbgRegParms +resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget) +{ + BytecodeFixup *fixup; + + assert(isJump(self_in_resolveJumpTarget)); + fixup = ((BytecodeFixup *) (((self_in_resolveJumpTarget->operands))[0])); + if (isAFixup(self_in_resolveJumpTarget, fixup)) { + assert(addressIsInInstructions((fixup->targetInstruction))); + jmpTarget(self_in_resolveJumpTarget, (fixup->targetInstruction)); + } + return self_in_resolveJumpTarget; +} + + +/* Rewrite a conditional jump long to jump to target. This version defaults + to using + rewriteJumpLongAt:, which works for many ISAs. Subclasses override if + necessary. */ + + /* CogAbstractInstruction>>#rewriteConditionalJumpLongAt:target: */ +static sqInt NoDbgRegParms +rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteJumpLongAttarget(self_in_rewriteConditionalJumpLongAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* A hack hook to allow ARM to override the simulated address for the + short-cut trampolines, + and to allow x64 to address CStackPointer and CFramePointer relative to + VarBaseReg. + */ + + /* CogAbstractInstruction>>#wantsNearAddressFor: */ +static sqInt NoDbgRegParms +wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject) +{ + return 0; +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + ADDS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-23 */ + + /* CogARMCompiler>>#adds:rn:imm:ror: */ +static sqInt NoDbgRegParms +addsrnimmror(AbstractInstruction * self_in_addsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc. + ADD destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-23 */ + + /* CogARMCompiler>>#add:rn:imm:ror: */ +static sqInt NoDbgRegParms +addrnimmror(AbstractInstruction * self_in_addrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (0U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* return an ADD destReg, srcReg, addReg instruction + ADD destReg, srcReg, addReg - ARM_ARM v7 DDI10406 p. A8-24 */ + + /* CogARMCompiler>>#add:rn:rm: */ +static sqInt NoDbgRegParms +addrnrm(AbstractInstruction * self_in_addrnrm, sqInt destReg, sqInt srcReg, sqInt addReg) +{ + return (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (0U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (addReg & 0xFFF); +} + + +/* return the address of the __aeabi_idivmod() call provided by the ARM low + level libs to do an integer divide that returns the quo in R0 and rem in + R1. A word on the somewhat strange usage of idivmod herein; we need a + declaration for the _aeabi_idivmod helper function, despite the fact that + in a simple C program test, you don't. To get that declaration we need a + variable to hang it off and said variable needs to be referred to in order + to not get culled. Thus the temp var idivmod, the declaration for it that + has nothing to do with it and the odd usage in the inSmalltalk: block. + */ + + /* CogARMCompiler>>#aeabiDivModFunctionAddr */ +static usqInt NoDbgRegParms +aeabiDivModFunctionAddr(AbstractInstruction * self_in_aeabiDivModFunctionAddr) +{ + extern void __aeabi_idivmod(int dividend, int divisor); + + return (usqInt)__aeabi_idivmod; +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + ANDS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-34 */ + + /* CogARMCompiler>>#ands:rn:imm:ror: */ +static sqInt NoDbgRegParms +andsrnimmror(AbstractInstruction * self_in_andsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + AND destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-34 */ + + /* CogARMCompiler>>#and:rn:imm:ror: */ +static sqInt NoDbgRegParms +andrnimmror(AbstractInstruction * self_in_andrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (0U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. + N.B. Do /not/ allocate TempReg. */ +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. + N.B. Do /not/ allocate TempReg. */ + + /* CogARMCompiler>>#availableRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << Extra0Reg))) { + return Extra0Reg; + } + if (!(liveRegsMask & (1U << Extra1Reg))) { + return Extra1Reg; + } + if (!(liveRegsMask & (1U << Extra2Reg))) { + return Extra2Reg; + } + if (!(liveRegsMask & (1U << Arg1Reg))) { + return Arg1Reg; + } + if (!(liveRegsMask & (1U << Arg0Reg))) { + return Arg0Reg; + } + if (!(liveRegsMask & (1U << SendNumArgsReg))) { + return SendNumArgsReg; + } + if (!(liveRegsMask & (1U << ClassReg))) { + return ClassReg; + } + if (!(liveRegsMask & (1U << ReceiverResultReg))) { + return ReceiverResultReg; + } + return NoReg; +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + BICS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 pp. + A8-50-1 + */ + + /* CogARMCompiler>>#bics:rn:imm:ror: */ +static sqInt NoDbgRegParms +bicsrnimmror(AbstractInstruction * self_in_bicsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(BicOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* return a BL offset instruction; offset is signed 24bits of WORD offset, so + +_32Mbyte range. Return address is in LR + BL offset - ARM_ARM v7 DDI10406 pp. A8-58-9 + */ + + /* CogARMCompiler>>#bl: */ +static sqInt NoDbgRegParms +bl(AbstractInstruction * self_in_bl, sqInt offset) +{ + return (((int)((usqInt)(AL) << 28))) | ((((int)((usqInt)((10 | (1 & 1))) << 24))) | ((((usqInt) offset) >> 2) & 0xFFFFFF)); +} + + +/* return a B offset instruction; offset is signed 24bits of WORD offset, so + +_32Mbyte range + B offset - ARM_ARM v7 DDI10406 pp. A8-44-5 + */ + + /* CogARMCompiler>>#b: */ +static sqInt NoDbgRegParms +b(AbstractInstruction * self_in_b, sqInt offset) +{ + return (((int)((usqInt)(AL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset) >> 2) & 0xFFFFFF)); +} + + +/* ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls + and jumps. + */ + + /* CogARMCompiler>>#callInstructionByteSize */ +static sqInt NoDbgRegParms +callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize) +{ + return 4; +} + + +/* Answer the address that the call immediately preceding + callSiteReturnAddress will jump to. + */ +/* this is also used by #jumpLongTargetBeforeFollowingAddress:. */ + + /* CogARMCompiler>>#callTargetFromReturnAddress: */ +static sqInt NoDbgRegParms +callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress) +{ + sqInt call; + sqInt callDistance; + sqInt relativeJump; + + call = longAt(callSiteReturnAddress - 4); + assert((instructionIsB(self_in_callTargetFromReturnAddress, call)) + || (instructionIsBL(self_in_callTargetFromReturnAddress, call))); + /* begin extractOffsetFromBL: */ + relativeJump = call & 0xFFFFFF; + relativeJump = (relativeJump & (1U << 23) + ? ((int) (((sqInt)((usqInt)((relativeJump | 0x3F000000)) << 2)))) + : ((sqInt)((usqInt)(relativeJump) << 2))); + callDistance = relativeJump; + return (callSiteReturnAddress + 4) + (((int) callDistance)); +} + + +/* Because we don't use Thumb, each ARM instruction has 4 bytes. Many + abstract opcodes need more than one instruction. Instructions that refer + to constants and/or literals depend on literals being stored in-line or + out-of-line. + N.B. The ^N forms are to get around the bytecode compiler's long branch + limits which are exceeded when each case jumps around the otherwise. */ + + /* CogARMCompiler>>#computeMaximumSize */ +static sqInt NoDbgRegParms +computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize) +{ + sqInt constant; + sqInt constant1; + sqInt constant2; + sqInt constant4; + sqInt constant5; + sqInt i; + sqInt i1; + sqInt i2; + sqInt i3; + sqInt n; + sqInt r; + sqInt u; + sqInt value; + unsigned int value1; + + + switch ((self_in_computeMaximumSize->opcode)) { + case Label: + return 0; + + case Literal: + case Fill32: + case Nop: + case Call: + case JumpR: + case Jump: + case JumpLong: + case JumpZero: + case JumpNonZero: + case JumpNegative: + case JumpNonNegative: + case JumpOverflow: + case JumpNoOverflow: + case JumpCarry: + case JumpNoCarry: + case JumpLess: + case JumpGreaterOrEqual: + case JumpGreater: + case JumpLessOrEqual: + case JumpBelow: + case JumpAboveOrEqual: + case JumpAbove: + case JumpBelowOrEqual: + case JumpLongZero: + case JumpLongNonZero: + case Stop: + case AddRR: + case AndRR: + case CmpRR: + case OrRR: + case XorRR: + case SubRR: + case NegateR: + case LogicalShiftLeftCqR: + case LogicalShiftRightCqR: + case ArithmeticShiftRightCqR: + case LogicalShiftLeftRR: + case LogicalShiftRightRR: + case ArithmeticShiftRightRR: + case AddRdRd: + case CmpRdRd: + case SubRdRd: + case MulRdRd: + case DivRdRd: + case SqrtRd: + case SMULL: + case MSR: + case CMPSMULL: + case PopLDM: + case PushSTM: + case MoveRR: + case MoveRdRd: + case MoveXbrRR: + case MoveRXbrR: + case MoveXwrRR: + case MoveRXwrR: + case PopR: + case PushR: + return 4; + + case AlignmentNops: + return (((self_in_computeMaximumSize->operands))[0]) - 4; + + case CallFull: + case JumpFull: + case AddCwR: + case AndCwR: + case CmpCwR: + case OrCwR: + case SubCwR: + case XorCwR: + case MoveRdM64r: + case MoveM64rRd: + return 4 + 4; + + case JumpFPEqual: + case JumpFPNotEqual: + case JumpFPLess: + case JumpFPGreaterOrEqual: + case JumpFPGreater: + case JumpFPLessOrEqual: + case JumpFPOrdered: + case JumpFPUnordered: + case ConvertRRd: + return 8; + + case RetN: + return ((((self_in_computeMaximumSize->operands))[0]) == 0 + ? 4 + : 8); + + case AddCqR: + case CmpCqR: + case SubCqR: + /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ + constant = ((self_in_computeMaximumSize->operands))[0]; + value = constant; + while (1) { + if ((value & 0xFF) == value) { + return 4; + + } + for (i1 = 2; i1 <= 30; i1 += 2) { + if ((value & (((0xFFU << i1) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i1)))) == value) { + return 4; + + } + } + if (!((value == constant) + && (constant != 0))) break; + value = -constant; + } + return 4 + 4; + + + case AndCqR: + case AndCqRR: + case XorCqR: + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + constant1 = ((self_in_computeMaximumSize->operands))[0]; + value1 = constant1; + while (1) { + if ((value1 & 0xFF) == value1) { + return 4; + + } + for (i2 = 2; i2 <= 30; i2 += 2) { + if ((value1 & (((0xFFU << i2) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i2)))) == value1) { + return 4; + + } + } + if (!(value1 == constant1)) break; + value1 = (constant1 < 0 + ? -1 - constant1 + : (unsigned int)~constant1); + } + return 8; + + + case OrCqR: + case TstCqR: + case LoadEffectiveAddressMwrR: + case MoveM16rR: + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + constant2 = ((self_in_computeMaximumSize->operands))[0]; + if ((constant2 & 0xFF) == constant2) { + return 4; + + } + for (i3 = 2; i3 <= 30; i3 += 2) { + if ((constant2 & (((0xFFU << i3) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i3)))) == constant2) { + return 4; + + } + } + return 4 + 4; + + + case MoveCqR: + return 4; + + case MoveCwR: + return 4; + + case MoveAwR: + case MoveAbR: + case PrefetchAw: + return (isAddressRelativeToVarBase(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 4 + : 4 + 4); + + case MoveRAw: + case MoveRAb: + return (isAddressRelativeToVarBase(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? 4 + : 4 + 4); + + case MoveRMwr: + case MoveRMbr: + case MoveRM16r: + /* begin is12BitValue:ifTrue:ifFalse: */ + constant4 = ((self_in_computeMaximumSize->operands))[1]; + if ((SQABS(constant4)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (constant4 >= 0) { + return 4; + + } + else { + return 4; + + } + } + else { + return 4 + 4; + + } + + case MoveMbrR: + case MoveMwrR: + /* begin is12BitValue:ifTrue:ifFalse: */ + constant5 = ((self_in_computeMaximumSize->operands))[0]; + if ((SQABS(constant5)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (constant5 >= 0) { + return 4; + + } + else { + return 4; + + } + } + else { + return 4 + 4; + + } + + case PushCw: + return 4 + 4; + + case PushCq: + return 4 + 4; + + default: + error("Case not found and no otherwise clause"); + } + return 0; +} + + +/* According to IHI0042E ARM Architecture Procedure Calling Standard, in + section 5.1.1: + A subroutine must preserve the contents of the registers r4-r8, r10, r11 + and SP (and r9 in PCS variants that designate r9 as v6). + SP = r13, so... */ + + /* CogARMCompiler>>#concreteCalleeSavedRegisterMask */ +static sqInt NoDbgRegParms +concreteCalleeSavedRegisterMask(AbstractInstruction * self_in_concreteCalleeSavedRegisterMask) +{ + return 3568; +} + + +/* According to IHI0042E ARM Architecture Procedure Calling Standard, in + section 5.1.1: + A subroutine must preserve the contents of the registers r4-r8, r10, r11 + and SP (and r9 in PCS variants that designate r9 as v6). + SP = r13, so the callee-saved regs are r4-r8 & r10-r12. + The caller-saved registers are those that are not callee-saved and not + reserved for hardware/abi uses, + i..e r0-r3, r9 & r12. */ + + /* CogARMCompiler>>#concreteCallerSavedRegisterMask */ +static sqInt NoDbgRegParms +concreteCallerSavedRegisterMask(AbstractInstruction * self_in_concreteCallerSavedRegisterMask) +{ + return 4623; +} + + +/* 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, + setting machineCodeSize, and answer the following address. */ + + /* CogARMCompiler>>#concretizeAt: */ +static sqInt NoDbgRegParms +concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress) +{ + assert((actualAddress % 4) == 0); + (self_in_concretizeAt->address) = actualAddress; + dispatchConcretize(self_in_concretizeAt); + assert((((self_in_concretizeAt->maxSize)) == null) + || (((self_in_concretizeAt->maxSize)) >= ((self_in_concretizeAt->machineCodeSize)))); + return actualAddress + ((self_in_concretizeAt->machineCodeSize)); +} + + +/* Generate a CMP a, b, ASR #31 instruction, specifically for comparing the + resutls of SMULLs in genMulR:R: + */ + + /* CogARMCompiler>>#concretizeCMPSMULL */ +static usqInt NoDbgRegParms +concretizeCMPSMULL(AbstractInstruction * self_in_concretizeCMPSMULL) +{ + sqInt aWord; + usqIntptr_t hiReg; + usqIntptr_t loReg; + + hiReg = ((self_in_concretizeCMPSMULL->operands))[0]; + loReg = ((self_in_concretizeCMPSMULL->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = (((((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((hiReg << 16) | (0U << 12))) + (0x1FU << 7)) + (2U << 5)) + loReg; + ((self_in_concretizeCMPSMULL->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeCMPSMULL->machineCodeSize) = 4); +} + + +/* Concretize the current instruction, but with a condition. */ + + /* CogARMCompiler>>#concretizeConditionalInstruction */ +static void NoDbgRegParms +concretizeConditionalInstruction(AbstractInstruction * self_in_concretizeConditionalInstruction) +{ + sqInt aWord; + sqInt i; + sqInt instr; + unsigned char savedCond; + + assert(((self_in_concretizeConditionalInstruction->conditionOrNil)) != null); + savedCond = (self_in_concretizeConditionalInstruction->conditionOrNil); + (self_in_concretizeConditionalInstruction->conditionOrNil) = null; + dispatchConcretize(self_in_concretizeConditionalInstruction); + (self_in_concretizeConditionalInstruction->conditionOrNil) = savedCond; + for (i = 0; i < ((self_in_concretizeConditionalInstruction->machineCodeSize)); i += 4) { + instr = (((((self_in_concretizeConditionalInstruction->machineCode))[i / 4]) | (15U << 28)) - (15U << 28)); + /* begin machineCodeAt:put: */ + aWord = instr | (((int)((usqInt)((((self_in_concretizeConditionalInstruction->conditionOrNil)) & 15)) << 28))); + ((self_in_concretizeConditionalInstruction->machineCode))[i / 4] = aWord; + } + return; +} + + +/* fill with operand 0 according to the processor's endianness */ + + /* CogARMCompiler>>#concretizeFill32 */ +static usqInt NoDbgRegParms +concretizeFill32(AbstractInstruction * self_in_concretizeFill32) +{ + sqInt aWord; + + /* begin machineCodeAt:put: */ + aWord = ((self_in_concretizeFill32->operands))[0]; + ((self_in_concretizeFill32->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeFill32->machineCodeSize) = 4); +} + + +/* Generate an MSR CPSR_f, #flags instruction. + Note that we only have business with the NZCV flags so we use + N -> 8 + Z -> 4 + C -> 2 + V -> 1. + You don't want to mess with this too much. + */ + + /* CogARMCompiler>>#concretizeMSR */ +static usqInt NoDbgRegParms +concretizeMSR(AbstractInstruction * self_in_concretizeMSR) +{ + sqInt aWord; + usqIntptr_t flags; + + flags = ((self_in_concretizeMSR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = msr(self_in_concretizeMSR, flags); + ((self_in_concretizeMSR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMSR->machineCodeSize) = 4); +} + + /* CogARMCompiler>>#concretizePushOrPopMultipleRegisters: */ +static usqInt NoDbgRegParms +concretizePushOrPopMultipleRegisters(AbstractInstruction * self_in_concretizePushOrPopMultipleRegisters, sqInt doPush) +{ + assert((((self_in_concretizePushOrPopMultipleRegisters->operands))[0]) != 0); + ((self_in_concretizePushOrPopMultipleRegisters->machineCode))[0] = ((((((int)((usqInt)(AL) << 28))) + ((doPush + ? 146U << 20 + : 139U << 20))) + (((int)((usqInt)(SP) << 16)))) + (((self_in_concretizePushOrPopMultipleRegisters->operands))[0])); + return ((self_in_concretizePushOrPopMultipleRegisters->machineCodeSize) = 4); +} + + +/* Generate an SMULL loResultReg, hiResultReg, srcA, srcB instruction */ + + /* CogARMCompiler>>#concretizeSMULL */ +static usqInt NoDbgRegParms +concretizeSMULL(AbstractInstruction * self_in_concretizeSMULL) +{ + sqInt aWord; + sqInt hiResultReg; + sqInt loResultReg; + usqIntptr_t srcA; + usqIntptr_t 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 = ((self_in_concretizeSMULL->operands))[0]; + loResultReg = (srcB = ((self_in_concretizeSMULL->operands))[1]); + hiResultReg = RISCTempReg; + /* begin machineCodeAt:put: */ + aWord = (((((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((6U << 21) | (0U << 20)))) | ((((sqInt)((usqInt)(hiResultReg) << 16))) | (((sqInt)((usqInt)(loResultReg) << 12))))) + (srcA << 8)) + (9U << 4)) + srcB; + ((self_in_concretizeSMULL->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeSMULL->machineCodeSize) = 4); +} + + +/* test for the NV condition code; this isn't allowed as an actual condition + and is used to encdoe many of the newer instructions + */ + + /* CogARMCompiler>>#conditionIsNotNever: */ +static sqInt NoDbgRegParms +conditionIsNotNever(AbstractInstruction * self_in_conditionIsNotNever, sqInt instr) +{ + return (((usqInt) instr) >> 28) < 15; +} + + +/* 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 + */ + + /* CogARMCompiler>>#dataOpType:rd:rn:rm:lsr: */ +static sqInt NoDbgRegParms +dataOpTyperdrnrmlsr(AbstractInstruction * self_in_dataOpTyperdrnrmlsr, sqInt armOpcode, sqInt destReg, sqInt srcReg, sqInt addReg, sqInt shft) +{ + if (shft == 0) { + return (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((sqInt)((usqInt)(armOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (addReg & 0xFFF); + } + else { + return (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((sqInt)((usqInt)(armOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | ((((((sqInt)((usqInt)(shft) << 7))) | 32) | addReg) & 0xFFF); + } +} + + +/* Attempt to generate concrete machine code for the instruction at address. + This is the inner dispatch of concretizeAt: actualAddress which exists + only to get around the branch size limits in the SqueakV3 (blue book + derived) bytecode set. */ + + /* CogARMCompiler>>#dispatchConcretize */ +static void NoDbgRegParms +dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) +{ + usqIntptr_t addressOperand; + sqInt aWord; + sqInt aWord1; + sqInt aWord10; + sqInt aWord11; + sqInt aWord110; + sqInt aWord111; + sqInt aWord1110; + sqInt aWord1111; + sqInt aWord1112; + sqInt aWord1113; + sqInt aWord112; + sqInt aWord113; + sqInt aWord114; + sqInt aWord115; + sqInt aWord116; + sqInt aWord117; + sqInt aWord118; + sqInt aWord119; + sqInt aWord12; + sqInt aWord120; + sqInt aWord121; + sqInt aWord1210; + sqInt aWord1211; + sqInt aWord122; + sqInt aWord123; + sqInt aWord124; + sqInt aWord125; + sqInt aWord126; + sqInt aWord127; + sqInt aWord128; + sqInt aWord129; + sqInt aWord13; + sqInt aWord130; + sqInt aWord131; + sqInt aWord132; + sqInt aWord133; + sqInt aWord134; + sqInt aWord14; + sqInt aWord15; + sqInt aWord16; + sqInt aWord17; + sqInt aWord18; + sqInt aWord19; + sqInt aWord2; + sqInt aWord20; + sqInt aWord21; + sqInt aWord210; + sqInt aWord211; + sqInt aWord2110; + sqInt aWord2111; + sqInt aWord212; + sqInt aWord213; + sqInt aWord214; + sqInt aWord215; + sqInt aWord216; + sqInt aWord217; + sqInt aWord218; + sqInt aWord219; + sqInt aWord22; + sqInt aWord220; + sqInt aWord221; + sqInt aWord222; + sqInt aWord223; + sqInt aWord224; + sqInt aWord225; + sqInt aWord226; + sqInt aWord23; + sqInt aWord24; + sqInt aWord25; + sqInt aWord26; + sqInt aWord27; + sqInt aWord28; + sqInt aWord29; + sqInt aWord3; + sqInt aWord30; + sqInt aWord31; + sqInt aWord310; + sqInt aWord311; + sqInt aWord312; + sqInt aWord313; + sqInt aWord314; + sqInt aWord315; + sqInt aWord316; + sqInt aWord32; + sqInt aWord33; + sqInt aWord34; + sqInt aWord35; + sqInt aWord36; + sqInt aWord37; + sqInt aWord38; + sqInt aWord39; + sqInt aWord4; + sqInt aWord40; + sqInt aWord41; + sqInt aWord410; + sqInt aWord411; + sqInt aWord42; + sqInt aWord43; + sqInt aWord44; + sqInt aWord45; + sqInt aWord46; + sqInt aWord47; + sqInt aWord48; + sqInt aWord49; + sqInt aWord5; + sqInt aWord50; + sqInt aWord51; + sqInt aWord52; + sqInt aWord53; + sqInt aWord54; + sqInt aWord55; + sqInt aWord56; + sqInt aWord57; + sqInt aWord58; + sqInt aWord59; + sqInt aWord6; + sqInt aWord60; + sqInt aWord61; + sqInt aWord62; + sqInt aWord63; + sqInt aWord64; + sqInt aWord65; + sqInt aWord66; + sqInt aWord67; + sqInt aWord68; + sqInt aWord7; + sqInt aWord8; + sqInt aWord9; + usqIntptr_t base; + usqIntptr_t base1; + usqIntptr_t base2; + usqIntptr_t base3; + usqIntptr_t baseReg; + usqIntptr_t baseReg1; + usqIntptr_t baseReg2; + usqIntptr_t constant; + usqIntptr_t constant1; + usqIntptr_t constant10; + sqInt constant11; + usqIntptr_t constant12; + usqIntptr_t constant13; + usqIntptr_t constant14; + usqIntptr_t constant2; + usqIntptr_t constant3; + usqIntptr_t constant4; + usqIntptr_t constant5; + usqIntptr_t constant6; + usqIntptr_t constant7; + usqIntptr_t constant8; + usqIntptr_t constant9; + AbstractInstruction *dependentChain; + usqIntptr_t dest; + usqIntptr_t dest1; + usqIntptr_t destAddr; + usqIntptr_t destAddr1; + usqIntptr_t destReg; + usqIntptr_t destReg1; + usqIntptr_t destReg10; + usqIntptr_t destReg11; + usqIntptr_t destReg12; + usqIntptr_t destReg2; + usqIntptr_t destReg3; + usqIntptr_t destReg4; + usqIntptr_t destReg5; + usqIntptr_t destReg6; + usqIntptr_t destReg7; + usqIntptr_t destReg8; + usqIntptr_t destReg9; + sqInt distance; + sqInt distance1; + sqInt distance2; + usqIntptr_t distReg; + usqIntptr_t distReg1; + usqIntptr_t distReg2; + usqIntptr_t dstReg; + usqIntptr_t dstReg1; + sqInt flagsOrOpcode; + sqInt flagsOrOpcode1; + sqInt flagsOrOpcode11; + sqInt flagsOrOpcode12; + sqInt flagsOrOpcode2; + sqInt flagsOrOpcode3; + sqInt flagsOrOpcode4; + sqInt flagsOrOpcode5; + usqIntptr_t fpReg; + sqInt hb; + sqInt hb1; + sqInt hb11; + sqInt hb12; + sqInt hb2; + sqInt hb3; + sqInt hb4; + sqInt hb5; + sqInt i; + sqInt i1; + sqInt i10; + sqInt i11; + sqInt i12; + sqInt i13; + sqInt i14; + sqInt i15; + sqInt i2; + sqInt i3; + sqInt i4; + sqInt i5; + sqInt i6; + sqInt i7; + sqInt i8; + sqInt i9; + sqInt immediate; + sqInt immediate1; + sqInt immediate10; + sqInt immediate11; + sqInt immediate12; + sqInt immediate13; + sqInt immediate14; + sqInt immediate15; + sqInt immediate16; + sqInt immediate17; + sqInt immediate18; + sqInt immediate19; + sqInt immediate2; + sqInt immediate20; + sqInt immediate3; + sqInt immediate4; + sqInt immediate5; + sqInt immediate6; + sqInt immediate7; + sqInt immediate8; + sqInt immediate9; + usqIntptr_t index; + usqIntptr_t index1; + usqIntptr_t index2; + usqIntptr_t index3; + usqInt instrOffset; + usqInt instrOffset1; + usqInt instrOffset10; + usqInt instrOffset11; + usqInt instrOffset12; + usqInt instrOffset13; + usqInt instrOffset14; + usqInt instrOffset15; + usqInt instrOffset16; + sqInt instrOffset17; + sqInt instrOffset18; + sqInt instrOffset19; + usqInt instrOffset2; + usqInt instrOffset20; + usqInt instrOffset21; + usqInt instrOffset22; + sqInt instrOffset23; + sqInt instrOffset24; + usqInt instrOffset25; + usqInt instrOffset26; + usqInt instrOffset27; + usqInt instrOffset28; + usqInt instrOffset29; + usqInt instrOffset3; + usqInt instrOffset4; + usqInt instrOffset5; + usqInt instrOffset6; + usqInt instrOffset7; + usqInt instrOffset8; + usqInt instrOffset9; + sqInt invert; + sqInt invert1; + sqInt invert2; + sqInt invert3; + sqInt invert4; + unsigned int invVal; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + AbstractInstruction *jumpTarget10; + AbstractInstruction *jumpTarget11; + AbstractInstruction *jumpTarget110; + AbstractInstruction *jumpTarget111; + AbstractInstruction *jumpTarget112; + AbstractInstruction *jumpTarget113; + AbstractInstruction *jumpTarget114; + AbstractInstruction *jumpTarget115; + AbstractInstruction *jumpTarget116; + AbstractInstruction *jumpTarget117; + AbstractInstruction *jumpTarget118; + AbstractInstruction *jumpTarget119; + AbstractInstruction *jumpTarget12; + AbstractInstruction *jumpTarget120; + AbstractInstruction *jumpTarget121; + AbstractInstruction *jumpTarget122; + AbstractInstruction *jumpTarget123; + AbstractInstruction *jumpTarget124; + AbstractInstruction *jumpTarget13; + AbstractInstruction *jumpTarget14; + AbstractInstruction *jumpTarget15; + AbstractInstruction *jumpTarget16; + AbstractInstruction *jumpTarget17; + AbstractInstruction *jumpTarget18; + AbstractInstruction *jumpTarget19; + AbstractInstruction *jumpTarget2; + AbstractInstruction *jumpTarget20; + AbstractInstruction *jumpTarget21; + AbstractInstruction *jumpTarget22; + AbstractInstruction *jumpTarget23; + AbstractInstruction *jumpTarget24; + AbstractInstruction *jumpTarget25; + AbstractInstruction *jumpTarget26; + AbstractInstruction *jumpTarget27; + AbstractInstruction *jumpTarget28; + AbstractInstruction *jumpTarget29; + AbstractInstruction *jumpTarget3; + AbstractInstruction *jumpTarget30; + AbstractInstruction *jumpTarget31; + AbstractInstruction *jumpTarget32; + AbstractInstruction *jumpTarget33; + AbstractInstruction *jumpTarget34; + AbstractInstruction *jumpTarget4; + AbstractInstruction *jumpTarget5; + AbstractInstruction *jumpTarget6; + AbstractInstruction *jumpTarget7; + AbstractInstruction *jumpTarget8; + AbstractInstruction *jumpTarget9; + sqInt negate; + sqInt negate1; + sqIntptr_t offset; + sqIntptr_t offset1; + sqInt offset10; + sqInt offset11; + sqInt offset12; + sqInt offset13; + sqInt offset14; + sqInt offset15; + sqInt offset16; + sqInt offset17; + sqInt offset18; + sqInt offset19; + sqInt offset2; + sqInt offset20; + sqInt offset21; + sqInt offset22; + sqInt offset23; + sqInt offset24; + sqInt offset25; + sqInt offset26; + usqIntptr_t offset27; + sqInt offset28; + sqInt offset29; + sqInt offset3; + sqInt offset30; + sqInt offset31; + sqInt offset32; + sqInt offset33; + sqInt offset4; + sqInt offset5; + sqInt offset6; + sqInt offset7; + sqInt offset8; + sqInt offset9; + sqInt p; + usqIntptr_t rd; + usqIntptr_t rd1; + usqIntptr_t rd10; + usqIntptr_t rd11; + usqIntptr_t rd110; + usqIntptr_t rd111; + usqIntptr_t rd12; + usqIntptr_t rd13; + usqIntptr_t rd14; + usqIntptr_t rd15; + usqIntptr_t rd16; + usqIntptr_t rd17; + usqIntptr_t rd18; + usqIntptr_t rd19; + usqIntptr_t rd2; + usqIntptr_t rd20; + usqIntptr_t rd21; + usqIntptr_t rd22; + usqIntptr_t rd3; + usqIntptr_t rd4; + usqIntptr_t rd5; + usqIntptr_t rd6; + usqIntptr_t rd7; + usqIntptr_t rd8; + usqIntptr_t rd9; + usqIntptr_t reg; + usqIntptr_t reg1; + usqIntptr_t reg2; + usqIntptr_t reg3; + usqIntptr_t reg4; + usqIntptr_t reg5; + usqIntptr_t reg6; + usqIntptr_t reg7; + usqIntptr_t regA; + usqIntptr_t regB; + usqIntptr_t regLHS; + usqIntptr_t regLHS1; + usqIntptr_t regLHS2; + usqIntptr_t regLHS3; + usqIntptr_t regLHS4; + usqIntptr_t regRHS; + usqIntptr_t regRHS1; + usqIntptr_t regRHS2; + usqIntptr_t regRHS3; + usqIntptr_t rn; + usqIntptr_t rn1; + usqIntptr_t rn10; + usqIntptr_t rn11; + usqIntptr_t rn110; + usqIntptr_t rn111; + usqIntptr_t rn12; + usqIntptr_t rn13; + usqIntptr_t rn14; + usqIntptr_t rn15; + usqIntptr_t rn16; + usqIntptr_t rn17; + usqIntptr_t rn18; + usqIntptr_t rn19; + usqIntptr_t rn2; + usqIntptr_t rn20; + usqIntptr_t rn21; + usqIntptr_t rn22; + usqIntptr_t rn23; + usqIntptr_t rn24; + usqIntptr_t rn3; + usqIntptr_t rn4; + usqIntptr_t rn5; + usqIntptr_t rn6; + usqIntptr_t rn7; + usqIntptr_t rn8; + usqIntptr_t rn9; + sqInt rot; + sqInt rot1; + sqInt rot10; + sqInt rot11; + sqInt rot12; + sqInt rot13; + sqInt rot2; + sqInt rot3; + sqInt rot4; + sqInt rot5; + sqInt rot6; + sqInt rot7; + sqInt rot8; + sqInt rot9; + usqIntptr_t src; + usqIntptr_t src1; + usqIntptr_t srcAddr; + usqIntptr_t srcAddr1; + usqIntptr_t srcReg; + usqIntptr_t srcReg1; + usqIntptr_t srcReg10; + usqIntptr_t srcReg11; + usqIntptr_t srcReg12; + usqIntptr_t srcReg13; + usqIntptr_t srcReg14; + usqIntptr_t srcReg15; + usqIntptr_t srcReg16; + usqIntptr_t srcReg17; + usqIntptr_t srcReg18; + usqIntptr_t srcReg19; + usqIntptr_t srcReg2; + usqIntptr_t srcReg3; + usqIntptr_t srcReg4; + usqIntptr_t srcReg5; + usqIntptr_t srcReg6; + usqIntptr_t srcReg7; + usqIntptr_t srcReg8; + usqIntptr_t srcReg9; + int u; + int u1; + sqInt u2; + sqInt u3; + sqInt u4; + sqInt u5; + sqInt u6; + sqInt u7; + sqIntptr_t val; + sqIntptr_t val1; + sqIntptr_t val11; + sqIntptr_t val12; + sqIntptr_t val2; + usqIntptr_t val3; + sqIntptr_t val4; + sqIntptr_t val5; + sqInt value; + sqInt value1; + unsigned int value2; + unsigned int value3; + unsigned int value4; + unsigned int value5; + unsigned int value6; + sqInt word; + sqInt word1; + usqIntptr_t word2; + usqIntptr_t word3; + + if (!(((self_in_dispatchConcretize->conditionOrNil)) == null)) { + concretizeConditionalInstruction(self_in_dispatchConcretize); + return; + } + + switch ((self_in_dispatchConcretize->opcode)) { + case Label: + /* begin concretizeLabel */ + dependentChain = (self_in_dispatchConcretize->dependent); + while (!(dependentChain == null)) { + updateLabel(dependentChain, self_in_dispatchConcretize); + dependentChain = (dependentChain->dependent); + } + (self_in_dispatchConcretize->machineCodeSize) = 0; + return; + + case Literal: + concretizeLiteral(self_in_dispatchConcretize); + return; + + case AlignmentNops: + /* begin concretizeAlignmentNops */ + assert((((self_in_dispatchConcretize->machineCodeSize)) % 4) == 0); + for (p = 0; p < ((self_in_dispatchConcretize->machineCodeSize)); p += 4) { + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[p / 4] = 3785359360U; + } + return; + + case Fill32: + concretizeFill32(self_in_dispatchConcretize); + return; + + case Nop: + /* begin concretizeNop */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 3785359360U; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case Call: + /* begin concretizeCall */ + assert((((self_in_dispatchConcretize->operands))[0]) != 0); + assert(((((self_in_dispatchConcretize->operands))[0]) % 4) == 0); + + /* normal pc offset */ + offset2 = (((int) (((self_in_dispatchConcretize->operands))[0]))) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset2)); + /* begin machineCodeAt:put: */ + aWord = bl(self_in_dispatchConcretize, offset2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case CallFull: + /* begin concretizeCallFull */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord1 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1; + instrOffset = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[instrOffset / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((1 & 1)) << 5)))) | ConcreteIPReg)); + assert(instrOffset == (literalLoadInstructionBytes(self_in_dispatchConcretize))); + (self_in_dispatchConcretize->machineCodeSize) = instrOffset + 4; + return; + + case JumpR: + /* begin concretizeJumpR */ + + /* bx reg */ + reg = ((self_in_dispatchConcretize->operands))[0]; + aWord2 = (((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | reg); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord2; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpFull: + /* begin concretizeJumpFull */ + jumpTarget11 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + if ((addressIsInInstructions(jumpTarget11)) + || (jumpTarget11 == (methodLabel()))) { + jumpTarget11 = ((AbstractInstruction *) ((jumpTarget11->address))); + } + assert(jumpTarget11 != 0); + jumpTarget2 = jumpTarget11; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord3 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord3; + instrOffset1 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[instrOffset1 / 4] = ((((int)((usqInt)(AL) << 28))) | ((19922704 | (((int)((usqInt)((0 & 1)) << 5)))) | ConcreteIPReg)); + (self_in_dispatchConcretize->machineCodeSize) = instrOffset1 + 4; + return; + + case JumpLong: + case Jump: + /* begin concretizeConditionalJump: */ + jumpTarget12 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget12); + if ((addressIsInInstructions(jumpTarget12)) + || (jumpTarget12 == (methodLabel()))) { + jumpTarget12 = ((AbstractInstruction *) ((jumpTarget12->address))); + } + assert(jumpTarget12 != 0); + jumpTarget3 = jumpTarget12; + offset3 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset3)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(AL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset3) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpLongZero: + case JumpZero: + /* begin concretizeConditionalJump: */ + jumpTarget13 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget13); + if ((addressIsInInstructions(jumpTarget13)) + || (jumpTarget13 == (methodLabel()))) { + jumpTarget13 = ((AbstractInstruction *) ((jumpTarget13->address))); + } + assert(jumpTarget13 != 0); + jumpTarget4 = jumpTarget13; + offset4 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset4)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset4) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpLongNonZero: + case JumpNonZero: + /* begin concretizeConditionalJump: */ + jumpTarget14 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget14); + if ((addressIsInInstructions(jumpTarget14)) + || (jumpTarget14 == (methodLabel()))) { + jumpTarget14 = ((AbstractInstruction *) ((jumpTarget14->address))); + } + assert(jumpTarget14 != 0); + jumpTarget5 = jumpTarget14; + offset5 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset5)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset5) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpNegative: + /* begin concretizeConditionalJump: */ + jumpTarget15 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget15); + if ((addressIsInInstructions(jumpTarget15)) + || (jumpTarget15 == (methodLabel()))) { + jumpTarget15 = ((AbstractInstruction *) ((jumpTarget15->address))); + } + assert(jumpTarget15 != 0); + jumpTarget6 = jumpTarget15; + offset6 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset6)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(MI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset6) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpNonNegative: + /* begin concretizeConditionalJump: */ + jumpTarget16 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget16); + if ((addressIsInInstructions(jumpTarget16)) + || (jumpTarget16 == (methodLabel()))) { + jumpTarget16 = ((AbstractInstruction *) ((jumpTarget16->address))); + } + assert(jumpTarget16 != 0); + jumpTarget7 = jumpTarget16; + offset7 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset7)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(PL) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset7) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpOverflow: + /* begin concretizeConditionalJump: */ + jumpTarget17 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget17); + if ((addressIsInInstructions(jumpTarget17)) + || (jumpTarget17 == (methodLabel()))) { + jumpTarget17 = ((AbstractInstruction *) ((jumpTarget17->address))); + } + assert(jumpTarget17 != 0); + jumpTarget8 = jumpTarget17; + offset8 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset8)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset8) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpNoOverflow: + /* begin concretizeConditionalJump: */ + jumpTarget18 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget18); + if ((addressIsInInstructions(jumpTarget18)) + || (jumpTarget18 == (methodLabel()))) { + jumpTarget18 = ((AbstractInstruction *) ((jumpTarget18->address))); + } + assert(jumpTarget18 != 0); + jumpTarget9 = jumpTarget18; + offset9 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset9)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset9) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpCarry: + case JumpAboveOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget19 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget19); + if ((addressIsInInstructions(jumpTarget19)) + || (jumpTarget19 == (methodLabel()))) { + jumpTarget19 = ((AbstractInstruction *) ((jumpTarget19->address))); + } + assert(jumpTarget19 != 0); + jumpTarget10 = jumpTarget19; + offset10 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset10)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset10) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpNoCarry: + case JumpBelow: + /* begin concretizeConditionalJump: */ + jumpTarget110 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget110); + if ((addressIsInInstructions(jumpTarget110)) + || (jumpTarget110 == (methodLabel()))) { + jumpTarget110 = ((AbstractInstruction *) ((jumpTarget110->address))); + } + assert(jumpTarget110 != 0); + jumpTarget20 = jumpTarget110; + offset11 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset11)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(CC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset11) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpLess: + /* begin concretizeConditionalJump: */ + jumpTarget111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget111); + if ((addressIsInInstructions(jumpTarget111)) + || (jumpTarget111 == (methodLabel()))) { + jumpTarget111 = ((AbstractInstruction *) ((jumpTarget111->address))); + } + assert(jumpTarget111 != 0); + jumpTarget21 = jumpTarget111; + offset12 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset12)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset12) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpGreaterOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget112); + if ((addressIsInInstructions(jumpTarget112)) + || (jumpTarget112 == (methodLabel()))) { + jumpTarget112 = ((AbstractInstruction *) ((jumpTarget112->address))); + } + assert(jumpTarget112 != 0); + jumpTarget22 = jumpTarget112; + offset13 = (((int) jumpTarget22)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset13)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset13) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpGreater: + /* begin concretizeConditionalJump: */ + jumpTarget113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget113); + if ((addressIsInInstructions(jumpTarget113)) + || (jumpTarget113 == (methodLabel()))) { + jumpTarget113 = ((AbstractInstruction *) ((jumpTarget113->address))); + } + assert(jumpTarget113 != 0); + jumpTarget23 = jumpTarget113; + offset14 = (((int) jumpTarget23)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset14)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset14) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpLessOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget114); + if ((addressIsInInstructions(jumpTarget114)) + || (jumpTarget114 == (methodLabel()))) { + jumpTarget114 = ((AbstractInstruction *) ((jumpTarget114->address))); + } + assert(jumpTarget114 != 0); + jumpTarget24 = jumpTarget114; + offset15 = (((int) jumpTarget24)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset15)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset15) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpAbove: + /* begin concretizeConditionalJump: */ + jumpTarget115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget115); + if ((addressIsInInstructions(jumpTarget115)) + || (jumpTarget115 == (methodLabel()))) { + jumpTarget115 = ((AbstractInstruction *) ((jumpTarget115->address))); + } + assert(jumpTarget115 != 0); + jumpTarget25 = jumpTarget115; + offset16 = (((int) jumpTarget25)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset16)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(HI) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset16) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpBelowOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget116); + if ((addressIsInInstructions(jumpTarget116)) + || (jumpTarget116 == (methodLabel()))) { + jumpTarget116 = ((AbstractInstruction *) ((jumpTarget116->address))); + } + assert(jumpTarget116 != 0); + jumpTarget26 = jumpTarget116; + offset17 = (((int) jumpTarget26)) - (((int) (((self_in_dispatchConcretize->address)) + 8))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset17)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(LS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset17) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case JumpFPEqual: + /* begin concretizeFPConditionalJump: */ + jumpTarget117 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget117); + if ((addressIsInInstructions(jumpTarget117)) + || (jumpTarget117 == (methodLabel()))) { + jumpTarget117 = ((AbstractInstruction *) ((jumpTarget117->address))); + } + assert(jumpTarget117 != 0); + jumpTarget27 = jumpTarget117; + offset18 = (((int) jumpTarget27)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset18)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(EQ) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset18) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPNotEqual: + /* begin concretizeFPConditionalJump: */ + jumpTarget118 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget118); + if ((addressIsInInstructions(jumpTarget118)) + || (jumpTarget118 == (methodLabel()))) { + jumpTarget118 = ((AbstractInstruction *) ((jumpTarget118->address))); + } + assert(jumpTarget118 != 0); + jumpTarget28 = jumpTarget118; + offset19 = (((int) jumpTarget28)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset19)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(NE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset19) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPLess: + /* begin concretizeFPConditionalJump: */ + jumpTarget119 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget119); + if ((addressIsInInstructions(jumpTarget119)) + || (jumpTarget119 == (methodLabel()))) { + jumpTarget119 = ((AbstractInstruction *) ((jumpTarget119->address))); + } + assert(jumpTarget119 != 0); + jumpTarget29 = jumpTarget119; + offset20 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset20)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset20) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPGreaterOrEqual: + /* begin concretizeFPConditionalJump: */ + jumpTarget120 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget120); + if ((addressIsInInstructions(jumpTarget120)) + || (jumpTarget120 == (methodLabel()))) { + jumpTarget120 = ((AbstractInstruction *) ((jumpTarget120->address))); + } + assert(jumpTarget120 != 0); + jumpTarget30 = jumpTarget120; + offset21 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset21)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset21) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPGreater: + /* begin concretizeFPConditionalJump: */ + jumpTarget121 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget121); + if ((addressIsInInstructions(jumpTarget121)) + || (jumpTarget121 == (methodLabel()))) { + jumpTarget121 = ((AbstractInstruction *) ((jumpTarget121->address))); + } + assert(jumpTarget121 != 0); + jumpTarget31 = jumpTarget121; + offset22 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset22)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(GT) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset22) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPLessOrEqual: + /* begin concretizeFPConditionalJump: */ + jumpTarget122 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget122); + if ((addressIsInInstructions(jumpTarget122)) + || (jumpTarget122 == (methodLabel()))) { + jumpTarget122 = ((AbstractInstruction *) ((jumpTarget122->address))); + } + assert(jumpTarget122 != 0); + jumpTarget32 = jumpTarget122; + offset23 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset23)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(LE) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset23) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPOrdered: + /* begin concretizeFPConditionalJump: */ + jumpTarget123 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget123); + if ((addressIsInInstructions(jumpTarget123)) + || (jumpTarget123 == (methodLabel()))) { + jumpTarget123 = ((AbstractInstruction *) ((jumpTarget123->address))); + } + assert(jumpTarget123 != 0); + jumpTarget33 = jumpTarget123; + offset24 = (((int) jumpTarget33)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset24)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VC) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset24) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case JumpFPUnordered: + /* begin concretizeFPConditionalJump: */ + jumpTarget124 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget124); + if ((addressIsInInstructions(jumpTarget124)) + || (jumpTarget124 == (methodLabel()))) { + jumpTarget124 = ((AbstractInstruction *) ((jumpTarget124->address))); + } + assert(jumpTarget124 != 0); + jumpTarget34 = jumpTarget124; + offset25 = (((int) jumpTarget34)) - (((int) (((self_in_dispatchConcretize->address)) + (8 + 4)))); + assert(isInImmediateJumpRange(self_in_dispatchConcretize, offset25)); + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = 4008835600U; + /* begin machineCodeAt:put: */ + ((self_in_dispatchConcretize->machineCode))[4 / 4] = ((((int)((usqInt)(VS) << 28))) | ((((int)((usqInt)((10 | (0 & 1))) << 24))) | ((((usqInt) offset25) >> 2) & 0xFFFFFF))); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + case RetN: + /* begin concretizeRetN */ + offset26 = ((self_in_dispatchConcretize->operands))[0]; + if (offset26 == 0) { + /* begin machineCodeAt:put: */ + aWord4 = movrn(self_in_dispatchConcretize, PC, LR); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord4; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l132; + } + assert(offset26 < 0xFF); + /* begin machineCodeAt:put: */ + aWord11 = addrnimmror(self_in_dispatchConcretize, SP, SP, offset26, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord11; + /* begin machineCodeAt:put: */ + aWord21 = movrn(self_in_dispatchConcretize, PC, LR); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord21; + (self_in_dispatchConcretize->machineCodeSize) = 8; + l132: /* end concretizeRetN */; + return; + + case Stop: + /* begin concretizeStop */ + ((self_in_dispatchConcretize->machineCode))[0 / 4] = ((((int)((usqInt)(AL) << 28))) | ((66U << 20) | (7U << 4))); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case AddCqR: + /* begin concretizeNegateableDataOperationCqR: */ + val = ((self_in_dispatchConcretize->operands))[0]; + + /* Extra note - if ever a version of this code wants to NOT set the Set flag + - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen. */ + rn = ((self_in_dispatchConcretize->operands))[1]; + rd = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + ? 0 + : rn); + /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ + value = val; + while (1) { + if ((value & 0xFF) == value) { + negate = val != value; + /* begin machineCodeAt:put: */ + flagsOrOpcode = (negate + ? inverseOpcodeFor(self_in_dispatchConcretize, AddOpcode) + : AddOpcode); + aWord5 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord5; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l142; + + goto l135; + } + for (i = 2; i <= 30; i += 2) { + if ((value & (((0xFFU << i) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i)))) == value) { + rot = 32 - i; + immediate = (((usqInt) value) >> i) | ((((sqInt)((usqInt)(value) << (32 - i)))) & 0xFFFFFFFFU); + negate = val != value; + /* begin machineCodeAt:put: */ + flagsOrOpcode1 = (negate + ? inverseOpcodeFor(self_in_dispatchConcretize, AddOpcode) + : AddOpcode); + aWord5 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode1) << 21))) | (1U << 20)))) | ((rn << 16) | (rd << 12))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord5; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l142; + + goto l135; + } + } + if (!((value == val) + && (val != 0))) break; + value = -val; + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val > 0) { + hb = highBit(val); + if ((1U << hb) == (val + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord12 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord12; + /* begin machineCodeAt:put: */ + aWord22 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AddOpcode, rd, rn, ConcreteIPReg, 32 - hb); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord22; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l142; + } + } + /* begin concretizeDataOperationCwR: */ + constant = ((self_in_dispatchConcretize->operands))[0]; + rn1 = ((self_in_dispatchConcretize->operands))[1]; + rd1 = rn1; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord31 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord31; + instrOffset2 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord111 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn1 << 16) | (rd1 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset2 / 4] = aWord111; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset2 + 4))); + goto l142; + + l135: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; + l142: /* end concretizeNegateableDataOperationCqR: */; + return; + + case AndCqR: + /* begin concretizeInvertibleDataOperationCqR: */ + val2 = ((self_in_dispatchConcretize->operands))[0]; + rn18 = ((self_in_dispatchConcretize->operands))[1]; + assert(!((((self_in_dispatchConcretize->opcode)) == CmpOpcode))); + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + value4 = val2; + while (1) { + if ((value4 & 0xFF) == value4) { + invert2 = val2 != value4; + /* begin machineCodeAt:put: */ + flagsOrOpcode2 = (invert2 + ? inverseOpcodeFor(self_in_dispatchConcretize, AndOpcode) + : AndOpcode); + aWord65 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode2) << 21))) | (1U << 20)))) | ((rn18 << 16) | (rn18 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value4) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord65; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l330; + + goto l318; + } + for (i8 = 2; i8 <= 30; i8 += 2) { + if ((value4 & (((0xFFU << i8) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i8)))) == value4) { + rot8 = 32 - i8; + immediate15 = (((usqInt) value4) >> i8) | ((value4 << (32 - i8)) & 0xFFFFFFFFU); + invert2 = val2 != value4; + /* begin machineCodeAt:put: */ + flagsOrOpcode11 = (invert2 + ? inverseOpcodeFor(self_in_dispatchConcretize, AndOpcode) + : AndOpcode); + aWord65 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode11) << 21))) | (1U << 20)))) | ((rn18 << 16) | (rn18 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot8) >> 1)) << 8))) | immediate15) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord65; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l330; + + goto l318; + } + } + if (!(value4 == val2)) break; + value4 = (val2 < 0 + ? -1 - val2 + : (unsigned int)~val2); + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val2 > 0) { + hb2 = highBit(val2); + if ((1U << hb2) == (val2 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord131 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord131; + /* begin machineCodeAt:put: */ + aWord223 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rn18, rn18, ConcreteIPReg, 32 - hb2); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord223; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l330; + } + } + /* begin concretizeDataOperationCqR: */ + val11 = ((self_in_dispatchConcretize->operands))[0]; + rn21 = ((self_in_dispatchConcretize->operands))[1]; + + /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ + rd18 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + ? 0 + : rn21); + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((val11 & 0xFF) == val11) { + /* begin machineCodeAt:put: */ + aWord410 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn21 << 16) | (rd18 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val11) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord410; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l330; + + goto l364; + } + for (i13 = 2; i13 <= 30; i13 += 2) { + if ((val11 & (((0xFFU << i13) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i13)))) == val11) { + rot11 = 32 - i13; + immediate14 = (((usqInt) val11) >> i13) | ((((sqIntptr_t)((usqInt)(val11) << (32 - i13)))) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord410 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn21 << 16) | (rd18 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot11) >> 1)) << 8))) | immediate14) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord410; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l330; + + goto l364; + } + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val11 > 0) { + hb11 = highBit(val11); + if ((1U << hb11) == (val11 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord1210 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1210; + /* begin machineCodeAt:put: */ + aWord2110 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, rd18, rn21, ConcreteIPReg, 32 - hb11); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord2110; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l330; + } + } + /* begin concretizeDataOperationCwR: */ + constant10 = ((self_in_dispatchConcretize->operands))[0]; + rn19 = ((self_in_dispatchConcretize->operands))[1]; + rd19 = rn19; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord313 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord313; + instrOffset26 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord1110 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn19 << 16) | (rd19 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset26 / 4] = aWord1110; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset26 + 4))); + goto l330; + + l364: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + goto l330; + + l318: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l330: /* end concretizeInvertibleDataOperationCqR: */; + return; + + case AndCqRR: + /* begin concretizeAndCqRR */ + val3 = ((self_in_dispatchConcretize->operands))[0]; + srcReg19 = ((self_in_dispatchConcretize->operands))[1]; + dstReg1 = ((self_in_dispatchConcretize->operands))[2]; + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + value5 = val3; + while (1) { + if ((value5 & 0xFF) == value5) { + invert3 = val3 != value5; + /* begin machineCodeAt:put: */ + aWord66 = (invert3 + ? bicsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, value5, 0) + : andsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, value5, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord66; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l338; + + goto l336; + } + for (i9 = 2; i9 <= 30; i9 += 2) { + if ((value5 & (((0xFFU << i9) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i9)))) == value5) { + rot9 = 32 - i9; + immediate16 = (((usqInt) value5) >> i9) | ((value5 << (32 - i9)) & 0xFFFFFFFFU); + invert3 = val3 != value5; + /* begin machineCodeAt:put: */ + aWord66 = (invert3 + ? bicsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, immediate16, rot9) + : andsrnimmror(self_in_dispatchConcretize, dstReg1, srcReg19, immediate16, rot9)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord66; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l338; + + goto l336; + } + } + if (!(value5 == val3)) break; + value5 = (val3 < 0 + ? -1 - val3 + : (unsigned int)~val3); + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + hb3 = highBit(((self_in_dispatchConcretize->operands))[0]); + if ((1U << hb3) == (val3 + 1)) { + + /* MVN temp reg, 0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord132 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord132; + /* begin machineCodeAt:put: */ + aWord224 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, AndOpcode, dstReg1, srcReg19, ConcreteIPReg, 32 - hb3); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord224; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l338; + } + else { + /* begin concretizeDataOperationCwR: */ + constant12 = ((self_in_dispatchConcretize->operands))[0]; + rn20 = ((self_in_dispatchConcretize->operands))[1]; + rd20 = rn20; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord314 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord314; + instrOffset27 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord1111 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn20 << 16) | (rd20 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset27 / 4] = aWord1111; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset27 + 4))); + goto l338; + } + + l336: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l338: /* end concretizeAndCqRR */; + return; + + case CmpCqR: + /* begin concretizeNegateableDataOperationCqR: */ + val1 = ((self_in_dispatchConcretize->operands))[0]; + + /* Extra note - if ever a version of this code wants to NOT set the Set flag + - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen. */ + rn2 = ((self_in_dispatchConcretize->operands))[1]; + rd2 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + ? 0 + : rn2); + /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ + value1 = val1; + while (1) { + if ((value1 & 0xFF) == value1) { + negate1 = val1 != value1; + /* begin machineCodeAt:put: */ + flagsOrOpcode3 = (negate1 + ? inverseOpcodeFor(self_in_dispatchConcretize, CmpOpcode) + : CmpOpcode); + aWord6 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode3) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd2 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value1) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord6; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l150; + + goto l143; + } + for (i1 = 2; i1 <= 30; i1 += 2) { + if ((value1 & (((0xFFU << i1) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i1)))) == value1) { + rot1 = 32 - i1; + immediate1 = (((usqInt) value1) >> i1) | ((((sqInt)((usqInt)(value1) << (32 - i1)))) & 0xFFFFFFFFU); + negate1 = val1 != value1; + /* begin machineCodeAt:put: */ + flagsOrOpcode4 = (negate1 + ? inverseOpcodeFor(self_in_dispatchConcretize, CmpOpcode) + : CmpOpcode); + aWord6 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode4) << 21))) | (1U << 20)))) | ((rn2 << 16) | (rd2 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot1) >> 1)) << 8))) | immediate1) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord6; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l150; + + goto l143; + } + } + if (!((value1 == val1) + && (val1 != 0))) break; + value1 = -val1; + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val1 > 0) { + hb1 = highBit(val1); + if ((1U << hb1) == (val1 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord13 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord13; + /* begin machineCodeAt:put: */ + aWord23 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, CmpOpcode, rd2, rn2, ConcreteIPReg, 32 - hb1); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord23; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l150; + } + } + /* begin concretizeDataOperationCwR: */ + constant1 = ((self_in_dispatchConcretize->operands))[0]; + rn11 = ((self_in_dispatchConcretize->operands))[1]; + rd11 = 0; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord32 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord32; + instrOffset3 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord112 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn11 << 16) | (rd11 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset3 / 4] = aWord112; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset3 + 4))); + goto l150; + + l143: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; + l150: /* end concretizeNegateableDataOperationCqR: */; + return; + + case OrCqR: + /* begin concretizeDataOperationCqR: */ + val4 = ((self_in_dispatchConcretize->operands))[0]; + rn22 = ((self_in_dispatchConcretize->operands))[1]; + + /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ + rd21 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + ? 0 + : rn22); + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((val4 & 0xFF) == val4) { + /* begin machineCodeAt:put: */ + aWord67 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn22 << 16) | (rd21 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val4) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord67; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l348; + + goto l346; + } + for (i10 = 2; i10 <= 30; i10 += 2) { + if ((val4 & (((0xFFU << i10) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i10)))) == val4) { + rot10 = 32 - i10; + immediate17 = (((usqInt) val4) >> i10) | ((((sqIntptr_t)((usqInt)(val4) << (32 - i10)))) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord67 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn22 << 16) | (rd21 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot10) >> 1)) << 8))) | immediate17) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord67; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l348; + + goto l346; + } + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val4 > 0) { + hb4 = highBit(val4); + if ((1U << hb4) == (val4 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord133 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord133; + /* begin machineCodeAt:put: */ + aWord225 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, OrOpcode, rd21, rn22, ConcreteIPReg, 32 - hb4); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord225; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l348; + } + } + /* begin concretizeDataOperationCwR: */ + constant13 = ((self_in_dispatchConcretize->operands))[0]; + rn110 = ((self_in_dispatchConcretize->operands))[1]; + rd110 = rn110; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord315 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord315; + instrOffset28 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord1112 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn110 << 16) | (rd110 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset28 / 4] = aWord1112; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset28 + 4))); + goto l348; + + l346: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l348: /* end concretizeDataOperationCqR: */; + return; + + case SubCqR: + /* begin concretizeSubCqR */ + word = ((self_in_dispatchConcretize->operands))[0]; + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((word & 0xFF) == word) { + reg1 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord7 = subsrnimmror(self_in_dispatchConcretize, reg1, reg1, word, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l158; + + goto l151; + } + for (i11 = 2; i11 <= 30; i11 += 2) { + if ((word & (((0xFFU << i11) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i11)))) == word) { + rot2 = 32 - i11; + immediate2 = (((usqInt) word) >> i11) | ((((sqInt)((usqInt)(word) << (32 - i11)))) & 0xFFFFFFFFU); + reg1 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord7 = subsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, rot2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord7; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l158; + + goto l151; + } + } + + /* before building a full load of a big constant, see if we can do an add of the constant negated */ + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if (((-word) & 0xFF) == (-word)) { + immediate2 = -word; + reg1 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord14 = addsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord14; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l158; + + goto l365; + } + for (i2 = 2; i2 <= 30; i2 += 2) { + if (((-word) & (((0xFFU << i2) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i2)))) == (-word)) { + rot2 = 32 - i2; + immediate2 = (((usqInt) (-word)) >> i2) | ((((sqInt)((usqInt)((-word)) << (32 - i2)))) & 0xFFFFFFFFU); + reg1 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord14 = addsrnimmror(self_in_dispatchConcretize, reg1, reg1, immediate2, rot2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord14; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l158; + + goto l365; + } + } + /* begin concretizeDataOperationCwR: */ + constant2 = ((self_in_dispatchConcretize->operands))[0]; + rn3 = ((self_in_dispatchConcretize->operands))[1]; + rd3 = rn3; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord24 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord24; + instrOffset4 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord113 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn3 << 16) | (rd3 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset4 / 4] = aWord113; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset4 + 4))); + goto l158; + + l365: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + + l151: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l158: /* end concretizeSubCqR */; + return; + + case TstCqR: + /* begin concretizeTstCqR */ + constant11 = ((self_in_dispatchConcretize->operands))[0]; + if ((constant11 & 0xFF) == constant11) { + reg2 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord8 = tstrnimmror(self_in_dispatchConcretize, reg2, reg2, constant11, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord8; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l164; + + goto l159; + } + for (i3 = 2; i3 <= 30; i3 += 2) { + if ((constant11 & (((0xFFU << i3) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i3)))) == constant11) { + rot3 = 32 - i3; + immediate3 = (((usqInt) constant11) >> i3) | ((((sqInt)((usqInt)(constant11) << (32 - i3)))) & 0xFFFFFFFFU); + reg2 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord8 = tstrnimmror(self_in_dispatchConcretize, reg2, reg2, immediate3, rot3); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord8; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l164; + + goto l159; + } + } + /* begin concretizeDataOperationCwR: */ + constant3 = ((self_in_dispatchConcretize->operands))[0]; + rn4 = ((self_in_dispatchConcretize->operands))[1]; + rd4 = rn4; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord25 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord25; + instrOffset5 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord15 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(TstOpcode) << 21))) | (1U << 20)))) | ((rn4 << 16) | (rd4 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset5 / 4] = aWord15; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset5 + 4))); + goto l164; + + l159: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l164: /* end concretizeTstCqR */; + return; + + case XorCqR: + /* begin concretizeInvertibleDataOperationCqR: */ + val5 = ((self_in_dispatchConcretize->operands))[0]; + rn23 = ((self_in_dispatchConcretize->operands))[1]; + assert(!((((self_in_dispatchConcretize->opcode)) == CmpOpcode))); + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + value6 = val5; + while (1) { + if ((value6 & 0xFF) == value6) { + invert4 = val5 != value6; + /* begin machineCodeAt:put: */ + flagsOrOpcode5 = (invert4 + ? inverseOpcodeFor(self_in_dispatchConcretize, XorOpcode) + : XorOpcode); + aWord68 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode5) << 21))) | (1U << 20)))) | ((rn23 << 16) | (rn23 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | value6) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord68; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l362; + + goto l350; + } + for (i15 = 2; i15 <= 30; i15 += 2) { + if ((value6 & (((0xFFU << i15) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i15)))) == value6) { + rot12 = 32 - i15; + immediate19 = (((usqInt) value6) >> i15) | ((value6 << (32 - i15)) & 0xFFFFFFFFU); + invert4 = val5 != value6; + /* begin machineCodeAt:put: */ + flagsOrOpcode12 = (invert4 + ? inverseOpcodeFor(self_in_dispatchConcretize, XorOpcode) + : XorOpcode); + aWord68 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((sqInt)((usqInt)(flagsOrOpcode12) << 21))) | (1U << 20)))) | ((rn23 << 16) | (rn23 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot12) >> 1)) << 8))) | immediate19) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord68; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l362; + + goto l350; + } + } + if (!(value6 == val5)) break; + value6 = (val5 < 0 + ? -1 - val5 + : (unsigned int)~val5); + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val5 > 0) { + hb5 = highBit(val5); + if ((1U << hb5) == (val5 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord134 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord134; + /* begin machineCodeAt:put: */ + aWord226 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rn23, rn23, ConcreteIPReg, 32 - hb5); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord226; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l362; + } + } + /* begin concretizeDataOperationCqR: */ + val12 = ((self_in_dispatchConcretize->operands))[0]; + rn24 = ((self_in_dispatchConcretize->operands))[1]; + + /* Extra note - if ever a version of this code wants to NOT set the Set flag - Cmp must always have it set or it will pretend to be a SMALALBT and Very Bad Things might happen */ + rd22 = (((self_in_dispatchConcretize->opcode)) == CmpOpcode + ? 0 + : rn24); + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((val12 & 0xFF) == val12) { + /* begin machineCodeAt:put: */ + aWord411 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn24 << 16) | (rd22 << 12))) | (((((int)((usqInt)((((usqInt) 0) >> 1)) << 8))) | val12) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord411; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l362; + + goto l366; + } + for (i14 = 2; i14 <= 30; i14 += 2) { + if ((val12 & (((0xFFU << i14) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i14)))) == val12) { + rot13 = 32 - i14; + immediate18 = (((usqInt) val12) >> i14) | ((((sqIntptr_t)((usqInt)(val12) << (32 - i14)))) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord411 = (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn24 << 16) | (rd22 << 12))) | (((((sqInt)((usqInt)((((usqInt) rot13) >> 1)) << 8))) | immediate18) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord411; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l362; + + goto l366; + } + } + + /* let's try to see if the constant can be made from a simple shift of 0xFFFFFFFF */ + if (val12 > 0) { + hb12 = highBit(val12); + if ((1U << hb12) == (val12 + 1)) { + + /* MVN temp, #0, making 0xffffffff */ + /* begin machineCodeAt:put: */ + aWord1211 = mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, 0, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord1211; + /* begin machineCodeAt:put: */ + aWord2111 = dataOpTyperdrnrmlsr(self_in_dispatchConcretize, XorOpcode, rd22, rn24, ConcreteIPReg, 32 - hb12); + ((self_in_dispatchConcretize->machineCode))[4 / 4] = aWord2111; + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l362; + } + } + /* begin concretizeDataOperationCwR: */ + constant14 = ((self_in_dispatchConcretize->operands))[0]; + rn111 = ((self_in_dispatchConcretize->operands))[1]; + rd111 = rn111; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord316 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord316; + instrOffset29 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord1113 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn111 << 16) | (rd111 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset29 / 4] = aWord1113; + ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = instrOffset29 + 4))); + goto l362; + + l366: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + goto l362; + + l350: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + l362: /* end concretizeInvertibleDataOperationCqR: */; + return; + + case AddCwR: + /* begin concretizeDataOperationCwR: */ + constant4 = ((self_in_dispatchConcretize->operands))[0]; + rn5 = ((self_in_dispatchConcretize->operands))[1]; + rd5 = rn5; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord9 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord9; + instrOffset6 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord16 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn5 << 16) | (rd5 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset6 / 4] = aWord16; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset6 + 4; + return; + + case AndCwR: + /* begin concretizeDataOperationCwR: */ + constant5 = ((self_in_dispatchConcretize->operands))[0]; + rn6 = ((self_in_dispatchConcretize->operands))[1]; + rd6 = rn6; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord10 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord10; + instrOffset7 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord17 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn6 << 16) | (rd6 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset7 / 4] = aWord17; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset7 + 4; + return; + + case CmpCwR: + /* begin concretizeDataOperationCwR: */ + constant6 = ((self_in_dispatchConcretize->operands))[0]; + rn7 = ((self_in_dispatchConcretize->operands))[1]; + rd7 = 0; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord18 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord18; + instrOffset8 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord19 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn7 << 16) | (rd7 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset8 / 4] = aWord19; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset8 + 4; + return; + + case OrCwR: + /* begin concretizeDataOperationCwR: */ + constant7 = ((self_in_dispatchConcretize->operands))[0]; + rn8 = ((self_in_dispatchConcretize->operands))[1]; + rd8 = rn8; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord20 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord20; + instrOffset9 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord110 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn8 << 16) | (rd8 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset9 / 4] = aWord110; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset9 + 4; + return; + + case SubCwR: + /* begin concretizeDataOperationCwR: */ + constant8 = ((self_in_dispatchConcretize->operands))[0]; + rn9 = ((self_in_dispatchConcretize->operands))[1]; + rd9 = rn9; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord26 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord26; + instrOffset10 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord114 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn9 << 16) | (rd9 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset10 / 4] = aWord114; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset10 + 4; + return; + + case XorCwR: + /* begin concretizeDataOperationCwR: */ + constant9 = ((self_in_dispatchConcretize->operands))[0]; + rn10 = ((self_in_dispatchConcretize->operands))[1]; + rd10 = rn10; + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord27 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord27; + instrOffset11 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord115 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn10 << 16) | (rd10 << 12))) | (ConcreteIPReg & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[instrOffset11 / 4] = aWord115; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset11 + 4; + return; + + case AddRR: + /* begin concretizeDataOperationRR: */ + srcReg1 = ((self_in_dispatchConcretize->operands))[0]; + rn12 = ((self_in_dispatchConcretize->operands))[1]; + rd12 = rn12; + /* begin machineCodeAt:put: */ + aWord28 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AddOpcode) << 21))) | (1U << 20)))) | ((rn12 << 16) | (rd12 << 12))) | (srcReg1 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord28; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case AndRR: + /* begin concretizeDataOperationRR: */ + srcReg2 = ((self_in_dispatchConcretize->operands))[0]; + rn13 = ((self_in_dispatchConcretize->operands))[1]; + rd13 = rn13; + /* begin machineCodeAt:put: */ + aWord29 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(AndOpcode) << 21))) | (1U << 20)))) | ((rn13 << 16) | (rd13 << 12))) | (srcReg2 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord29; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case CmpRR: + /* begin concretizeDataOperationRR: */ + srcReg3 = ((self_in_dispatchConcretize->operands))[0]; + rn14 = ((self_in_dispatchConcretize->operands))[1]; + rd14 = 0; + /* begin machineCodeAt:put: */ + aWord30 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(CmpOpcode) << 21))) | (1U << 20)))) | ((rn14 << 16) | (rd14 << 12))) | (srcReg3 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord30; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case OrRR: + /* begin concretizeDataOperationRR: */ + srcReg4 = ((self_in_dispatchConcretize->operands))[0]; + rn15 = ((self_in_dispatchConcretize->operands))[1]; + rd15 = rn15; + /* begin machineCodeAt:put: */ + aWord33 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (1U << 20)))) | ((rn15 << 16) | (rd15 << 12))) | (srcReg4 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord33; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SubRR: + /* begin concretizeDataOperationRR: */ + srcReg5 = ((self_in_dispatchConcretize->operands))[0]; + rn16 = ((self_in_dispatchConcretize->operands))[1]; + rd16 = rn16; + /* begin machineCodeAt:put: */ + aWord34 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((rn16 << 16) | (rd16 << 12))) | (srcReg5 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord34; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case XorRR: + /* begin concretizeDataOperationRR: */ + srcReg6 = ((self_in_dispatchConcretize->operands))[0]; + rn17 = ((self_in_dispatchConcretize->operands))[1]; + rd17 = rn17; + /* begin machineCodeAt:put: */ + aWord35 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(XorOpcode) << 21))) | (1U << 20)))) | ((rn17 << 16) | (rd17 << 12))) | (srcReg6 & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord35; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case AddRdRd: + /* begin concretizeAddRdRd */ + regRHS = ((self_in_dispatchConcretize->operands))[0]; + regLHS = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (((3996125952U | (regLHS << 16)) | (regLHS << 12)) | regRHS); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case CmpRdRd: + /* begin concretizeCmpRdRd */ + regA = ((self_in_dispatchConcretize->operands))[0]; + regB = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = ((4004776768U | (regB << 12)) | regA); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case DivRdRd: + /* begin concretizeDivRdRd */ + regRHS1 = ((self_in_dispatchConcretize->operands))[0]; + regLHS1 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (((4001368832U | (regLHS1 << 16)) | (regLHS1 << 12)) | regRHS1); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MulRdRd: + /* begin concretizeMulRdRd */ + regRHS2 = ((self_in_dispatchConcretize->operands))[0]; + regLHS2 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (((3995077376U | (regLHS2 << 16)) | (regLHS2 << 12)) | regRHS2); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SubRdRd: + /* begin concretizeSubRdRd */ + regRHS3 = ((self_in_dispatchConcretize->operands))[0]; + regLHS3 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (((3996126016U | (regLHS3 << 16)) | (regLHS3 << 12)) | regRHS3); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SqrtRd: + /* begin concretizeSqrtRd */ + regLHS4 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = ((4004580288U | (regLHS4 << 12)) | regLHS4); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case NegateR: + /* begin concretizeNegateR */ + + /* RSB destReg, srcReg, #0 */ + reg3 = ((self_in_dispatchConcretize->operands))[0]; + aWord36 = ((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(RsbOpcode) << 21))) | (0U << 20)))) | ((reg3 << 16) | (reg3 << 12)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord36; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case LoadEffectiveAddressMwrR: + /* begin concretizeLoadEffectiveAddressMwrR */ + offset27 = ((self_in_dispatchConcretize->operands))[0]; + srcReg7 = ((self_in_dispatchConcretize->operands))[1]; + destReg1 = ((self_in_dispatchConcretize->operands))[2]; + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((offset27 & 0xFF) == offset27) { + /* begin machineCodeAt:put: */ + aWord37 = addrnimmror(self_in_dispatchConcretize, destReg1, srcReg7, offset27, 0U << 1); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; + (self_in_dispatchConcretize->machineCodeSize) = 4; + + goto l203; + } + for (i4 = 2; i4 <= 30; i4 += 2) { + if ((offset27 & (((0xFFU << i4) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i4)))) == offset27) { + rot4 = 32 - i4; + immediate4 = (((usqInt) offset27) >> i4) | ((offset27 << (32 - i4)) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord37 = addrnimmror(self_in_dispatchConcretize, destReg1, srcReg7, immediate4, ((sqInt)((usqInt)(rot4) << 1))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord37; + (self_in_dispatchConcretize->machineCodeSize) = 4; + + goto l203; + } + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord116 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord116; + instrOffset12 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord210 = addrnrm(self_in_dispatchConcretize, destReg1, srcReg7, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[16 / 4] = aWord210; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset12 + 4; + + l203: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + (self_in_dispatchConcretize->machineCodeSize); + return; + + case ArithmeticShiftRightCqR: + /* begin concretizeArithmeticShiftRightCqR */ + distance = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + + /* cond 000 1101 0 0000 dest dist -100 srcR */ + reg4 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord38 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg4 << 12))) | (((((sqInt)((usqInt)(distance) << 7))) | (64 | reg4)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord38; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case LogicalShiftRightCqR: + /* begin concretizeLogicalShiftRightCqR */ + distance1 = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + + /* cond 000 1101 0 0000 dest dist -010 srcR */ + reg5 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord39 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg5 << 12))) | (((((sqInt)((usqInt)(distance1) << 7))) | (32 | reg5)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord39; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case LogicalShiftLeftCqR: + /* begin concretizeLogicalShiftLeftCqR */ + distance2 = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + + /* cond 000 1101 0 0000 dest dista 000 srcR */ + reg6 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord40 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (reg6 << 12))) | (((((sqInt)((usqInt)(distance2) << 7))) | reg6) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord40; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ArithmeticShiftRightRR: + /* begin concretizeArithmeticShiftRightRR */ + distReg = ((self_in_dispatchConcretize->operands))[0]; + + /* cond 000 1101 0 0000 destR distR 0101 srcR */ + destReg2 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord41 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg2 << 12))) | (((distReg << 8) | (80 | destReg2)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord41; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case LogicalShiftLeftRR: + /* begin concretizeLogicalShiftLeftRR */ + distReg1 = ((self_in_dispatchConcretize->operands))[0]; + + /* cond 000 1101 0 0000 dest dist 0001 srcR */ + destReg3 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord42 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg3 << 12))) | (((distReg1 << 8) | (16 | destReg3)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord42; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case LogicalShiftRightRR: + /* begin concretizeLogicalShiftRightRR */ + distReg2 = ((self_in_dispatchConcretize->operands))[0]; + + /* cond 000 1101 0 0000 dest dist 0011 srcR */ + destReg4 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord43 = (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (destReg4 << 12))) | (((distReg2 << 8) | (48 | destReg4)) & 0xFFF); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord43; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SMULL: + concretizeSMULL(self_in_dispatchConcretize); + return; + + case CMPSMULL: + concretizeCMPSMULL(self_in_dispatchConcretize); + return; + + case MSR: + concretizeMSR(self_in_dispatchConcretize); + return; + + case PopLDM: + concretizePushOrPopMultipleRegisters(self_in_dispatchConcretize, 0); + return; + + case PushSTM: + concretizePushOrPopMultipleRegisters(self_in_dispatchConcretize, 1); + return; + + case MoveCqR: + /* begin concretizeMoveCqR */ + word1 = ((self_in_dispatchConcretize->operands))[0]; + reg7 = ((self_in_dispatchConcretize->operands))[1]; + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((word1 & 0xFF) == word1) { + /* begin machineCodeAt:put: */ + aWord44 = movimmror(self_in_dispatchConcretize, reg7, word1, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord44; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l225; + + goto l223; + } + for (i12 = 2; i12 <= 30; i12 += 2) { + if ((word1 & (((0xFFU << i12) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i12)))) == word1) { + rot5 = 32 - i12; + immediate5 = (((usqInt) word1) >> i12) | ((((sqInt)((usqInt)(word1) << (32 - i12)))) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord44 = movimmror(self_in_dispatchConcretize, reg7, immediate5, rot5); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord44; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l225; + + goto l223; + } + } + if (word1 < 0) { + invVal = -1 - word1; + } + else { + invVal = (unsigned int)~word1; + } + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + if ((invVal & 0xFF) == invVal) { + /* begin machineCodeAt:put: */ + aWord117 = mvnimmror(self_in_dispatchConcretize, reg7, invVal, 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord117; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l225; + + goto l367; + } + for (i5 = 2; i5 <= 30; i5 += 2) { + if ((invVal & (((0xFFU << i5) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i5)))) == invVal) { + rot5 = 32 - i5; + immediate5 = (((usqInt) invVal) >> i5) | ((invVal << (32 - i5)) & 0xFFFFFFFFU); + /* begin machineCodeAt:put: */ + aWord117 = mvnimmror(self_in_dispatchConcretize, reg7, immediate5, rot5); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord117; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l225; + + goto l367; + } + } + (self_in_dispatchConcretize->machineCodeSize) = loadCwInto(self_in_dispatchConcretize, ((self_in_dispatchConcretize->operands))[1]); + goto l225; + + l367: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + + l223: /* end rotateable8bitImmediate:ifTrue:ifFalse: */; + l225: /* end concretizeMoveCqR */; + return; + + case MoveCwR: + /* begin concretizeMoveCwR */ + (self_in_dispatchConcretize->machineCodeSize) = loadCwInto(self_in_dispatchConcretize, ((self_in_dispatchConcretize->operands))[1]); + return; + + case MoveRR: + /* begin concretizeMoveRR */ + srcReg8 = ((self_in_dispatchConcretize->operands))[0]; + + /* cond 000 1101 0 0000 dest 0000 0000 srcR */ + destReg5 = ((self_in_dispatchConcretize->operands))[1]; + /* begin machineCodeAt:put: */ + aWord45 = movrn(self_in_dispatchConcretize, destReg5, srcReg8); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord45; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveAwR: + /* begin concretizeMoveAwR */ + srcAddr = ((self_in_dispatchConcretize->operands))[0]; + destReg6 = ((self_in_dispatchConcretize->operands))[1]; + if ((srcAddr != null) + && ((srcAddr >= (varBaseAddress())) + && ((srcAddr - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord46 = ldrrnplusImm(self_in_dispatchConcretize, destReg6, ConcreteVarBaseReg, srcAddr - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord46; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l232; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord118 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord118; + instrOffset13 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord211 = ldrrnplusImm(self_in_dispatchConcretize, destReg6, ConcreteIPReg, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset13 / 4] = aWord211; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset13 + 4; + l232: /* end concretizeMoveAwR */; + return; + + case MoveRAw: + /* begin concretizeMoveRAw */ + srcReg9 = ((self_in_dispatchConcretize->operands))[0]; + destAddr = ((self_in_dispatchConcretize->operands))[1]; + if ((destAddr != null) + && ((destAddr >= (varBaseAddress())) + && ((destAddr - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord47 = strrnplusImm(self_in_dispatchConcretize, srcReg9, ConcreteVarBaseReg, destAddr - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord47; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l237; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord119 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord119; + instrOffset14 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord212 = strrnplusImm(self_in_dispatchConcretize, srcReg9, ConcreteIPReg, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset14 / 4] = aWord212; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset14 + 4; + l237: /* end concretizeMoveRAw */; + return; + + case MoveAbR: + /* begin concretizeMoveAbR */ + srcAddr1 = ((self_in_dispatchConcretize->operands))[0]; + destReg7 = ((self_in_dispatchConcretize->operands))[1]; + if ((srcAddr1 != null) + && ((srcAddr1 >= (varBaseAddress())) + && ((srcAddr1 - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord48 = ldrbrnplusimm(self_in_dispatchConcretize, destReg7, ConcreteVarBaseReg, 1, srcAddr1 - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord48; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l242; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord120 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord120; + instrOffset15 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord213 = ldrbrnplusimm(self_in_dispatchConcretize, destReg7, ConcreteIPReg, 1, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset15 / 4] = aWord213; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset15 + 4; + l242: /* end concretizeMoveAbR */; + return; + + case MoveRAb: + /* begin concretizeMoveRAb */ + srcReg10 = ((self_in_dispatchConcretize->operands))[0]; + destAddr1 = ((self_in_dispatchConcretize->operands))[1]; + if ((destAddr1 != null) + && ((destAddr1 >= (varBaseAddress())) + && ((destAddr1 - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord49 = strbrnplusimm(self_in_dispatchConcretize, srcReg10, ConcreteVarBaseReg, 1, destAddr1 - (varBaseAddress())); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord49; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l247; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord121 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord121; + instrOffset16 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord214 = strbrnplusimm(self_in_dispatchConcretize, srcReg10, ConcreteIPReg, 1, 0); + ((self_in_dispatchConcretize->machineCode))[instrOffset16 / 4] = aWord214; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset16 + 4; + l247: /* end concretizeMoveRAb */; + return; + + case MoveMbrR: + /* begin concretizeMoveMbrR */ + offset28 = ((self_in_dispatchConcretize->operands))[0]; + srcReg11 = ((self_in_dispatchConcretize->operands))[1]; + destReg8 = ((self_in_dispatchConcretize->operands))[2]; + /* begin is12BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset28)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (offset28 >= 0) { + /* begin machineCodeAt:put: */ + aWord50 = ldrbrnplusimm(self_in_dispatchConcretize, destReg8, srcReg11, 1, offset28); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord50; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l254; + + goto l251; + } + else { + immediate6 = SQABS(offset28); + /* begin machineCodeAt:put: */ + aWord50 = ldrbrnplusimm(self_in_dispatchConcretize, destReg8, srcReg11, 0, immediate6); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord50; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l254; + + goto l251; + } + } + else { + if ((offset28 != null) + && ((offset28 >= (varBaseAddress())) + && ((offset28 - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord122 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset28 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord122; + instrOffset17 = 4; + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord215 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord215; + instrOffset17 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + } + /* begin machineCodeAt:put: */ + aWord310 = ldrbrnrm(self_in_dispatchConcretize, destReg8, srcReg11, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset17 / 4] = aWord310; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset17 + 4; + goto l254; + + goto l251; + } + l251: /* end is12BitValue:ifTrue:ifFalse: */; + l254: /* end concretizeMoveMbrR */; + return; + + case MoveRMbr: + /* begin concretizeMoveRMbr */ + srcReg12 = ((self_in_dispatchConcretize->operands))[0]; + offset29 = ((self_in_dispatchConcretize->operands))[1]; + baseReg = ((self_in_dispatchConcretize->operands))[2]; + /* begin is12BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset29)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (offset29 >= 0) { + /* begin machineCodeAt:put: */ + aWord51 = strbrnplusimm(self_in_dispatchConcretize, srcReg12, baseReg, 1, offset29); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord51; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l261; + + goto l258; + } + else { + immediate7 = SQABS(offset29); + /* begin machineCodeAt:put: */ + aWord51 = strbrnplusimm(self_in_dispatchConcretize, srcReg12, baseReg, 0, immediate7); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord51; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l261; + + goto l258; + } + } + else { + if ((offset29 != null) + && ((offset29 >= (varBaseAddress())) + && ((offset29 - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord123 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset29 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord123; + instrOffset18 = 4; + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord216 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord216; + instrOffset18 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + } + /* begin machineCodeAt:put: */ + aWord311 = strbrnrm(self_in_dispatchConcretize, srcReg12, baseReg, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset18 / 4] = aWord311; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset18 + 4; + goto l261; + + goto l258; + } + l258: /* end is12BitValue:ifTrue:ifFalse: */; + l261: /* end concretizeMoveRMbr */; + return; + + case MoveRM16r: + /* begin concretizeMoveRM16r */ + srcReg13 = ((self_in_dispatchConcretize->operands))[0]; + offset30 = ((self_in_dispatchConcretize->operands))[1]; + baseReg1 = ((self_in_dispatchConcretize->operands))[2]; + /* begin is12BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset30)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (offset30 >= 0) { + /* begin machineCodeAt:put: */ + aWord52 = strhrnplusimm(self_in_dispatchConcretize, srcReg13, baseReg1, 1, offset30); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord52; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l268; + + goto l265; + } + else { + immediate8 = SQABS(offset30); + /* begin machineCodeAt:put: */ + aWord52 = strhrnplusimm(self_in_dispatchConcretize, srcReg13, baseReg1, 0, immediate8); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord52; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l268; + + goto l265; + } + } + else { + if ((offset30 != null) + && ((offset30 >= (varBaseAddress())) + && ((offset30 - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + aWord124 = addsrnimmror(self_in_dispatchConcretize, ConcreteIPReg, ConcreteVarBaseReg, offset30 - (varBaseAddress()), 0); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord124; + instrOffset19 = 4; + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord217 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord217; + instrOffset19 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + } + /* begin machineCodeAt:put: */ + aWord312 = strhrnrm(self_in_dispatchConcretize, srcReg13, baseReg1, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset19 / 4] = aWord312; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset19 + 4; + goto l268; + + goto l265; + } + l265: /* end is12BitValue:ifTrue:ifFalse: */; + l268: /* end concretizeMoveRM16r */; + return; + + case MoveM16rR: + /* begin concretizeMoveM16rR */ + offset31 = ((self_in_dispatchConcretize->operands))[0]; + srcReg14 = ((self_in_dispatchConcretize->operands))[1]; + destReg9 = ((self_in_dispatchConcretize->operands))[2]; + /* begin is8BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset31)) <= 0xFF) { + + /* (2 raisedTo: 8)-1 */ + if (offset31 >= 0) { + /* begin machineCodeAt:put: */ + aWord53 = ldrhrnplusimm(self_in_dispatchConcretize, destReg9, srcReg14, 1, offset31); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord53; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l274; + + } + else { + immediate9 = SQABS(offset31); + /* begin machineCodeAt:put: */ + aWord53 = ldrhrnplusimm(self_in_dispatchConcretize, destReg9, srcReg14, 0, immediate9); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord53; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l274; + + } + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord125 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord125; + instrOffset20 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord218 = ldrhrnrm(self_in_dispatchConcretize, destReg9, srcReg14, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset20 / 4] = aWord218; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset20 + 4; + goto l274; + } + l274: /* end concretizeMoveM16rR */; + return; + + case MoveM64rRd: + /* begin concretizeMoveM64rRd */ + offset = ((self_in_dispatchConcretize->operands))[0]; + u = (offset > 0 + ? 1 + : 0); + srcReg = ((self_in_dispatchConcretize->operands))[1]; + destReg = ((self_in_dispatchConcretize->operands))[2]; + ((self_in_dispatchConcretize->machineCode))[0] = ((((3977251584U | (srcReg << 16)) | (destReg << 12)) | (((int)((usqInt)(u) << 23)))) | (((usqInt) offset) >> 2)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveMwrR: + /* begin concretizeMoveMwrR */ + offset32 = ((self_in_dispatchConcretize->operands))[0]; + srcReg15 = ((self_in_dispatchConcretize->operands))[1]; + destReg10 = ((self_in_dispatchConcretize->operands))[2]; + /* begin is12BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset32)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (offset32 >= 0) { + /* begin machineCodeAt:put: */ + aWord54 = ldrrnplusimm(self_in_dispatchConcretize, destReg10, srcReg15, 1, offset32); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord54; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l280; + + goto l275; + } + else { + immediate10 = SQABS(offset32); + /* begin machineCodeAt:put: */ + aWord54 = ldrrnplusimm(self_in_dispatchConcretize, destReg10, srcReg15, 0, immediate10); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord54; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l280; + + goto l275; + } + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord126 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord126; + instrOffset21 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord219 = ldrrnrm(self_in_dispatchConcretize, destReg10, srcReg15, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset21 / 4] = aWord219; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset21 + 4; + goto l280; + + goto l275; + } + l275: /* end is12BitValue:ifTrue:ifFalse: */; + l280: /* end concretizeMoveMwrR */; + return; + + case MoveXbrRR: + /* begin concretizeMoveXbrRR */ + + /* index is number of *bytes* */ + index = ((self_in_dispatchConcretize->operands))[0]; + base = ((self_in_dispatchConcretize->operands))[1]; + + /* LDRB dest, [base, +index, LSL #0] */ + /* cond 011 1100 1 base dest 00000 00 0 inde */ + dest = ((self_in_dispatchConcretize->operands))[2]; + /* begin machineCodeAt:put: */ + aWord55 = ldrbrnrm(self_in_dispatchConcretize, dest, base, index); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord55; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveRXbrR: + /* begin concretizeMoveRXbrR */ + src = ((self_in_dispatchConcretize->operands))[0]; + index1 = ((self_in_dispatchConcretize->operands))[1]; + + /* str b src, [base, +index, LSL #0] */ + /* cond 011 1100 0 base srcR 00000 00 0 index */ + base1 = ((self_in_dispatchConcretize->operands))[2]; + /* begin machineCodeAt:put: */ + aWord56 = strbrnrm(self_in_dispatchConcretize, src, base1, index1); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord56; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveXwrRR: + /* begin concretizeMoveXwrRR */ + index2 = ((self_in_dispatchConcretize->operands))[0]; + base2 = ((self_in_dispatchConcretize->operands))[1]; + + /* LDR dest, [base, +index, LSL #2] */ + /* cond 011 1100 1 base dest 00010 00 0 inde bulit by lowest level generator so we can do the lsl #2 on the index register */ + dest1 = ((self_in_dispatchConcretize->operands))[2]; + /* begin machineCodeAt:put: */ + aWord57 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, dest1, base2, 1, 1, 0, 0, 1, index2); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord57; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveRXwrR: + /* begin concretizeMoveRXwrR */ + src1 = ((self_in_dispatchConcretize->operands))[0]; + + /* index is number of *words* = 4* bytes */ + index3 = ((self_in_dispatchConcretize->operands))[1]; + + /* str src, [base, +index, LSL #2] */ + /* cond 011 1100 0 base srcR 00010 00 0 inde */ + base3 = ((self_in_dispatchConcretize->operands))[2]; + /* begin machineCodeAt:put: */ + aWord58 = memMxrregbasepubwlrmLsl2(self_in_dispatchConcretize, AL, src1, base3, 1, 1, 0, 0, 0, index3); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord58; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveRMwr: + /* begin concretizeMoveRMwr */ + srcReg16 = ((self_in_dispatchConcretize->operands))[0]; + offset33 = ((self_in_dispatchConcretize->operands))[1]; + baseReg2 = ((self_in_dispatchConcretize->operands))[2]; + /* begin is12BitValue:ifTrue:ifFalse: */ + if ((SQABS(offset33)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (offset33 >= 0) { + /* begin machineCodeAt:put: */ + aWord59 = strrnplusimm(self_in_dispatchConcretize, srcReg16, baseReg2, 1, offset33); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord59; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l294; + + goto l289; + } + else { + immediate11 = SQABS(offset33); + /* begin machineCodeAt:put: */ + aWord59 = strrnplusimm(self_in_dispatchConcretize, srcReg16, baseReg2, 0, immediate11); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord59; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l294; + + goto l289; + } + } + else { + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord127 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord127; + instrOffset22 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord220 = strrnrm(self_in_dispatchConcretize, srcReg16, baseReg2, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset22 / 4] = aWord220; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset22 + 4; + goto l294; + + goto l289; + } + l289: /* end is12BitValue:ifTrue:ifFalse: */; + l294: /* end concretizeMoveRMwr */; + return; + + case MoveRdM64r: + /* begin concretizeMoveRdM64r */ + offset1 = ((self_in_dispatchConcretize->operands))[1]; + u1 = (offset1 > 0 + ? 1 + : 0); + dstReg = ((self_in_dispatchConcretize->operands))[2]; + fpReg = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = ((((3976203008U | (dstReg << 16)) | (fpReg << 12)) | (((int)((usqInt)(u1) << 23)))) | (((usqInt) offset1) >> 2)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case PopR: + /* begin concretizePopR */ + + /* LDR destReg, [SP], #4 */ + destReg11 = ((self_in_dispatchConcretize->operands))[0]; + aWord60 = popR(self_in_dispatchConcretize, destReg11); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord60; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case PushR: + /* begin concretizePushR */ + + /* cond | 010 | 1001 | 0 | -Rn- | -Rd- | 0000 0000 0100 */ + /* STR srcReg, [sp, #-4] */ + srcReg17 = ((self_in_dispatchConcretize->operands))[0]; + aWord61 = pushR(self_in_dispatchConcretize, srcReg17); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord61; + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case PushCq: + /* begin concretizePushCq */ + word2 = ((self_in_dispatchConcretize->operands))[0]; + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + value2 = word2; + while (1) { + if ((value2 & 0xFF) == value2) { + invert = word2 != value2; + /* begin machineCodeAt:put: */ + aWord62 = (invert + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value2, 0) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value2, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; + instrOffset23 = 4; + + goto l302; + } + for (i6 = 2; i6 <= 30; i6 += 2) { + if ((value2 & (((0xFFU << i6) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i6)))) == value2) { + rot6 = 32 - i6; + immediate12 = (((usqInt) value2) >> i6) | ((value2 << (32 - i6)) & 0xFFFFFFFFU); + invert = word2 != value2; + /* begin machineCodeAt:put: */ + aWord62 = (invert + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate12, rot6) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate12, rot6)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord62; + instrOffset23 = 4; + + goto l302; + } + } + if (!(value2 == word2)) break; + value2 = (word2 < 0 + ? -1 - word2 + : (unsigned int)~word2); + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord128 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord128; + instrOffset23 = ((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 4))); + + l302: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + /* begin machineCodeAt:put: */ + aWord221 = pushR(self_in_dispatchConcretize, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset23 / 4] = aWord221; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset23 + 4; + return; + + case PushCw: + /* begin concretizePushCw */ + word3 = ((self_in_dispatchConcretize->operands))[0]; + if (((addressIsInInstructions(((AbstractInstruction *) word3))) + || ((((AbstractInstruction *) word3)) == (methodLabel()))) + || (((((usqInt)word3)) >= ((methodLabel->address))) + && ((((usqInt)word3)) < (youngReferrers())))) { + instrOffset24 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); + } + else { + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + value3 = word3; + while (1) { + if ((value3 & 0xFF) == value3) { + invert1 = word3 != value3; + /* begin machineCodeAt:put: */ + aWord63 = (invert1 + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, value3, 0) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, value3, 0)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord63; + instrOffset24 = 4; + + goto l307; + } + for (i7 = 2; i7 <= 30; i7 += 2) { + if ((value3 & (((0xFFU << i7) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i7)))) == value3) { + rot7 = 32 - i7; + immediate13 = (((usqInt) value3) >> i7) | ((value3 << (32 - i7)) & 0xFFFFFFFFU); + invert1 = word3 != value3; + /* begin machineCodeAt:put: */ + aWord63 = (invert1 + ? mvnimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate13, rot7) + : movimmror(self_in_dispatchConcretize, ConcreteIPReg, immediate13, rot7)); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord63; + instrOffset24 = 4; + + goto l307; + } + } + if (!(value3 == word3)) break; + value3 = (word3 < 0 + ? -1 - word3 + : (unsigned int)~word3); + } + instrOffset24 = loadCwInto(self_in_dispatchConcretize, ConcreteIPReg); + + l307: /* end rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */; + } + /* begin machineCodeAt:put: */ + aWord129 = pushR(self_in_dispatchConcretize, ConcreteIPReg); + ((self_in_dispatchConcretize->machineCode))[instrOffset24 / 4] = aWord129; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset24 + 4; + return; + + case PrefetchAw: + /* begin concretizePrefetchAw */ + addressOperand = ((self_in_dispatchConcretize->operands))[0]; + if ((addressOperand != null) + && ((addressOperand >= (varBaseAddress())) + && ((addressOperand - (varBaseAddress())) < (1U << 12)))) { + /* begin machineCodeAt:put: */ + immediate20 = addressOperand - (varBaseAddress()); + aWord64 = ((usqInt) (4115722240U | ((((int)((usqInt)(ConcreteVarBaseReg) << 16))) | ((1U << 23) | immediate20)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord64; + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l313; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address))); + assert((SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord130 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8)))); + ((self_in_dispatchConcretize->machineCode))[0 / 4] = aWord130; + instrOffset25 = ((self_in_dispatchConcretize->machineCodeSize) = 4); + /* begin machineCodeAt:put: */ + aWord222 = 4115722240U | ((((int)((usqInt)(ConcreteIPReg) << 16))) | ((1U << 23) | 0)); + ((self_in_dispatchConcretize->machineCode))[instrOffset25 / 4] = aWord222; + (self_in_dispatchConcretize->machineCodeSize) = instrOffset25 + 4; + l313: /* end concretizePrefetchAw */; + return; + + case ConvertRRd: + /* begin concretizeConvertRRd */ + srcReg18 = ((self_in_dispatchConcretize->operands))[0]; + destReg12 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = (fmsrFromto(self_in_dispatchConcretize, srcReg18, 9)); + ((self_in_dispatchConcretize->machineCode))[1] = (fsitodFromto(self_in_dispatchConcretize, 9, destReg12)); + (self_in_dispatchConcretize->machineCodeSize) = 8; + return; + + default: + error("Case not found and no otherwise clause"); + } + return; +} + + +/* FMSR or VMOV instruction to move a value from an ARM reg to an fpu double + register ready for conversion + FMSR regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-68 + VMOV regB, regA - ARM_ARM v7 DDi10406 pp. A8-462-3 + */ +/* the dest reg bits are spread out a little */ + + /* CogARMCompiler>>#fmsrFrom:to: */ +static usqInt NoDbgRegParms +fmsrFromto(AbstractInstruction * self_in_fmsrFromto, sqInt regA, sqInt regB) +{ + sqInt destReg; + + destReg = (((sqInt)((usqInt)((((usqInt) regB) >> 1)) << 16))) | (((sqInt)((usqInt)((regB & 1)) << 7))); + return (3992979984U | (((sqInt)((usqInt)(regA) << 12)))) | destReg; +} + + +/* FSITOD or VCVT instruction to move convert an integer value to an fpu + double FSITOD regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-95 + VCVTW. regB, regA - ARM_ARM v7 DDI10406.pdf pp. A8-576-8 + */ +/* the src reg bits are spread out a little */ + + /* CogARMCompiler>>#fsitodFrom:to: */ +static usqInt NoDbgRegParms +fsitodFromto(AbstractInstruction * self_in_fsitodFromto, sqInt regA, sqInt regB) +{ + sqInt srcReg; + + srcReg = (((usqInt) regA) >> 1) | (((sqInt)((usqInt)((regA & 1)) << 5))); + return (4005039040U | srcReg) | (((sqInt)((usqInt)(regB) << 12))); +} + + +/* Answer if CallFull and/or JumpFull are relative and hence need relocating + on method + compation. If so, they are annotated with IsRelativeCall in methods and + relocated in + relocateIfCallOrMethodReference:mcpc:delta: */ + + /* CogARMCompiler>>#fullCallsAreRelative */ +static sqInt NoDbgRegParms +fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative) +{ + return 0; +} + + +/* Currently no instruction level support for divide on ARM. See also + #canDivQuoRem + */ + + /* CogARMCompiler>>#genDivR:R:Quo:Rem: */ +static AbstractInstruction * NoDbgRegParms +genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder) +{ + usqInt divRemFunctionAddr; + AbstractInstruction * inst; + sqInt rDividend; + sqInt rDivisor; + sqInt rQuotient; + sqInt rRemainder; + AbstractInstruction * self_in_saveAndRestoreLinkRegAround; + + assert(abstractRegDividend != abstractRegDivisor); + assert(abstractRegQuotient != abstractRegRemainder); + rDividend = abstractRegDividend; + rDivisor = abstractRegDivisor; + if (!(rDividend == CArg0Reg)) { + + /* we need to move the value in rDividend to CArg0Reg. Best to double check if rDivisor is already using it first */ + if (rDivisor == CArg0Reg) { + + /* oh dear; we also need to move rDivisor's value out of the way first.. I'll move it to CArg1Reg and if some nitwit has managed to put rDividend there they deserve the crash */ + if (rDividend == CArg1Reg) { + error("register choices in genDivR:R:Quo:Rem: made life impossible"); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, rDivisor, CArg1Reg); + rDivisor = CArg1Reg; + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, rDividend, CArg0Reg); + } + if (!(rDivisor == CArg1Reg)) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, rDivisor, CArg1Reg); + } + divRemFunctionAddr = aeabiDivModFunctionAddr(self_in_genDivRRQuoRem); + /* begin saveAndRestoreLinkRegAround: */ + self_in_saveAndRestoreLinkRegAround = ((AbstractInstruction *) (backEnd())); + /* begin PushR: */ + inst = genoperand(PushR, LinkReg); + CallFullRTregistersToBeSavedMask(((usqInt)divRemFunctionAddr), (1U << CArg2Reg) | (1U << CArg3Reg)); + + /* begin PopR: */ + genoperand(PopR, LinkReg); + rQuotient = abstractRegQuotient; + rRemainder = abstractRegRemainder; + if (!(rQuotient == CArg0Reg)) { + + /* oh good grief, not again */ + /* begin MoveR:R: */ + genoperandoperand(MoveRR, CArg0Reg, rQuotient); + if (rQuotient == CArg1Reg) { + error("register choices in genDivR:R:Quo:Rem: made life impossible"); + } + } + if (!(rRemainder == CArg1Reg)) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, CArg1Reg, rRemainder); + } + return self_in_genDivRRQuoRem; +} + + +/* Load the stack pointer register with that of the C stack, effecting + a switch to the C stack. Used when machine code calls into the + CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogARMCompiler>>#genLoadCStackPointer */ +static sqInt NoDbgRegParms +genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer) +{ + sqInt address; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, SPReg)); + return 0; +} + + +/* Load the frame and stack pointer registers with those of the C stack, + effecting a switch to the C stack. Used when machine code calls into + the CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogARMCompiler>>#genLoadCStackPointers */ +static sqInt NoDbgRegParms +genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers) +{ + sqInt address; + sqInt address1; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, SPReg)); + /* begin MoveAw:R: */ + address1 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, FPReg)); + return 0; +} + + +/* Switch back to the Smalltalk stack. Assign SPReg first + because typically it is used immediately afterwards. */ + + /* CogARMCompiler>>#genLoadStackPointers */ +static sqInt NoDbgRegParms +genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) +{ + sqInt address; + sqInt address1; + + /* begin MoveAw:R: */ + address = stackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, SPReg)); + /* begin MoveAw:R: */ + address1 = framePointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, FPReg)); + return 0; +} + + +/* Use SMULL to produce a 64-bit result, explicitly in RISCTempReg,regDest. - + ARM_ARM v7 DDI10406 pp. A8-354-5 + By comparing RISCTempReg with regDest ASR 31(which effectively makes it 0 + or -1) we know that the result being EQ means the hi reg and the top bit + of the lo reg are the same - ie no overflow. The condition code can then + be forced to oVerflow by use of MSR APSR_nzcvq, #1, lsl 28 + */ + + /* CogARMCompiler>>#genMulR:R: */ +static AbstractInstruction * NoDbgRegParms +genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest) +{ + AbstractInstruction *first; + + + /* result in RISCTempReg,regDest */ + first = genoperandoperand(SMULL, regSource, regDest); + genoperandoperand(CMPSMULL, RISCTempReg, regDest); + genoperand(MSR, 1); + return first; +} + + +/* Ensure that the register args are pushed before the outer and + inner retpcs at an entry miss for arity <= self numRegArgs. The + outer retpc is that of a call at a send site. The inner is the call + from a method or PIC abort/miss to the trampoline. */ +/* Putting the receiver and args above the return address means the + CoInterpreter has a single machine-code frame format which saves + us a lot of work. */ +/* Iff there are register args convert + sp -> outerRetpc (send site retpc) + linkReg = innerRetpc (PIC abort/miss retpc) + to + base -> receiver + (arg0) + (arg1) + sp -> outerRetpc (send site retpc) + sp -> linkReg/innerRetpc (PIC abort/miss retpc) */ + + /* CogARMCompiler>>#genPushRegisterArgsForAbortMissNumArgs: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + if (numArgs > 0) { + /* begin PushR: */ + genoperand(PushR, Arg0Reg); + if (numArgs > 1) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + } + } + /* begin PushR: */ + genoperand(PushR, TempReg); + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + return self_in_genPushRegisterArgsForAbortMissNumArgs; +} + + +/* Ensure that the register args are pushed before the retpc for arity <= + self numRegArgs. + */ +/* This is easy on a RISC like ARM because the return address is in the link + register. Putting + the receiver and args above the return address means the CoInterpreter has + a single + machine-code frame format which saves us a lot of work + NOTA BENE: we do NOT push the return address here, which means it must be + dealt with later. */ + + /* CogARMCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) +{ + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + if (numArgs > 0) { + /* begin PushR: */ + genoperand(PushR, Arg0Reg); + if (numArgs > 1) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + } + } + } + return self_in_genPushRegisterArgsForNumArgsscratchReg; +} + + +/* This is a no-op on ARM since the ABI passes up to 4 args in registers and + trampolines currently observe that limit. + */ + + /* CogARMCompiler>>#genRemoveNArgsFromStack: */ +static sqInt NoDbgRegParms +genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) +{ + assert(n <= 4); + return 0; +} + + +/* Restore the general purpose registers except for abstractReg for a + trampoline call. + */ +/* Restore none, because the ARM ABI only defines callee saved registers, no + caller-saved regs. + */ + + /* CogARMCompiler>>#genRestoreRegsExcept: */ +static AbstractInstruction * NoDbgRegParms +genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) +{ + return self_in_genRestoreRegsExcept; +} + + +/* Save the frame and stack pointer registers to the framePointer + and stackPointer variables. Used to save the machine code frame + for use by the run-time when calling into the CoInterpreter run-time. */ + + /* CogARMCompiler>>#genSaveStackPointers */ +static sqInt NoDbgRegParms +genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers) +{ + sqInt address; + sqInt address1; + + /* begin MoveR:Aw: */ + address = framePointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, FPReg, address)); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, SPReg, address1)); + return 0; +} + + /* CogARMCompiler>>#genSubstituteReturnAddress: */ +static AbstractInstruction * NoDbgRegParms +genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc) +{ + /* begin MoveCw:R: */ + return checkLiteralforInstruction(retpc, genoperandoperand(MoveCwR, retpc, LR)); +} + + +/* Answer the instruction immediately preceding followingAddress. */ + + /* CogARMCompiler>>#instructionBeforeAddress: */ +static sqInt NoDbgRegParms +instructionBeforeAddress(AbstractInstruction * self_in_instructionBeforeAddress, sqInt followingAddress) +{ + return longAt(followingAddress - 4); +} + + +/* is this a BLX instruction? */ + + /* CogARMCompiler>>#instructionIsBLX: */ +static sqInt NoDbgRegParms +instructionIsBLX(AbstractInstruction * self_in_instructionIsBLX, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsBLX, instr)) + && ((instr & 0xFFFFFF0) == 19922736); +} + + +/* is this a BL instruction? */ + + /* CogARMCompiler>>#instructionIsBL: */ +static sqInt NoDbgRegParms +instructionIsBL(AbstractInstruction * self_in_instructionIsBL, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsBL, instr)) + && ((instr & (15U << 24)) == (11U << 24)); +} + + +/* is this a BX instruction? */ + + /* CogARMCompiler>>#instructionIsBX: */ +static sqInt NoDbgRegParms +instructionIsBX(AbstractInstruction * self_in_instructionIsBX, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsBX, instr)) + && ((instr & 0xFFFFFF0) == 19922704); +} + + +/* is this a B instruction? */ + + /* CogARMCompiler>>#instructionIsB: */ +static sqInt NoDbgRegParms +instructionIsB(AbstractInstruction * self_in_instructionIsB, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsB, instr)) + && ((instr & (15U << 24)) == (10U << 24)); +} + + +/* is this a CMP instruction? */ + + /* CogARMCompiler>>#instructionIsCMP: */ +static sqInt NoDbgRegParms +instructionIsCMP(AbstractInstruction * self_in_instructionIsCMP, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsCMP, instr)) + && (((((usqInt) instr) >> 21) & 0x7F) == CmpOpcode); +} + + +/* is this any kind of LDR instruction? c.f. memMxr:reg:base:u:b:l:imm: */ + + /* CogARMCompiler>>#instructionIsLDR: */ +static sqInt NoDbgRegParms +instructionIsLDR(AbstractInstruction * self_in_instructionIsLDR, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsLDR, instr)) + && (((((usqInt) instr) >> 20) & 197) == 65); +} + + +/* is this an ORR instruction? */ + + /* CogARMCompiler>>#instructionIsOR: */ +static sqInt NoDbgRegParms +instructionIsOR(AbstractInstruction * self_in_instructionIsOR, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsOR, instr)) + && (((((usqInt) instr) >> 21) & 0x7F) == (16 | OrOpcode)); +} + + +/* is this a push -str r??, [sp, #-4] - instruction? */ + + /* CogARMCompiler>>#instructionIsPush: */ +static sqInt NoDbgRegParms +instructionIsPush(AbstractInstruction * self_in_instructionIsPush, sqInt instr) +{ + return (conditionIsNotNever(self_in_instructionIsPush, instr)) + && ((instr & 268374015) == 86835204); +} + + +/* Answer the instruction size at pc.Simple on ARM ;-) */ + + /* CogARMCompiler>>#instructionSizeAt: */ +static sqInt NoDbgRegParms +instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc) +{ + return 4; +} + + +/* Several of the opcodes are inverses. Answer the inverse for an opcode if + it has one. + See Table A3-2 in sec A3.4 Data-processing instructions of the AARM. */ + + /* CogARMCompiler>>#inverseOpcodeFor: */ +static sqInt NoDbgRegParms +inverseOpcodeFor(AbstractInstruction * self_in_inverseOpcodeFor, sqInt armOpcode) +{ + + switch (armOpcode) { + case AddOpcode: + return SubOpcode; + + case AndOpcode: + return BicOpcode; + + case BicOpcode: + return AndOpcode; + + case CmpOpcode: + return CmpNotOpcode; + + case MoveOpcode: + return MoveNotOpcode; + + case MoveNotOpcode: + return MoveOpcode; + + case SubOpcode: + return AddOpcode; + + default: + error("opcode has no inverse"); + return -1; + + } +} + + +/* Support for addressing variables off the dedicated VarBaseReg */ + + /* CogARMCompiler>>#isAddressRelativeToVarBase: */ +static sqInt NoDbgRegParms +isAddressRelativeToVarBase(AbstractInstruction * self_in_isAddressRelativeToVarBase, usqInt varAddress) +{ + return (varAddress != null) + && ((varAddress >= (varBaseAddress())) + && ((varAddress - (varBaseAddress())) < (1U << 12))); +} + + +/* Assuming mcpc is a send return pc answer if the instruction before it is a + call (not a CallFull). + */ +/* There are two types of calls: BL and/BLX encoding */ + + /* CogARMCompiler>>#isCallPrecedingReturnPC: */ +static sqInt NoDbgRegParms +isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc) +{ + sqInt call; + + /* begin instructionBeforeAddress: */ + call = longAt(mcpc - 4); + return (instructionIsBL(self_in_isCallPrecedingReturnPC, call)) + || (instructionIsBLX(self_in_isCallPrecedingReturnPC, call)); +} + + +/* ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls + and jumps. + */ + + /* CogARMCompiler>>#isInImmediateJumpRange: */ +static sqInt NoDbgRegParms +isInImmediateJumpRange(AbstractInstruction * self_in_isInImmediateJumpRange, usqIntptr_t operand) +{ + return (((((int) operand)) >= -33554432) && ((((int) operand)) <= 0x1FFFFFC)); +} + + /* CogARMCompiler>>#isJumpAt: */ +static sqInt NoDbgRegParms +isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc) +{ + int instr; + + instr = long32At(pc); + return (instructionIsB(self_in_isJumpAt, instr)) + || (instructionIsBX(self_in_isJumpAt, instr)); +} + + +/* add xx, pc, blah or sub xx, pc, blah */ + + /* CogARMCompiler>>#isPCRelativeValueLoad: */ +static sqInt NoDbgRegParms +isPCRelativeValueLoad(AbstractInstruction * self_in_isPCRelativeValueLoad, unsigned int instr) +{ + return ((((usqInt) instr) >> 16) == 57999) + || ((((usqInt) instr) >> 16) == 57935); +} + + +/* Branch/Call ranges. Jump[Cond] can be generated as short as possible. + Call/Jump[Cond]Long must be generated + in the same number of bytes irrespective of displacement since their + targets may be updated, but they need only + span 16Mb, the maximum size of the code zone. This allows e.g. ARM to use + single-word call and jump instructions + for most calls and jumps. CallFull/JumpFull must also be generated in the + same number of bytes irrespective of + displacement for the same reason, but they must be able to span the full + (32-bit or 64-bit) address space because + they are used to call code in the C runtime, which may be distant from the + code zone + */ + + /* CogARMCompiler>>#jumpLongByteSize */ +static sqInt NoDbgRegParms +jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize) +{ + return 4; +} + + /* CogARMCompiler>>#jumpLongConditionalByteSize */ +static sqInt NoDbgRegParms +jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize) +{ + return jumpLongByteSize(self_in_jumpLongConditionalByteSize); +} + + +/* Answer the target address for the long jump immediately preceding mcpc */ + + /* CogARMCompiler>>#jumpLongTargetBeforeFollowingAddress: */ +static sqInt NoDbgRegParms +jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc) +{ + return callTargetFromReturnAddress(self_in_jumpLongTargetBeforeFollowingAddress, mcpc); +} + + /* CogARMCompiler>>#jumpTargetPCAt: */ +static usqInt NoDbgRegParms +jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc) +{ + int operand; + int word; + + word = long32At(pc); + operand = word & 0xFFFFFF; + if (operand & 0x800000) { + operand -= 0x1000000; + } + return ((operand * 4) + pc) + 8; +} + + +/* LDRB destReg, [baseReg, 'u' immediate12bitValue] u=0 -> - ARM_ARM v7 + DDI10406 pp. A8-128-9 + Note that this is a very low level interface that does not check the sign + of the immediate, nor validity. See for example #concretizeMoveMbrR */ + + /* CogARMCompiler>>#ldrb:rn:plus:imm: */ +static sqInt NoDbgRegParms +ldrbrnplusimm(AbstractInstruction * self_in_ldrbrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_ldrbrnplusimm, AL, destReg, baseReg, u, 1, 1, immediate12bitValue); +} + + +/* LDRB destReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-132-3 + The contents of offsetReg are assumed to be correctly signed */ + + /* CogARMCompiler>>#ldrb:rn:rm: */ +static sqInt NoDbgRegParms +ldrbrnrm(AbstractInstruction * self_in_ldrbrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg) +{ + return memMxrregbasepubwlrm(self_in_ldrbrnrm, AL, destReg, baseReg, 1, 1, 1, 0, 1, offsetReg); +} + + +/* LDRH destReg, [baseReg, 'u' immediate8bitValue] u=0 -> subtract imm; =1 -> + add imm - ARM_ARM v7 DDI10406 pp. A8-152-3 */ + + /* CogARMCompiler>>#ldrh:rn:plus:imm: */ +static sqInt NoDbgRegParms +ldrhrnplusimm(AbstractInstruction * self_in_ldrhrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate8bitValue) +{ + return memM16xrregbasepuwloffset(self_in_ldrhrnplusimm, AL, destReg, baseReg, 1, u, 0, 1, immediate8bitValue); +} + + +/* LDRH destReg, [baseReg, +offsetReg] - ARM_ARM v7 DDI10406 pp. A8-156-7 + The contents of offsetReg are assumed to be correctly signed */ + + /* CogARMCompiler>>#ldrh:rn:rm: */ +static sqInt NoDbgRegParms +ldrhrnrm(AbstractInstruction * self_in_ldrhrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg) +{ + return memM16xrregbasepuwlrm(self_in_ldrhrnrm, AL, destReg, baseReg, 1, 1, 0, 1, offsetReg); +} + + +/* LDR destReg, [baseReg, +immediate12bitValue] - ARM_ARM v7 DDI10406 pp. + A8-120-1 + */ + + /* CogARMCompiler>>#ldr:rn:plusImm: */ +static sqInt NoDbgRegParms +ldrrnplusImm(AbstractInstruction * self_in_ldrrnplusImm, sqInt destReg, sqInt baseReg, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_ldrrnplusImm, AL, destReg, baseReg, 1, 0, 1, immediate12bitValue); +} + + +/* LDR destReg, [baseReg, immediate12bitValue] u=0 -> subtract imm; =1 -> add + imm - ARM_ARM v7 DDI10406 pp. A8-120-1 */ + + /* CogARMCompiler>>#ldr:rn:plus:imm: */ +static sqInt NoDbgRegParms +ldrrnplusimm(AbstractInstruction * self_in_ldrrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_ldrrnplusimm, AL, destReg, baseReg, u, 0, 1, immediate12bitValue); +} + + +/* LDR destReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-124-5 + The contents of offsetReg are assumed to be correctly signed */ + + /* CogARMCompiler>>#ldr:rn:rm: */ +static sqInt NoDbgRegParms +ldrrnrm(AbstractInstruction * self_in_ldrrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg) +{ + return memMxrregbasepubwlrm(self_in_ldrrnrm, AL, destReg, baseReg, 1, 1, 0, 0, 1, offsetReg); +} + + +/* Load the operand into the destination register, answering + the size of the instructions generated to do so. */ + + /* CogARMCompiler>>#loadCwInto: */ +static sqInt NoDbgRegParms +loadCwInto(AbstractInstruction * self_in_loadCwInto, sqInt destReg) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t distance; + sqInt i; + sqInt immediate; + sqInt negate; + usqIntptr_t operand; + sqInt rot; + sqInt value; + + operand = ((self_in_loadCwInto->operands))[0]; + if ((addressIsInInstructions(((AbstractInstruction *) operand))) + || ((((AbstractInstruction *) operand)) == (methodLabel()))) { + operand = ((((AbstractInstruction *) operand))->address); + } + if (((((usqInt)operand)) >= ((methodLabel->address))) + && ((((usqInt)operand)) < (youngReferrers()))) { + distance = operand - (((self_in_loadCwInto->address)) + 8); + /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ + value = distance; + while (1) { + if ((value & 0xFF) == value) { + negate = distance != value; + /* begin machineCodeAt:put: */ + aWord = (negate + ? subrnimmror(self_in_loadCwInto, destReg, PC, value, 0) + : addrnimmror(self_in_loadCwInto, destReg, PC, value, 0)); + ((self_in_loadCwInto->machineCode))[0 / 4] = aWord; + return 4; + + goto l2; + } + for (i = 2; i <= 30; i += 2) { + if ((value & (((0xFFU << i) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i)))) == value) { + rot = 32 - i; + immediate = (((usqInt) value) >> i) | ((((sqInt)((usqInt)(value) << (32 - i)))) & 0xFFFFFFFFU); + negate = distance != value; + /* begin machineCodeAt:put: */ + aWord = (negate + ? subrnimmror(self_in_loadCwInto, destReg, PC, immediate, rot) + : addrnimmror(self_in_loadCwInto, destReg, PC, immediate, rot)); + ((self_in_loadCwInto->machineCode))[0 / 4] = aWord; + return 4; + + goto l2; + } + } + if (!((value == distance) + && (distance != 0))) break; + value = -distance; + } + assert(!((isAnInstruction(self_in_loadCwInto, ((AbstractInstruction *) (((self_in_loadCwInto->operands))[0])))))); + + l2: /* end rotateable8bitSignedImmediate:ifTrue:ifFalse: */; + } + /* begin moveCw:intoR: */ + assert(addressIsInCurrentCompilation((((self_in_loadCwInto->dependent))->address))); + assert((SQABS((((((self_in_loadCwInto->dependent))->address)) - (((self_in_loadCwInto->address)) + 8)))) < (1U << 12)); + /* begin machineCodeAt:put: */ + aWord1 = ldrrnplusimm(self_in_loadCwInto, destReg, PC, (((((self_in_loadCwInto->dependent))->address)) >= (((self_in_loadCwInto->address)) + 8) + ? 1 + : 0), SQABS((((((self_in_loadCwInto->dependent))->address)) - (((self_in_loadCwInto->address)) + 8)))); + ((self_in_loadCwInto->machineCode))[0 / 4] = aWord1; + return ((usqInt) (((self_in_loadCwInto->machineCodeSize) = 4))); +} + + +/* Answer the byte size of a MoveCwR opcode's corresponding machine code + when the argument is a PIC. This is for the self-reference at the end of a + closed PIC. On ARM this is a single instruction pc-relative register load. */ + + /* CogARMCompiler>>#loadPICLiteralByteSize */ +static sqInt NoDbgRegParms +loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize) +{ + return 4; +} + + +/* Answer the maximum number of bytes of machine code generated for any + abstract instruction. + e.g. CmpCwR => + mov R3, #, 12 + orr R3, R3, #, 8 + orr R3, R3, #, 4 + orr R3, R3, #, 0 + cmp R?, R3 */ + + /* CogARMCompiler>>#machineCodeBytes */ +static sqInt NoDbgRegParms +machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes) +{ + return 20; +} + + +/* Answer the maximum number of words of machine code generated for any + abstract instruction. + e.g. CmpCwR => + mov R3, #, 12 + orr R3, R3, #, 8 + orr R3, R3, #, 4 + orr R3, R3, #, 0 + cmp R?, R3 */ + + /* CogARMCompiler>>#machineCodeWords */ +static sqInt NoDbgRegParms +machineCodeWords(AbstractInstruction * self_in_machineCodeWords) +{ + return 5; +} + + +/* build an ARM [base +/- offset8] half-word memory instruction + p -> pre-index (1) or post-index (0) the offset. Combines with W to do + some odd things. + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + w -> write-back (1) if pre-indexing. + l -> load (1) or store (0) */ + + /* CogARMCompiler>>#memM16xr:reg:base:p:u:w:l:offset: */ +static sqInt NoDbgRegParms +memM16xrregbasepuwloffset(AbstractInstruction * self_in_memM16xrregbasepuwloffset, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offset8) +{ + return (((sqInt)((usqInt)(cond) << 28))) | ((0U << 25) | ((((sqInt)((usqInt)(postpreoffset) << 24))) | ((((sqInt)((usqInt)(updown) << 23))) | ((1U << 22) | ((((sqInt)((usqInt)(weirdstuff) << 21))) | ((((sqInt)((usqInt)(loadstore) << 20))) | ((((sqInt)((usqInt)(baseReg) << 16))) | ((((sqInt)((usqInt)(destReg) << 12))) | ((((sqInt)((usqInt)((offset8 & 240)) << 4))) | ((11U << 4) | (offset8 & 15))))))))))); +} + + +/* build an ARM [base +/- offsetReg] memory instruction + p -> pre-index (1) or post-index (0) the offset. Combines with W to do + some odd things. + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + w -> write-back (1) if pre-indexing. + l -> load (1) or store (0) + */ + + /* CogARMCompiler>>#memM16xr:reg:base:p:u:w:l:rm: */ +static sqInt NoDbgRegParms +memM16xrregbasepuwlrm(AbstractInstruction * self_in_memM16xrregbasepuwlrm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg) +{ + return (((sqInt)((usqInt)(cond) << 28))) | ((0U << 25) | ((((sqInt)((usqInt)(postpreoffset) << 24))) | ((((sqInt)((usqInt)(updown) << 23))) | ((0U << 22) | ((((sqInt)((usqInt)(weirdstuff) << 21))) | ((((sqInt)((usqInt)(loadstore) << 20))) | ((((sqInt)((usqInt)(baseReg) << 16))) | ((((sqInt)((usqInt)(destReg) << 12))) | (176 | offsetReg))))))))); +} + + +/* build an ARM [base +/- offset] memory instruction + p -> pre-index (1) or post-index (0) the offset. Combines with W to do + some odd things. + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + w -> write-back (1) if pre-indexing. + l -> load (1) or store (0) + */ + + /* CogARMCompiler>>#memMxr:reg:base:p:u:b:w:l:imm: */ +static sqInt NoDbgRegParms +memMxrregbasepubwlimm(AbstractInstruction * self_in_memMxrregbasepubwlimm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offset) +{ + return (((sqInt)((usqInt)(cond) << 28))) | ((2U << 25) | ((((sqInt)((usqInt)(postpreoffset) << 24))) | ((((sqInt)((usqInt)(updown) << 23))) | ((((sqInt)((usqInt)(byteword) << 22))) | ((((sqInt)((usqInt)(weirdstuff) << 21))) | ((((sqInt)((usqInt)(loadstore) << 20))) | ((((sqInt)((usqInt)(baseReg) << 16))) | ((((sqInt)((usqInt)(destReg) << 12))) | offset)))))))); +} + + +/* build an ARM [base +/- offsetReg lsl #2] memory instruction - see also + #memMxr:reg:base:p:u:b:w:l:rm: and keep them correlated properly + p -> pre-index (1) or post-index (0) the offset. Combines with W to do + some odd things. + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + w -> write-back (1) if pre-indexing. + l -> load (1) or store (0) + */ + + /* CogARMCompiler>>#memMxr:reg:base:p:u:b:w:l:rmLsl2: */ +static sqInt NoDbgRegParms +memMxrregbasepubwlrmLsl2(AbstractInstruction * self_in_memMxrregbasepubwlrmLsl2, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg) +{ + return (((sqInt)((usqInt)((cond & 15)) << 28))) | ((3U << 25) | ((((sqInt)((usqInt)((postpreoffset & 1)) << 24))) | ((((sqInt)((usqInt)((updown & 1)) << 23))) | ((((sqInt)((usqInt)((byteword & 1)) << 22))) | ((((sqInt)((usqInt)((weirdstuff & 1)) << 21))) | ((((sqInt)((usqInt)((loadstore & 1)) << 20))) | ((((sqInt)((usqInt)((baseReg & 15)) << 16))) | ((((sqInt)((usqInt)((destReg & 15)) << 12))) | (256 | (offsetReg & 15)))))))))); +} + + +/* build an ARM [base +/- offsetReg] memory instruction + p -> pre-index (1) or post-index (0) the offset. Combines with W to do + some odd things. + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + w -> write-back (1) if pre-indexing. + l -> load (1) or store (0) + */ + + /* CogARMCompiler>>#memMxr:reg:base:p:u:b:w:l:rm: */ +static sqInt NoDbgRegParms +memMxrregbasepubwlrm(AbstractInstruction * self_in_memMxrregbasepubwlrm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg) +{ + return (((sqInt)((usqInt)((cond & 15)) << 28))) | ((3U << 25) | ((((sqInt)((usqInt)((postpreoffset & 1)) << 24))) | ((((sqInt)((usqInt)((updown & 1)) << 23))) | ((((sqInt)((usqInt)((byteword & 1)) << 22))) | ((((sqInt)((usqInt)((weirdstuff & 1)) << 21))) | ((((sqInt)((usqInt)((loadstore & 1)) << 20))) | ((((sqInt)((usqInt)((baseReg & 15)) << 16))) | ((((sqInt)((usqInt)((destReg & 15)) << 12))) | (offsetReg & 15))))))))); +} + + +/* This is the lowest level build of an ARM [base +/- immediate 12bit offset] + memory instruction + u -> up (1) or down (0) ie + or - for the offset + b -> byte(1) or word (0) + l -> load (1) or store (0) + */ + + /* CogARMCompiler>>#memMxr:reg:base:u:b:l:imm: */ +static sqInt NoDbgRegParms +memMxrregbaseublimm(AbstractInstruction * self_in_memMxrregbaseublimm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt updown, sqInt byteword, sqInt loadstore, sqInt immediate12bitValue) +{ + return (((sqInt)((usqInt)((cond & 15)) << 28))) | ((5U << 24) | ((((sqInt)((usqInt)((updown & 1)) << 23))) | ((((sqInt)((usqInt)((byteword & 1)) << 22))) | ((((sqInt)((usqInt)((loadstore & 1)) << 20))) | ((((sqInt)((usqInt)((baseReg & 15)) << 16))) | ((((sqInt)((usqInt)((destReg & 15)) << 12))) | (immediate12bitValue & 0xFFF))))))); +} + + +/* MOVS destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-196-7 */ + + /* CogARMCompiler>>#movs:rn: */ +static sqInt NoDbgRegParms +movsrn(AbstractInstruction * self_in_movsrn, sqInt destReg, sqInt srcReg) +{ + return (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (1U << 20)))) | ((0U << 16) | (((sqInt)((usqInt)(destReg) << 12))))) | (srcReg & 0xFFF); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc. + MOV destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. + A8-194-5 + */ + + /* CogARMCompiler>>#mov:imm:ror: */ +static sqInt NoDbgRegParms +movimmror(AbstractInstruction * self_in_movimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (0U << 20)))) | ((0U << 16) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate8bitValue) & 0xFFF); +} + + +/* MOV destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-196-7 */ + + /* CogARMCompiler>>#mov:rn: */ +static sqInt NoDbgRegParms +movrn(AbstractInstruction * self_in_movrn, sqInt destReg, sqInt srcReg) +{ + return (((((int)((usqInt)(AL) << 28))) | ((0U << 25) | ((((int)((usqInt)(MoveOpcode) << 21))) | (0U << 20)))) | ((0U << 16) | (((sqInt)((usqInt)(destReg) << 12))))) | (srcReg & 0xFFF); +} + + +/* Generate an MSR CPSR_f, #flags instruction. + Note that + a) CPSR_f is equivalent to APSR_nzcvq (ARM ARM DDI0406A p A8-209 & A2-14) + b) We only have business with the NZCV flags so the generated instruction + shifts the flags value <<28 - which is a ROR 4 + */ + + /* CogARMCompiler>>#msr: */ +static sqInt NoDbgRegParms +msr(AbstractInstruction * self_in_msr, sqInt flags) +{ + return (321449984 + (2U << 8)) + (flags & 15); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc. + MVN destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. + A8-214-5 + */ + + /* CogARMCompiler>>#mvn:imm:ror: */ +static sqInt NoDbgRegParms +mvnimmror(AbstractInstruction * self_in_mvnimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(MoveNotOpcode) << 21))) | (0U << 20)))) | ((0U << 16) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate8bitValue) & 0xFFF); +} + + /* CogARMCompiler>>#numIntRegArgs */ +static sqInt NoDbgRegParms +numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs) +{ + return 4; +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc. + ORR destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. + A8-228-9 + */ + + /* CogARMCompiler>>#orr:imm:ror: */ +static sqInt NoDbgRegParms +orrimmror(AbstractInstruction * self_in_orrimmror, sqInt destReg, sqInt immediate8bitValue, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(OrOpcode) << 21))) | (0U << 20)))) | ((((sqInt)((usqInt)(destReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate8bitValue) & 0xFFF); +} + + /* CogARMCompiler>>#padIfPossibleWithStopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr) +{ + sqInt nullBytes; + sqInt p; + + nullBytes = ((endAddr - startAddr) + 1) % 4; + stopsFromto(self_in_padIfPossibleWithStopsFromto, startAddr, endAddr - nullBytes); + for (p = ((endAddr - nullBytes) + 1); p <= endAddr; p += 1) { + byteAtput(p, 0xFF); + } + return self_in_padIfPossibleWithStopsFromto; +} + + +/* pop word off TOS + LDR srcReg, [sp] #4 - ARM_ARM v7 DDI10406 pp. A8-120-1 */ + + /* CogARMCompiler>>#popR: */ +static sqInt NoDbgRegParms +popR(AbstractInstruction * self_in_popR, sqInt dstReg) +{ + return memMxrregbasepubwlimm(self_in_popR, AL, dstReg, SP, 0, 1, 0, 0, 1, 4); +} + + /* CogARMCompiler>>#pushLinkRegisterByteSize */ +static sqInt NoDbgRegParms +pushLinkRegisterByteSize(AbstractInstruction * self_in_pushLinkRegisterByteSize) +{ + return 4; +} + + +/* push word to TOS + STR srcReg, [sp, #-4]! - ARM_ARM v7 DDI10406 pp. A8-382-3 */ + + /* CogARMCompiler>>#pushR: */ +static sqInt NoDbgRegParms +pushR(AbstractInstruction * self_in_pushR, sqInt srcReg) +{ + return memMxrregbasepubwlimm(self_in_pushR, AL, srcReg, SP, 1, 0, 0, 1, 0, 4); +} + + /* CogARMCompiler>>#relocateCallBeforeReturnPC:by: */ +static AbstractInstruction * NoDbgRegParms +relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta) +{ + sqInt distanceDiv4; + sqInt instr; + + assert((delta % 4) == 0); + if (delta != 0) { + /* begin instructionBeforeAddress: */ + instr = longAt(retpc - 4); + assert((instructionIsB(self_in_relocateCallBeforeReturnPCby, instr)) + || (instructionIsBL(self_in_relocateCallBeforeReturnPCby, instr))); + distanceDiv4 = instr & 0xFFFFFF; + distanceDiv4 += delta / 4; + longAtput(retpc - 4, (instr & 0xFF000000U) | (distanceDiv4 & 0xFFFFFF)); + } + return self_in_relocateCallBeforeReturnPCby; +} + + +/* Rewrite a call instruction to call a different target. This variant is + used to link PICs + in ceSendMiss et al,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ + + /* CogARMCompiler>>#rewriteCallAt:target: */ +static sqInt NoDbgRegParms +rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + return rewriteTransferAttarget(self_in_rewriteCallAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Rewrite a callFull instruction to jump to a different target. This variant + is used to rewrite cached primitive calls where we load the target address + into ip + and use the 'blx ip' instruction for the actual call. + Answer the extent of the + code change which is used to compute the range of the icache to flush. */ + + /* CogARMCompiler>>#rewriteCallFullAt:target: */ +static sqInt NoDbgRegParms +rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteFullTransferAttargetexpectedInstruction(self_in_rewriteCallFullAttarget, callSiteReturnAddress, callTargetAddress, 3778019132U); +} + + +/* Rewrite a full jump instruction to jump to a different target. This + variant is used to rewrite cached primitive calls where we load the target + address into ip + and use the 'bx ip' instruction for the actual jump. + Answer the extent of the + code change which is used to compute the range of the icache to flush. */ + + /* CogARMCompiler>>#rewriteJumpFullAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteFullTransferAttargetexpectedInstruction(self_in_rewriteJumpFullAttarget, callSiteReturnAddress, callTargetAddress, 3778019100U); +} + + +/* Rewrite a jump instruction to call a different target. This variant is + used to reset the + jumps in the prototype CPIC to suit each use,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ + + /* CogARMCompiler>>#rewriteJumpLongAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + return rewriteTransferAttarget(self_in_rewriteJumpLongAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Rewrite a call/jump instruction to call a different target. This variant + is used to link PICs + in ceSendMiss et al, and to rewrite call/jumps in CPICs. + Answer the extent of + the code change which is used to compute the range of the icache to flush. */ +/* for debug - [cogit disassembleFrom: callSiteReturnAddress - 10 to: + callSiteReturnAddress - 1]. + */ + + /* CogARMCompiler>>#rewriteTransferAt:target: */ +static sqInt NoDbgRegParms +rewriteTransferAttarget(AbstractInstruction * self_in_rewriteTransferAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + usqInt callDistance; + sqInt instr; + + if (!(callTargetAddress >= (minCallAddress()))) { + error("linking callsite to invalid address"); + } + + + /* pc offset */ + /* return offset */ + callDistance = ((usqInt) (callTargetAddress - ((callSiteReturnAddress + 8) - 4))); + assert(isInImmediateJumpRange(self_in_rewriteTransferAttarget, callDistance)); + /* begin instructionBeforeAddress: */ + instr = longAt(callSiteReturnAddress - 4); + assert((instructionIsB(self_in_rewriteTransferAttarget, instr)) + || (instructionIsBL(self_in_rewriteTransferAttarget, instr))); + longAtput(callSiteReturnAddress - 4, (instr & 0xFF000000U) | ((callDistance / 4) & 0xFFFFFF)); + assert((callTargetFromReturnAddress(self_in_rewriteTransferAttarget, callSiteReturnAddress)) == callTargetAddress); + return 4; +} + + +/* to save Slang from having to be a real compiler (it can't inline switches + that return) + */ +/* Answer if the receiver's opcode sets the condition codes correctly for the + given conditional jump opcode. + ARM has to check carefully since the V flag is not affected by + non-comparison instructions + */ + + /* CogARMCompiler>>#setsConditionCodesFor: */ +static sqInt NoDbgRegParms +setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode) +{ + + switch ((self_in_setsConditionCodesFor->opcode)) { + case ArithmeticShiftRightCqR: + case ArithmeticShiftRightRR: + case LogicalShiftLeftCqR: + case LogicalShiftLeftRR: + return shiftSetsConditionCodesFor(self_in_setsConditionCodesFor, aConditionalJumpOpcode); + + case XorRR: + return 1; + + default: + haltmsg("unhandled opcode in setsConditionCodesFor:"); + return 0; + + } +} + + +/* check what flags the opcdoe needs setting - ARM doesn't set V when simply + MOVing + */ + + /* CogARMCompiler>>#shiftSetsConditionCodesFor: */ +static sqInt NoDbgRegParms +shiftSetsConditionCodesFor(AbstractInstruction * self_in_shiftSetsConditionCodesFor, sqInt aConditionalJumpOpcode) +{ + + switch (aConditionalJumpOpcode) { + case JumpNegative: + case JumpZero: + case JumpLess: + return 1; + + default: + haltmsg("unhandled opcode in setsConditionCodesFor:"); + return 0; + + } +} + + +/* Return a minimum amount of headroom for each stack page (in bytes). In a + JIT the stack has to have room for interrupt handlers which will run on + the stack. + According to ARM architecture v5 reference manual chapter A2.6, the basic + interrupt procedure does not push anything onto the stack. It uses + SPSR_err and R14_err to preserve state. Afterwards, it calls an interrupt + procedure. So leave some room. + */ + + /* CogARMCompiler>>#stackPageInterruptHeadroomBytes */ +static sqInt NoDbgRegParms +stackPageInterruptHeadroomBytes(AbstractInstruction * self_in_stackPageInterruptHeadroomBytes) +{ + return 128; +} + + /* CogARMCompiler>>#stopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr) +{ + sqInt addr; + + assert((((endAddr - startAddr) + 1) % 4) == 0); + for (addr = startAddr; addr <= endAddr; addr += 4) { + longAtput(addr, (((int)((usqInt)(AL) << 28))) | ((66U << 20) | (7U << 4))); + } + return self_in_stopsFromto; +} + + +/* STRB destReg, [baseReg, 'u' immediate12bitValue] u=0 -> subtract imm; =1 + -> add imm - ARM_ARM v7 DDI10406 pp. A8-388-9 */ + + /* CogARMCompiler>>#strb:rn:plus:imm: */ +static sqInt NoDbgRegParms +strbrnplusimm(AbstractInstruction * self_in_strbrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_strbrnplusimm, AL, destReg, baseReg, u, 1, 0, immediate12bitValue); +} + + +/* STRB srcReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-390-1 + The contents of offsetReg are assumed to be correctly signed */ + + /* CogARMCompiler>>#strb:rn:rm: */ +static sqInt NoDbgRegParms +strbrnrm(AbstractInstruction * self_in_strbrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg) +{ + return memMxrregbasepubwlrm(self_in_strbrnrm, AL, srcReg, baseReg, 1, 1, 1, 0, 0, offsetReg); +} + + +/* STRH destReg, [baseReg, 'u' immediate8bitValue] u=0 -> subtract imm; =1 -> + add imm - ARM_ARM v7 DDI10406 pp. A8-408-9 */ + + /* CogARMCompiler>>#strh:rn:plus:imm: */ +static sqInt NoDbgRegParms +strhrnplusimm(AbstractInstruction * self_in_strhrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate8bitValue) +{ + return memM16xrregbasepuwloffset(self_in_strhrnplusimm, AL, destReg, baseReg, 1, u, 0, 0, immediate8bitValue); +} + + +/* STRH srcReg, [baseReg, +offsetReg] - ARM_ARM v7 DDI10406 pp. A8-410-1 */ + + /* CogARMCompiler>>#strh:rn:rm: */ +static sqInt NoDbgRegParms +strhrnrm(AbstractInstruction * self_in_strhrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg) +{ + return memM16xrregbasepuwlrm(self_in_strhrnrm, AL, srcReg, baseReg, 1, 1, 0, 0, offsetReg); +} + + +/* STR srcReg, [baseReg, +immediate12bitValue] - ARM_ARM v7 DDI10406 pp. + A8-382-3 + */ + + /* CogARMCompiler>>#str:rn:plusImm: */ +static sqInt NoDbgRegParms +strrnplusImm(AbstractInstruction * self_in_strrnplusImm, sqInt srcReg, sqInt baseReg, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_strrnplusImm, AL, srcReg, baseReg, 1, 0, 0, immediate12bitValue); +} + + +/* STR destReg, [baseReg, 'u' immediate12bitValue] u=0 -> subtract imm; =1 -> + add imm - ARM_ARM v7 DDI10406 pp. A8-382-3 */ + + /* CogARMCompiler>>#str:rn:plus:imm: */ +static sqInt NoDbgRegParms +strrnplusimm(AbstractInstruction * self_in_strrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) +{ + return memMxrregbaseublimm(self_in_strrnplusimm, AL, destReg, baseReg, u, 0, 0, immediate12bitValue); +} + + +/* STR srcReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-384-5 + The contents of offsetReg are assumed to be correctly signed */ + + /* CogARMCompiler>>#str:rn:rm: */ +static sqInt NoDbgRegParms +strrnrm(AbstractInstruction * self_in_strrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg) +{ + return memMxrregbasepubwlrm(self_in_strrnrm, AL, srcReg, baseReg, 1, 1, 0, 0, 0, offsetReg); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + SUBS destReg, srcReg, #immediate ROR rot - ARM_ARM v7 DDI10406 pp. + A8-418-9 + */ + + /* CogARMCompiler>>#subs:rn:imm:ror: */ +static sqInt NoDbgRegParms +subsrnimmror(AbstractInstruction * self_in_subsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc + SUB destReg, srcReg, #immediate ROR rot - ARM_ARM v7 DDI10406 pp. A8-418-9 */ + + /* CogARMCompiler>>#sub:rn:imm:ror: */ +static sqInt NoDbgRegParms +subrnimmror(AbstractInstruction * self_in_subrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(SubOpcode) << 21))) | (0U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (((sqInt)((usqInt)(destReg) << 12))))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Remember the ROR is doubled by the cpu so use 30>>1 etc */ +/* also note that TST has no destReg + TST srcReg, #immediate ROR rot - ARM_ARM v7 DDI10406 pp. A8-452-3 */ + + /* CogARMCompiler>>#tst:rn:imm:ror: */ +static sqInt NoDbgRegParms +tstrnimmror(AbstractInstruction * self_in_tstrnimmror, sqInt ignored, sqInt srcReg, sqInt immediate, sqInt rot) +{ + return (((((int)((usqInt)(AL) << 28))) | ((1U << 25) | ((((int)((usqInt)(TstOpcode) << 21))) | (1U << 20)))) | ((((sqInt)((usqInt)(srcReg) << 16))) | (0U << 12))) | (((((sqInt)((usqInt)((((usqInt) rot) >> 1)) << 8))) | immediate) & 0xFFF); +} + + +/* Answer if Call and JumpLong are relative and hence need to take the + caller's relocation delta into account during code compaction, rather than + just the + callee's delta. */ + + /* CogARMCompiler>>#zoneCallsAreRelative */ +static sqInt NoDbgRegParms +zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative) +{ + return 1; +} + + /* CogBlockMethod>>#cmHomeMethod */ +static CogMethod * NoDbgRegParms +cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) +{ + return ((self_in_cmHomeMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) self_in_cmHomeMethod) + : ((CogMethod *) ((((usqInt)self_in_cmHomeMethod)) - ((self_in_cmHomeMethod->homeOffset))))); +} + + /* CogBytecodeDescriptor>>#isBranch */ +static sqInt NoDbgRegParms +isBranch(BytecodeDescriptor * self_in_isBranch) +{ + return (((self_in_isBranch->spanFunction)) != null) + && (!((self_in_isBranch->isBlockCreation))); +} + + /* CogBytecodeDescriptor>>#isUnconditionalBranch */ +static sqInt NoDbgRegParms +isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch) +{ + return (isBranch(self_in_isUnconditionalBranch)) + && (!(((self_in_isUnconditionalBranch->isBranchTrue)) + || ((self_in_isUnconditionalBranch->isBranchFalse)))); +} + + /* Cogit>>#AddCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAddCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + return anInstruction; +} + + /* Cogit>>#AndCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + return anInstruction; +} + + /* Cogit>>#AndCq:R:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *first; + + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(AndCqRR, quickConstant, srcReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + return anInstruction; + + if (srcReg == destReg) { + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + return anInstruction1; + } + first = genoperandoperand(MoveRR, srcReg, destReg); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + return first; +} + + /* Cogit>>#ArithmeticShiftRightR:R: */ +static AbstractInstruction * NoDbgRegParms +gArithmeticShiftRightRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(ArithmeticShiftRightRR, reg1, reg2); +} + + /* Cogit>>#abortOffset */ +sqInt +abortOffset(void) +{ + return missOffset; +} + + /* Cogit>>#addCleanBlockStarts */ +static void +addCleanBlockStarts(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt startPCOrNil; + + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + maxLitIndex = ((maxLitIndex < i) ? i : maxLitIndex); + addBlockStartAtnumArgsnumCopiedspan(startPCOrNil - 1, argumentCountOfClosure(lit), copiedValueCountOfClosure(lit), spanForCleanBlockStartingAt(startPCOrNil - 1)); + } + } +} + + +/* Perform an integrity/leak check using the heapMap. + Set a bit at each cog method's header. */ + + /* Cogit>>#addCogMethodsToHeapMap */ +void +addCogMethodsToHeapMap(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + heapMapAtWordPut(cogMethod, 1); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* Cogit>>#addressIsInCurrentCompilation: */ +static sqInt NoDbgRegParms +addressIsInCurrentCompilation(sqInt address) +{ + return ((((usqInt)address)) >= ((methodLabel->address))) + && ((((usqInt)address)) < (youngReferrers())); +} + + /* Cogit>>#addressIsInFixups: */ +static sqInt NoDbgRegParms +addressIsInFixups(AbstractInstruction *address) +{ + return address >= (AbstractInstruction *)&fixups[0] && address < (AbstractInstruction *)&fixups[numAbstractOpcodes]; +} + + /* Cogit>>#addressIsInInstructions: */ +static sqInt NoDbgRegParms +addressIsInInstructions(AbstractInstruction *address) +{ + return !((usqInt)(address) & BytesPerWord-1) \ + && (address) >= &abstractOpcodes[0] \ + && (address) < &abstractOpcodes[opcodeIndex]; +} + + +/* calculate the end of the n'th case statement - which is complicated + because we have case 1 right at the top of our CPIC and then build up from + the last one. Yes I know this sounds strange, but trust me - I'm an + Engineer, we do things backwards all the emit + */ + + /* Cogit>>#addressOfEndOfCase:inCPIC: */ +static sqInt NoDbgRegParms +addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC) +{ + assert((n >= 1) + && (n <= MaxCPICCases)); + return (n == 1 + ? (((sqInt)cPIC)) + firstCPICCaseOffset + : ((((sqInt)cPIC)) + firstCPICCaseOffset) + (((MaxCPICCases + 1) - n) * cPICCaseSize)); +} + + /* Cogit>>#alignUptoRoutineBoundary: */ +static sqInt NoDbgRegParms +alignUptoRoutineBoundary(sqInt anAddress) +{ + return (((anAddress + 7) | 7) - 7); +} + + +/* Check that all methods have valid selectors, and that all linked sends are + to valid targets and have valid cache tags + */ + + /* Cogit>>#allMachineCodeObjectReferencesValid */ +static sqInt +allMachineCodeObjectReferencesValid(void) +{ + CogMethod *cogMethod; + sqInt ok; + + ok = 1; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (!(asserta(checkValidOopReference((cogMethod->selector))))) { + ok = 0; + } + if (!(asserta((cogMethodDoesntLookKosher(cogMethod)) == 0))) { + ok = 0; + } + } + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, ((sqInt)cogMethod))) == 0))) { + ok = 0; + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(asserta(noTargetsFreeInClosedPIC(cogMethod)))) { + ok = 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#allMethodsHaveCorrectHeader */ +static sqInt +allMethodsHaveCorrectHeader(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (!(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod()))) { + return 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + /* Cogit>>#annotateAbsolutePCRef: */ +static AbstractInstruction * NoDbgRegParms +annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = IsAbsPCReference); + return abstractInstruction; +} + + /* Cogit>>#annotateBytecode: */ +static AbstractInstruction * NoDbgRegParms +annotateBytecode(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = HasBytecodePC); + return abstractInstruction; +} + + /* Cogit>>#annotate:objRef: */ +static AbstractInstruction * NoDbgRegParms +annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) +{ + if (shouldAnnotateObjectReference(anOop)) { + if (isYoungObject(anOop)) { + hasYoungReferent = 1; + } + (abstractInstruction->annotation = IsObjectReference); + } + return abstractInstruction; +} + + /* Cogit>>#assertSaneJumpTarget: */ +static void NoDbgRegParms +assertSaneJumpTarget(AbstractInstruction *jumpTarget) +{ + assert((closedPICSize == null) + || ((openPICSize == null) + || ((addressIsInInstructions(jumpTarget)) + || ((((((usqInt)jumpTarget)) >= codeBase) && ((((usqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); +} + + /* Cogit>>#blockCreationBytecodeSizeForHeader: */ +static sqInt NoDbgRegParms +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) +{ + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? AltBlockCreationBytecodeSize + : BlockCreationBytecodeSize); +} + + +/* Evaluate binaryFunction with the block start mcpc and supplied arg for + each entry in the block dispatch. If the function answers non-zero answer + the value + it answered. Used to update back-references to the home method in + compaction. */ + + /* Cogit>>#blockDispatchTargetsFor:perform:arg: */ +static sqInt NoDbgRegParms +blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) +{ + sqInt blockEntry; + sqInt end; + sqInt pc; + sqInt result; + usqInt targetpc; + + if (((cogMethod->blockEntryOffset)) == 0) { + return null; + } + blockEntry = ((cogMethod->blockEntryOffset)) + (((sqInt)cogMethod)); + pc = blockEntry; + end = (mapEndFor(cogMethod)) - 1; + while (pc < end) { + if (isJumpAt(backEnd, pc)) { + targetpc = jumpTargetPCAt(backEnd, pc); + if (targetpc < blockEntry) { + result = binaryFunction(targetpc, arg); + if (result != 0) { + return result; + } + } + } + pc += instructionSizeAt(backEnd, pc); + } + return 0; +} + + +/* Answer the zero-relative bytecode pc matching the machine code pc argument + in cogMethod, given the start of the bytecodes for cogMethod's block or + method object. */ + + /* Cogit>>#bytecodePCFor:startBcpc:in: */ +sqInt +bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc1; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc1 = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc1)), startbcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc1 += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + return 0; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + return 0; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc1)), bcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return 0; +} + + /* Cogit>>#CallFullRT:registersToBeSavedMask: */ +static AbstractInstruction * NoDbgRegParms +CallFullRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved) +{ + sqInt callerSavedRegsToBeSaved; + AbstractInstruction *lastInst; + + callerSavedRegsToBeSaved = CallerSavedRegisterMask & registersToBeSaved; + /* begin genPushRegisterMask: */ + if (callerSavedRegsToBeSaved == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, callerSavedRegsToBeSaved); + } + + /* begin CallFullRT: */ + /* begin CallFull: */ + lastInst = checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + /* begin genPopRegisterMask: */ + return (callerSavedRegsToBeSaved == 0 + ? (/* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC)) + : genoperand(PopLDM, callerSavedRegsToBeSaved)); + +} + + /* Cogit>>#CallRT:registersToBeSavedMask: */ +static AbstractInstruction * NoDbgRegParms +CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved) +{ + AbstractInstruction *abstractInstruction; + sqInt callerSavedRegsToBeSaved; + AbstractInstruction *lastInst; + + callerSavedRegsToBeSaved = CallerSavedRegisterMask & registersToBeSaved; + /* begin genPushRegisterMask: */ + if (callerSavedRegsToBeSaved == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, callerSavedRegsToBeSaved); + } + + /* begin CallRT: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + lastInst = abstractInstruction; + /* begin genPopRegisterMask: */ + return (callerSavedRegsToBeSaved == 0 + ? (/* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC)) + : genoperand(PopLDM, callerSavedRegsToBeSaved)); + +} + + /* Cogit>>#Call: */ +static AbstractInstruction * NoDbgRegParms +gCall(sqInt callTarget) +{ + return genoperand(Call, callTarget); +} + + /* Cogit>>#CmpCq:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + return anInstruction; +} + + /* Cogit>>#CmpCw:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCwR(sqInt wordConstant, sqInt reg) +{ + /* begin gen:literal:operand: */ + return checkLiteralforInstruction(wordConstant, genoperandoperand(CmpCwR, wordConstant, reg)); +} + + /* Cogit>>#CmpR:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(CmpRR, reg1, reg2); +} + + +/* This is a static version of ceCallCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiver */ +void +callCogCodePopReceiver(void) +{ + realCECallCogCodePopReceiverReg(); + error("what??"); + +} + + +/* This is a static version of ceCallCogCodePopReceiverAndClassRegs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiverAndClassRegs */ +void +callCogCodePopReceiverAndClassRegs(void) +{ + realCECallCogCodePopReceiverAndClassRegs(); +} + + +/* Code entry closed PIC miss. A send has fallen + through a closed (finite) polymorphic inline cache. + Either extend it or patch the send site to an open PIC. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#ceCPICMiss:receiver: */ +sqInt +ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver) +{ + sqInt cacheTag; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + sqInt outerReturn; + sqInt result; + sqInt selector; + + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(cPIC); + } + outerReturn = stackTop(); + assert(!(((inlineCacheTagAt(backEnd, outerReturn)) == (picAbortDiscriminatorValue())))); + if (((cPIC->cPICNumCases)) < MaxCPICCases) { + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (cPIC->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + + l1: /* end lookup:for:methodAndErrorSelectorInto: */; + } + else { + newTargetMethodOrNil = (errorSelectorOrNil = null); + } + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if ((((cPIC->cPICNumCases)) >= MaxCPICCases) + || (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((cPIC->selector), (cPIC->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(cPIC); + } + cogExtendPICCaseNMethodtagisMNUCase(cPIC, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + executeCogPICfromLinkedSendWithReceiverandCacheTag(cPIC, receiver, longAt(pcRelativeAddressAt(backEnd, ((usqInt)(outerReturn - 8))))); + return null; +} + + /* Cogit>>#ceFree: */ +void +ceFree(void*pointer) +{ + free(pointer); +} + + /* Cogit>>#ceMalloc: */ +void* +ceMalloc(size_t size) +{ + return malloc(size); +} + + +/* An in-line cache check in a method has failed. The failing entry check has + jumped to the ceMethodAbort abort call at the start of the method which + has called this routine. + If possible allocate a closed PIC for the current and existing classes. + The stack looks like: + receiver + args + sender return address + sp=> ceMethodAbort call return address + So we can find the method that did the failing entry check at + ceMethodAbort call return address - missOffset + and we can find the send site from the outer return address. */ + + /* Cogit>>#ceSICMiss: */ +sqInt +ceSICMiss(sqInt receiver) +{ + sqInt cacheTag; + sqInt entryPoint; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt extent; + usqInt innerReturn; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + usqInt outerReturn; + CogMethod *pic; + sqInt result; + sqInt selector; + CogMethod *targetMethod; + + + /* Whether we can relink to a PIC or not we need to pop off the inner return and identify the target method. */ + innerReturn = ((usqInt)(popStack())); + targetMethod = ((CogMethod *) (innerReturn - missOffset)); + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(targetMethod); + } + outerReturn = ((usqInt)(stackTop())); + assert(((outerReturn >= methodZoneBase) && (outerReturn <= (freeStart())))); + entryPoint = callTargetFromReturnAddress(backEnd, outerReturn); + assert(((targetMethod->selector)) != (nilObject())); + assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint); + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (targetMethod->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + +l1: /* end lookup:for:methodAndErrorSelectorInto: */; + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || (((longAt(pcRelativeAddressAt(backEnd, ((usqInt)(outerReturn - 8))))) == 0) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((targetMethod->selector), (targetMethod->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(targetMethod); + } + pic = openPICWithSelector((targetMethod->selector)); + if ((pic == null) + || (!1)) { + + /* otherwise attempt to create a closed PIC for the two cases. */ + pic = cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase((targetMethod->selector), (targetMethod->cmNumArgs), targetMethod, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + if ((((((sqInt)pic)) >= MaxNegativeErrorCode) && ((((sqInt)pic)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. + Continue as if this is an unlinked send. */ + if ((((sqInt)pic)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return ceSendFromInLineCacheMiss(targetMethod); + } + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + } + extent = (((pic->cmType)) == CMOpenPIC + ? rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat((targetMethod->selector), mframeHomeMethodExport(), outerReturn), (((sqInt)pic)) + cmEntryOffset) + : rewriteCallAttarget(backEnd, outerReturn, (((sqInt)pic)) + cmEntryOffset)); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + executeCogPICfromLinkedSendWithReceiverandCacheTag(pic, receiver, longAt(pcRelativeAddressAt(backEnd, ((usqInt)(outerReturn - 8))))); + return null; +} + + /* Cogit>>#checkAssertsEnabledInCogit */ +void +checkAssertsEnabledInCogit(void) +{ + sqInt assertsAreEnabledInCogit; + + assertsAreEnabledInCogit = 0; + assert(assertsAreEnabledInCogit); +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRefAndTarget:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt offset; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObject; + sqInt targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = longAt(((usqInt)mcpc)); + if (!(asserta(checkValidOopReference(literal)))) { + return 1; + } + if ((couldBeObject(literal)) + && (isReallyYoungObject(literal))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 2; + } + } + } + if (annotation >= IsSendCall) { + if (!(asserta((((((CogMethod *) cogMethod))->cmType)) == CMMethod))) { + return 3; + } + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8)))); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj) { + if (couldBeObject(cacheTag1)) { + if (!(asserta(checkValidOopReference(cacheTag1)))) { + return 4; + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 5; + } + } + if ((couldBeObject(cacheTag1)) + && (isReallyYoungObject(cacheTag1))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 6; + } + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 7; + } + } + + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send; find which kind. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(asserta((((targetMethod1->cmType)) == CMMethod) + || ((((targetMethod1->cmType)) == CMClosedPIC) + || (((targetMethod1->cmType)) == CMOpenPIC))))) { + return 8; + } + + } + } + return 0; +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRef:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt entryPoint; + sqInt literal; + sqInt off; + sqInt offset; + sqInt offset1; + sqInt selectorOrCacheTag; + sqInt *sendTable; + sqInt table; + + if (annotation == IsObjectReference) { + literal = longAt(((usqInt)mcpc)); + if (!(checkValidOopReference(literal))) { + print("object ref leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + offset = entryPoint; + } + else { + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable = superSendTrampolines; + + + } + } + offset = offset1; + + } + selectorOrCacheTag = longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8)))); + if ((entryPoint > methodZoneBase) + && ((offset != cmNoCheckEntryOffset) + && ((((((CogMethod *) (entryPoint - offset)))->cmType)) != CMOpenPIC))) { + + /* linked non-super send, cacheTag is a cacheTag */ + if (!(validInlineCacheTag(selectorOrCacheTag))) { + print("cache tag leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + else { + + /* unlinked send or super send; cacheTag is a selector unless 64-bit, in which case it is an index. */ + if (!(checkValidOopReference(selectorOrCacheTag))) { + print("selector leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + } + return 0; +} + + +/* Answer if all references to objects in machine-code are valid. */ + + /* Cogit>>#checkIntegrityOfObjectReferencesInCode: */ +sqInt +checkIntegrityOfObjectReferencesInCode(sqInt gcModes) +{ + CogMethod *cogMethod; + sqInt count; + sqInt ok; + + cogMethod = ((CogMethod *) methodZoneBase); + ok = 1; + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if ((cogMethod->cmRefersToYoung)) { + if (((count = occurrencesInYoungReferrers(cogMethod))) != 1) { + print("young referrer CM "); + printHex(((sqInt)cogMethod)); + if (count == 0) { + print(" is not in youngReferrers"); + cr(); + } + else { + print(" is in youngReferrers "); + printNum(count); + print(" times!"); + cr(); + } + ok = 0; + } + } + if (!(checkValidOopReference((cogMethod->selector)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" selector"); + cr(); + ok = 0; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + if (!(checkValidObjectReference((cogMethod->methodObject)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if (!(isOopCompiledMethod((cogMethod->methodObject)))) { + print("non-method in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + if (((isYoungObject((cogMethod->methodObject))) + || (isYoung((cogMethod->selector)))) + && (!((cogMethod->cmRefersToYoung)))) { + print("CM "); + printHex(((sqInt)cogMethod)); + print(" refers to young but not marked as such"); + cr(); + ok = 0; + } + + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(checkValidObjectReferencesInClosedPIC(cogMethod))) { + ok = 0; + } + } + else { + if (((cogMethod->cmType)) == CMOpenPIC) { + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#checkMaybeObjRefInClosedPIC: */ +static sqInt NoDbgRegParms +checkMaybeObjRefInClosedPIC(sqInt maybeObject) +{ + if (maybeObject == 0) { + return 1; + } + if (!(couldBeObject(maybeObject))) { + return 1; + } + return checkValidObjectReference(maybeObject); +} + + /* Cogit>>#checkValidObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt ok; + sqInt pc; + + ok = 1; + + /* first we check the obj ref at the beginning of the CPIC */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongByteSize(backEnd))); + cr(); + ok = 0; + } + + /* For each case we check any object reference at the end address - sizeof(conditional instruction) and then increment the end address by case size */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongConditionalByteSize(backEnd))); + cr(); + ok = 0; + } + pc += cPICCaseSize; + } + return ok; +} + + +/* Answer if the ClosedPIC refers to any unmarked objects or freed/freeable + target methods, + applying markAndTraceOrFreeCogMethod:firstVisit: to those targets to + determine if freed/freeable. + */ + + /* Cogit>>#closedPICRefersToUnmarkedObject: */ +static sqInt NoDbgRegParms +closedPICRefersToUnmarkedObject(CogMethod *cPIC) +{ + sqInt i; + sqInt object; + sqInt pc; + + if (!((isImmediate((cPIC->selector))) + || (isMarked((cPIC->selector))))) { + return 1; + } + pc = addressOfEndOfCaseinCPIC(1, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + } + return 0; +} + + /* Cogit>>#codeEntryFor: */ +char * +codeEntryFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i + 1]; + } + } + return null; +} + + /* Cogit>>#codeEntryNameFor: */ +char * +codeEntryNameFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i]; + } + } + return null; +} + + /* Cogit>>#cogCodeBase */ +sqInt +cogCodeBase(void) +{ + return codeBase; +} + + +/* Answer the contents of the code zone as an array of pair-wise element, + address in ascending address order. + Answer a string for a runtime routine or abstract label (beginning, end, + etc), a CompiledMethod for a CMMethod, + or a selector (presumably a Symbol) for a PIC. */ + + /* Cogit>>#cogCodeConstituents */ +sqInt +cogCodeConstituents(void) +{ + CogMethod *cogMethod; + sqInt constituents; + sqInt count; + sqInt i; + sqInt label; + sqInt value; + + + /* + 3 for start, freeStart and end */ + count = (trampolineTableIndex / 2) + 3; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + count += 1; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + constituents = instantiateClassindexableSize(classArray(), count * 2); + if (!(constituents)) { + return constituents; + } + pushRemappableOop(constituents); + if ((((label = stringForCString("CogCode"))) == null) + || (((value = positive32BitIntegerFor(codeBase))) == null)) { + return null; + } + storePointerUncheckedofObjectwithValue(0, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(1, topRemappableOop(), value); + for (i = 0; i < trampolineTableIndex; i += 2) { + if ((((label = stringForCString(trampolineAddresses[i]))) == null) + || (((value = positive32BitIntegerFor(((usqInt)(trampolineAddresses[i + 1]))))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(2 + i, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(3 + i, topRemappableOop(), value); + } + count = trampolineTableIndex + 2; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), (((cogMethod->cmType)) == CMMethod + ? (cogMethod->methodObject) + : (cogMethod->selector))); + if (!((value = positive32BitIntegerFor(((usqInt)cogMethod))))) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + count += 2; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if ((((label = stringForCString("CCFree"))) == null) + || (((value = positive32BitIntegerFor(mzFreeStart))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + if ((((label = stringForCString("CCEnd"))) == null) + || (((value = positive32BitIntegerFor(limitAddress))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 2, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 3, topRemappableOop(), value); + constituents = popRemappableOop(); + beRootIfOld(constituents); + return constituents; +} + + +/* Extend the cPIC with the supplied case. If caseNMethod is cogged dispatch + direct to + its unchecked entry-point. If caseNMethod is not cogged, jump to the fast + interpreter dispatch, and if isMNUCase then dispatch to fast MNU + invocation and mark the cPIC as + having the MNU case for cache flushing. */ + + /* Cogit>>#cogExtendPIC:CaseNMethod:tag:isMNUCase: */ +static sqInt NoDbgRegParms +cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase) +{ + sqInt address; + usqInt addressFollowingJump; + sqInt operand; + usqIntptr_t target; + + compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase); + assert(!(inlineCacheTagIsYoung(caseNTag))); + assert((caseNMethod != null) + && (!(isYoung(caseNMethod)))); + if ((!isMNUCase) + && (methodHasCogMethod(caseNMethod))) { + + /* this isn't an MNU and we have an already cogged method to jump to */ + operand = 0; + target = (((sqInt)(cogMethodOf(caseNMethod)))) + cmNoCheckEntryOffset; + } + else { + operand = caseNMethod; + if (isMNUCase) { + + /* this is an MNU so tag the CPIC header and setup a jump to the MNUAbort */ + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) cPIC))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + target = (((sqInt)cPIC)) + (sizeof(CogMethod)); + } + else { + + /* setup a jump to the interpretAborth so we can cog the target method */ + target = (((sqInt)cPIC)) + (picInterpretAbortOffset()); + } + } + address = addressOfEndOfCaseinCPIC(((cPIC->cPICNumCases)) + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(address, caseNTag, operand, target); + /* begin rewriteCPIC:caseJumpTo: */ + addressFollowingJump = (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)); + rewriteTransferAttarget(((AbstractInstruction *) backEnd), addressFollowingJump, address - cPICCaseSize); + flushICacheFromto(processor, ((usqInt)cPIC), (((usqInt)cPIC)) + closedPICSize); + (cPIC->cPICNumCases = ((cPIC->cPICNumCases)) + 1); + return 0; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cogFullBlockMethod:numCopied: */ +CogMethod * +cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied) +{ + CogMethod *cogMethod; + + + /* inline exclude: */ + assert(!((methodHasCogMethod(aMethodObj)))); + assert(isOopCompiledMethod(ultimateLiteralOf(aMethodObj))); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogFullBlockMethod(numCopied); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#cogitPostGCAction: */ +void +cogitPostGCAction(sqInt gcMode) +{ + +# if SPURVM + if (gcMode == GCModeBecome) { + followForwardedLiteralsInOpenPICList(); + } + +# endif /* SPURVM */ + + assert(allMethodsHaveCorrectHeader()); + assert(((gcMode & (GCModeFull + GCModeNewSpace)) == 0) + || (kosherYoungReferrers())); +} + + +/* Check that the header fields onf a non-free method are consistent with + the type. Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#cogMethodDoesntLookKosher: */ +sqInt +cogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + if (((((cogMethod->blockSize)) & (BytesPerWord - 1)) != 0) + || ((((cogMethod->blockSize)) < (sizeof(CogMethod))) + || (((cogMethod->blockSize)) >= 32768))) { + return 1; + } + if (((cogMethod->cmType)) == CMFree) { + return 2; + } + if (((cogMethod->cmType)) == CMMethod) { + if (!((((cogMethod->methodHeader)) & 1))) { + return 11; + } + if (!(couldBeObject((cogMethod->methodObject)))) { + return 12; + } + if ((((cogMethod->stackCheckOffset)) > 0) + && (((cogMethod->stackCheckOffset)) < cmNoCheckEntryOffset)) { + return 13; + } + return 0; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (((cogMethod->blockSize)) != openPICSize) { + return 21; + } + if (((cogMethod->methodHeader)) != 0) { + return 22; + } + if (((cogMethod->objectHeader)) >= 0) { + if ((((cogMethod->methodObject)) != 0) + && ((((cogMethod->methodObject)) < methodZoneBase) + || ((((cogMethod->methodObject)) > ((freeStart()) - openPICSize)) + || (((((cogMethod->methodObject)) & (BytesPerWord - 1)) != 0) + || ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) != CMOpenPIC))))) { + return 23; + } + } + if (((cogMethod->stackCheckOffset)) != 0) { + return 24; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (((cogMethod->blockSize)) != closedPICSize) { + return 0x1F; + } + if (!(((((cogMethod->cPICNumCases)) >= 1) && (((cogMethod->cPICNumCases)) <= MaxCPICCases)))) { + return 32; + } + if (((cogMethod->methodHeader)) != 0) { + return 33; + } + if (((cogMethod->methodObject)) != 0) { + return 34; + } + return 0; + } + return 9; +} + + +/* Attempt to create a one-case PIC for an MNU. + The tag for the case is at the send site and so doesn't need to be + generated. + */ + + /* Cogit>>#cogMNUPICSelector:receiver:methodOperand:numArgs: */ +CogMethod * +cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs) +{ + CogMethod *pic; + sqInt startAddress; + + if ((isYoung(selector)) + || ((inlineCacheTagForInstance(rcvr)) == 0)) { + return 0; + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 1); + assert(endCPICCase0 != null); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + callForCogCompiledCodeCompaction(); + return 0; + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + (pic->cPICNumCases = 1); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 1); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Create an Open PIC. Temporarily create a direct call of + ceSendFromOpenPIC:. Should become a probe of the first-level method lookup + cache followed by a + call of ceSendFromOpenPIC: if the probe fails. */ + + /* Cogit>>#cogOpenPICSelector:numArgs: */ +static CogMethod * NoDbgRegParms +cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs) +{ + sqInt codeSize; + sqInt end; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + CogMethod *pic; + sqInt startAddress; + + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 0); + startAddress = allocate(openPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + (methodLabel->address = startAddress); + (methodLabel->dependent = null); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + compileOpenPICnumArgs(selector, numArgs); + computeMaximumSizes(); + concretizeAt(methodLabel, startAddress); + codeSize = generateInstructionsAt(startAddress + (sizeof(CogMethod))); + mapSize = generateMapAtstart((startAddress + openPICSize) - 1, startAddress + cmNoCheckEntryOffset); + assert((((entry->address)) - startAddress) == cmEntryOffset); + assert(((roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize))) <= openPICSize); + end = outputInstructionsAt(startAddress + (sizeof(CogMethod))); + /* begin fillInOPICHeader:numArgs:selector: */ + pic = ((CogMethod *) startAddress); + (pic->cmType = CMOpenPIC); + (pic->objectHeader = 0); + (pic->blockSize = openPICSize); + addToOpenPICList(pic); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + if ((pic->cmRefersToYoung = isYoung(selector))) { + addToYoungReferrers(pic); + } + (pic->cmUsageCount = initialOpenPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (pic->cPICNumCases = 0); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMOpenPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(openPICSize == (roundUpLength(openPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + openPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to create a two-case PIC for case0CogMethod and + case1Method,case1Tag. The tag for case0CogMethod is at the send site and + so doesn't need to be generated. + case1Method may be any of + - a Cog method; link to its unchecked entry-point + - a CompiledMethod; link to ceInterpretMethodFromPIC: + - a CompiledMethod; link to ceMNUFromPICMNUMethod:receiver: */ + + /* Cogit>>#cogPICSelector:numArgs:Case0Method:Case1Method:tag:isMNUCase: */ +static CogMethod * NoDbgRegParms +cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase) +{ + CogMethod *pic; + sqInt startAddress; + + if (isYoung(selector)) { + return ((CogMethod *) YoungSelectorInPIC); + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), isMNUCase); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = isMNUCase; + (pic->cPICNumCases = 2); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 2); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cog:selector: */ +CogMethod * +cogselector(sqInt aMethodObj, sqInt aSelectorOop) +{ + CogMethod *cogMethod; + + + /* inline exclude:selector: */ + assert(!((methodHasCogMethod(aMethodObj)))); + + assert(!((isOopCompiledMethod(ultimateLiteralOf(aMethodObj))))); + compilationBreakpointisMNUCase(aSelectorOop, lengthOf(aSelectorOop), 0); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogMethod(aSelectorOop); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#compactCogCompiledCode */ +void +compactCogCompiledCode(void) +{ + assert(noCogMethodsMaximallyMarked()); + markActiveMethodsAndReferents(); + freeOlderMethodsForCompaction(); + compactPICsWithFreedTargets(); + planCompaction(); + updateStackZoneReferencesToCompiledCodePreCompaction(); + relocateMethodsPreCompaction(); + compactCompiledCode(); + assert(allMethodsHaveCorrectHeader()); + assert(kosherYoungReferrers()); + stopsFromto(backEnd, freeStart(), (youngReferrers()) - 1); + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(youngReferrers()))); +} + + /* Cogit>>#compactPICsWithFreedTargets */ +static void +compactPICsWithFreedTargets(void) +{ + CogMethod *cogMethod; + sqInt count; + + cogMethod = ((CogMethod *) methodZoneBase); + count = 0; + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICCompactAndIsNowEmpty(cogMethod))) { + (cogMethod->cmType = CMFree); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + count += 1; + } + assert(count == (numMethods())); +} + + +/* The start of a CogMethod has a call to a run-time abort routine that + either handles an in-line cache failure or a stack overflow. The routine + selects the + path depending on ReceiverResultReg; if zero it takes the stack overflow + path; if nonzero the in-line cache miss path. Neither of these paths + returns. The abort routine must be called; In the callee the method is + located by + adding the relevant offset to the return address of the call. + + N.B. This code must match that in compilePICAbort: so that the offset of + the return address of the call is the same in methods and closed PICs. */ + + /* Cogit>>#compileAbort */ +static AbstractInstruction * +compileAbort(void) +{ + AbstractInstruction *anInstruction; + sqInt callTarget; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + stackOverflowCall = anInstruction; + + /* If there is a link register it must be saved (pushed onto the stack) before it + is smashed by the abort call, and hence needs to be manually handled here */ + /* begin PushR: */ + sendMiss = genoperand(PushR, LinkReg); + /* begin Call: */ + callTarget = methodAbortTrampolineFor(methodOrBlockNumArgs); + return genoperand(Call, callTarget); + +} + + /* Cogit>>#compileBlockDispatchFrom:to: */ +static sqInt NoDbgRegParms +compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex) +{ + AbstractInstruction *anInstruction; + BlockStart *blockStart; + sqInt halfWay; + AbstractInstruction *jmp; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + sqInt quickConstant; + + if (lowBlockStartIndex == highBlockStartIndex) { + blockStart = blockStartAt(lowBlockStartIndex); + /* begin Jump: */ + jumpTarget = (blockStart->entryLabel); + genoperand(Jump, ((sqInt)jumpTarget)); + return null; + } + halfWay = (highBlockStartIndex + lowBlockStartIndex) / 2; + assert(((halfWay >= lowBlockStartIndex) && (halfWay <= highBlockStartIndex))); + + /* N.B. FLAGS := TempReg - startpc */ + blockStart = blockStartAt(halfWay); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)(((blockStart->startpc)) + 1) << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + if (lowBlockStartIndex == halfWay) { + /* begin JumpLessOrEqual: */ + jumpTarget1 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)jumpTarget1)); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + return null; + } + if ((halfWay + 1) == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + /* begin JumpGreater: */ + jumpTarget2 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpGreater, ((sqInt)jumpTarget2)); + return compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + } + /* begin JumpGreater: */ + jmp = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + if (halfWay == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + jmpTarget(jmp, (blockStart->entryLabel)); + } + else { + jmpTarget(jmp, gLabel()); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + } + return 0; +} + + +/* Compile a block's entry. This looks like a dummy CogBlockMethod header + (for frame parsing) + followed by either a frame build, if a frame is required, or nothing. The + CogMethodHeader's objectHeader field is a back pointer to the method, but + this can't be filled in until code generation. */ + + /* Cogit>>#compileBlockEntry: */ +static void NoDbgRegParms +compileBlockEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt alignment; + + /* begin AlignmentNops: */ + alignment = blockAlignment(); + genoperand(AlignmentNops, alignment); + (blockStart->fakeHeader = gLabel()); + + switch (sizeof(CogBlockMethod)) { + case 8: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 12: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 16: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + default: + error("Case not found and no otherwise clause"); + } + (blockStart->entryLabel = gLabel()); + if (needsFrame) { + compileBlockFrameBuild(blockStart); + if (recordBlockTrace()) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceBlockActivationTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + } + else { + compileBlockFramelessEntry(blockStart); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:floatResultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l4; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(delta * BytesPerWord)); + } + } + l4: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + /* begin genSaveRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, regsToSave); + } + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, CArg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(-2 - regOrConst0)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, CArg0Reg); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, CArg1Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(-2 - regOrConst1)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, CArg1Reg); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, CArg2Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(-2 - regOrConst2)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, CArg2Reg); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, CArg3Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(-2 - regOrConst3)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, CArg3Reg); + } + ((AbstractInstruction *) backEnd); +l13: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + if (resultRegOrNone != NoReg) { + cFloatResultToRd(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + /* begin genRestoreRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PopLDM, regsToSave); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l4; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(delta * BytesPerWord)); + } + } + l4: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + /* begin genSaveRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, regsToSave); + } + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, CArg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(-2 - regOrConst0)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, CArg0Reg); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, CArg1Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(-2 - regOrConst1)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, CArg1Reg); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, CArg2Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(-2 - regOrConst2)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, CArg2Reg); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, CArg3Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(-2 - regOrConst3)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, CArg3Reg); + } + ((AbstractInstruction *) backEnd); +l13: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + /* begin genRestoreRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PopLDM, regsToSave); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l4; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(delta * BytesPerWord)); + } + } + l4: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + /* begin genSaveRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, regsToSave); + } + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, CArg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(-2 - regOrConst0)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, CArg0Reg); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, CArg1Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(-2 - regOrConst1)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, CArg1Reg); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, CArg2Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(-2 - regOrConst2)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, CArg2Reg); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l13; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, CArg3Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(-2 - regOrConst3)); + } + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, CArg3Reg); + } + ((AbstractInstruction *) backEnd); +l13: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + if (resultReg2OrNone != NoReg) { + genWriteCSecondResultIntoReg(backEnd, resultReg2OrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + /* begin genRestoreRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PopLDM, regsToSave); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:floatArg:floatArg:floatArg:floatArg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l4; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(delta * BytesPerWord)); + } + } + l4: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + /* begin genSaveRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PushSTM, regsToSave); + } + genMarshallNArgsfloatArgfloatArgfloatArgfloatArg(backEnd, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3); + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNFloatArgsFromStack(backEnd, numArgs); + /* begin genRestoreRegs: */ + if (regsToSave == 0) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + genoperand(PopLDM, regsToSave); + } +} + + +/* Compile the cache tag computation and the first comparison. Answer the + address of that comparison. */ + + /* Cogit>>#compileCPICEntry */ +static AbstractInstruction * +compileCPICEntry(void) +{ + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + +/* Compile the abstract instructions for the entire full block method. */ + + /* Cogit>>#compileEntireFullBlockMethod: */ +static sqInt NoDbgRegParms +compileEntireFullBlockMethod(sqInt numCopied) +{ + sqInt result; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileFullBlockEntry(); + compileFullBlockMethodFrameBuild(numCopied); + if (((result = compileMethodBody())) < 0) { + return result; + } + assert(blockCount == 0); + return 0; +} + + +/* The entry code to a method checks that the class of the current receiver + matches that in the inline cache. Other non-obvious elements are that its + alignment must be + different from the alignment of the noCheckEntry so that the method map + machinery can distinguish normal and super sends (super sends bind to the + noCheckEntry). */ + + /* Cogit>>#compileEntry */ +static void +compileEntry(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction * inst; + + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)sendMiss)); + /* begin Label */ + noCheckEntry = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (compileSendTrace()) { + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceLinkedSendTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + /* begin PopR: */ + genoperand(PopR, LinkReg); + } +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Abort for stack overflow on full block activation (no inline cache miss + possible). The flag is SendNumArgsReg. */ + + /* Cogit>>#compileFullBlockEntry */ +static sqInt +compileFullBlockEntry(void) +{ + sqInt alignment; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt callTarget; + AbstractInstruction * jumpNoContextSwitch; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + stackOverflowCall = anInstruction; + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin Call: */ + callTarget = methodAbortTrampolineFor(methodOrBlockNumArgs); + genoperand(Call, callTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + fullBlockNoContextSwitchEntry = anInstruction1; + /* begin Jump: */ + jumpNoContextSwitch = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + alignment = ((BytesPerWord < 8) ? 8 : BytesPerWord); + genoperand(AlignmentNops, alignment); + /* begin MoveR:R: */ + fullBlockEntry = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpNoContextSwitch, gLabel()); + return 0; +} + + +/* Compile the top-level method body. */ + + /* Cogit>>#compileMethodBody */ +static sqInt +compileMethodBody(void) +{ + if (endPC < initialPC) { + return 0; + } + return compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +} + + +/* The start of a PIC has a call to a run-time abort routine that either + handles a dispatch to an + interpreted method or a dispatch of an MNU case. The routine selects the + path by testing + ClassReg, which holds the inline cache tag; if equal to the + picAbortDiscriminatorValue (zero) + it takes the MNU path; if nonzero the dispatch to interpreter path. + Neither of these paths + returns. The abort routine must be called; In the callee the PIC is + located by adding the + relevant offset to the return address of the call. + + N.B. This code must match that in compileAbort so that the offset of the + return address of + the call is the same in methods and closed PICs. */ + + /* Cogit>>#compilePICAbort: */ +static sqInt NoDbgRegParms +compilePICAbort(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + sqInt callTarget; + AbstractInstruction * picMNUAbort; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + picMNUAbort = anInstruction; + + /* If there is a link register it must be saved (pushed onto the stack) before it + is smashed by the abort call, and hence needs to be manually handled here */ + /* begin PushR: */ + picInterpretAbort = genoperand(PushR, LinkReg); + /* begin Call: */ + callTarget = picAbortTrampolineFor(numArgs); + genoperand(Call, callTarget); + + return 0; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargfloatResultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, PCReg); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, PCReg); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, resultReg2OrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, PCReg); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, PCReg); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeEntryOffsets */ +static void +computeEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + AbstractInstruction *sendMissCall; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + sendMissCall = compileAbort(); + compileEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cmEntryOffset = ((entry->address)) - methodZoneBase; + cmNoCheckEntryOffset = ((noCheckEntry->address)) - methodZoneBase; + missOffset = (((sendMissCall->address)) + ((sendMissCall->machineCodeSize))) - methodZoneBase; + entryPointMask = BytesPerWord - 1; + while ((cmEntryOffset & entryPointMask) == (cmNoCheckEntryOffset & entryPointMask)) { + entryPointMask = (entryPointMask + entryPointMask) + 1; + } + if (entryPointMask >= (roundUpLength(1))) { + error("cannot differentiate checked and unchecked entry-points with current cog method alignment"); + } + checkedEntryAlignment = cmEntryOffset & entryPointMask; + uncheckedEntryAlignment = cmNoCheckEntryOffset & entryPointMask; + assert(checkedEntryAlignment != uncheckedEntryAlignment); +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeFullBlockEntryOffsets */ +static void +computeFullBlockEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + compileFullBlockEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cbEntryOffset = ((fullBlockEntry->address)) - methodZoneBase; + cbNoSwitchEntryOffset = ((fullBlockNoContextSwitchEntry->address)) - methodZoneBase; + +} + + +/* This pass assigns maximum sizes to all abstract instructions and + eliminates jump fixups. + It hence assigns the maximum address an instruction will occur at which + allows the next + pass to conservatively size jumps. */ + + /* Cogit>>#computeMaximumSizes */ +static void +computeMaximumSizes(void) +{ + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt relativeAddress; + + dumpLiterals(0); + relativeAddress = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + (abstractInstruction->address = relativeAddress); + (abstractInstruction->maxSize = computeMaximumSize(abstractInstruction)); + relativeAddress += (abstractInstruction->maxSize); + } +} + + +/* Configure a copy of the prototype CPIC for a two-case PIC for + case0CogMethod and + case1Method + case1Tag. + The tag for case0CogMethod is at the send site and so doesn't need to be + generated. case1Method may be any of + - a Cog method; jump to its unchecked entry-point + - a CompiledMethod; jump to the ceInterpretFromPIC trampoline + - nil; call ceMNUFromPIC + addDelta is the address change from the prototype to the new CPIC + location, needed + because the loading of the CPIC label at the end may use a literal instead + of a pc relative load. */ +/* self disassembleFrom: cPIC asInteger + (self sizeof: CogMethod) to: cPIC + asInteger + closedPICSize + */ + + /* Cogit>>#configureCPIC:Case0:Case1Method:tag:isMNUCase:numArgs:delta: */ +static sqInt NoDbgRegParms +configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta) +{ + sqInt caseEndAddress; + sqInt operand; + usqIntptr_t targetEntry; + + assert(case1Method != null); + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + assert(!(inlineCacheTagIsYoung(case1Tag))); + if ((!isMNUCase) + && (methodHasCogMethod(case1Method))) { + operand = 0; + targetEntry = (((sqInt)(cogMethodOf(case1Method)))) + cmNoCheckEntryOffset; + } + else { + + /* We do not scavenge PICs, hence we cannot cache the MNU method if it is in new space. */ + operand = ((case1Method == null) + || (isYoungObject(case1Method)) + ? 0 + : case1Method); + targetEntry = (case1Method == null + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : (((sqInt)cPIC)) + (picInterpretAbortOffset())); + } + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)case0CogMethod)) + cmNoCheckEntryOffset); + + /* update the cpic case */ + caseEndAddress = addressOfEndOfCaseinCPIC(2, cPIC); + rewriteCPICCaseAttagobjReftarget(caseEndAddress, case1Tag, operand, ((sqInt)((isMNUCase + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : targetEntry)))); + relocateMethodReferenceBeforeAddressby(backEnd, ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)), addrDelta); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + return 0; +} + + +/* Configure a copy of the prototype CPIC for a one-case MNU CPIC that calls + ceMNUFromPIC for + case0Tag The tag for case0 is at the send site and so doesn't need to be + generated. addDelta is the address change from the prototype to the new + CPIC location, needed + because the loading of the CPIC label at the end may be a literal instead + of a pc-relative load. */ +/* adjust the jump at missOffset, the ceAbortXArgs */ + + /* Cogit>>#configureMNUCPIC:methodOperand:numArgs:delta: */ +static sqInt NoDbgRegParms +configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta) +{ + usqInt addressFollowingJump; + int operand; + sqInt target; + + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + + /* set the jump to the case0 method */ + operand = ((methodOperand == null) + || (isYoungObject(methodOperand)) + ? 0 + : methodOperand); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)cPIC)) + (sizeof(CogMethod))); + storeLiteralbeforeFollowingAddress(backEnd, operand, ((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + relocateMethodReferenceBeforeAddressby(backEnd, ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)), addrDelta); + /* begin rewriteCPIC:caseJumpTo: */ + target = addressOfEndOfCaseinCPIC(2, cPIC); + /* begin rewriteCPICJumpAt:target: */ + addressFollowingJump = (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)); + rewriteTransferAttarget(((AbstractInstruction *) backEnd), addressFollowingJump, target); + return 0; +} + + +/* Scan the CPIC for target methods that have been freed and eliminate them. + Since the first entry cannot be eliminated, answer that the PIC should be + freed if the first entry is to a free target. Answer if the PIC is now + empty or should be freed. */ + + /* Cogit>>#cPICCompactAndIsNowEmpty: */ +static sqInt NoDbgRegParms +cPICCompactAndIsNowEmpty(CogMethod *cPIC) +{ + usqInt addressFollowingJump; + usqInt addressFollowingJump1; + sqInt entryPoint; + sqInt followingAddress; + sqInt i; + sqInt methods[MaxCPICCases]; + sqInt pc; + int tags[MaxCPICCases]; + CogMethod *targetMethod; + sqInt targets[MaxCPICCases]; + sqInt used; + sqInt valid; + + used = 0; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + + /* Collect all target triples except for triples whose entry-point is a freed method */ + valid = 1; + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + if (i == 1) { + return 1; + } + valid = 0; + } + } + if (valid) { + tags[used] = ((i > 1 + ? (/* begin literal32BeforeFollowingAddress: */ + (followingAddress = pc - (jumpLongConditionalByteSize(backEnd))), + literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), followingAddress)) + : 0)); + targets[used] = entryPoint; + methods[used] = (literalBeforeFollowingAddress(backEnd, pc - ((i == 1 + ? jumpLongByteSize(backEnd) + : (jumpLongConditionalByteSize(backEnd)) + (cmpC32RTempByteSize(backEnd)))))); + used += 1; + } + } + if (used == ((cPIC->cPICNumCases))) { + return 0; + } + if (used == 0) { + return 1; + } + (cPIC->cPICNumCases = used); + if (used == 1) { + pc = addressOfEndOfCaseinCPIC(2, cPIC); + /* begin rewriteCPIC:caseJumpTo: */ + addressFollowingJump = (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)); + rewriteTransferAttarget(((AbstractInstruction *) backEnd), addressFollowingJump, pc); + return 0; + } + for (i = 1; i < used; i += 1) { + pc = addressOfEndOfCaseinCPIC(i + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(pc, tags[i], methods[i], targets[i]); + } + /* begin rewriteCPIC:caseJumpTo: */ + addressFollowingJump1 = (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)); + rewriteTransferAttarget(((AbstractInstruction *) backEnd), addressFollowingJump1, pc - cPICCaseSize); + return 0; +} + + +/* The first case in a CPIC doesn't have a class reference so we need only + step over actually usd subsequent cases. + */ + + /* Cogit>>#cPICHasForwardedClass: */ +static sqInt NoDbgRegParms +cPICHasForwardedClass(CogMethod *cPIC) +{ + sqInt classIndex; + sqInt i; + sqInt pc; + + + /* start by finding the address of the topmost case, the cPICNumCases'th one */ + pc = (addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC)) - (jumpLongConditionalByteSize(backEnd)); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + /* begin literal32BeforeFollowingAddress: */ + classIndex = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (isForwardedClassIndex(classIndex)) { + return 1; + } + pc += cPICCaseSize; + } + return 0; +} + + +/* scan the CPIC for target methods that have been freed. */ + + /* Cogit>>#cPICHasFreedTargets: */ +static sqInt NoDbgRegParms +cPICHasFreedTargets(CogMethod *cPIC) +{ + sqInt entryPoint; + sqInt i; + sqInt pc; + CogMethod *targetMethod; + + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + return 1; + } + } + } + return 0; +} + + +/* Whimsey; we want 16rCA5E10 + cPICPrototypeCaseOffset to be somewhere in + the middle of the zone. + */ + + /* Cogit>>#cPICPrototypeCaseOffset */ +static usqInt +cPICPrototypeCaseOffset(void) +{ + return ((methodZoneBase + (youngReferrers())) / 2) - 13262352; +} + + +/* Are any of the jumps from this CPIC to targetMethod? */ + + /* Cogit>>#cPIC:HasTarget: */ +static sqInt NoDbgRegParms +cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) +{ + sqInt i; + sqInt pc; + usqInt target; + + target = (((usqInt)targetMethod)) + cmNoCheckEntryOffset; + + /* Since this is a fast test doing simple compares we don't need to care that some + cases have nonsense addresses in there. Just zip on through. */ + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (target == (jumpLongTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + for (i = 2; i <= MaxCPICCases; i += 1) { + pc += cPICCaseSize; + if (target == (jumpLongTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + } + return 0; +} + + +/* Division is a little weird on some processors. Defer to the backEnd + to allow it to generate any special code it may need to. */ + + /* Cogit>>#DivR:R:Quo:Rem: */ +static AbstractInstruction * NoDbgRegParms +gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) +{ + genDivRRQuoRem(backEnd, rDivisor, rDividend, rQuotient, rRemainder); + return abstractInstructionAt(opcodeIndex - 1); +} + + +/* Return the default number of bytes to allocate for native code at startup. + The actual value can be set via vmParameterAt: and/or a preference in the + ini file. */ + + /* Cogit>>#defaultCogCodeSize */ +sqInt +defaultCogCodeSize(void) +{ + return 1024 * 1280; +} + + +/* Answer the number of bytecodes to skip to get to the first bytecode + past the primitive call and any store of the error code. */ + + /* Cogit>>#deltaToSkipPrimAndErrorStoreIn:header: */ +static sqInt NoDbgRegParms +deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader) +{ + return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0) + && ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj))) + ? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader)) + : 0); +} + + /* Cogit>>#endPCOf: */ +static sqInt NoDbgRegParms +endPCOf(sqInt aMethod) +{ + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt end; + sqInt latestContinuation; + sqInt nExts; + sqInt pc; + sqInt prim; + sqInt targetPC; + + pc = (latestContinuation = startPCOfMethod(aMethod)); + if (((prim = primitiveIndexOf(aMethod))) > 0) { + if (isQuickPrimitiveIndex(prim)) { + return pc - 1; + } + } + /* begin bytecodeSetOffsetFor: */ + bsOffset = (methodUsesAlternateBytecodeSet(aMethod) + ? 256 + : 0); + nExts = 0; + end = numBytesOf(aMethod); + while (pc <= end) { + byte = fetchByteofObject(pc, aMethod); + descriptor = generatorAt(byte + bsOffset); + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + end = pc; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, aMethod); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + if ((descriptor->isBlockCreation)) { + pc += distance; + } + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + pc += (descriptor->numBytes); + } + return end; +} + + +/* This is a static version of ceEnterCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#enterCogCodePopReceiver */ +void +enterCogCodePopReceiver(void) +{ + realCEEnterCogCodePopReceiverReg(); + error("what??"); + +} + + +/* Use asserts to check if the ClosedPICPrototype is as expected from + compileClosedPICPrototype, and can be updated as required via + rewriteCPICCaseAt:tag:objRef:target:. If all asserts pass, answer + 0, otherwise answer a bit mask identifying all the errors. */ +/* self disassembleFrom: methodZoneBase + (self sizeof: CogMethod) to: + methodZoneBase + closedPICSize + */ + + /* Cogit>>#expectedClosedPICPrototype: */ +static sqInt NoDbgRegParms +expectedClosedPICPrototype(CogMethod *cPIC) +{ + sqInt classTag; + usqInt classTagPC; + sqInt entryPoint; + sqInt errors; + sqInt i; + usqInt methodObjPC; + sqInt object; + usqInt pc; + + errors = 0; + + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((usqInt)cPIC)) + firstCPICCaseOffset; + object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd))); + if (!(asserta(object == (firstPrototypeMethodOop())))) { + errors = 1; + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + if (!(asserta(entryPoint == ((cPICPrototypeCaseOffset()) + 13262352)))) { + errors += 2; + } + for (i = 1; i < MaxCPICCases; i += 1) { + + /* verify information in case is as expected. */ + pc += cPICCaseSize; + methodObjPC = (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == ((subsequentPrototypeMethodOop()) + i)))) { + errors = errors | 4; + } + classTagPC = pc - (jumpLongConditionalByteSize(backEnd)); + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == (3133021973U + i)))) { + errors = errors | 8; + } + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (!(asserta(entryPoint == (((cPICPrototypeCaseOffset()) + 13262352) + (i * 16))))) { + errors = errors | 16; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == (((subsequentPrototypeMethodOop()) + i) ^ 2779096485U)))) { + errors = errors | 32; + } + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == ((3133021973U + i) ^ 1515870810)))) { + errors = errors | 64; + } + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (!(asserta(entryPoint == ((((cPICPrototypeCaseOffset()) + 13262352) + (i * 16)) ^ 5614160)))) { + errors = errors | 128; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, (pc + cPICEndSize) - (endSizeOffset())); + if (!(asserta(entryPoint == (cPICMissTrampolineFor(0))))) { + errors += 256; + } + return errors; +} + + +/* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A) */ + + /* Cogit>>#extABytecode */ +static sqInt +extABytecode(void) +{ + extA = (((usqInt) extA << 8)) + byte1; + return 0; +} + + +/* 225 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B) */ + + /* Cogit>>#extBBytecode */ +static sqInt +extBBytecode(void) +{ + extB = ((numExtB == 0) + && (byte1 > 0x7F) + ? byte1 - 256 + : (((usqInt) extB << 8)) + byte1); + numExtB += 1; + return 0; +} + + +/* Fill in the block headers now we know the exact layout of the code. */ + + /* Cogit>>#fillInBlockHeadersAt: */ +static sqInt NoDbgRegParms +fillInBlockHeadersAt(sqInt startAddress) +{ + CogBlockMethod *blockHeader; + BlockStart *blockStart; + sqInt i; + + if (!(needsFrame + && (blockCount > 0))) { + return null; + } + if (blockNoContextSwitchOffset == null) { + blockNoContextSwitchOffset = ((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)); + } + else { + assert(blockNoContextSwitchOffset == (((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)))); + } + for (i = 0; i < blockCount; i += 1) { + blockStart = blockStartAt(i); + blockHeader = ((CogBlockMethod *) ((((blockStart->fakeHeader))->address))); + (blockHeader->homeOffset = ((((blockStart->fakeHeader))->address)) - startAddress); + (blockHeader->startpc = (blockStart->startpc)); + (blockHeader->cmType = CMBlock); + (blockHeader->cmNumArgs = (blockStart->numArgs)); + (blockHeader->cbUsesInstVars = (blockStart->hasInstVarRef)); + (blockHeader->stackCheckOffset = (((blockStart->stackCheckLabel)) == null + ? 0 + : ((((blockStart->stackCheckLabel))->address)) - ((((blockStart->fakeHeader))->address)))); + } + return 0; +} + + /* Cogit>>#fillInMethodHeader:size:selector: */ +static CogMethod * NoDbgRegParms +fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) +{ + CogMethod *originalMethod; + sqInt rawHeader; + + (method->cmType = CMMethod); + (method->objectHeader = nullHeaderForMachineCodeMethod()); + (method->blockSize = size); + (method->methodObject = methodObj); + + /* If the method has already been cogged (e.g. Newspeak accessors) then + leave the original method attached to its cog method, but get the right header. */ + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); + assert(((originalMethod->blockSize)) == size); + assert(methodHeader == ((originalMethod->methodHeader))); + } + else { + rawHeaderOfput(methodObj, ((sqInt)method)); + } + (method->methodHeader = methodHeader); + (method->selector = selector); + (method->cmNumArgs = argumentCountOfMethodHeader(methodHeader)); + if ((method->cmRefersToYoung = hasYoungReferent)) { + addToYoungReferrers(method); + } + (method->cmUsageCount = initialMethodUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) method))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (method->cmUsesPenultimateLit = maxLitIndex >= ((literalCountOfMethodHeader(methodHeader)) - 2)); + (method->blockEntryOffset = (blockEntryLabel != null + ? ((blockEntryLabel->address)) - (((sqInt)method)) + : 0)); + if (needsFrame) { + if (!((((stackCheckLabel->address)) - (((sqInt)method))) <= MaxStackCheckOffset)) { + error("too much code for stack check offset"); + } + } + (method->stackCheckOffset = (needsFrame + ? ((stackCheckLabel->address)) - (((sqInt)method)) + : 0)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)method)) + missOffset)) == (methodAbortTrampolineFor((method->cmNumArgs)))); + assert(size == (roundUpLength(size))); + flushICacheFromto(processor, ((usqInt)method), (((usqInt)method)) + size); + /* begin maybeEnableSingleStep */ + return method; +} + + /* Cogit>>#findBackwardBranch:IsBackwardBranch:Mcpc:Bcpc:MatchingBcpc: */ +static sqInt NoDbgRegParms +findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc) +{ + return ((isBackwardBranchAndAnnotation & 1) + && ((((sqInt)targetBcpc)) == bcpc) + ? ((sqInt)mcpc) + : 0); +} + + /* Cogit>>#findBlockMethodWithEntry:startBcpc: */ +static usqInt NoDbgRegParms +findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc) +{ + CogBlockMethod *cogBlockMethod; + + cogBlockMethod = ((CogBlockMethod *) (blockEntryMcpc - (sizeof(CogBlockMethod)))); + if (((cogBlockMethod->startpc)) == startBcpc) { + return ((usqInt)cogBlockMethod); + } + return 0; +} + + /* Cogit>>#findMapLocationForMcpc:inMethod: */ +static sqInt NoDbgRegParms +findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + if (mcpc == targetMcpc) { + return map; + } + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation != IsAnnotationExtension) { + mcpc += 4 * ((annotation == IsDisplacementX2N + ? ((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + if (mcpc >= targetMcpc) { + assert(mcpc == targetMcpc); + if (annotation == IsDisplacementX2N) { + map -= 1; + mapByte = byteAt(map); + annotation = ((usqInt) mapByte) >> AnnotationShift; + assert(annotation > IsAnnotationExtension); + } + return map; + } + map -= 1; + } + return 0; +} + + +/* Find the CMMethod or CMBlock that has zero-relative startbcpc as its first + bytecode pc. + As this is for cannot resume processing and/or conversion to machine-code + on backward + branch, it doesn't have to be fast. Enumerate block returns and map to + bytecode pcs. */ + + /* Cogit>>#findMethodForStartBcpc:inHomeMethod: */ +CogBlockMethod * +findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) == CMMethod); + if (startbcpc == (startPCOfMethodHeader((cogMethod->methodHeader)))) { + return ((CogBlockMethod *) cogMethod); + } + assert(((cogMethod->blockEntryOffset)) != 0); + return ((CogBlockMethod *) (blockDispatchTargetsForperformarg(cogMethod, findBlockMethodWithEntrystartBcpc, startbcpc))); +} + + +/* Machine code addresses map to the following bytecode for all bytecodes + except backward branches, where they map to the backward branch itself. + This is so that loops continue, rather than terminate prematurely. */ + + /* Cogit>>#find:IsBackwardBranch:Mcpc:Bcpc:MatchingMcpc: */ +static sqInt NoDbgRegParms +findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc) +{ + return (targetMcpc == mcpc + ? ((descriptor == null) + || (isBackwardBranchAndAnnotation & 1) + ? bcpc + : bcpc + ((descriptor->numBytes))) + : 0); +} + + /* Cogit>>#firstMappedPCFor: */ +static usqInt NoDbgRegParms +firstMappedPCFor(CogMethod *cogMethod) +{ + return ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); +} + + +/* Answer a fake value for the first method oop in the PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. */ + + /* Cogit>>#firstPrototypeMethodOop */ +static sqInt +firstPrototypeMethodOop(void) +{ + return (((((usqInt)99282957)) >= ((methodLabel->address))) + && ((((usqInt)99282957)) < (youngReferrers())) + ? 212332557 + : 99282957); +} + + /* Cogit>>#followForwardedLiteralsIn: */ +void +followForwardedLiteralsIn(CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((cogMethod->cmType)) != CMMethod) + || (!(isForwarded((cogMethod->methodObject))))); + if (shouldRemapOop((cogMethod->selector))) { + (cogMethod->selector = remapObj((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + ensureInYoungReferrers(cogMethod); + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#followForwardedMethods */ +void +followForwardedMethods(void) +{ + CogMethod *cogMethod; + sqInt freedPIC; + + freedPIC = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (isForwarded((cogMethod->methodObject))) { + (cogMethod->methodObject = followForwarded((cogMethod->methodObject))); + if (isYoungObject((cogMethod->methodObject))) { + ensureInYoungReferrers(cogMethod); + } + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (followMethodReferencesInClosedPIC(cogMethod)) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } +} + + +/* Follow a potential object reference from a closed PIC. + This may be a method reference or null. + Answer if the followed literal is young. + 'mcpc' refers to the jump/branch instruction at the end of + each cpic case */ + + /* Cogit>>#followMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +followMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + if (!(isForwarded(object))) { + return isYoungObject(object); + } + subject = followForwarded(object); + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + return isYoungObject(subject); +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#followMethodReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +followMethodReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = followMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (followMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Free machine-code methods whose compiled methods are unmarked + and open PICs whose selectors are not marked, and closed PICs that + refer to unmarked objects. */ + + /* Cogit>>#freeUnmarkedMachineCode */ +void +freeUnmarkedMachineCode(void) +{ + CogMethod *cogMethod; + sqInt freedMethod; + + freedMethod = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (!(isMarked((cogMethod->methodObject))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((!(isImmediate((cogMethod->selector)))) + && (!(isMarked((cogMethod->selector)))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMClosedPIC) + && (closedPICRefersToUnmarkedObject(cogMethod))) { + freedMethod = 1; + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedMethod) { + unlinkSendsToFree(); + } +} + + /* Cogit>>#genCallMustBeBooleanFor: */ +static AbstractInstruction * NoDbgRegParms +genCallMustBeBooleanFor(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt callTarget; + + /* begin CallRT: */ + callTarget = (boolean == (falseObject()) + ? ceSendMustBeBooleanAddFalseTrampoline + : ceSendMustBeBooleanAddTrueTrampoline); + /* begin annotateCall: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + return abstractInstruction; +} + + /* Cogit>>#genCheckForInterruptsTrampoline */ +static sqInt +genCheckForInterruptsTrampoline(void) +{ + sqInt address; + + zeroOpcodeIndex(); + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, LinkReg, address)); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCheckForInterrupts, "ceCheckForInterruptsTrampoline", 0, null, null, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genConditionalBranch:operand: */ +static AbstractInstruction * NoDbgRegParms +genConditionalBranchoperand(sqInt opcode, sqInt operandOne) +{ + AbstractInstruction *branch; + AbstractInstruction * self_in_noteFollowingConditionalBranch; + + /* begin noteFollowingConditionalBranch: */ + self_in_noteFollowingConditionalBranch = previousInstruction(); + branch = genoperand(opcode, operandOne); + return branch; +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. The desired arguments and entry-point are pushed on a stackPage's + stack. The enilopmart pops off the values to be loaded into registers and + then executes a return instruction to pop off the entry-point and jump to + it. + BEFORE AFTER (stacks grow down) + whatever stackPointer -> whatever + target address => reg1 = reg1val, etc + reg1val pc = target address + reg2val + stackPointer -> reg3val */ + + /* Cogit>>#genEnilopmartFor:and:and:forCall:called: */ +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) + +{ + AbstractInstruction *anInstruction; + sqInt endAddress; + sqInt enilopmart; + sqInt quickConstant; + sqInt size; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + + genLoadStackPointers(backEnd); + if (regArg3OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg3OrNone); + } + if (regArg2OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg2OrNone); + } + /* begin PopR: */ + genoperand(PopR, regArg1); + genEnilopmartReturn(forCall); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineName, enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. At the point the enilopmart enters machine code via a return + instruction, any argument registers have been loaded with their values and + the stack, if + for call, looks like + ret pc + stackPointer -> target address + + and if not for call, looks like + whatever + stackPointer -> target address + + If forCall and running on a CISC, ret pc must be left on the stack. If + forCall and + running on a RISC, ret pc must be popped into LinkReg. In either case, + target address must be removed from the stack and jumped/returned to. */ + + /* Cogit>>#genEnilopmartReturn: */ +static void NoDbgRegParms +genEnilopmartReturn(sqInt forCall) +{ + if (forCall) { + /* begin PopR: */ + genoperand(PopR, RISCTempReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin JumpR: */ + genoperand(JumpR, RISCTempReg); + } + else { + /* begin PopR: */ + genoperand(PopR, PCReg); + + } + +} + + +/* Generate the routine that writes the current values of the C frame and + stack pointers into + variables. These are used to establish the C stack in trampolines back + into the C run-time. + + This is a presumptuous quick hack for x86. It is presumptuous for two + reasons. Firstly + the system's frame and stack pointers may differ from those we use in + generated code, + e.g. on register-rich RISCs. Secondly the ABI may not support a simple + frameless call + as written here (for example 128-bit stack alignment on Mac OS X). */ + + /* Cogit>>#generateCaptureCStackPointers: */ +static void NoDbgRegParms +generateCaptureCStackPointers(sqInt captureFramePointer) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt quickConstant; + sqInt quickConstant1; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 32; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + + /* Must happen first; value may be used in accessing any of the following addresses */ + startAddress = methodZoneBase; + /* begin PushR: */ + genoperand(PushR, VarBaseReg); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + + if (captureFramePointer) { + /* begin MoveR:Aw: */ + address = cFramePointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, FPReg, address)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, TempReg); + /* begin AddCq:R: */ + quickConstant1 = 0 + BytesPerWord; + + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AddCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + /* begin MoveR:Aw: */ + address1 = cStackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + + /* begin PopR: */ + genoperand(PopR, VarBaseReg); + + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + flushICacheFromto(processor, ((usqInt)startAddress), ((usqInt)methodZoneBase)); + recordGeneratedRunTimeaddress("ceCaptureCStackPointers", startAddress); + ceCaptureCStackPointers = ((void (*)(void)) startAddress); +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ + + /* Cogit>>#generateClosedPICPrototype */ +static void +generateClosedPICPrototype(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + CogMethod *cPIC; + AbstractInstruction * cPICEndOfCodeLabel; + sqInt endAddress; + AbstractInstruction * endCPICCase1; + usqIntptr_t fixupSize; + sqInt h; + AbstractInstruction *jumpNext; + sqInt jumpTarget; + sqInt jumpTarget1; + sqInt jumpTarget2; + sqInt numArgs; + sqInt opcode; + usqIntptr_t opcodeSize; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + + + /* stack allocate the various collections so that they + are effectively garbage collected on return. */ + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = MaxCPICCases * 9; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + /* begin compileClosedPICPrototype */ + compilePICAbort((numArgs = 0)); + + /* At the end of the entry code we need to jump to the first case code, which is actually the last chunk. + On each entension we must update this jump to move back one case. */ + jumpNext = compileCPICEntry(); + /* begin MoveUniqueCw:R: */ + wordConstant3 = firstPrototypeMethodOop(); + /* begin gen:uniqueLiteral:operand: */ + anInstruction1 = genoperandoperand(MoveCwR, wordConstant3, SendNumArgsReg); + assert(usesOutOfLineLiteral(anInstruction1)); + (anInstruction1->dependent = allocateLiteral(wordConstant3)); + /* begin JumpLong: */ + jumpTarget1 = (cPICPrototypeCaseOffset()) + 13262352; + genoperand(JumpLong, jumpTarget1); + /* begin Label */ + endCPICCase0 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + for (h = 1; h < MaxCPICCases; h += 1) { + if (h == (MaxCPICCases - 1)) { + jmpTarget(jumpNext, gLabel()); + } + /* begin MoveUniqueCw:R: */ + wordConstant2 = (subsequentPrototypeMethodOop()) + h; + /* begin gen:uniqueLiteral:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant2, SendNumArgsReg); + assert(usesOutOfLineLiteral(anInstruction)); + (anInstruction->dependent = allocateLiteral(wordConstant2)); + /* begin CmpC32:R: */ + wordConstant = 3133021973U + h; + /* begin gen:literal:operand: */ + opcode = CmpCwR; + checkLiteralforInstruction(wordConstant, genoperandoperand(opcode, wordConstant, TempReg)); + /* begin JumpLongZero: */ + jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16); + genConditionalBranchoperand(JumpLongZero, ((sqInt)jumpTarget)); + if (h == 1) { + /* begin Label */ + endCPICCase1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + /* begin MoveCw:R: */ + wordConstant1 = (methodLabel->address); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant1, genoperandoperand(MoveCwR, wordConstant1, ClassReg)); + /* begin JumpLong: */ + jumpTarget2 = cPICMissTrampolineFor(numArgs); + genoperand(JumpLong, jumpTarget2); + /* begin Label */ + cPICEndOfCodeLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + dumpLiterals(0); + computeMaximumSizes(); + cPIC = ((CogMethod *) methodZoneBase); + closedPICSize = (sizeof(CogMethod)) + (generateInstructionsAt(methodZoneBase + (sizeof(CogMethod)))); + endAddress = outputInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + assert((methodZoneBase + closedPICSize) == endAddress); + firstCPICCaseOffset = ((endCPICCase0->address)) - methodZoneBase; + cPICEndOfCodeOffset = ((cPICEndOfCodeLabel->address)) - methodZoneBase; + cPICCaseSize = ((endCPICCase1->address)) - ((endCPICCase0->address)); + cPICEndSize = closedPICSize - (((MaxCPICCases - 1) * cPICCaseSize) + firstCPICCaseOffset); + closedPICSize = roundUpLength(closedPICSize); + assert(((picInterpretAbort->address)) == (((methodLabel->address)) + (picInterpretAbortOffset()))); + assert((expectedClosedPICPrototype(cPIC)) == 0); + storeLiteralbeforeFollowingAddress(backEnd, 0, ((endCPICCase0->address)) - (jumpLongByteSize(backEnd))); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + cPICPrototype = cPIC; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogFullBlock */ +static CogMethod * +generateCogFullBlock(void) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cbNoSwitchEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cbEntryOffset) == ((fullBlockEntry->address))); + assert((startAddress + cbNoSwitchEntryOffset) == ((fullBlockNoContextSwitchEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cbNoSwitchEntryOffset); + flag("TOCHECK"); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, nilObject()); + (method->cpicHasMNUCaseOrCMIsFullBlock = 1); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogMethod: */ +static CogMethod * NoDbgRegParms +generateCogMethod(sqInt selector) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cmNoCheckEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cmEntryOffset) == ((entry->address))); + assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); + fillInBlockHeadersAt(startAddress); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* Size pc-dependent instructions and assign eventual addresses to all + instructions. Answer the size of the code. + Compute forward branches based on virtual address (abstract code starts at + 0), assuming that any branches branched over are long. + Compute backward branches based on actual address. + Reuse the fixups array to record the pc-dependent instructions that need + to have + their code generation postponed until after the others. */ + + /* Cogit>>#generateInstructionsAt: */ +static sqInt NoDbgRegParms +generateInstructionsAt(sqInt eventualAbsoluteAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + BytecodeFixup *fixup; + sqInt i; + sqInt j; + sqInt pcDependentIndex; + + absoluteAddress = eventualAbsoluteAddress; + pcDependentIndex = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + if (isPCDependent(abstractInstruction)) { + sizePCDependentInstructionAt(abstractInstruction, absoluteAddress); + fixup = fixupAt(pcDependentIndex); + pcDependentIndex += 1; + (fixup->instructionIndex = i); + absoluteAddress += (abstractInstruction->machineCodeSize); + } + else { + absoluteAddress = concretizeAt(abstractInstruction, absoluteAddress); + } + } + for (j = 0; j < pcDependentIndex; j += 1) { + fixup = fixupAt(j); + abstractInstruction = abstractInstructionAt((fixup->instructionIndex)); + concretizeAt(abstractInstruction, (abstractInstruction->address)); + } + return absoluteAddress - eventualAbsoluteAddress; +} + + +/* Generate the method map at addressrNull (or compute it if addressOrNull is + null). Answer the length of the map in byes. Each entry in the map is in + two parts. In the + least signficant bits are a displacement of how far from the start or + previous entry, + unless it is an IsAnnotationExtension byte, in which case those bits are + the extension. + In the most signficant bits are the type of annotation at the point + reached. A null + byte ends the map. */ + + /* Cogit>>#generateMapAt:start: */ +static sqInt NoDbgRegParms +generateMapAtstart(sqInt addressOrNull, sqInt startAddress) +{ + unsigned char annotation; + sqInt delta; + sqInt i; + AbstractInstruction *instruction; + sqInt length; + sqInt location; + sqInt mapEntry; + sqInt maxDelta; + usqIntptr_t mcpc; + + length = 0; + location = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + annotation = (instruction->annotation); + if (!(annotation == null)) { + /* begin assertValidAnnotation:for: */ + assert((annotation != (getIsObjectReference())) + || (((instruction->opcode)) == Literal)); + mcpc = (((instruction->opcode)) == Literal + ? (instruction->address) + : ((instruction->address)) + ((instruction->machineCodeSize))); + while (((delta = (mcpc - location) / 4)) > DisplacementMask) { + maxDelta = (((((delta < MaxX2NDisplacement) ? delta : MaxX2NDisplacement)) | DisplacementMask) - DisplacementMask); + assert((((usqInt) maxDelta) >> AnnotationShift) <= DisplacementMask); + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, (((usqInt) maxDelta) >> AnnotationShift) + DisplacementX2N); + } + location += maxDelta * 4; + length += 1; + } + if (!(addressOrNull == null)) { + mapEntry = delta + (((sqInt)((usqInt)((((annotation < IsSendCall) ? annotation : IsSendCall))) << AnnotationShift))); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + location += delta * 4; + length += 1; + if (annotation > IsSendCall) { + + /* Add the necessary IsAnnotationExtension */ + if (!(addressOrNull == null)) { + mapEntry = (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift))) + (annotation - IsSendCall); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + length += 1; + } + } + } + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, MapEnd); + } + return length + 1; +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#generateOpenPICPrototype */ +static void +generateOpenPICPrototype(void) +{ + sqInt codeSize; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + compileOpenPICnumArgs(specialSelector(0), 2); + computeMaximumSizes(); + concretizeAt(methodLabel, methodZoneBase); + codeSize = generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + mapSize = generateMapAtstart(null, methodZoneBase + cmNoCheckEntryOffset); + openPICSize = (roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize)); +} + + +/* Generate the run-time entries at the base of the native code zone and + update the base. + */ + + /* Cogit>>#generateRunTimeTrampolines */ +static void +generateRunTimeTrampolines(void) +{ + ceSendMustBeBooleanAddFalseTrampoline = genMustBeBooleanTrampolineForcalled(falseObject(), "ceSendMustBeBooleanAddFalseTrampoline"); + ceSendMustBeBooleanAddTrueTrampoline = genMustBeBooleanTrampolineForcalled(trueObject(), "ceSendMustBeBooleanAddTrueTrampoline"); + ceNonLocalReturnTrampoline = genNonLocalReturnTrampoline(); + + /* Neither of the context inst var access trampolines save registers. Their operation could cause + arbitrary update of stack frames, so the assumption is that callers flush the stack before calling + the context inst var access trampolines, and that everything except the result is dead afterwards. */ + ceCheckForInterruptTrampoline = genCheckForInterruptsTrampoline(); + ceFetchContextInstVarTrampoline = genTrampolineForcalledargargresult(ceContextinstVar, "ceFetchContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, SendNumArgsReg); + ceStoreContextInstVarTrampoline = genTrampolineForcalledargargargresult(ceContextinstVarvalue, "ceStoreContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, ClassReg, ReceiverResultReg); + + /* These two are unusual; they are reached by return instructions. */ + ceCannotResumeTrampoline = genTrampolineForcalled(ceCannotResume, "ceCannotResumeTrampoline"); + ceBaseFrameReturnTrampoline = genReturnTrampolineForcalledarg(ceBaseFrameReturn, "ceBaseFrameReturnTrampoline", ReceiverResultReg); + ceReturnToInterpreterTrampoline = genReturnTrampolineForcalledarg(ceReturnToInterpreter, "ceReturnToInterpreterTrampoline", ReceiverResultReg); + ceMallocTrampoline = genTrampolineForcalledargresult(ceMalloc, "ceMallocTrampoline", ReceiverResultReg, TempReg); + ceFreeTrampoline = genTrampolineForcalledarg(ceFree, "ceFreeTrampoline", ReceiverResultReg); + ceFFICalloutTrampoline = genFFICalloutTrampoline(); + +} + + +/* Generate a routine ceCaptureCStackPointers that will capture the C stack + pointer, and, if it is in use, the C frame pointer. These are used in + trampolines to call + run-time routines in the interpreter from machine-code. */ + + /* Cogit>>#generateStackPointerCapture */ +static void +generateStackPointerCapture(void) +{ + sqInt oldMethodZoneBase; + sqInt oldTrampolineTableIndex; + + + /* For the benefit of the following assert, assume the minimum at first. */ + cFramePointerInUse = 0; + assertCStackWellAligned(); + oldMethodZoneBase = methodZoneBase; + oldTrampolineTableIndex = trampolineTableIndex; + generateCaptureCStackPointers(1); + ceCaptureCStackPointers(); + if (!((cFramePointerInUse = isCFramePointerInUse()))) { + methodZoneBase = oldMethodZoneBase; + trampolineTableIndex = oldTrampolineTableIndex; + generateCaptureCStackPointers(0); + } + assertCStackWellAligned(); +} + + +/* Generate the run-time entries and exits at the base of the native code + zone and update the base. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* Cogit>>#generateTrampolines */ +static void +generateTrampolines(void) +{ + usqIntptr_t fixupSize; + sqInt methodZoneStart; + usqIntptr_t opcodeSize; + + methodZoneStart = methodZoneBase; + (methodLabel->address = methodZoneStart); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 80; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + hasYoungReferent = 0; + generateSendTrampolines(); + generateMissAbortTrampolines(); + generateObjectRepresentationTrampolines(); + generateRunTimeTrampolines(); + generateEnilopmarts(); + generateTracingTrampolines(); + recordGeneratedRunTimeaddress("methodZoneBase", methodZoneBase); + flushICacheFromto(processor, ((usqInt)methodZoneStart), ((usqInt)methodZoneBase)); +} + + /* Cogit>>#genFFICalloutTrampoline */ +static sqInt +genFFICalloutTrampoline(void) +{ + sqInt address; + sqInt address2; + sqInt startAddress; + + opcodeIndex = 0; + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, LinkReg, address)); + + /* begin CallR: */ + genoperand(CallR, TempReg); + /* begin MoveAw:R: */ + address2 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address2, genoperandoperand(MoveAwR, address2, LinkReg)); + + /* begin RetN: */ + genoperand(RetN, 0); + startAddress = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceFFICalloutTrampoline", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a routine that answers the stack pointer immedately + after a leaf call, used for checking stack pointer alignment. */ + + /* Cogit>>#genGetLeafCallStackPointer */ +static void +genGetLeafCallStackPointer(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 4; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + startAddress = methodZoneBase; + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, R0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetFP", startAddress); + ceGetFP = ((usqIntptr_t (*)(void)) startAddress); + startAddress = methodZoneBase; + zeroOpcodeIndex(); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, R0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetSP", startAddress); + ceGetSP = ((usqIntptr_t (*)(void)) startAddress); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target + or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch + in a closed PIC. It distinguishes the two by testing ClassReg. If the + register is zero then this is an MNU. + + This poses a problem in 32-bit Spur, where zero is the cache tag for + immediate characters (tag pattern 2r10) because SmallIntegers have tag + patterns 2r11 + and 2r01, so anding with 1 reduces these to 0 & 1. We solve the ambiguity + by patching send sites with a 0 cache tag to open PICs instead of closed + PICs. */ + + /* Cogit>>#genInnerPICAbortTrampoline: */ +static sqInt NoDbgRegParms +genInnerPICAbortTrampoline(char *name) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpMNUCase; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceInterpretMethodFromPICreceiver, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg); + jmpTarget(jumpMNUCase, gLabel()); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceMNUFromPICMNUMethodreceiver, name, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genLoadCStackPointersForPrimCall */ +static sqInt +genLoadCStackPointersForPrimCall(void) +{ + sqInt address; + sqInt address1; + sqInt address2; + AbstractInstruction *anInstruction; + + if (debugPrimCallStackOffset == 0) { + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, SPReg)); + } + else { + /* begin MoveAw:R: */ + address1 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, TempReg)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, debugPrimCallStackOffset, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(debugPrimCallStackOffset)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SPReg); + } + if (cFramePointerInUse) { + /* begin MoveAw:R: */ + address2 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address2, genoperandoperand(MoveAwR, address2, FPReg)); + } + return 0; +} + + +/* The in-line cache for a send is implemented as a constant load into + ClassReg. We always use a 32-bit load, even in 64-bits. + + In the initial (unlinked) state the in-line cache is notionally loaded + with the selector. + But since in 64-bits an arbitrary selector oop won't fit in a 32-bit + constant load, we + instead load the cache with the selector's index, either into the literal + frame of the + current method, or into the special selector array. Negative values are + 1-relative indices into the special selector array. + + When a send is linked, the load of the selector, or selector index, is + overwritten with a + load of the receiver's class, or class tag. Hence, the 64-bit VM is + currently constrained + to use class indices as cache tags. If out-of-line literals are used, + distinct caches /must + not/ share acche locations, for if they do, send cacheing will be confused + by the sharing. + Hence we use the MoveUniqueC32:R: instruction that will not share literal + locations. */ + + /* Cogit>>#genLoadInlineCacheWithSelector: */ +static void NoDbgRegParms +genLoadInlineCacheWithSelector(sqInt selectorIndex) +{ + AbstractInstruction *anInstruction; + sqInt cacheValue; + sqInt opcode; + sqInt selector; + + assert((selectorIndex < 0 + ? (((-selectorIndex) >= 1) && ((-selectorIndex) <= (numSpecialSelectors()))) + : ((selectorIndex >= 0) && (selectorIndex <= ((literalCountOf(methodObj)) - 1))))); + selector = (selectorIndex < 0 + ? specialSelector(-1 - selectorIndex) + : getLiteral(selectorIndex)); + assert(addressCouldBeOop(selector)); + if (isYoung(selector)) { + hasYoungReferent = 1; + } + cacheValue = selector; + + /* begin MoveUniqueC32:R: */ + opcode = MoveCwR; + /* begin uniqueLiteral:forInstruction: */ + anInstruction = genoperandoperand(opcode, cacheValue, ClassReg); + assert(usesOutOfLineLiteral(anInstruction)); + (anInstruction->dependent = allocateLiteral(cacheValue)); +} + + /* Cogit>>#genNonLocalReturnTrampoline */ +static sqInt +genNonLocalReturnTrampoline(void) +{ + sqInt address; + + zeroOpcodeIndex(); + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, LinkReg, address)); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceNonLocalReturn, "ceNonLocalReturnTrampoline", 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate a trampoline for a routine used as a return address, that has one + argument. Hack: a negative value indicates an abstract register, a + non-negative value indicates a constant. */ + + /* Cogit>>#genReturnTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 0, NoReg, 0); +} + + +/* If the client requires, then on an ARM-like RISC processor, the return + address needs to + be pushed to the stack so that the interpreter sees the same stack layout + as on CISC. + */ + + /* Cogit>>#genSmalltalkToCStackSwitch: */ +static sqInt NoDbgRegParms +genSmalltalkToCStackSwitch(sqInt pushLinkReg) +{ + if (pushLinkReg) { + /* begin PushR: */ + genoperand(PushR, LinkReg); + } + genSaveStackPointers(backEnd); + if (cFramePointerInUse) { + genLoadCStackPointers(backEnd); + } + else { + genLoadCStackPointer(backEnd); + } + return 0; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called: */ +static sqInt NoDbgRegParms +genTrampolineForcalled(void *aRoutine, char *aString) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with two arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:floatResult: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, resultReg2, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:floatArg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone, resultReg2OrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, regMask, 1, NoReg, 0); +} + + +/* */ + + /* Cogit>>#gen: */ +static AbstractInstruction * NoDbgRegParms +gen(sqInt opcode) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + return abstractInstruction; +} + + +/* */ +/* */ + + /* Cogit>>#gen:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperand(sqInt opcode, sqInt operand) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operand; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + ((abstractInstruction->operands))[2] = operandThree; + return abstractInstruction; +} + + /* Cogit>>#getLiteral: */ +static sqInt NoDbgRegParms +getLiteral(sqInt litIndex) +{ + if (maxLitIndex < litIndex) { + maxLitIndex = litIndex; + } + return literalofMethod(litIndex, methodObj); +} + + +/* Access for the literal manager. */ + + /* Cogit>>#getOpcodeIndex */ +static sqInt +getOpcodeIndex(void) +{ + return opcodeIndex; +} + + /* Cogit>>#incrementUsageOfTargetIfLinkedSend:mcpc:ignored: */ +static sqInt NoDbgRegParms +incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + + if (annotation >= IsSendCall) { + assert(annotation != IsNSSendCall); + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmUsageCount)) < (CMMaxUsageCount / 2)) { + (targetMethod1->cmUsageCount = ((targetMethod1->cmUsageCount)) + 1); + } + + } + } + return 0; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#indexForSelector:in:at: */ +static sqInt NoDbgRegParms +indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc) +{ + sqInt i; + sqInt iLimiT; + sqInt methodOop; + + assert(((((usqInt)mcpc)) > (((usqInt)cogMethod))) + && (mcpc < ((((usqInt)cogMethod)) + ((cogMethod->blockSize))))); + for (i = 0; i < NumSpecialSelectors; i += 1) { + if (selector == (specialSelector(i))) { + return -1 - i; + } + } + + /* Then search the method's literal frame... open code fetchPointer:ofObject: for speed... */ + methodOop = (cogMethod->methodObject); + for (i = LiteralStart, iLimiT = (literalCountOfMethodHeader((cogMethod->methodHeader))); i <= iLimiT; i += 1) { + if ((longAt(((i * BytesPerOop) + BaseHeaderSize) + methodOop)) == selector) { + assert(selector == (literalofMethod(i - 1, methodOop))); + return i - 1; + } + } + error("could not find selector in method when unlinking send site"); + return 0; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialClosedPICUsageCount */ +static sqInt +initialClosedPICUsageCount(void) +{ + return CMMaxUsageCount / 2; +} + + /* Cogit>>#initializeBackend */ +static void +initializeBackend(void) +{ + AbstractInstruction *existingInst; + sqInt i; + sqInt iLimiT; + AbstractInstruction *newInst; + AbstractInstruction *newLiterals; + + (methodLabel->machineCodeSize = 0); + (methodLabel->opcode = Label); + ((methodLabel->operands))[0] = 0; + ((methodLabel->operands))[1] = 0; + assert(((registerMaskFor(VarBaseReg)) & CallerSavedRegisterMask) == 0); + + /* begin allocateLiterals: */ + if (4 > literalsSize) { + + /* Must copy across state (not using realloc, cuz...) and + must also update existing instructions to refer to the new ones... + It's either this or modify all generation routines to be able to retry + with more literals after running out of literals. */ + newLiterals = calloc(4, sizeof(CogAbstractInstruction)); + if (!(literals == null)) { + for (i = 0; i < nextLiteralIndex; i += 1) { + existingInst = literalInstructionAt(i); + newInst = (&(newLiterals[i])); + cloneLiteralFrom(newInst, existingInst); + assert(((existingInst->dependent)) == null); + (existingInst->dependent = newInst); + } + for (i = 0, iLimiT = (opcodeIndex - 1); i <= iLimiT; i += 1) { + existingInst = abstractInstructionAt(i); + if ((((existingInst->dependent)) != null) + && (((((existingInst->dependent))->opcode)) == Literal)) { + (existingInst->dependent = (((existingInst->dependent))->dependent)); + } + } + } + free(literals); + literals = newLiterals; + literalsSize = 4; + } + /* begin resetLiterals */ + + /* an impossibly high value */ + firstOpcodeIndex = 1U << 16; + nextLiteralIndex = (lastDumpedLiteralIndex = 0); +} + + /* Cogit>>#initializeCodeZoneFrom:upTo: */ +void +initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress) +{ + usqIntptr_t fixupSize; + sqInt numberOfAbstractOpcodes; + usqIntptr_t opcodeSize; + sqInt startAddress1; + + initializeBackend(); + stopsFromto(backEnd, startAddress, endAddress - 1); + sqMakeMemoryExecutableFromTo(startAddress, endAddress); + codeBase = (methodZoneBase = startAddress); + minValidCallAddress = (((((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) < (primitiveFailAddress())) ? (((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) : (primitiveFailAddress())); + manageFromto(methodZoneBase, endAddress); + /* begin maybeGenerateCheckFeatures */ + /* begin maybeGenerateICacheFlush */ + /* begin generateVMOwnerLockFunctions */ + +# if COGMTVM + /* begin allocateOpcodes:bytecodes: */ + numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd); + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + zeroOpcodeIndex(); + startAddress1 = methodZoneBase; + generateLowLevelTryLock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress1); + ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress1); + zeroOpcodeIndex(); + initialPC = 0; + endPC = numAbstractOpcodes - 1; + startAddress1 = methodZoneBase; + generateLowLevelUnlock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress1); + ceUnlockVMOwner = ((void (*)(void)) startAddress1); + +# endif /* COGMTVM */ + + genGetLeafCallStackPointer(); + generateStackPointerCapture(); + generateTrampolines(); + computeEntryOffsets(); + computeFullBlockEntryOffsets(); + generateClosedPICPrototype(); + manageFromto(methodZoneBase, endAddress); + generateOpenPICPrototype(); +} + + +/* Answer a usage count that reflects likely long-term usage. + Answer 1 for non-primitives or quick primitives (inst var accessors), + 2 for methods with interpreter primitives, and 3 for compiled primitives. */ + + /* Cogit>>#initialMethodUsageCount */ +static sqInt +initialMethodUsageCount(void) +{ + if ((primitiveIndex == 1) + || (isQuickPrimitiveIndex(primitiveIndex))) { + return 1; + } + if (!(primitiveGeneratorOrNil())) { + return 2; + } + return 3; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialOpenPICUsageCount */ +static sqInt +initialOpenPICUsageCount(void) +{ + return CMMaxUsageCount - 1; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#inlineCacheValueForSelector:in:at: */ +static sqInt NoDbgRegParms +inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc) +{ + return selector; +} + + /* Cogit>>#inverseBranchFor: */ +static sqInt NoDbgRegParms +inverseBranchFor(sqInt opcode) +{ + + switch (opcode) { + case JumpLongZero: + return JumpLongNonZero; + + case JumpLongNonZero: + return JumpLongZero; + + case JumpZero: + return JumpNonZero; + + case JumpNonZero: + return JumpZero; + + case JumpNegative: + return JumpNonNegative; + + case JumpNonNegative: + return JumpNegative; + + case JumpOverflow: + return JumpNoOverflow; + + case JumpNoOverflow: + return JumpOverflow; + + case JumpCarry: + return JumpNoCarry; + + case JumpNoCarry: + return JumpCarry; + + case JumpLess: + return JumpGreaterOrEqual; + + case JumpGreaterOrEqual: + return JumpLess; + + case JumpGreater: + return JumpLessOrEqual; + + case JumpLessOrEqual: + return JumpGreater; + + case JumpBelow: + return JumpAboveOrEqual; + + case JumpAboveOrEqual: + return JumpBelow; + + case JumpAbove: + return JumpBelowOrEqual; + + case JumpBelowOrEqual: + return JumpAbove; + + default: + error("Case not found and no otherwise clause"); + } + error("invalid opcode for inverse"); + return 0; +} + + +/* See Cogit class>>initializeAnnotationConstants */ + + /* Cogit>>#isPCMappedAnnotation: */ +static sqInt NoDbgRegParms +isPCMappedAnnotation(sqInt annotation) +{ + return annotation >= HasBytecodePC; +} + + /* Cogit>>#isPCWithinMethodZone: */ +sqInt +isPCWithinMethodZone(void *address) +{ + return (((((usqInt)address)) >= methodZoneBase) && ((((usqInt)address)) <= (freeStart()))); +} + + +/* Answer if the instruction preceding retpc is a call instruction. */ + + /* Cogit>>#isSendReturnPC: */ +sqInt +isSendReturnPC(sqInt retpc) +{ + sqInt target; + + if (!(isCallPrecedingReturnPC(backEnd, retpc))) { + return 0; + } + target = callTargetFromReturnAddress(backEnd, retpc); + return (((target >= firstSend) && (target <= lastSend))) + || (((target >= methodZoneBase) && (target <= (freeStart())))); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPEqual(void *jumpTarget) +{ + /* begin genJumpFPEqual: */ + return genoperand(JumpFPEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreaterOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreaterOrEqual(void *jumpTarget) +{ + /* begin genJumpFPGreaterOrEqual: */ + return genoperand(JumpFPGreaterOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreater: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreater(void *jumpTarget) +{ + /* begin genJumpFPGreater: */ + return genoperand(JumpFPGreater, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLessOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLessOrEqual(void *jumpTarget) +{ + /* begin genJumpFPLessOrEqual: */ + return genoperand(JumpFPLessOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLess: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLess(void *jumpTarget) +{ + /* begin genJumpFPLess: */ + return genoperand(JumpFPLess, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPNotEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPNotEqual(void *jumpTarget) +{ + /* begin genJumpFPNotEqual: */ + return genoperand(JumpFPNotEqual, ((sqInt)jumpTarget)); +} + + /* Cogit>>#Label */ +static AbstractInstruction * +gLabel(void) +{ + return genoperandoperand(Label, (labelCounter += 1), bytecodePC); +} + + /* Cogit>>#LogicalShiftLeftCq:R: */ +static AbstractInstruction * NoDbgRegParms +gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg) +{ + return genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); +} + + /* Cogit>>#lastOpcode */ +static AbstractInstruction * +lastOpcode(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#linkSendAt:in:to:offset:receiver: */ +void +linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver) +{ + sqInt address; + sqInt extent; + sqInt inlineCacheTag; + + assert((theEntryOffset == cmEntryOffset) + || (theEntryOffset == cmNoCheckEntryOffset)); + assert(((callSiteReturnAddress >= methodZoneBase) && (callSiteReturnAddress <= (freeStart())))); + inlineCacheTag = (theEntryOffset == cmNoCheckEntryOffset + ? (targetMethod->selector) + : inlineCacheTagForInstance(receiver)); + address = (((sqInt)targetMethod)) + theEntryOffset; + extent = rewriteInlineCacheAttagtarget(backEnd, callSiteReturnAddress, inlineCacheTag, address); + flushICacheFromto(processor, (((usqInt)callSiteReturnAddress)) - extent, ((usqInt)callSiteReturnAddress)); +} + + /* Cogit>>#loadBytesAndGetDescriptor */ +static BytecodeDescriptor * +loadBytesAndGetDescriptor(void) +{ + BytecodeDescriptor *descriptor; + + byte0 = (fetchByteofObject(bytecodePC, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor, bytecodePC); + return descriptor; +} + + /* Cogit>>#loadSubsequentBytesForDescriptor:at: */ +static void NoDbgRegParms +loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc) +{ + if (((descriptor->numBytes)) > 1) { + byte1 = fetchByteofObject(pc + 1, methodObj); + if (((descriptor->numBytes)) > 2) { + byte2 = fetchByteofObject(pc + 2, methodObj); + if (((descriptor->numBytes)) > 3) { + byte3 = fetchByteofObject(pc + 3, methodObj); + if (((descriptor->numBytes)) > 4) { + notYetImplemented(); + } + } + } + } +} + + /* Cogit>>#MoveAw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveAwR(sqInt address, sqInt reg) +{ + /* begin gen:literal:operand: */ + return checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, reg)); +} + + /* Cogit>>#MoveCq:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + return anInstruction; +} + + /* Cogit>>#MoveCw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCwR(sqInt wordConstant, sqInt reg) +{ + /* begin gen:literal:operand: */ + return checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, reg)); +} + + /* Cogit>>#MoveMw:r:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + return anInstruction; +} + + /* Cogit>>#MoveR:Mw:r: */ +static AbstractInstruction * NoDbgRegParms +gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, baseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + return anInstruction; +} + + /* Cogit>>#MoveR:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(MoveRR, reg1, reg2); +} + + +/* Answer the address of the null byte at the end of the method map. */ + + /* Cogit>>#mapEndFor: */ +static sqInt NoDbgRegParms +mapEndFor(CogMethod *cogMethod) +{ + usqInt end; + + end = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while ((byteAt(end)) != MapEnd) { + end -= 1; + assert(end > (firstMappedPCFor(cogMethod))); + } + return end; +} + + +/* Unlinking/GC/Disassembly support */ + + /* Cogit>>#mapFor:performUntil:arg: */ +static sqInt NoDbgRegParms +mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = functionSymbol(annotation, (((char *) mcpc)), arg); + if (result != 0) { + return result; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return 0; +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#mapObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +mapObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = remapMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential class ref in the compare instruction, and the potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (remapMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Update all references to objects in the generated runtime. */ + + /* Cogit>>#mapObjectReferencesInGeneratedRuntime */ +static void +mapObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + sqInt mappedLiteral; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = longAt(mcpc); + mappedLiteral = remapObject(literal); + if (mappedLiteral != literal) { + /* begin storeLiteral:atAnnotatedAddress:using: */ + longAtput(mcpc, mappedLiteral); + codeModified = 1; + } + } +} + + +/* Update all references to objects in machine code for a become. + Unlike incrementalGC or fullGC a method that does not refer to young may + refer to young as a result of the become operation. Unlike incrementalGC + or fullGC the reference from a Cog method to its methodObject *must not* + change since the two are two halves of the same object. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForBecome */ +static void +mapObjectReferencesInMachineCodeForBecome(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt remappedMethod; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = (freedPIC = 0); + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + assert(!hasYoungObj); + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + if ((isYoung((cogMethod->selector))) + || (mapObjectReferencesInClosedPIC(cogMethod))) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + else { + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + remappedMethod = remapOop((cogMethod->methodObject)); + if (remappedMethod != ((cogMethod->methodObject))) { + if (methodHasCogMethod(remappedMethod)) { + error("attempt to become two cogged methods"); + } + if (!(withoutForwardingOnandwithsendToCogit((cogMethod->methodObject), remappedMethod, (cogMethod->cmUsesPenultimateLit), methodhasSameCodeAscheckPenultimate))) { + error("attempt to become cogged method into different method"); + } + if ((rawHeaderOf((cogMethod->methodObject))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + rawHeaderOfput(remappedMethod, ((sqInt)cogMethod)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + } + } + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + ensureInYoungReferrers(cogMethod); + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (freedPIC) { + unlinkSendsToFree(); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for a full gc. Since + the current (New)ObjectMemory GC makes everything old in a full GC + a method not referring to young will not refer to young afterwards */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForFullGC */ +static void +mapObjectReferencesInMachineCodeForFullGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + codeModified = 0; + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(!((cogMethod->cmRefersToYoung))); + mapObjectReferencesInClosedPIC(cogMethod); + } + else { + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for either a Spur + scavenging gc + or a Squeak V3 incremental GC. Avoid scanning all code by using the + youngReferrers list. In a young gc a method referring to young may no + longer refer to young, but a + method not referring to young cannot and will not refer to young + afterwards. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForYoungGC */ +static void +mapObjectReferencesInMachineCodeForYoungGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + usqInt pointer; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = 0; + pointer = youngReferrers(); + while (pointer < limitAddress) { + assert(!hasYoungObj); + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) == CMFree) { + assert(!((cogMethod->cmRefersToYoung))); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if ((cogMethod->cmRefersToYoung)) { + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + pointer += BytesPerWord; + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code. */ + + /* Cogit>>#mapObjectReferencesInMachineCode: */ +void +mapObjectReferencesInMachineCode(sqInt gcMode) +{ + + switch (gcMode) { + case GCModeNewSpace: + mapObjectReferencesInMachineCodeForYoungGC(); + break; + case GCModeFull: + mapObjectReferencesInMachineCodeForFullGC(); + break; + case GCModeBecome: + mapObjectReferencesInMachineCodeForBecome(); + break; + default: + error("Case not found and no otherwise clause"); + } + if (!(asserta((freeStart()) <= (youngReferrers())))) { + error("youngReferrers list overflowed"); + } +} + + +/* Mark objects in machine-code of marked methods (or open PICs with marked + selectors). + */ + + /* Cogit>>#markAndTraceMachineCodeOfMarkedMethods */ +void +markAndTraceMachineCodeOfMarkedMethods(void) +{ + sqInt annotation; + sqInt annotation1; + CogMethod *cogMethod; + usqInt map; + usqInt map1; + sqInt mapByte; + sqInt mapByte1; + usqInt mcpc; + usqInt mcpc1; + sqInt result; + sqInt result1; + sqInt val; + sqInt val1; + + val = 0; + val1 = 0; + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + codeModified = 0; + markAndTraceObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector))))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc1 = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map1 = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte1 = byteAt(map1))) != MapEnd) { + if (mapByte1 >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc1 += (mapByte1 & DisplacementMask) * 4; + if ((((annotation1 = ((usqInt) mapByte1) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte1 = byteAt(map1 - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation1 += mapByte1 & DisplacementMask; + map1 -= 1; + } + result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); + if (result1 != 0) { + goto l4; + } + } + else { + if (mapByte1 < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte1 - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map1 -= 1; + } + l4: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Mark and trace any object references in the generated run-time. */ + + /* Cogit>>#markAndTraceObjectReferencesInGeneratedRuntime */ +static void +markAndTraceObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = longAt(mcpc); + markAndTraceLiteralinatpc(literal, ((CogMethod *) null), ((usqInt)mcpc)); + } +} + + +/* Mark and trace objects in the argument and free if it is appropriate. + Answer if the method has been freed. firstVisit is a hint used to avoid + scanning methods we've already seen. False positives are fine. + For a CMMethod this + frees if the bytecode method isnt marked, + marks and traces object literals and selectors, + unlinks sends to targets that should be freed. + For a CMClosedPIC this + frees if it refers to anything that should be freed or isn't marked. + For a CMOpenPIC this + frees if the selector isn't marked. */ +/* this recurses at most one level down */ + + /* Cogit>>#markAndTraceOrFreeCogMethod:firstVisit: */ +static sqInt NoDbgRegParms +markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + sqInt val; + + val = 0; + if (((cogMethod->cmType)) == CMFree) { + return 1; + } + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if (((cogMethod->cmType)) == CMMethod) { + if (!(isMarked((cogMethod->methodObject)))) { + freeMethod(cogMethod); + return 1; + } + if (firstVisit) { + /* begin markLiteralsAndUnlinkUnmarkedSendsIn: */ + assert(((cogMethod->cmType)) == CMMethod); + assert(isMarked((cogMethod->methodObject))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(closedPICRefersToUnmarkedObject(cogMethod))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (isMarked((cogMethod->selector))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + assert((((cogMethod->cmType)) == CMMethod) + || ((((cogMethod->cmType)) == CMClosedPIC) + || (((cogMethod->cmType)) == CMOpenPIC))); + return 0; +} + + +/* If entryPoint is that of some method, then mark and trace objects in it + and free if it is appropriate. + Answer if the method has been freed. */ + + /* Cogit>>#markAndTraceOrFreePICTarget:in: */ +static sqInt NoDbgRegParms +markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC) +{ + CogMethod *targetMethod; + + assert((entryPoint > methodZoneBase) + && (entryPoint < (freeStart()))); + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + return 0; + } + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + return markAndTraceOrFreeCogMethodfirstVisit(targetMethod, (((usqInt)targetMethod)) > (((usqInt)cPIC))); +} + + +/* Mark and trace literals. Unlink sends that have unmarked cache tags or + targets. + */ + + /* Cogit>>#markLiteralsAndUnlinkIfUnmarkedSend:pc:method: */ +static sqInt NoDbgRegParms +markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt cacheTagMarked; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + sqInt val; + + literal = 0; + val = 0; + if (annotation == IsObjectReference) { + literal = longAt(((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8)))); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + cacheTagMarked = tagCouldBeObj1 + && (cacheTagIsMarked(cacheTag1)); + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((!cacheTagMarked) + || (markAndTraceOrFreeCogMethodfirstVisit(targetMethod1, (((usqInt)targetMethod1)) > (((usqInt)mcpc))))) { + + /* Either the cacheTag is unmarked (e.g. new class) or the target + has been freed (because it is unmarked), so unlink the send. */ + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + markAndTraceLiteralinat((targetMethod1->selector), targetMethod1, (&((targetMethod1->selector)))); + } + + } + else { + + /* cacheTag is selector */ + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + + } + return 0; +} + + +/* Mark and trace literals. + Additionally in Newspeak, void push implicits that have unmarked classes. */ + + /* Cogit>>#markLiterals:pc:method: */ +static sqInt NoDbgRegParms +markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + + literal = 0; + if (annotation == IsObjectReference) { + literal = longAt(((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8)))); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1) { + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + + /* cacheTag is selector */ + codeModified = 1; + } + } + + } + return 0; +} + + /* Cogit>>#markMethodAndReferents: */ +void +markMethodAndReferents(CogBlockMethod *aCogMethod) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((aCogMethod->cmType)) == CMMethod) + || (((aCogMethod->cmType)) == CMBlock)); + cogMethod = (((aCogMethod->cmType)) == CMMethod + ? ((CogMethod *) aCogMethod) + : cmHomeMethod(aCogMethod)); + (cogMethod->cmUsageCount = CMMaxUsageCount); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#maxCogMethodAddress */ +usqInt +maxCogMethodAddress(void) +{ + return ((usqInt)(limitZony())); +} + + +/* If this is the Newspeak VM and the objectRepresentation supports pinning + then allocate space for the implicit receiver caches on the heap. */ + + /* Cogit>>#maybeAllocAndInitIRCs */ +static sqInt +maybeAllocAndInitIRCs(void) +{ + return 1; + +} + + +/* Check that the header fields are consistent with the type. + Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#maybeFreeCogMethodDoesntLookKosher: */ +static sqInt NoDbgRegParms +maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + sqInt result; + + result = cogMethodDoesntLookKosher(cogMethod); + return (result == 2 + ? 0 + : result); +} + + +/* In SIsta Spur counters are held on the heap in pinned objects which must + be marked + to avoid them being garbage collected. This is the hook through which that + happens. + */ + + /* Cogit>>#maybeMarkCountersIn: */ +static void NoDbgRegParms +maybeMarkCountersIn(CogMethod *cogMethod) +{ +} + + /* Cogit>>#mclassIsSmallInteger */ +static sqInt +mclassIsSmallInteger(void) +{ + return (methodClassOf(methodObj)) == (classSmallInteger()); +} + + +/* Answer the absolute machine code pc matching the zero-relative + bytecode pc of a backward branch in cogMethod, given the start + of the bytecodes for cogMethod's block or method object. */ + + /* Cogit>>#mcPCForBackwardBranch:startBcpc:in: */ +usqInt +mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc1; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = (((0 + (((int)((usqInt)(HasBytecodePC) << 1)))) & 1) + && ((((sqInt)(((void *)bcpc)))) == startbcpc) + ? ((sqInt)(((char *) mcpc))) + : 0); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc1 = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc1 += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc1 == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, -1, aMethodObj)) + : 0)); + bcpc1 = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc1 >= endbcpc) { + return ((sqInt) 0); + } + } + else { + if (((descriptor->isReturn)) + && (bcpc1 >= latestContinuation)) { + return ((sqInt) 0); + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj); + targetPC = (bcpc1 + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) < 0)); + result = findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc1, (((void *)bcpc))); + if (result != 0) { + return result; + } + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return ((sqInt) 0); +} + + +/* For the purposes of become: see if the two methods are similar, i.e. can + be safely becommed. + This is pretty strict. All literals and bytecodes must be identical. Only + trailer bytes and header + flags can differ. */ + + /* Cogit>>#method:hasSameCodeAs:checkPenultimate: */ +static sqInt NoDbgRegParms +methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) +{ + sqInt bi; + sqInt endPCA; + sqInt headerA; + sqInt headerB; + sqInt li; + sqInt numLitsA; + + headerA = methodHeaderOf(methodA); + headerB = methodHeaderOf(methodB); + numLitsA = literalCountOfMethodHeader(headerA); + endPCA = endPCOf(methodA); + if (((argumentCountOfMethodHeader(headerA)) != (argumentCountOfMethodHeader(headerB))) + || (((temporaryCountOfMethodHeader(headerA)) != (temporaryCountOfMethodHeader(headerB))) + || (((primitiveIndexOfMethodheader(methodA, headerA)) != (primitiveIndexOfMethodheader(methodB, headerB))) + || ((numLitsA != (literalCountOfMethodHeader(headerB))) + || (endPCA > (numBytesOf(methodB))))))) { + return 0; + } + for (li = 1; li < numLitsA; li += 1) { + if ((fetchPointerofObject(li, methodA)) != (fetchPointerofObject(li, methodB))) { + if ((li < (numLitsA - 1)) + || (comparePenultimateLiteral)) { + return 0; + } + } + } + for (bi = (startPCOfMethod(methodA)); bi <= endPCA; bi += 1) { + if ((fetchByteofObject(bi, methodA)) != (fetchByteofObject(bi, methodB))) { + return 0; + } + } + return 1; +} + + /* Cogit>>#minCogMethodAddress */ +sqInt +minCogMethodAddress(void) +{ + return methodZoneBase; +} + + /* Cogit>>#mnuOffset */ +sqInt +mnuOffset(void) +{ + return missOffset; +} + + /* Cogit>>#NegateR: */ +static AbstractInstruction * NoDbgRegParms +gNegateR(sqInt reg) +{ + return genoperand(NegateR, reg); +} + + /* Cogit>>#needsFrameIfImmutability: */ +static sqInt NoDbgRegParms +needsFrameIfImmutability(sqInt stackDelta) +{ + return IMMUTABILITY; +} + + /* Cogit>>#needsFrameIfInBlock: */ +static sqInt NoDbgRegParms +needsFrameIfInBlock(sqInt stackDelta) +{ + return inBlock > 0; +} + + /* Cogit>>#needsFrameNever: */ +static sqInt NoDbgRegParms +needsFrameNever(sqInt stackDelta) +{ + return 0; +} + + /* Cogit>>#noAssertMethodClassAssociationOf: */ +static sqInt NoDbgRegParms +noAssertMethodClassAssociationOf(sqInt methodPointer) +{ + return literalofMethod((literalCountOfMethodHeader(noAssertHeaderOf(methodPointer))) - 1, methodPointer); +} + + +/* Check that no method is maximally marked. A maximal mark is an indication + the method has been scanned to increase the usage count of its referent + methods. */ + + /* Cogit>>#noCogMethodsMaximallyMarked */ +static sqInt +noCogMethodsMaximallyMarked(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == CMMaxUsageCount)) { + return 0; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + +/* Answer if all targets in the PIC are in-use methods. */ + + /* Cogit>>#noTargetsFreeInClosedPIC: */ +static sqInt NoDbgRegParms +noTargetsFreeInClosedPIC(CogMethod *cPIC) +{ + return !(cPICHasFreedTargets(cPIC)); +} + + +/* Store the generated machine code, answering the last address */ + + /* Cogit>>#outputInstructionsAt: */ +static sqInt NoDbgRegParms +outputInstructionsAt(sqInt startAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt j; + + absoluteAddress = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + assert(((abstractInstruction->address)) == absoluteAddress); + /* begin outputMachineCodeAt: */ + for (j = 0; j < ((abstractInstruction->machineCodeSize)); j += 4) { + longAtput(absoluteAddress + j, ((abstractInstruction->machineCode))[j / 4]); + } + absoluteAddress += (abstractInstruction->machineCodeSize); + } + return absoluteAddress; +} + + +/* Output instructions generated for one of the generated run-time routines, + a trampoline, etc + */ + + /* Cogit>>#outputInstructionsForGeneratedRuntimeAt: */ +static sqInt NoDbgRegParms +outputInstructionsForGeneratedRuntimeAt(sqInt startAddress) +{ + sqInt endAddress; + sqInt size; + + computeMaximumSizes(); + (methodLabel->address = startAddress); + size = generateInstructionsAt(startAddress); + endAddress = outputInstructionsAt(startAddress); + assert((startAddress + size) == endAddress); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + return startAddress; +} + + /* Cogit>>#PopR: */ +static AbstractInstruction * NoDbgRegParms +gPopR(sqInt reg) +{ + return genoperand(PopR, reg); +} + + /* Cogit>>#PushCw: */ +static AbstractInstruction * NoDbgRegParms +gPushCw(sqInt wordConstant) +{ + /* begin gen:literal: */ + return checkLiteralforInstruction(wordConstant, genoperand(PushCw, wordConstant)); +} + + +/* Code entry closed PIC full or miss to an instance of a young class or to a + young target method. + Attempt to patch the send site to an open PIC. Answer if the attempt + succeeded; in fact it will + only return if the attempt failed. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#patchToOpenPICFor:numArgs:receiver: */ +sqInt +patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver) +{ + sqInt extent; + CogMethod *oPIC; + sqInt outerReturn; + + + /* See if an Open PIC is already available. */ + outerReturn = stackTop(); + oPIC = openPICWithSelector(selector); + if (!(oPIC)) { + + /* otherwise attempt to create an Open PIC. */ + oPIC = cogOpenPICSelectornumArgs(selector, numArgs); + if ((((((sqInt)oPIC)) >= MaxNegativeErrorCode) && ((((sqInt)oPIC)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. */ + if ((((sqInt)oPIC)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return 0; + } + } + extent = rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat(selector, mframeHomeMethodExport(), outerReturn), (((sqInt)oPIC)) + cmEntryOffset); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + flushICacheFromto(processor, ((usqInt)oPIC), (((usqInt)oPIC)) + openPICSize); + executeCogMethodfromLinkedSendWithReceiver(oPIC, receiver); + return 1; +} + + +/* This value is used to decide between MNU processing + or interpretation in the closed PIC aborts. */ + + /* Cogit>>#picAbortDiscriminatorValue */ +static sqInt +picAbortDiscriminatorValue(void) +{ + return 0; +} + + +/* Answer the start of the abort sequence for invoking the interpreter in a + closed PIC. + */ + + /* Cogit>>#picInterpretAbortOffset */ +static sqInt +picInterpretAbortOffset(void) +{ + return (interpretOffset()) - ((pushLinkRegisterByteSize(backEnd)) + (callInstructionByteSize(backEnd))); +} + + /* Cogit>>#previousInstruction */ +static AbstractInstruction * +previousInstruction(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#printCogMethodFor: */ +void +printCogMethodFor(void *address) +{ + CogMethod *cogMethod; + + cogMethod = methodFor(address); + if (cogMethod == 0) { + if ((codeEntryFor(address)) == null) { + print("not a method"); + cr(); + } + else { + print("trampoline "); + print(codeEntryNameFor(address)); + cr(); + } + } + else { + printCogMethod(cogMethod); + } +} + + /* Cogit>>#printPCMapPairsFor: */ +void +printPCMapPairsFor(CogMethod *cogMethod) +{ + unsigned char annotation; + usqInt map; + unsigned char mapByte; + usqInt mcpc; + sqInt value; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + /* begin mapStartFor: */ + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation == IsAnnotationExtension) { + value = (mapByte & DisplacementMask) + IsSendCall; + } + else { + value = annotation; + mcpc += 4 * ((annotation == IsDisplacementX2N + ? ((int)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + printHexnp(map); + print(": "); + printf("%02x", mapByte); + printChar(' '); + printNum(annotation); + print(" ("); + + switch (value) { + case IsDisplacementX2N: + print("IsDisplacementX2N"); + break; + case IsAnnotationExtension: + print("IsAnnotationExtension"); + break; + case IsObjectReference: + print("IsObjectReference"); + break; + case IsAbsPCReference: + print("IsAbsPCReference"); + break; + case HasBytecodePC: + print("HasBytecodePC"); + break; + case IsRelativeCall: + print("IsRelativeCall"); + break; + case IsSendCall: + print("IsSendCall"); + break; + case IsSuperSend: + print("IsSuperSend"); + break; + case IsDirectedSuperSend: + print("IsDirectedSuperSend"); + break; + default: + print("??? "); + printHexnp(value); + + } + + print(") "); + printHexnp(mapByte & DisplacementMask); + printChar(' '); + putchar('@'); + printHex(mcpc); + cr(); + flush(); + map -= 1; + } +} + + /* Cogit>>#printTrampolineTable */ +void +printTrampolineTable(void) +{ + sqInt i; + + for (i = 0; i < trampolineTableIndex; i += 2) { + printHex(((sqInt)(trampolineAddresses[i + 1]))); + print(": "); + print(((char *) (trampolineAddresses[i]))); + cr(); + } +} + + /* Cogit>>#processorHasDivQuoRemAndMClassIsSmallInteger */ +static sqInt +processorHasDivQuoRemAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#processorHasMultiplyAndMClassIsSmallInteger */ +static sqInt +processorHasMultiplyAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#recordGeneratedRunTime:address: */ +static void NoDbgRegParms +recordGeneratedRunTimeaddress(char *aString, sqInt address) +{ + trampolineAddresses[trampolineTableIndex] = aString; + trampolineAddresses[trampolineTableIndex + 1] = (((char *) address)); + trampolineTableIndex += 2; +} + + +/* This one for C support code. */ + + /* Cogit>>#recordPrimTraceFunc */ +sqInt +recordPrimTraceFunc(void) +{ + return recordPrimTrace(); +} + + /* Cogit>>#recordRunTimeObjectReferences */ +static void +recordRunTimeObjectReferences(void) +{ + sqInt i; + AbstractInstruction *instruction; + + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + if (((instruction->annotation)) == IsObjectReference) { + assert(runtimeObjectRefIndex < NumObjRefsInRuntime); + assert(!hasYoungReferent); + if (hasYoungReferent) { + error("attempt to generate run-time routine containing young object reference. Cannot initialize Cogit run-time."); + } + objectReferencesInRuntime[runtimeObjectRefIndex] = (((usqInt)((((instruction->opcode)) == Literal + ? (instruction->address) + : ((instruction->address)) + ((instruction->machineCodeSize)))))); + runtimeObjectRefIndex += 1; + } + } +} + + /* Cogit>>#registerMaskFor: */ +static sqInt NoDbgRegParms +registerMaskFor(sqInt reg) +{ + return 1U << reg; +} + + /* Cogit>>#relocateCallsAndSelfReferencesInMethod: */ +static void NoDbgRegParms +relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) +{ + sqInt annotation; + sqLong callDelta; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqLong refDelta; + sqInt result; + + refDelta = (cogMethod->objectHeader); + callDelta = refDelta; + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cogMethod)) + missOffset)) == ((((cogMethod->cmType)) == CMMethod + ? methodAbortTrampolineFor((cogMethod->cmNumArgs)) + : picAbortTrampolineFor((cogMethod->cmNumArgs))))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cogMethod)) + missOffset, -callDelta); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#relocateCallsInClosedPIC: */ +static void NoDbgRegParms +relocateCallsInClosedPIC(CogMethod *cPIC) +{ + sqLong callDelta; + sqInt entryPoint; + sqInt i; + sqInt pc; + sqLong refDelta; + CogMethod *targetMethod; + + refDelta = (cPIC->objectHeader); + callDelta = refDelta; + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cPIC)) + missOffset)) == (picAbortTrampolineFor((cPIC->cmNumArgs)))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cPIC)) + missOffset, -callDelta); + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + + /* Interpret/MNU */ + } + else { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert(((targetMethod->cmType)) == CMMethod); + if (i == 1) { + relocateJumpLongBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + else { + relocateJumpLongConditionalBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + } + } + assert(((cPIC->cPICNumCases)) > 0); + relocateMethodReferenceBeforeAddressby(backEnd, (addressOfEndOfCaseinCPIC(2, cPIC)) + (loadPICLiteralByteSize(backEnd)), refDelta); + relocateJumpLongBeforeFollowingAddressby(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, -callDelta); +} + + /* Cogit>>#relocateIfCallOrMethodReference:mcpc:delta: */ +static sqInt NoDbgRegParms +relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta) +{ + sqInt callDelta; + sqInt entryPoint; + sqInt offset; + sqInt offset1; + sqInt sendTable; + sqInt *sendTable1; + CogMethod *targetMethod; + sqInt unlinkedRoutine; + + callDelta = refDelta; + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + + /* send is not linked; just relocate */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable1 = superSendTrampolines; + + + } + } + targetMethod = ((CogMethod *) (entryPoint - offset1)); + if (((targetMethod->cmType)) != CMFree) { + + /* send target not freed; just relocate. */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -(callDelta - ((targetMethod->objectHeader)))); + + /* See comment in planCompaction */ + restorePICUsageCount(targetMethod); + + return 0; + } + unlinkedRoutine = sendTable1[((((targetMethod->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod->cmNumArgs)) : (NumSendTrampolines - 1))]; + unlinkedRoutine -= callDelta; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + return 0; + + } + if (annotation == IsRelativeCall) { + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + if (annotation == IsAbsPCReference) { + relocateMethodReferenceBeforeAddressby(backEnd, ((sqInt)mcpc), refDelta); + } + return 0; +} + + /* Cogit>>#remapIfObjectRef:pc:hasYoung: */ +static sqInt NoDbgRegParms +remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt callSiteReturnAddress; + sqInt entryPoint; + sqInt entryPoint1; + sqInt ignored; + sqInt literal; + sqInt mappedCacheTag; + sqInt mappedLiteral; + sqInt *sendTable; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod *targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = longAt(((usqInt)mcpc)); + if (couldBeObject(literal)) { + mappedLiteral = remapObject(literal); + if (literal != mappedLiteral) { + /* begin storeLiteral:atAnnotatedAddress:using: */ + longAtput(((usqInt)mcpc), mappedLiteral); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedLiteral))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8)))); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1 + && (couldBeObject(cacheTag1))) { + mappedCacheTag = remapObject(cacheTag1); + if (cacheTag1 != mappedCacheTag) { + /* begin rewriteInlineCacheTag:at: */ + callSiteReturnAddress = ((usqInt)mcpc); + longAtput(pcRelativeAddressAt(((AbstractInstruction *) backEnd), callSiteReturnAddress - 8), mappedCacheTag); + ((AbstractInstruction *) backEnd); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedCacheTag))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + if (hasYoungPtr != 0) { + + /* Since the unlinking routines may rewrite the cacheTag to the send's selector, and + since they don't have the cogMethod to hand and can't add it to youngReferrers, + the method must remain in youngReferrers if the targetMethod's selector is young. */ + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = superSendTrampolines; + + + } + } + if (isYoung((targetMethod1->selector))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + + } + } + + } + return 0; +} + + +/* Remap a potential object reference from a closed PIC. + This may be an object reference, an inline cache tag or null. + Answer if the updated literal is young. + mcpc is the address of the next instruction following either + the load of the method literal or the compare of the class tag. */ + + /* Cogit>>#remapMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +remapMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + subject = remapOop(object); + if (object != subject) { + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + } + return isYoungObject(subject); +} + + +/* Rewrite the three values involved in a CPIC case. Used by the initialize & + extend CPICs. + c.f. expectedClosedPICPrototype: */ +/* write the obj ref/operand via the second ldr */ + + /* Cogit>>#rewriteCPICCaseAt:tag:objRef:target: */ +static void NoDbgRegParms +rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget) +{ + sqInt classTagPC; + sqInt methodObjPC; + + methodObjPC = (followingAddress - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + storeLiteralbeforeFollowingAddress(backEnd, newObjRef, methodObjPC); + + /* rewite the tag via the first ldr */ + classTagPC = followingAddress - (jumpLongConditionalByteSize(backEnd)); + /* begin storeLiteral32:beforeFollowingAddress: */ + storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), newTag, classTagPC); + + ((AbstractInstruction *) backEnd); + rewriteConditionalJumpLongAttarget(backEnd, followingAddress, newTarget); +} + + /* Cogit>>#SubCw:R: */ +static AbstractInstruction * NoDbgRegParms +gSubCwR(sqInt wordConstant, sqInt reg) +{ + /* begin gen:literal:operand: */ + return checkLiteralforInstruction(wordConstant, genoperandoperand(SubCwR, wordConstant, reg)); +} + + +/* Answer the number of clean blocks found in the literal frame */ + + /* Cogit>>#scanForCleanBlocks */ +static sqInt +scanForCleanBlocks(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt numCleanBlocks; + sqInt startPCOrNil; + + numCleanBlocks = 0; + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + numCleanBlocks += 1; + } + } + return numCleanBlocks; +} + + /* Cogit>>#setBreakMethod: */ +void +setBreakMethod(sqInt anObj) +{ + breakMethod = anObj; +} + + /* Cogit>>#setPostCompileHook: */ +void +setPostCompileHook(void (*aFunction)(CogMethod *)) +{ + postCompileHook = aFunction; +} + + +/* If a method is compiled to machine code via a block entry it won't have a + selector. A subsequent send can find the method and hence fill in the + selector. + */ +/* self disassembleMethod: cogMethod */ + + /* Cogit>>#setSelectorOf:to: */ +void +setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop) +{ + compilationBreakpointisMNUCase(aSelectorOop, numBytesOf(aSelectorOop), 0); + assert(((cogMethod->cmType)) == CMMethod); + (cogMethod->selector = aSelectorOop); + if (isYoung(aSelectorOop)) { + ensureInYoungReferrers(cogMethod); + } +} + + /* Cogit>>#spanForCleanBlockStartingAt: */ +static sqInt NoDbgRegParms +spanForCleanBlockStartingAt(sqInt startPC) +{ + BytecodeDescriptor *descriptor; + usqInt end; + sqInt pc; + + pc = startPC; + end = numBytesOf(methodObj); + while (pc <= end) { + descriptor = generatorAt((fetchByteofObject(pc, methodObj)) + bytecodeSetOffset); + pc += (descriptor->numBytes); + if ((descriptor->isReturn)) { + return pc - startPC; + } + } + error("couldn't locate end of clean block"); + return 0; +} + + +/* Answer a fake value for the method oop in other than the first case in the + PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. + */ + + /* Cogit>>#subsequentPrototypeMethodOop */ +static sqInt +subsequentPrototypeMethodOop(void) +{ + return (((((usqInt)195929424)) >= ((methodLabel->address))) + && ((((usqInt)195929424)) < (youngReferrers())) + ? 233496237 + : 195929424); +} + + /* Cogit>>#traceLinkedSendOffset */ +sqInt +traceLinkedSendOffset(void) +{ + return (cmNoCheckEntryOffset + (callInstructionByteSize(backEnd))) + (pushLinkRegisterByteSize(backEnd)); +} + + +/* Encode true and false and 0 to N such that they can't be confused for + register numbers (including NoReg) + and can be tested for by isTrampolineArgConstant: and decoded by + trampolineArgValue: + */ + + /* Cogit>>#trampolineArgConstant: */ +static sqInt NoDbgRegParms +trampolineArgConstant(sqInt booleanOrInteger) +{ + assert(booleanOrInteger >= 0); + return -2 - booleanOrInteger; +} + + /* Cogit>>#trampolineName:numArgs: */ +static char * NoDbgRegParms +trampolineNamenumArgs(char *routinePrefix, sqInt numArgs) +{ + char *theString; + + /* begin trampolineName:numArgs:limit: */ + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= (NumSendTrampolines - 2) + ? '0' + numArgs + : 'N')); + return theString; +} + + +/* Malloc a string with the contents for the trampoline table */ + + /* Cogit>>#trampolineName:numArgs:limit: */ +static char * NoDbgRegParms +trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit) +{ + char *theString; + + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#trampolineName:numRegArgs: */ +static char * NoDbgRegParms +trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs) +{ + sqInt argsLimit; + char *theString; + + /* begin trampolineName:numArgs:limit: */ + argsLimit = 2; + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#unknownBytecode */ +static sqInt +unknownBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* Unlink all sends in cog methods. */ + + /* Cogit>>#unlinkAllSends */ +void +unlinkAllSends(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) != CMFree) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); +} + + /* Cogit>>#unlinkIfFreeOrLinkedSend:pc:of: */ +static sqInt NoDbgRegParms +unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((targetMethod1->cmType)) == CMFree) + || (((targetMethod1->selector)) == theSelector)) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfInvalidClassSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send, but maybe a super send or linked to an OpenPIC, in which case the cache tag will be a selector.... */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) + || (((targetMethod1->cmType)) == CMOpenPIC))) { + if (!(isValidClassTag(longAt(pcRelativeAddressAt(backEnd, ((usqInt)((((sqInt)mcpc)) - 8))))))) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSendToFree:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmType)) == CMFree) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:to: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((sqInt)targetMethod1)) == theCogMethod) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + +/* Unlink all sends in cog methods whose class tag is that of a forwarded + class. + */ + + /* Cogit>>#unlinkSendsLinkedForInvalidClasses */ +void +unlinkSendsLinkedForInvalidClasses(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + codeModified = (freedPIC = 0); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasForwardedClass(cogMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + +/* Unlink all sends in cog methods. Free all Closed PICs with the selector, + or with an MNU case if isMNUSelector. First check if any method actually + has the selector; if not there can't be any linked send to it. This + routine (including descendents) is performance critical. It contributes + perhaps 30% of entire execution time in Compiler recompileAll. */ + + /* Cogit>>#unlinkSendsOf:isMNUSelector: */ +void +unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt mustScanAndUnlink; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + mustScanAndUnlink = 0; + if (isMNUSelector) { + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) + && (((cogMethod->cmType)) == CMClosedPIC)) { + assert(((cogMethod->cmType)) == CMClosedPIC); + freeMethod(cogMethod); + mustScanAndUnlink = 1; + } + else { + if (((cogMethod->selector)) == selector) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + else { + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selector)) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + if (!mustScanAndUnlink) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to free methods and/or pics. */ + + /* Cogit>>#unlinkSendsToFree */ +void +unlinkSendsToFree(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(noTargetsFreeInClosedPIC(cogMethod)); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to a particular target method. + If targetMethodObject isn't actually a method (perhaps being + used via invokeAsMethod) then there's nothing to do. */ + + /* Cogit>>#unlinkSendsTo:andFreeIf: */ +void +unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + CogMethod *targetMethod; + + if (!((isOopCompiledMethod(targetMethodObject)) + && (methodHasCogMethod(targetMethodObject)))) { + return; + } + targetMethod = cogMethodOf(targetMethodObject); + if (!(methodZoneBase)) { + return; + } + codeModified = (freedPIC = 0); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasTarget(cogMethod, targetMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freeIfTrue) { + freeMethod(targetMethod); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + /* Cogit>>#XorCw:R: */ +static AbstractInstruction * NoDbgRegParms +gXorCwR(sqInt wordConstant, sqInt reg) +{ + /* begin gen:literal:operand: */ + return checkLiteralforInstruction(wordConstant, genoperandoperand(XorCwR, wordConstant, reg)); +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ +/* Eliminate stale dependent info. */ + + /* Cogit>>#zeroOpcodeIndex */ +static void +zeroOpcodeIndex(void) +{ + sqInt i; + + for (i = 0; i < opcodeIndex; i += 1) { + ((abstractOpcodes[i]).dependent = null); + } + zeroOpcodeIndexForNewOpcodes(); +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ + + /* Cogit>>#zeroOpcodeIndexForNewOpcodes */ +static void +zeroOpcodeIndexForNewOpcodes(void) +{ + opcodeIndex = 0; + /* begin resetLiterals */ + + /* an impossibly high value */ + firstOpcodeIndex = 1U << 16; + nextLiteralIndex = (lastDumpedLiteralIndex = 0); +} + + /* CogMethodZone>>#addAllToYoungReferrers */ +void +addAllToYoungReferrers(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + ensureInYoungReferrers(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#addToOpenPICList: */ +static void NoDbgRegParms +addToOpenPICList(CogMethod *anOpenPIC) +{ + assert(((anOpenPIC->cmType)) == CMOpenPIC); + assert((openPICList == null) + || (((openPICList->cmType)) == CMOpenPIC)); + (anOpenPIC->nextOpenPIC = ((usqInt)openPICList)); + openPICList = anOpenPIC; +} + + /* CogMethodZone>>#addToYoungReferrers: */ +static void NoDbgRegParms +addToYoungReferrers(CogMethod *cogMethod) +{ + assert(youngReferrers <= limitAddress); + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + assert((cogMethod->cmRefersToYoung)); + assert((youngReferrers <= limitAddress) + && (youngReferrers >= (limitAddress - (methodCount * BytesPerWord)))); + if (!(asserta((limitAddress - (methodCount * BytesPerWord)) >= mzFreeStart))) { + error("no room on youngReferrers list"); + } + youngReferrers -= BytesPerWord; + longAtput(youngReferrers, ((usqInt)cogMethod)); +} + + /* CogMethodZone>>#allocate: */ +static sqInt NoDbgRegParms +allocate(sqInt numBytes) +{ + usqInt allocation; + sqInt roundedBytes; + + roundedBytes = (numBytes + 7) & -8; + if ((mzFreeStart + roundedBytes) >= (limitAddress - (methodCount * BytesPerWord))) { + return 0; + } + allocation = mzFreeStart; + mzFreeStart += roundedBytes; + methodCount += 1; + return allocation; +} + + +/* Free all methods */ + + /* CogMethodZone>>#clearCogCompiledCode */ +static void +clearCogCompiledCode(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMMethod) { + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + manageFromto(baseAddress, limitAddress); +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#clearSavedPICUsageCount: */ +static void NoDbgRegParms +clearSavedPICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = 0); + } +} + + /* CogMethodZone>>#compactCompiledCode */ +static void +compactCompiledCode(void) +{ + unsigned short bytes; + CogMethod *dest; + sqLong objectHeaderValue; + CogMethod *source; + + objectHeaderValue = nullHeaderForMachineCodeMethod(); + source = ((CogMethod *) baseAddress); + openPICList = null; + methodCount = 0; + while ((source < (limitZony())) + && (((source->cmType)) != CMFree)) { + assert((cogMethodDoesntLookKosher(source)) == 0); + (source->objectHeader = objectHeaderValue); + if (((source->cmUsageCount)) > 0) { + (source->cmUsageCount = ((source->cmUsageCount)) / 2); + } + clearSavedPICUsageCount(source); + + if (((source->cmType)) == CMOpenPIC) { + (source->nextOpenPIC = ((usqInt)openPICList)); + openPICList = source; + } + methodCount += 1; + source = ((CogMethod *) (roundUpLength((((sqInt)source)) + ((source->blockSize))))); + } + if (source >= (limitZony())) { + haltmsg("no free methods; cannot compact."); + return; + } + dest = source; + while (source < (limitZony())) { + assert((maybeFreeCogMethodDoesntLookKosher(source)) == 0); + bytes = (source->blockSize); + if (((source->cmType)) != CMFree) { + methodCount += 1; + memmove(dest, source, bytes); + (dest->objectHeader = objectHeaderValue); + if (((dest->cmType)) == CMMethod) { + + /* For non-Newspeak there should be a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only update the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((dest->methodObject))))) == (((sqInt)source))) { + rawHeaderOfput((dest->methodObject), ((sqInt)dest)); + } + else { + assert((noAssertMethodClassAssociationOf((dest->methodObject))) == (nilObject())); + } + } + else { + clearSavedPICUsageCount(dest); + + if (((dest->cmType)) == CMOpenPIC) { + (dest->nextOpenPIC = ((usqInt)openPICList)); + openPICList = dest; + } + } + if (((dest->cmUsageCount)) > 0) { + (dest->cmUsageCount = ((dest->cmUsageCount)) / 2); + } + dest = ((CogMethod *) ((((usqInt)dest)) + bytes)); + } + source = ((CogMethod *) ((((usqInt)source)) + bytes)); + } + mzFreeStart = ((usqInt)dest); + methodBytesFreedSinceLastCompaction = 0; +} + + /* CogMethodZone>>#ensureInYoungReferrers: */ +static void NoDbgRegParms +ensureInYoungReferrers(CogMethod *cogMethod) +{ + if (!((cogMethod->cmRefersToYoung))) { + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + (cogMethod->cmRefersToYoung = 1); + addToYoungReferrers(cogMethod); + } +} + + /* CogMethodZone>>#followForwardedLiteralsInOpenPICList */ +static void +followForwardedLiteralsInOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (openPIC != null) { + followForwardedLiteralsIn(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#freeMethod: */ +void +freeMethod(CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) != CMFree); + assert(((cogMethodDoesntLookKosher(cogMethod)) == 0) + || (((cogMethodDoesntLookKosher(cogMethod)) == 23) + && ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) == CMFree))); + if (((cogMethod->cmType)) == CMMethod) { + + /* For non-Newspeak there should ne a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only reset the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((cogMethod->methodObject))))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + } + } + if (((cogMethod->cmType)) == CMOpenPIC) { + removeFromOpenPICList(cogMethod); + } + (cogMethod->cmRefersToYoung = 0); + (cogMethod->cmType = CMFree); + methodBytesFreedSinceLastCompaction += (cogMethod->blockSize); +} + + +/* Free methods, preferring older methods for compaction, up to some + fraction, currently a quarter. + */ + + /* CogMethodZone>>#freeOlderMethodsForCompaction */ +static void +freeOlderMethodsForCompaction(void) +{ + usqInt amountToFree; + CogMethod *cogMethod; + sqInt freeableUsage; + usqInt freedSoFar; + usqInt initialFreeSpace; + usqInt zoneSize; + + zoneSize = limitAddress - baseAddress; + initialFreeSpace = (limitAddress - mzFreeStart) + methodBytesFreedSinceLastCompaction; + freedSoFar = initialFreeSpace; + + /* 4 needs to be e.g. a start-up parameter */ + amountToFree = zoneSize / 4; + freeableUsage = 0; + do { + cogMethod = ((CogMethod *) baseAddress); + while (((((usqInt)cogMethod)) < mzFreeStart) + && (freedSoFar < amountToFree)) { + if ((((cogMethod->cmType)) == CMMethod + ? ((cogMethod->cmUsageCount)) <= freeableUsage + : (((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == 0))) { + freeMethod(cogMethod); + freedSoFar += (cogMethod->blockSize); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } while((freedSoFar < amountToFree) + && (((freeableUsage += 1)) < CMMaxUsageCount)); +} + + +/* Answer that all entries in youngReferrers are in-use and have the + cmRefersToYoung flag set. + Used to check that the youngreferrers pruning routines work correctly. */ + + /* CogMethodZone>>#kosherYoungReferrers */ +static sqInt +kosherYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + if ((youngReferrers > limitAddress) + || (youngReferrers < mzFreeStart)) { + return 0; + } + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung)))) { + return 0; + } + pointer += BytesPerWord; + } + return 1; +} + + /* CogMethodZone>>#manageFrom:to: */ +static void NoDbgRegParms +manageFromto(sqInt theStartAddress, sqInt theLimitAddress) +{ + mzFreeStart = (baseAddress = theStartAddress); + youngReferrers = (limitAddress = theLimitAddress); + openPICList = null; + methodBytesFreedSinceLastCompaction = 0; + methodCount = 0; +} + + /* CogMethodZone>>#methodFor: */ +CogMethod * +methodFor(void *address) +{ + CogMethod *cogMethod; + CogMethod *nextMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((cogMethod < (limitZony())) + && ((((usqInt)cogMethod)) <= (((usqInt)address)))) { + /* begin methodAfter: */ + nextMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + if (nextMethod == cogMethod) { + return 0; + } + if (((((usqInt)address)) >= (((usqInt)cogMethod))) + && ((((usqInt)address)) < (((usqInt)nextMethod)))) { + return cogMethod; + } + cogMethod = nextMethod; + } + return 0; +} + + /* CogMethodZone>>#methodsCompiledToMachineCodeInto: */ +sqInt +methodsCompiledToMachineCodeInto(sqInt arrayObj) +{ + CogMethod *cogMethod; + sqInt methodIndex; + + methodIndex = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + storePointerUncheckedofObjectwithValue(methodIndex, arrayObj, (cogMethod->methodObject)); + methodIndex += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return methodIndex; +} + + /* CogMethodZone>>#numMethods */ +sqInt +numMethods(void) +{ + return methodCount; +} + + /* CogMethodZone>>#numMethodsOfType: */ +sqInt +numMethodsOfType(sqInt cogMethodType) +{ + CogMethod *cogMethod; + sqInt n; + + n = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cogMethodType) { + n += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return n; +} + + /* CogMethodZone>>#occurrencesInYoungReferrers: */ +static sqInt NoDbgRegParms +occurrencesInYoungReferrers(CogMethod *cogMethod) +{ + sqInt count; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + count = 0; + pointer = youngReferrers; + while (pointer < limitAddress) { + if ((((sqInt)cogMethod)) == (longAt(pointer))) { + count += 1; + } + pointer += BytesPerWord; + } + return count; +} + + /* CogMethodZone>>#openPICWithSelector: */ +static CogMethod * NoDbgRegParms +openPICWithSelector(sqInt aSelector) +{ + CogMethod *openPIC; + + openPIC = openPICList; + do { + if ((openPIC == null) + || (((openPIC->selector)) == aSelector)) { + return openPIC; + } + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* Some methods have been freed. Compute how much each survivor needs to + move during the ensuing compaction and record it in the objectHeader + field. + For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#planCompaction */ +static void +planCompaction(void) +{ + CogMethod *cogMethod; + sqInt delta; + + delta = 0; + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMFree) { + delta -= (cogMethod->blockSize); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->objectHeader = delta); + savePICUsageCount(cogMethod); + + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethods */ +void +printCogMethods(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + printCogMethod(cogMethod); + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsOfType: */ +void +printCogMethodsOfType(sqInt cmType) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cmType) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithMethod: */ +void +printCogMethodsWithMethod(sqInt methodOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->methodObject)) == methodOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithPrimitive: */ +void +printCogMethodsWithPrimitive(sqInt primIdx) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (primIdx == (primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader))))) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithSelector: */ +void +printCogMethodsWithSelector(sqInt selectorOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selectorOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogYoungReferrers */ +void +printCogYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((cogMethod->cmRefersToYoung))) { + print("*"); + } + if (((cogMethod->cmType)) == CMFree) { + print("!"); + } + if (!(((cogMethod->cmRefersToYoung)) + && (((cogMethod->cmType)) != CMFree))) { + print(" "); + } + printCogMethod(cogMethod); + pointer += BytesPerWord; + } +} + + /* CogMethodZone>>#printOpenPICList */ +void +printOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (!(openPIC == null)) { + printCogMethod(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#pruneYoungReferrers */ +static sqInt +pruneYoungReferrers(void) +{ + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((CogMethod *) (longAt(next))))->cmRefersToYoung)))) break; + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + if (((((CogMethod *) (longAt(source))))->cmRefersToYoung)) { + assert(source < (dest - BytesPerWord)); + longAtput((dest -= BytesPerWord), longAt(source)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + assert(kosherYoungReferrers()); + return 0; +} + + /* CogMethodZone>>#relocateAndPruneYoungReferrers */ +static sqInt +relocateAndPruneYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((cogMethod = ((CogMethod *) (longAt(next))))->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))))) break; + if (((cogMethod->objectHeader)) != 0) { + longAtput(next, (((sqInt)cogMethod)) + ((cogMethod->objectHeader))); + } + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + cogMethod = ((CogMethod *) (longAt(source))); + if ((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))) { + assert(source < (dest - BytesPerWord)); + if (((cogMethod->objectHeader)) != 0) { + cogMethod = ((CogMethod *) ((((sqInt)cogMethod)) + (((sqInt)((cogMethod->objectHeader)))))); + } + longAtput((dest -= BytesPerWord), ((sqInt)cogMethod)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + return 0; +} + + +/* All surviving methods have had the amount they are going to relocate by + stored in their objectHeader fields. Relocate all relative calls so that + after the compaction of both the method containing each call and the call + target the calls invoke the same target. */ + + /* CogMethodZone>>#relocateMethodsPreCompaction */ +static sqInt +relocateMethodsPreCompaction(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cmType)) == CMClosedPIC) { + relocateCallsInClosedPIC(cogMethod); + } + else { + relocateCallsAndSelfReferencesInMethod(cogMethod); + } + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + relocateAndPruneYoungReferrers(); + return 1; +} + + /* CogMethodZone>>#removeFromOpenPICList: */ +static sqInt NoDbgRegParms +removeFromOpenPICList(CogMethod *anOpenPIC) +{ + CogMethod *prevPIC; + + assert(((anOpenPIC->cmType)) == CMOpenPIC); + if (anOpenPIC == openPICList) { + + /* N.B. Use self rather than coInterpreter to avoid attempting to cast nil. + Conversion to CogMethod done in the nextOpenPIC accessor. */ + openPICList = ((CogMethod *) ((anOpenPIC->nextOpenPIC))); + return null; + } + prevPIC = openPICList; + do { + assert((prevPIC != null) + && (((prevPIC->cmType)) == CMOpenPIC)); + if (((prevPIC->nextOpenPIC)) == (((sqInt)anOpenPIC))) { + (prevPIC->nextOpenPIC = (anOpenPIC->nextOpenPIC)); + return null; + } + prevPIC = ((CogMethod *) ((prevPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#restorePICUsageCount: */ +static void NoDbgRegParms +restorePICUsageCount(CogMethod *cogMethod) +{ + if ((((cogMethod->cmType)) == CMClosedPIC) + && (((cogMethod->blockEntryOffset)) != 0)) { + (cogMethod->cmUsageCount = (cogMethod->blockEntryOffset)); + (cogMethod->blockEntryOffset = 0); + } +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#savePICUsageCount: */ +static void NoDbgRegParms +savePICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = (cogMethod->cmUsageCount)); + (cogMethod->cmUsageCount = 0); + } +} + + /* CogMethodZone>>#voidYoungReferrersPostTenureAll */ +static void +voidYoungReferrersPostTenureAll(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) != CMFree) { + (cogMethod->cmRefersToYoung = 0); + } + pointer += BytesPerWord; + } + youngReferrers = limitAddress; +} + + /* CogMethodZone>>#whereIsMaybeCodeThing: */ +char * +whereIsMaybeCodeThing(sqInt anOop) +{ + if (oopisGreaterThanOrEqualToandLessThan(anOop, codeBase, limitAddress)) { + if (oopisLessThan(anOop, methodZoneBase)) { + return " is in generated runtime"; + } + if (oopisLessThan(anOop, mzFreeStart)) { + return " is in generated methods"; + } + if (oopisLessThan(anOop, youngReferrers)) { + return " is in code zone"; + } + return " is in young referrers"; + } + return null; +} + + /* CogObjectRepresentation>>#checkValidObjectReference: */ +static sqInt NoDbgRegParms +checkValidObjectReference(sqInt anOop) +{ + return (!(isImmediate(anOop))) + && ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentation>>#genCmpClassFloatCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassFloatCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassFloatCompactIndex, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(ClassFloatCompactIndex)); + } + return anInstruction; +} + + /* CogObjectRepresentation>>#genCmpClassMethodContextCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassMethodContextCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(ClassMethodContextCompactIndex)); + } + return anInstruction; +} + + /* CogObjectRepresentation>>#genDoubleArithmetic:preOpCheck: */ +static sqInt NoDbgRegParms +genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)) +{ + AbstractInstruction *doOp; + AbstractInstruction *jumpFailAlloc; + AbstractInstruction *jumpFailCheck; + AbstractInstruction *jumpFailClass; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpNonInt; + + + /* inline processorHasDoublePrecisionFloatingPointSupport */ + /* begin hasDoublePrecisionFloatingPointSupport */ +; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + jumpImmediate = genJumpImmediate(Arg0Reg); + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFailClass = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + /* begin Label */ + doOp = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (!(preOpCheckOrNil == null)) { + jumpFailCheck = preOpCheckOrNil(DPFPReg0, DPFPReg1); + } + genoperandoperand(arithmeticOperator, DPFPReg1, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImmediate, gLabel()); + maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(Arg0Reg, TempReg, DPFPReg1, doOp); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonInt = genJumpNotSmallInteger(Arg0Reg); + + genConvertSmallIntegerToIntegerInReg(ClassReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, ClassReg, DPFPReg1); + /* begin Jump: */ + genoperand(Jump, ((sqInt)doOp)); + jmpTarget(jumpFailAlloc, jmpTarget(jumpFailClass, gLabel())); + jmpTarget(jumpNonInt, getJmpTarget(jumpFailClass)); + + if (!(preOpCheckOrNil == null)) { + jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); + } + return 0; +} + + /* CogObjectRepresentation>>#genDoubleComparison:invert: */ +static sqInt NoDbgRegParms +genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *compare; + sqInt constant; + AbstractInstruction *jumpCond; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpNonInt; + + + /* inline processorHasDoublePrecisionFloatingPointSupport */ + /* begin hasDoublePrecisionFloatingPointSupport */ +; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + jumpImmediate = genJumpImmediate(Arg0Reg); + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + if (invertComparison) { + + /* May need to invert for NaNs */ + /* begin CmpRd:Rd: */ + compare = genoperandoperand(CmpRdRd, DPFPReg0, DPFPReg1); + } + else { + /* begin CmpRd:Rd: */ + compare = genoperandoperand(CmpRdRd, DPFPReg1, DPFPReg0); + } + + /* FP jumps are a little weird */ + jumpCond = jumpOpcodeGenerator(0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImmediate, gLabel()); + maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(Arg0Reg, TempReg, DPFPReg1, compare); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonInt = genJumpNotSmallInteger(Arg0Reg); + + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, Arg0Reg, DPFPReg1); + /* begin Jump: */ + genoperand(Jump, ((sqInt)compare)); + jmpTarget(jumpFail, gLabel()); + jmpTarget(jumpNonInt, getJmpTarget(jumpFail)); + + return CompletePrimitive; +} + + +/* Get the method header (first word) of a CompiledMethod into headerReg. + Deal with the method possibly being cogged. */ + + /* CogObjectRepresentation>>#genGetMethodHeaderOf:into:scratch: */ +static sqInt NoDbgRegParms +genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpNotCogged; + sqInt offset; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, methodReg, headerReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin genJumpSmallInteger:scratchReg: */ + jumpNotCogged = genJumpSmallInteger(headerReg); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodHeader); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, headerReg, headerReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + jmpTarget(jumpNotCogged, gLabel()); + return 0; +} + + +/* TODO: Optimize this one avoiding the trampoline */ + + /* CogObjectRepresentation>>#genLcByteSizeOf:to: */ +static void NoDbgRegParms +genLcByteSizeOfto(sqInt oop, sqInt resultRegister) +{ + AbstractInstruction *abstractInstruction; + + if (oop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, oop, Arg0Reg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceByteSizeOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, resultRegister); + ssPushNativeRegister(resultRegister); +} + + /* CogObjectRepresentation>>#genLcFloat32:toOop: */ +static void NoDbgRegParms +genLcFloat32toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, value, DPFPReg0); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcFloat64:toOop: */ +static void NoDbgRegParms +genLcFloat64toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + if (value != DPFPReg0) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, DPFPReg0); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop: */ +static void NoDbgRegParms +genLcInstantiateOop(sqInt classOop) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:constantIndexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + if (classOop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, indexableSize, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(indexableSize)); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:indexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != Arg0Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + if (indexableSize != Arg1Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg1Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, Arg1Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInt64ToOop: */ +static void NoDbgRegParms +genLcInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOopToInt64: */ +static void NoDbgRegParms +genLcOopToInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + +/* Assume this is always correct */ + + /* CogObjectRepresentation>>#genLcOopToPointer: */ +static void NoDbgRegParms +genLcOopToPointer(sqInt object) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, object, object); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BaseHeaderSize)); + } + ssPushNativeRegister(object); +} + + /* CogObjectRepresentation>>#genLcOopToUInt64: */ +static void NoDbgRegParms +genLcOopToUInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat32: */ +static void NoDbgRegParms +genLcOoptoFloat32(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, DPFPReg0, value); + ssPushNativeRegisterSingleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat64: */ +static void NoDbgRegParms +genLcOoptoFloat64(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (DPFPReg0 != value) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, DPFPReg0, value); + } + ssPushNativeRegisterDoubleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcOop:toUInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcPointerToOop:class: */ +static void NoDbgRegParms +genLcPointerToOopclass(sqInt pointer, sqInt pointerClass) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin PushR: */ + genoperand(PushR, pointer); + annotateobjRef(gMoveCwR(pointerClass, Arg0Reg), pointerClass); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, BytesPerOop, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BytesPerOop)); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin PopR: */ + genoperand(PopR, pointer); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, pointer, BaseHeaderSize, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushRegister(pointer); +} + + /* CogObjectRepresentation>>#genLcUInt64ToOop: */ +static void NoDbgRegParms +genLcUInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcUInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLoadSlot:sourceReg:destReg: */ +static sqInt NoDbgRegParms +genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveAdd */ +static sqInt +genPrimitiveAdd(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, ReceiverResultReg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveAsFloat */ +static sqInt +genPrimitiveAsFloat(void) +{ + AbstractInstruction *jumpFailAlloc; + + + /* inline processorHasDoublePrecisionFloatingPointSupport */ + /* begin hasDoublePrecisionFloatingPointSupport */ +; + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, TempReg, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFailAlloc, gLabel()); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveBitAnd */ +static sqInt +genPrimitiveBitAnd(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitOr */ +static sqInt +genPrimitiveBitOr(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + +/* rTemp := rArg0 + rClass := tTemp + rTemp := rTemp & 1 + jz nonInt + rClass >>= 1 + cmp 0,rClass + jge neg + cmp 31,rClass // numSmallIntegerBits, jge for sign + jge tooBig + rTemp := rReceiver + rTemp <<= rClass + rTemp >>= rClass (arithmetic) + cmp rTemp,rReceiver + jnz ovfl + rReceiver := rReceiver - 1 + rReceiver := rReceiver <<= rClass + rReceiver := rReceiver + 1 + ret + neg: + rClass := 0 - rClass + cmp 31,rClass // numSmallIntegerBits + jge inRange + rClass := 31 + inRange + rReceiver := rReceiver >>= rClass. + rReceiver := rReceiver | smallIntegerTags. + ret + ovfl + tooBig + nonInt: + fail + */ + + /* CogObjectRepresentation>>#genPrimitiveBitShift */ +static sqInt +genPrimitiveBitShift(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpInRange; + AbstractInstruction *jumpNegative; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + AbstractInstruction *jumpTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + } + /* begin JumpNegative: */ + jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpGreaterOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, TempReg); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, ClassReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, ReceiverResultReg); + /* begin JumpNonZero: */ + jumpOvfl = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, ReceiverResultReg); + genAddSmallIntegerTagsTo(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNegative, gNegateR(ClassReg)); + /* begin CmpCq:R: */ + quickConstant2 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpLessOrEqual: */ + jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + quickConstant = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); + genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, jmpTarget(jumpTooBig, jmpTarget(jumpOvfl, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitXor */ +static sqInt +genPrimitiveBitXor(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin XorR:R: */ + genoperandoperand(XorRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveClass */ +static sqInt +genPrimitiveClass(void) +{ + sqInt reg; + sqInt reg1; + + reg = ReceiverResultReg; + if (methodOrBlockNumArgs > 0) { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + reg1 = (reg = Arg0Reg); + assert(0 < (numRegArgs())); + } + if ((genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ReceiverResultReg, TempReg, reg == ReceiverResultReg)) == BadRegisterSet) { + genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ClassReg, TempReg, reg == ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDiv */ +static sqInt +genPrimitiveDiv(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); + } + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + jmpTarget(jumpSameSign, (convert = gLabel())); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDivide */ +static sqInt +genPrimitiveDivide(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpInexact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOverflow; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jumpInexact = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + jumpOverflow = genJumpNotSmallIntegerValuescratch(TempReg, Arg1Reg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOverflow, jmpTarget(jumpInexact, jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveEqual */ +static sqInt +genPrimitiveEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpZero, gJumpFPEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatAdd */ +static sqInt +genPrimitiveFloatAdd(void) +{ + return genDoubleArithmeticpreOpCheck(AddRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatDivide */ +static sqInt +genPrimitiveFloatDivide(void) +{ + return genDoubleArithmeticpreOpCheck(DivRdRd, genDoubleFailIfZeroArgRcvrarg); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatEqual */ +static sqInt +genPrimitiveFloatEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatGreaterOrEqual */ +static sqInt +genPrimitiveFloatGreaterOrEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPGreaterOrEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatGreaterThan */ +static sqInt +genPrimitiveFloatGreaterThan(void) +{ + return genDoubleComparisoninvert(gJumpFPGreater, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatLessOrEqual */ +static sqInt +genPrimitiveFloatLessOrEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPGreaterOrEqual, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatLessThan */ +static sqInt +genPrimitiveFloatLessThan(void) +{ + return genDoubleComparisoninvert(gJumpFPGreater, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatMultiply */ +static sqInt +genPrimitiveFloatMultiply(void) +{ + return genDoubleArithmeticpreOpCheck(MulRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatNotEqual */ +static sqInt +genPrimitiveFloatNotEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPNotEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatSquareRoot */ +static sqInt +genPrimitiveFloatSquareRoot(void) +{ + AbstractInstruction *jumpFailAlloc; + + + /* inline processorHasDoublePrecisionFloatingPointSupport */ + /* begin hasDoublePrecisionFloatingPointSupport */ +; + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + /* begin SqrtRd: */ + genoperand(SqrtRd, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFailAlloc, gLabel()); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveFloatSubtract */ +static sqInt +genPrimitiveFloatSubtract(void) +{ + return genDoubleArithmeticpreOpCheck(SubRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterOrEqual */ +static sqInt +genPrimitiveGreaterOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreaterOrEqual, gJumpFPGreaterOrEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterThan */ +static sqInt +genPrimitiveGreaterThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreater, gJumpFPGreater, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveIdentical */ +static sqInt +genPrimitiveIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(0); +} + + /* CogObjectRepresentation>>#genPrimitiveLessOrEqual */ +static sqInt +genPrimitiveLessOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLessOrEqual, gJumpFPGreaterOrEqual, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveLessThan */ +static sqInt +genPrimitiveLessThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLess, gJumpFPGreater, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveMod */ +static sqInt +genPrimitiveMod(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genRemoveSmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ClassReg); + jmpTarget(jumpSameSign, jmpTarget(jumpExact, gLabel())); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveMultiply */ +static sqInt +genPrimitiveMultiply(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(processorHasMultiplyAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + genRemoveSmallIntegerTagsInScratchReg(Arg1Reg); + /* begin MulR:R: */ + genMulRR(backEnd, Arg1Reg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + +/* subclasses override if they can */ + + /* CogObjectRepresentation>>#genPrimitiveNewMethod */ +static sqInt +genPrimitiveNewMethod(void) +{ + return UnimplementedPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveNotEqual */ +static sqInt +genPrimitiveNotEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpNonZero, gJumpFPNotEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveNotIdentical */ +static sqInt +genPrimitiveNotIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(1); +} + + /* CogObjectRepresentation>>#genPrimitiveQuo */ +static sqInt +genPrimitiveQuo(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + convert = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveSubtract */ +static sqInt +genPrimitiveSubtract(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, TempReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genAddSmallIntegerTagsTo(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genSmallIntegerComparison: */ +static sqInt NoDbgRegParms +genSmallIntegerComparison(sqInt jumpOpcode) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpTrue; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpFail = genJumpNotSmallInteger(Arg0Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + jumpTrue = genConditionalBranchoperand(jumpOpcode, 0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFail, gLabel()); + return CompletePrimitive; +} + + +/* Stack looks like + return address */ + + /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ +static sqInt NoDbgRegParms +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpCond; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpNonInt; + sqInt r; + + r = genSmallIntegerComparison(jumpOpcode); + if (r < 0) { + return r; + } + +# if defined(DPFPReg0) + + /* Fall through on non-SmallInteger argument. Argument may be a Float : let us check or fail */ + jumpNonInt = genJumpImmediate(Arg0Reg); + + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(ReceiverResultReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, ReceiverResultReg, DPFPReg0); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + if (invertComparison) { + + /* May need to invert for NaNs */ + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg0, DPFPReg1); + } + else { + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg1, DPFPReg0); + } + + /* FP jumps are a little weird */ + jumpCond = jumpFPOpcodeGenerator(0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNonInt, jmpTarget(jumpFail, gLabel())); + + +# endif /* defined(DPFPReg0) */ + + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#isUnannotatableConstant: */ +static sqInt NoDbgRegParms +isUnannotatableConstant(CogSimStackEntry *simStackEntry) +{ + return (((simStackEntry->type)) == SSConstant) + && ((isImmediate((simStackEntry->constant))) + || (!(shouldAnnotateObjectReference((simStackEntry->constant))))); +} + + +/* If the receiver supports immediate floats then generate a test for a + smallFloat in oopReg, + converting it to the float value in dpReg and jumping to targetInst. + Otherwise do nothing. */ + + /* CogObjectRepresentation>>#maybeGenConvertIfSmallFloatIn:scratchReg:into:andJumpTo: */ +static sqInt NoDbgRegParms +maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(sqInt oopReg, sqInt scratch, sqInt dpReg, AbstractInstruction *targetInst) +{ + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#genAddSmallIntegerTagsTo: */ +static sqInt NoDbgRegParms +genAddSmallIntegerTagsTo(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, aRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + return 0; +} + + +/* Set the SmallInteger tag bits when the tag bits may be filled with + garbage. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genClearAndSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genClearAndSetSmallIntegerTagsIn(sqInt scratchReg) +{ + return genSetSmallIntegerTagsIn(scratchReg); +} + + +/* Convert the Character in reg to a SmallInteger, assuming + the Character's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertCharacterToSmallIntegerInReg: */ +static void NoDbgRegParms +genConvertCharacterToSmallIntegerInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertIntegerToSmallIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToSmallIntegerInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + return 0; +} + + +/* Convert the SmallInteger in reg to a Character, assuming + the SmallInteger's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToCharacterInReg: */ +static void NoDbgRegParms +genConvertSmallIntegerToCharacterInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertSmallIntegerToIntegerInReg(sqInt reg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, reg); + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#generateLowcodeObjectTrampolines */ +static void +generateLowcodeObjectTrampolines(void) +{ + ceFloatObjectOfTrampoline = genTrampolineForcalledfloatArgresult(floatObjectOf, "ceFloatObjectOfTrampoline", DPFPReg0, TempReg); + ceFloatValueOfTrampoline = genTrampolineForcalledargfloatResult(floatValueOf, "ceFloatValueOfTrampoline", ReceiverResultReg, DPFPReg0); + ceInstantiateClassIndexableSizeTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassIndexableSizeTrampoline", Arg0Reg, Arg1Reg, TempReg); + ceInstantiateClassTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassTrampoline", ReceiverResultReg, 0, TempReg); + ceByteSizeOfTrampoline = genTrampolineForcalledargresult(byteSizeOf, "ceByteSizeOfTrampoline", Arg0Reg, TempReg); + cePositive64BitIntegerTrampoline = genTrampolineForcalledargargresult(positive64BitIntegerFor, "cePositive64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + cePositive64BitValueOfTrampoline = genTrampolineForcalledargresultresult(positive64BitValueOf, "cePositive64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + ceSigned64BitIntegerTrampoline = genTrampolineForcalledargargresult(signed64BitIntegerFor, "ceSigned64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + ceSigned64BitValueOfTrampoline = genTrampolineForcalledargresultresult(signed64BitValueOf, "ceSigned64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + + cePositive32BitIntegerTrampoline = genTrampolineForcalledargresult(positive32BitIntegerFor, "cePositive32BitIntegerTrampoline", ReceiverResultReg, TempReg); + cePositive32BitValueOfTrampoline = genTrampolineForcalledargresult(positive32BitValueOf, "cePositive32BitValueOfTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitIntegerTrampoline = genTrampolineForcalledargresult(signed32BitIntegerFor, "ceSigned32BitIntegerTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitValueOfTrampoline = genTrampolineForcalledargresult(signed32BitValueOf, "ceSigned32BitValueOfTrampoline", ReceiverResultReg, TempReg); +} + + +/* indexReg contains the 1-relative index of an element in tableObj. + Since BaseHeaderSize > BytesPerOop we must adjust it to use + it as a zero-relative index from the beginning of the object. */ + + /* CogObjectRepresentationFor32BitSpur>>#genFetchIndexRegister:from:into: */ +static sqInt NoDbgRegParms +genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + assert(indexReg != destReg); + /* begin AddCq:R: */ + quickConstant = (BaseHeaderSize / BytesPerWord) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, indexReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tableObj)) { + annotateobjRef(gMoveCwR(tableObj, destReg), tableObj); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tableObj, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(tableObj)); + } + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, indexReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, encoded as a + SmallInteger. + */ +/* Get header word in scratchReg */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:asSmallIntegerInto: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(4)); + } + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + genConvertIntegerToSmallIntegerInReg(destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, unencoded. */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(4)); + } + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + return 0; +} + + +/* Extract the inline cache tag for the object in sourceReg into destReg. The + inline cache tag for a given object is the value loaded in inline caches + to distinguish + objects of different classes. In Spur this is either the tags for + immediates, (with + 1 & 3 collapsed to 1 for SmallIntegers, and 2 collapsed to 0 for + Characters), or + the receiver's classIndex. + If forEntry is true answer the entry label at which control is to enter + (cmEntryOffset). If forEntry is false, control enters at the start. + If forEntry is true, generate something like this: + Limm: + andl $0x1, rDest + j Lcmp + Lentry: + movl rSource, rDest + andl $0x3, rDest + jnz Limm + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + If forEntry is false, generate something like the following. + At least on a 2.2GHz Intel Core i7 the following is slightly faster than + the above, + 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks + Lentry: + movl rSource, rDest + andl $0x3, rDest + jz LnotImm + andl $1, rDest + j Lcmp + LnotImm: + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + But we expect most SmallInteger arithmetic to be performed in-line and so + prefer the + version that is faster for non-immediates (because it branches for + immediates only). */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetInlineCacheClassTagFrom:into:forEntry: */ +static AbstractInstruction * NoDbgRegParms +genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *entryLabel; + AbstractInstruction *immLabel; + AbstractInstruction *jumpCompare; + AbstractInstruction *jumpNotImm; + sqInt quickConstant; + + if (forEntry) { + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(1)); + } + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + jmpTarget(jumpCompare, gLabel()); + } + else { + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpZero: */ + jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin AndCq:R: */ + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(1)); + } + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + flag("endianness"); + jmpTarget(jumpNotImm, gMoveMwrR(0, sourceReg, destReg)); + jmpTarget(jumpCompare, gAndCqR(classIndexMask(), destReg)); + } + return entryLabel; +} + + /* CogObjectRepresentationFor32BitSpur>>#genGetOverflowSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetOverflowSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, -BaseHeaderSize, srcReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(-BaseHeaderSize)); + } + return 0; +} + + +/* Generate a test for aRegister containing an integer value in the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpIsSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpIsSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpGreaterOrEqual: */ + genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerInScratchReg(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 1, aRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + +/* Generate a test for aRegister containing an integer value outside the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpLess: */ + genConditionalBranchoperand(JumpLess, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcInt32ToOop: */ +static void NoDbgRegParms +genLcInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToInt32: */ +static void NoDbgRegParms +genLcOopToInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToUInt32: */ +static void NoDbgRegParms +genLcOopToUInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcUInt32ToOop: */ +static void NoDbgRegParms +genLcUInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAt */ +static sqInt +genPrimitiveAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *convertToIntAndReturn; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpIsArray; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpIsWords; + AbstractInstruction *jumpMethodOutOfBounds; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + sqInt quickConstant9; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpZero: */ + jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpBelow: */ + jumpNotIndexable = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpBelowOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant3)); + } + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant4)); + } + /* begin JumpAboveOrEqual: */ + jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable, gLabel()); + /* begin Jump: */ + jumpNotIndexable = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsArray, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(AddCqR, quickConstant5, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant5)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), nSlotsOrBytesReg)); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant6)); + } + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(BaseHeaderSize)); + } + methodInBounds = anInstruction9; + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + + /* begin Label */ + convertToIntAndReturn = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(1)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + quickConstant7 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(AddCqR, quickConstant7, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant7)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotSmallIntegerUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, formatReg); + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(ClassMethodContextCompactIndex)); + } + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant8 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AndCqR, quickConstant8, formatReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant8)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg1Reg); + /* begin AddCq:R: */ + quickConstant9 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(AddCqR, quickConstant9, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant9)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + /* begin Jump: */ + jumpMethodOutOfBounds = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpFixedFieldsOutOfBounds, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpMethodOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel()))))))))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAtPut */ +static sqInt +genPrimitiveAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNonSmallIntegerValue; + AbstractInstruction *jumpNotIndexableBits; + AbstractInstruction *jumpNotIndexablePointers; + AbstractInstruction * jumpNotPointers; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant10; + sqInt quickConstant11; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + sqInt quickConstant9; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant1 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpAbove: */ + jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); + /* begin CmpCq:R: */ + quickConstant2 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpBelow: */ + jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin JumpNonZero: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(AddCqR, quickConstant3, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant3)); + } + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpHasFixedFields, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(ClassMethodContextCompactIndex)); + } + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant4 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant4)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin AddCq:R: */ + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AddCqR, quickConstant5, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant5)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotPointers, gLabel()); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); + /* begin CmpCq:R: */ + quickConstant6 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant6)); + } + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant7, formatReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant7)); + } + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant8 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant8, formatReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant8)); + } + /* begin JumpBelow: */ + jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); + } + } + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin AddCq:R: */ + quickConstant9 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant9, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant9)); + } + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR((((usqInt)0xFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), nSlotsOrBytesReg); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant10 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant10, formatReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant10)); + } + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR((((usqInt)0xFFFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); + /* begin AndCq:R: */ + quickConstant11 = (BytesPerWord / 2) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(AndCqR, quickConstant11, formatReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(quickConstant11)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsCompiledMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + jmpTarget(jumpIsContext, jmpTarget(jumpNotIndexableBits, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexablePointers, jmpTarget(jumpNonSmallIntegerValue, jmpTarget(jumpFixedFieldsOutOfBounds, gLabel()))))))))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpIsContext)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(1)); + } + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); + return 0; +} + + +/* Arguably we should fail for immediates, but so far no one has complained, + so... + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveIdentityHash */ +static sqInt +genPrimitiveIdentityHash(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpNotSet; + AbstractInstruction *jumpSI; + AbstractInstruction * ret; + + jumpImm = genJumpImmediate(ReceiverResultReg); + genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ConstZero, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(ConstZero)); + } + /* begin JumpZero: */ + jumpNotSet = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + ret = genoperand(RetN, 0); + jmpTarget(jumpImm, gLabel()); + jumpSI = genJumpSmallInteger(ReceiverResultReg); + jmpTarget(jumpSI, ret); + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)ret)); + jmpTarget(jumpNotSet, gLabel()); + return 0; +} + + +/* :Assume the receiuver is never a SmallInteger. One would use ^self for + that. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveImmediateAsInteger */ +static sqInt +genPrimitiveImmediateAsInteger(void) +{ + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + +/* Implement primitiveNew for convenient cases: + - the receiver has a hash + - the receiver is fixed size (excluding ephemerons to save instructions & + miniscule time) + - single word header/num slots < numSlotsMask + - the result fits in eden (actually below scavengeThreshold) + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNew */ +static sqInt +genPrimitiveNew(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpUnhashed; + AbstractInstruction *jumpVariableOrEphemeron; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + AbstractInstruction *skip; + + if (methodOrBlockNumArgs != 0) { + return UnimplementedPrimitive; + } + + /* inst spec will hold class's instance specification, then byte size and finally end of new object. */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* get freeStart as early as possible so as not to wait later... */ + instSpecReg = (byteSizeReg = ClassReg); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, Arg1Reg)); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(AndCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant3)); + } + /* begin AndCq:R: */ + quickConstant4 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant4)); + } + /* begin CmpCq:R: */ + quickConstant5 = nonIndexablePointerFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant5)); + } + /* begin JumpAbove: */ + jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant6)); + } + /* begin JumpAboveOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction11 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize * 2)); + } + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction12 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(1)); + } + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + quickConstant7 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant7, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant7)); + } + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant8 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant8)); + } + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, byteSizeReg, address1)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(4)); + } + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction3 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveCq:R: */ + quickConstant2 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant2, fillReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + /* begin MoveR:Mw:r: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); + } + fillLoop = anInstruction5; + /* begin MoveR:Mw:r: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(4)); + } + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(8)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpUnhashed, jmpTarget(jumpVariableOrEphemeron, jmpTarget(jumpTooBig, jmpTarget(jumpNoSpace, gLabel())))); + return 0; +} + + +/* Implement primitiveNewWithArg for convenient cases: + - the receiver has a hash + - the receiver is variable and not compiled method + - single word header/num slots < numSlotsMask + - the result fits in eden + See superclass method for dynamic frequencies of formats. + For the moment we implement only arrayFormat, firstByteFormat & + firstLongFormat + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNewWithArg */ +static sqInt +genPrimitiveNewWithArg(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpArrayFormat; + AbstractInstruction *jumpArrayTooBig; + AbstractInstruction *jumpByteFormat; + AbstractInstruction *jumpBytePrepDone; + AbstractInstruction *jumpByteTooBig; + AbstractInstruction *jumpFailCuzFixed; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpLongPrepDone; + AbstractInstruction *jumpLongTooBig; + AbstractInstruction *jumpNElementsNonInt; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpUnhashed; + sqInt maxSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + sqInt quickConstant9; + AbstractInstruction *skip; + sqInt wordConstant; + + if (methodOrBlockNumArgs != 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + + /* inst spec will hold class's instance specification and then byte size and finally numSlots half of header */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* The max slots we'll allocate here are those for a single header */ + instSpecReg = (byteSizeReg = ClassReg); + + /* get freeStart as early as possible so as not to wait later... */ + maxSlots = (numSlotsMask()) - 1; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, Arg1Reg)); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + + /* get class's format inst var for inst spec (format field) */ + jumpNElementsNonInt = genJumpNotSmallInteger(Arg0Reg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant3)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, TempReg); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin CmpCq:R: */ + quickConstant4 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant4)); + } + /* begin JumpZero: */ + jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant5)); + } + /* begin JumpZero: */ + jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(quickConstant6)); + } + /* begin JumpNonZero: */ + jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = (((usqInt)maxSlots << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant7)); + } + /* begin JumpAbove: */ + jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCq: */ + anInstruction = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpByteTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, instSpecReg, TempReg); + /* begin AndCq:R: */ + anInstruction14 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(BytesPerWord - 1)); + } + /* begin LogicalShiftLeftCq:R: */ + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BytesPerWord - 1)); + } + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); + /* begin PushCq: */ + anInstruction2 = genoperand(PushCq, 0); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); + } + /* begin Jump: */ + jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpArrayTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCw: */ + wordConstant = nilObject(); + /* begin gen:literal: */ + checkLiteralforInstruction(wordConstant, genoperand(PushCw, wordConstant)); + jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction16 = genoperandoperand(CmpCqR, 0, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(BaseHeaderSize * 2)); + } + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction17 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(1)); + } + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + quickConstant8 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction18 = genoperandoperand(AddCqR, quickConstant8, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(quickConstant8)); + } + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant9 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction19 = genoperandoperand(CmpCqR, quickConstant9, byteSizeReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(quickConstant9)); + } + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, byteSizeReg, address1)); + /* begin MoveR:Mw:r: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(4)); + } + /* begin PopR: */ + genoperand(PopR, fillReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction6 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); + } + fillLoop = anInstruction7; + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(4)); + } + /* begin AddCq:R: */ + anInstruction20 = genoperandoperand(AddCqR, 8, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(8)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNoSpace, gPopR(TempReg)); + jmpTarget(jumpUnhashed, jmpTarget(jumpFailCuzFixed, jmpTarget(jumpArrayTooBig, jmpTarget(jumpByteTooBig, jmpTarget(jumpLongTooBig, jmpTarget(jumpNElementsNonInt, gLabel())))))); + return 0; +} + + +/* Implement primitiveShallowCopy/primitiveClone for convenient cases: + - the receiver is not a context + - the receiver is not a compiled method + - the result fits in eden (actually below scavengeThreshold) */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveShallowCopy */ +static sqInt +genPrimitiveShallowCopy(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *continuance; + AbstractInstruction *copyLoop; + sqInt formatReg; + AbstractInstruction * jumpEmpty; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpVariable; + sqInt ptrReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt resultReg; + sqInt slotsReg; + + jumpImmediate = genJumpImmediate(ReceiverResultReg); + resultReg = Arg0Reg; + + /* get freeStart as early as possible so as not to wait later... */ + slotsReg = Arg1Reg; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, resultReg)); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (ptrReg = (formatReg = SendNumArgsReg)), NoReg); + /* begin CmpCq:R: */ + quickConstant = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant)); + } + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = indexablePointersFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpZero: */ + jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + continuance = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genGetRawSlotSizeOfNonImminto(ReceiverResultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant2 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpZero: */ + jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, 0, slotsReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, slotsReg, TempReg); + /* begin AndCq:R: */ + anInstruction13 = genoperandoperand(AndCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(1)); + } + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, slotsReg); + /* begin AddCq:R: */ + quickConstant3 = BaseHeaderSize / BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(AddCqR, quickConstant3, slotsReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(quickConstant3)); + } + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, resultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant4 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction15 = genoperandoperand(CmpCqR, quickConstant4, slotsReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(quickConstant4)); + } + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ptrReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, slotsReg, address1)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BytesPerWord * 2)); + } + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant5 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(AndCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(quickConstant5)); + } + /* begin MoveR:Mw:r: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); + } + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BytesPerWord)); + } + /* begin AndCq:R: */ + quickConstant6 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); + /* begin gen:quickConstant:operand: */ + anInstruction17 = genoperandoperand(AndCqR, quickConstant6, TempReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(quickConstant6)); + } + /* begin MoveR:Mw:r: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(BytesPerWord)); + } + /* begin Label */ + copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AddCq:R: */ + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(BytesPerWord * 2)); + } + /* begin AddCq:R: */ + anInstruction19 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(BytesPerWord * 2)); + } + /* begin MoveMw:r:R: */ + anInstruction5 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); + } + /* begin MoveR:Mw:r: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(0)); + } + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(BytesPerWord)); + } + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(BytesPerWord)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ptrReg, slotsReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)copyLoop)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpVariable, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction20 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(ClassMethodContextCompactIndex)); + } + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); + jmpTarget(jumpImmediate, jmpTarget(jumpNoSpace, jmpTarget(jumpIsMethod, jmpTarget(jumpTooBig, jmpTarget(jumpEmpty, gLabel()))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAt */ +static sqInt +genPrimitiveStringAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *done; + sqInt formatReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsDone; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant)); + } + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpLess: */ + jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(AddCqR, quickConstant3, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant3)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + jumpWordsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(BytesPerWord - 1)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + jmpTarget(jumpWordsDone, (done = gLabel())); + genConvertIntegerToCharacterInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + quickConstant4 = (BytesPerWord / 1) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant4)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)done)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel())))))); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAtPut */ +static sqInt +genPrimitiveStringAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpBadArg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNotString; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant1 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpBelow: */ + jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant3)); + } + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant4)); + } + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); + } + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + quickConstant5 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AddCqR, quickConstant5, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant5)); + } + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); + /* begin AndCq:R: */ + quickConstant6 = (BytesPerWord / 2) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant6, formatReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(quickConstant6)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(BytesPerWord - 1)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel())))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpNotString)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(1)); + } + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentationFor32BitSpur>>#genRemoveSmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, scratchReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#genShiftAwaySmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg); + return 0; +} + + +/* Get the literal count of a CompiledMethod into headerReg, plus one if + requested. If inBytes is true, scale the count by the word size. Deal with + the possibility of + the method being cogged. */ + + /* CogObjectRepresentationFor32BitSpur>>#getLiteralCountOf:plusOne:inBytes:into:scratch: */ +static sqInt NoDbgRegParms +getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + genGetMethodHeaderOfintoscratch(methodReg, litCountReg, scratchReg); + if (inBytes) { + /* begin AndCq:R: */ + quickConstant = ((sqInt)((usqInt)((alternateHeaderNumLiteralsMask())) << 1)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, litCountReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, litCountReg); + } + else { + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, litCountReg); + /* begin AndCq:R: */ + quickConstant1 = alternateHeaderNumLiteralsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant1, litCountReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + } + if (plusOne) { + /* begin AddCq:R: */ + quickConstant2 = (inBytes + ? BytesPerWord + : 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, litCountReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant2)); + } + } + return 0; +} + + +/* Answer the relevant inline cache tag for an instance. + c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */ + + /* CogObjectRepresentationFor32BitSpur>>#inlineCacheTagForInstance: */ +static sqInt NoDbgRegParms +inlineCacheTagForInstance(sqInt oop) +{ + return (isImmediate(oop) + ? oop & 1 + : classIndexOf(oop)); +} + + /* CogObjectRepresentationFor32BitSpur>>#jumpNotSmallIntegerUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0x3FFFFFFF, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0x3FFFFFFF)); + } + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in an inline cache preceding address in + cogMethodOrNil. Answer if code was modified. */ + + /* CogObjectRepresentationFor32BitSpur>>#markAndTraceCacheTagLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + AbstractInstruction * self_in_rewriteInlineCacheTagat; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + /* begin rewriteInlineCacheTag:at: */ + self_in_rewriteInlineCacheTagat = ((AbstractInstruction *) (backEnd())); + longAtput(pcRelativeAddressAt(self_in_rewriteInlineCacheTagat, address - 8), objOop); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + /* CogObjectRepresentationFor32BitSpur>>#numSmallIntegerBits */ +static sqInt +numSmallIntegerBits(void) +{ + return 0x1F; +} + + +/* The two valid tag patterns are 0 (Character) and 1 (SmallInteger) */ + + /* CogObjectRepresentationFor32BitSpur>>#validInlineCacheTag: */ +static sqInt NoDbgRegParms +validInlineCacheTag(usqInt classIndexOrTagPattern) +{ + return (classIndexOrTagPattern <= 1) + || ((classAtIndex(classIndexOrTagPattern)) != null); +} + + +/* Answer if the cacheTag is not unmarked, i.e. answer true for compact class + indices and immediates; only answer false for unmarked objects. In Spur + linked send cache tags are class indices so effectively they're always + marked. */ + + /* CogObjectRepresentationForSpur>>#cacheTagIsMarked: */ +static sqInt NoDbgRegParms +cacheTagIsMarked(sqInt cacheTag) +{ + return 1; +} + + /* CogObjectRepresentationForSpur>>#checkValidOopReference: */ +static sqInt NoDbgRegParms +checkValidOopReference(sqInt anOop) +{ + return (isImmediate(anOop)) + || ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentationForSpur>>#couldBeObject: */ +static sqInt NoDbgRegParms +couldBeObject(sqInt literal) +{ + return (isNonImmediate(literal)) + && (oopisGreaterThanOrEqualTo(literal, startOfMemory())); +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genActiveContextTrampolineLarge:inBlock:called: */ +static sqInt NoDbgRegParms +genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genGetActiveContextLargeinBlock(isLarge, isInBlock); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(aString, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + /* CogObjectRepresentationForSpur>>#genAllocFloatValue:into:scratchReg:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt scratch1, sqInt scratch2) +{ + sqInt address; + sqInt address1; + usqIntptr_t allocSize; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *jumpFail; + usqLong newFloatHeader; + sqInt quickConstant; + sqInt quickConstant1; + + allocSize = BaseHeaderSize + (sizeof(double)); + newFloatHeader = headerForSlotsformatclassIndex((sizeof(double)) / BytesPerWord, firstLongFormat(), ClassFloatCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, resultReg)); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(allocSize)); + } + /* begin CmpCq:R: */ + quickConstant1 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant1, scratch1); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpAboveOrEqual: */ + jumpFail = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, scratch1, address1)); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) newFloatHeader); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, scratch1); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, newFloatHeader >> 32, scratch1); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(newFloatHeader >> 32)); + } + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); + } + /* begin MoveRd:M64:r: */ + anInstruction5 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(BaseHeaderSize)); + } + return jumpFail; +} + + +/* Check the remembered bit of the object in objReg; answer the jump taken if + the bit is already set. + Only need to fetch the byte containing it, which reduces the size of the + mask constant. + */ + + /* CogObjectRepresentationForSpur>>#genCheckRememberedBitOf:scratch: */ +static AbstractInstruction * NoDbgRegParms +genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + int mask; + sqInt rememberedBitByteOffset; + + rememberedBitByteOffset = (rememberedBitShift()) / 8; + mask = 1U << ((rememberedBitShift()) % 8); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, rememberedBitByteOffset, objReg, scratchReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(rememberedBitByteOffset)); + } + /* begin TstCq:R: */ + anInstruction1 = genoperandoperand(TstCqR, mask, scratchReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(mask)); + } + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genConvertCharacterToCodeInReg: */ +static sqInt NoDbgRegParms +genConvertCharacterToCodeInReg(sqInt reg) +{ + sqInt quickConstant; + + /* begin LogicalShiftRightCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, reg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genConvertIntegerToCharacterInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToCharacterInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin LogicalShiftLeftCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); + /* begin AddCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant1, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant1)); + } + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. If numCopied > 0 pop those values off the stack. */ + + /* CogObjectRepresentationForSpur>>#genCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *anInstruction; + sqInt i; + sqInt offset; + + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(bcpc, numArgs, numCopied, ctxtNumArgs, isLargeCtxt, isInBlock); + for (i = 1; i <= numCopied; i += 1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Mw:r: */ + offset = (((numCopied - i) + ClosureFirstCopiedValueIndex) * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + } + return 0; +} + + +/* Create a full closure with the given values. */ + + /* CogObjectRepresentationForSpur>>#genCreateFullClosure:numArgs:numCopied:ignoreContext:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + sqInt constant; + usqLong header; + sqInt numSlots; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultReg and thence in ClassReg. */ + if (ignoreContext) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ClassReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction9 = genoperandoperand(MoveCqR, constant, ClassReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(constant)); + } + } + } + else { + genGetActiveContextNumArgslargeinBlock(contextNumArgs, contextIsLarge, contextIsBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + } + numSlots = FullClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + assert(ClassFullBlockClosureCompactIndex != 0); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassFullBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(header >> 32)); + } + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); + } + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction4 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(byteSize)); + } + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + /* begin CmpCq:R: */ + quickConstant2 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant2, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + offset = (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, ClassReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset)); + } + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(compiledBlock)) { + annotateobjRef(gMoveCwR(compiledBlock, TempReg), compiledBlock); + } + else { + /* begin MoveCq:R: */ + anInstruction11 = genoperandoperand(MoveCqR, compiledBlock, TempReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(compiledBlock)); + } + } + /* begin MoveR:Mw:r: */ + offset1 = (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(offset1)); + } + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant1)); + } + /* begin MoveR:Mw:r: */ + offset2 = (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(offset2)); + } + return 0; +} + + +/* Make sure that the object in reg is not forwarded. This routine assumes + the object will + never be forwarded to an immediate, as it is used to unforward literal + variables (associations). + Use the fact that isForwardedObjectClassIndexPun is a power of two to save + an instruction. */ + + /* CogObjectRepresentationForSpur>>#genEnsureObjInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *loop; + AbstractInstruction *ok; + sqInt quickConstant; + + assert(reg != scratch); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, gLabel()); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + return genEnsureOopInRegNotForwardedscratchRegjumpBackTo(reg, scratch, gLabel()); +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:jumpBackTo: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *finished; + AbstractInstruction *imm; + AbstractInstruction *ok; + sqInt quickConstant; + + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(reg != scratch); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) instruction)))); + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + jmpTarget(imm, jmpTarget(ok, finished)); + return 0; +} + + +/* Make sure that the oop in reg is not forwarded, updating the slot in + objReg with the value. + */ + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:updatingSlot:in: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *imm; + AbstractInstruction *loop; + sqInt offset; + AbstractInstruction *ok; + sqInt quickConstant; + + + /* Open-code + self genEnsureOopInRegNotForwarded: reg + scratchReg: scratch + updatingMw: index * objectMemory wordSize + objectMemory baseHeaderSize + r: objReg. + to avoid calling the store check unless the receiver is forwarded. */ + assert((reg != scratch) + && (objReg != scratch)); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin MoveR:Mw:r: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, offset, objReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + assert((reg == Arg0Reg) + && ((scratch == TempReg) + && (objReg == ReceiverResultReg))); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckContextReceiverTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, jmpTarget(imm, gLabel())); + return 0; +} + + +/* Do the store check. Answer the argument for the benefit of the code + generator; ReceiverResultReg may be caller-saved and hence smashed by this + call. Answering + it allows the code generator to reload ReceiverResultReg cheaply. + In Spur the only thing we leave to the run-time is adding the receiver to + the remembered set and setting its isRemembered bit. */ + + /* CogObjectRepresentationForSpur>>#generateObjectRepresentationTrampolines */ +static void +generateObjectRepresentationTrampolines(void) +{ + sqInt instVarIndex; + AbstractInstruction *jumpSC; + + +# if IMMUTABILITY + for (instVarIndex = 0; instVarIndex < NumStoreTrampolines; instVarIndex += 1) { + ceStoreTrampolines[instVarIndex] = (genStoreTrampolineCalledinstVarIndex(trampolineNamenumArgslimit("ceStoreTrampoline", instVarIndex, NumStoreTrampolines - 2), instVarIndex)); + } + +# endif /* IMMUTABILITY */ + + /* begin genStoreCheckTrampoline */ + if (CheckRememberedInTrampoline) { + zeroOpcodeIndex(); + jumpSC = genCheckRememberedBitOfscratch(ReceiverResultReg, R0); + assert(((jumpSC->opcode)) == JumpNonZero); + (jumpSC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSC, gLabel()); + } + ceStoreCheckTrampoline = genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, "ceStoreCheckTrampoline", 1, ReceiverResultReg, null, null, null, ((CallerSavedRegisterMask | (1U << ReceiverResultReg)) - (1U << ReceiverResultReg)), 1, (CallerSavedRegisterMask & (1U << ReceiverResultReg) + ? ReceiverResultReg + : (/* begin cResultRegister */ + R0)), CheckRememberedInTrampoline); + ceStoreCheckContextReceiverTrampoline = genStoreCheckContextReceiverTrampoline(); + ceScheduleScavengeTrampoline = genTrampolineForcalledregsToSave(ceScheduleScavenge, "ceScheduleScavengeTrampoline", CallerSavedRegisterMask); + ceSmallActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, 0, "ceSmallMethodContext"); + ceSmallActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InVanillaBlock, "ceSmallBlockContext"); + ceSmallActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InFullBlock, "ceSmallFullBlockContext"); + + ceLargeActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, 0, "ceLargeMethodContext"); + ceLargeActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InVanillaBlock, "ceLargeBlockContext"); + ceLargeActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InFullBlock, "ceLargeFullBlockContext"); + + generateLowcodeObjectTrampolines(); + +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextLarge:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction24; + AbstractInstruction *anInstruction25; + AbstractInstruction *anInstruction26; + AbstractInstruction *anInstruction27; + AbstractInstruction *anInstruction28; + AbstractInstruction *anInstruction29; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction30; + AbstractInstruction *anInstruction31; + AbstractInstruction *anInstruction32; + AbstractInstruction *anInstruction33; + AbstractInstruction *anInstruction34; + AbstractInstruction *anInstruction35; + AbstractInstruction *anInstruction36; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt constant; + AbstractInstruction *continuation; + AbstractInstruction *exit; + usqLong header; + AbstractInstruction * inst; + AbstractInstruction *jumpNeedScavenge; + AbstractInstruction *jumpSingle; + AbstractInstruction *loopHead; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt offset4; + sqInt offset5; + sqInt offset6; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + AbstractInstruction * self_in_saveAndRestoreLinkRegAround; + sqInt slotSize; + + + /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ + /* begin MoveMw:r:R: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(FoxMethod)); + } + gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); + /* begin JumpZero: */ + jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(FoxThisContext)); + } + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSingle, gLabel()); + /* begin OrCq:R: */ + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(MFMethodFlagHasContextFlag)); + } + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(FoxMethod)); + } + + switch (isInBlock) { + case InFullBlock: + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); + } + break; + case InVanillaBlock: + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(3)); + } + /* begin MoveM16:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, ClassReg); + break; + case 0: + /* begin SubCq:R: */ + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(1)); + } + break; + default: + error("Case not found and no otherwise clause"); + } + slotSize = (isLarge + ? LargeContextSlots + : SmallContextSlots); + header = headerForSlotsformatclassIndex(slotSize, indexablePointersFormat(), ClassMethodContextCompactIndex); + flag("endianness"); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant2 = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant2)); + } + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(0)); + } + /* begin MoveCq:R: */ + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction21)) { + (anInstruction21->dependent = locateLiteral(header >> 32)); + } + /* begin MoveR:Mw:r: */ + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction31)) { + (anInstruction31->dependent = locateLiteral(4)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin AddCq:R: */ + quickConstant5 = smallObjectBytesForSlots(slotSize); + /* begin gen:quickConstant:operand: */ + anInstruction29 = genoperandoperand(AddCqR, quickConstant5, TempReg); + if (usesOutOfLineLiteral(anInstruction29)) { + (anInstruction29->dependent = locateLiteral(quickConstant5)); + } + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + /* begin CmpCq:R: */ + quickConstant6 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction30 = genoperandoperand(CmpCqR, quickConstant6, TempReg); + if (usesOutOfLineLiteral(anInstruction30)) { + (anInstruction30->dependent = locateLiteral(quickConstant6)); + } + /* begin JumpAboveOrEqual: */ + jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + continuation = genoperandoperand(MoveRR, FPReg, TempReg); + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + offset = BaseHeaderSize + (SenderIndex * BytesPerOop); + /* begin gen:operand:quickConstant:operand: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(offset)); + } + /* begin MoveMw:r:R: */ + anInstruction13 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(FoxSavedFP)); + } + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + offset1 = BaseHeaderSize + (InstructionPointerIndex * BytesPerOop); + /* begin gen:operand:quickConstant:operand: */ + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction14)) { + (anInstruction14->dependent = locateLiteral(offset1)); + } + /* begin MoveMw:r:R: */ + offset2 = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction15 = genoperandoperandoperand(MoveMwrR, offset2, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(offset2)); + } + /* begin MoveR:Mw:r: */ + offset3 = BaseHeaderSize + (MethodIndex * BytesPerWord); + /* begin gen:operand:quickConstant:operand: */ + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction16)) { + (anInstruction16->dependent = locateLiteral(offset3)); + } + /* begin MoveR:Mw:r: */ + anInstruction17 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + if (usesOutOfLineLiteral(anInstruction17)) { + (anInstruction17->dependent = locateLiteral(FoxThisContext)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SPReg, TempReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin SubCq:R: */ + quickConstant3 = 3; + /* begin gen:quickConstant:operand: */ + anInstruction18 = genoperandoperand(SubCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction18)) { + (anInstruction18->dependent = locateLiteral(quickConstant3)); + } + /* begin AddR:R: */ + genoperandoperand(AddRR, SendNumArgsReg, TempReg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:Mw:r: */ + offset4 = BaseHeaderSize + (StackPointerIndex * BytesPerOop); + /* begin gen:operand:quickConstant:operand: */ + anInstruction19 = genoperandoperandoperand(MoveRMwr, TempReg, offset4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction19)) { + (anInstruction19->dependent = locateLiteral(offset4)); + } + if (isInBlock > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin AddCq:R: */ + anInstruction27 = genoperandoperand(AddCqR, 2, TempReg); + if (usesOutOfLineLiteral(anInstruction27)) { + (anInstruction27->dependent = locateLiteral(2)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + } + else { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction28 = genoperandoperand(MoveCqR, constant, TempReg); + if (usesOutOfLineLiteral(anInstruction28)) { + (anInstruction28->dependent = locateLiteral(constant)); + } + } + } + /* begin MoveR:Mw:r: */ + offset5 = BaseHeaderSize + (ClosureIndex * BytesPerOop); + /* begin gen:operand:quickConstant:operand: */ + anInstruction20 = genoperandoperandoperand(MoveRMwr, TempReg, offset5, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction20)) { + (anInstruction20->dependent = locateLiteral(offset5)); + } + /* begin MoveMw:r:R: */ + anInstruction22 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction22)) { + (anInstruction22->dependent = locateLiteral(FoxMFReceiver)); + } + /* begin MoveR:Mw:r: */ + offset6 = BaseHeaderSize + (ReceiverIndex * BytesPerOop); + /* begin gen:operand:quickConstant:operand: */ + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, offset6, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction23)) { + (anInstruction23->dependent = locateLiteral(offset6)); + } + /* begin MoveCq:R: */ + anInstruction24 = genoperandoperand(MoveCqR, 1, ClassReg); + if (usesOutOfLineLiteral(anInstruction24)) { + (anInstruction24->dependent = locateLiteral(1)); + } + /* begin CmpR:R: */ + loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); + /* begin JumpGreater: */ + exit = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, ClassReg, TempReg); + /* begin AddCq:R: */ + anInstruction32 = genoperandoperand(AddCqR, 2, TempReg); + if (usesOutOfLineLiteral(anInstruction32)) { + (anInstruction32->dependent = locateLiteral(2)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + /* begin AddCq:R: */ + quickConstant7 = ReceiverIndex + (BaseHeaderSize / BytesPerWord); + /* begin gen:quickConstant:operand: */ + anInstruction33 = genoperandoperand(AddCqR, quickConstant7, ClassReg); + if (usesOutOfLineLiteral(anInstruction33)) { + (anInstruction33->dependent = locateLiteral(quickConstant7)); + } + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); + /* begin SubCq:R: */ + quickConstant4 = (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction25 = genoperandoperand(SubCqR, quickConstant4, ClassReg); + if (usesOutOfLineLiteral(anInstruction25)) { + (anInstruction25->dependent = locateLiteral(quickConstant4)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin MoveCq:R: */ + quickConstant1 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant1)); + } + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, ClassReg); + /* begin AddCq:R: */ + anInstruction34 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + if (usesOutOfLineLiteral(anInstruction34)) { + (anInstruction34->dependent = locateLiteral(FoxMFReceiver)); + } + /* begin AddCq:R: */ + quickConstant8 = (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord); + /* begin gen:quickConstant:operand: */ + anInstruction35 = genoperandoperand(AddCqR, quickConstant8, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction35)) { + (anInstruction35->dependent = locateLiteral(quickConstant8)); + } + /* begin SubCq:R: */ + anInstruction26 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + if (usesOutOfLineLiteral(anInstruction26)) { + (anInstruction26->dependent = locateLiteral(BytesPerWord)); + } + loopHead = anInstruction26; + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SPReg, ClassReg); + /* begin JumpBelow: */ + exit = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); + /* begin AddCq:R: */ + anInstruction36 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction36)) { + (anInstruction36->dependent = locateLiteral(1)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNeedScavenge, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + self_in_saveAndRestoreLinkRegAround = ((AbstractInstruction *) (backEnd())); + /* begin PushR: */ + inst = genoperand(PushR, LinkReg); + CallRTregistersToBeSavedMask(ceScheduleScavengeTrampoline, ((1U << ReceiverResultReg) | (1U << SendNumArgsReg)) | (1U << ClassReg)); + + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuation)); + return 0; +} + + +/* Get the active context into ReceiverResultReg, creating it if necessary. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt routine; + + if (isLargeContext) { + + switch (isInBlock) { + case 0: + routine = ceLargeActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceLargeActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceLargeActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + else { + + switch (isInBlock) { + case 0: + routine = ceSmallActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceSmallActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceSmallActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(numArgs)); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, routine); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetBits:ofFormatByteOf:into: */ +static sqInt NoDbgRegParms +genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); + } + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(mask)); + } + return 0; +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetClassIndexOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + return 0; +} + + +/* Fetch the class object whose index is in instReg into destReg. + It is non-obvious, but the Cogit assumes loading a class does not involve + a runtime call, so do not call classAtIndex: */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOfClassIndex:into:scratchReg: */ +static sqInt NoDbgRegParms +genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant2; + sqInt quickConstant3; + + assert(instReg != destReg); + assert(instReg != scratchReg); + assert(destReg != scratchReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); + assert(!(shouldAnnotateObjectReference(classTableRootObj()))); + /* begin MoveMw:r:R: */ + offset = (classTableRootObj()) + BaseHeaderSize; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant2 = classTableMinorIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant2)); + } + /* begin AddCq:R: */ + quickConstant3 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(AddCqR, quickConstant3, scratchReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant3)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's class into destReg. If the instance is not the + receiver and is forwarded, follow forwarding. */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOf:into:scratchReg:instRegIsReceiver: */ +static sqInt NoDbgRegParms +genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpIsImm; + AbstractInstruction *jumpNotForwarded; + AbstractInstruction *loop; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if ((instReg == destReg) + || ((instReg == scratchReg) + || (destReg == scratchReg))) { + return BadRegisterSet; + } + /* begin MoveR:R: */ + loop = genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant1 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpNonZero: */ + jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant2 = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + if (!instRegIsReceiver) { + + /* if it is forwarded... */ + /* begin CmpCq:R: */ + quickConstant = isForwardedObjectClassIndexPun(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BaseHeaderSize)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(jumpNotForwarded, gLabel()); + } + jmpTarget(jumpIsImm, gMoveRR(scratchReg, destReg)); + if (scratchReg == TempReg) { + /* begin PushR: */ + genoperand(PushR, instReg); + genGetClassObjectOfClassIndexintoscratchReg(destReg, instReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, destReg); + /* begin PopR: */ + genoperand(PopR, instReg); + } + else { + genGetClassObjectOfClassIndexintoscratchReg(destReg, scratchReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, scratchReg, destReg); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1); +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetCompactClassIndexNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg) +{ + return genGetClassIndexOfNonImminto(instReg, destReg); +} + + /* CogObjectRepresentationForSpur>>#genGetDoubleValueOf:into: */ +static sqInt NoDbgRegParms +genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, BaseHeaderSize, srcReg, destFPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BaseHeaderSize)); + } + return 0; +} + + +/* Get the format field of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into: */ +static sqInt NoDbgRegParms +genGetFormatOfinto(sqInt srcReg, sqInt destReg) +{ + return genGetBitsofFormatByteOfinto(formatMask(), srcReg, destReg); +} + + +/* Get the format of the object in sourceReg into destReg. If + scratchRegOrNone is not NoReg, load at least the least significant 32-bits + (64-bits in 64-bits) of the + header word, which contains the format, into scratchRegOrNone. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into:leastSignificantHalfOfBaseHeaderIntoScratch: */ +static sqInt NoDbgRegParms +genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, sqInt destReg, sqInt scratchRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + + if (scratchRegOrNone == NoReg) { + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(3)); + } + } + else { + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, destReg, scratchRegOrNone); + /* begin LogicalShiftRightCq:R: */ + quickConstant = formatShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, destReg); + } + /* begin AndCq:R: */ + quickConstant1 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant1)); + } + return 0; +} + + +/* Get the size in word-sized slots of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetNumSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetNumSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jmp; + sqInt quickConstant; + + assert(srcReg != destReg); + genGetRawSlotSizeOfNonImminto(srcReg, destReg); + /* begin CmpCq:R: */ + quickConstant = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpLess: */ + jmp = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genGetOverflowSlotsOfinto(srcReg, destReg); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* The raw numSlots field is the most significant byte of the 64-bit header + word. MoveMbrR zero-extends. */ + + /* CogObjectRepresentationForSpur>>#genGetRawSlotSizeOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetRawSlotSizeOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction1; + + /* begin MoveMb:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMbrR, 7, sourceReg, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(7)); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genJumpImmediate: */ +static AbstractInstruction * NoDbgRegParms +genJumpImmediate(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin TstCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(TstCqR, quickConstant, aRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genJumpImmutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpMutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin genJumpBaseHeaderMutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpNotCharacterInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotCharacterInScratchReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin CmpCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genLcFirstFieldPointer: */ +static void NoDbgRegParms +genLcFirstFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8)); + } + ssPushNativeRegister(objectReg); +} + + +/* TODO: Retrieve the number of fixed fields. */ + + /* CogObjectRepresentationForSpur>>#genLcFirstIndexableFieldPointer: */ +static void NoDbgRegParms +genLcFirstIndexableFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8)); + } + ssPushNativeRegister(objectReg); +} + + +/* Check for integer */ + + /* CogObjectRepresentationForSpur>>#genLcIsBytes:to: */ +static void NoDbgRegParms +genLcIsBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBytes; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant1 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, valueReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpLess: */ + isNotBytes = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBytes, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsFloatObject:to: */ +static void NoDbgRegParms +genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsIndexable:to: */ +static void NoDbgRegParms +genLcIsIndexableto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + ssPushNativeRegister(valueReg); +} + + +/* Check for the immediate case */ + + /* CogObjectRepresentationForSpur>>#genLcIsIntegerObject:to: */ +static void NoDbgRegParms +genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseResult; + AbstractInstruction * isImmediate; + AbstractInstruction * isLargeNegativeInteger; + AbstractInstruction * isLargePositiveInteger; + sqInt quickConstant; + AbstractInstruction * trueResult; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = smallIntegerTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, valueReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetClassIndexOfNonImminto(objectReg, TempReg); + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, ClassLargePositiveInteger, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(ClassLargePositiveInteger)); + } + /* begin JumpNonZero: */ + isLargePositiveInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, ClassLargeNegativeInteger, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(ClassLargeNegativeInteger)); + } + /* begin JumpNonZero: */ + isLargeNegativeInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, valueReg, valueReg); + /* begin Jump: */ + falseResult = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + trueResult = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isLargePositiveInteger, trueResult); + jmpTarget(isLargeNegativeInteger, trueResult); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Label */ + cont = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(falseResult, cont); + jmpTarget(isImmediate, cont); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsPointers:to: */ +static void NoDbgRegParms +genLcIsPointersto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotPointers; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(9)); + } + /* begin JumpGreaterOrEqual: */ + isNotPointers = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotPointers, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWordsOrBytes:to: */ +static void NoDbgRegParms +genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBits; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(9)); + } + /* begin JumpLess: */ + isNotBits = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, 24, valueReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(24)); + } + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBits, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWords:to: */ +static void NoDbgRegParms +genLcIsWordsto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotWords; + sqInt quickConstant2; + sqInt quickConstant3; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant3 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(AndCqR, quickConstant3, valueReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant3)); + } + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpNonZero: */ + isNotWords = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotWords, falseTarget); + + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:at: */ +static void NoDbgRegParms +genLcLoadObjectat(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, fieldIndex, object, object); + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:field: */ +static void NoDbgRegParms +genLcLoadObjectfield(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 8 + (BytesPerOop * fieldIndex), object, object); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8 + (BytesPerOop * fieldIndex))); + } + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:at: */ +static void NoDbgRegParms +genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8)); + } + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, value, fieldIndex, object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:field: */ +static void NoDbgRegParms +genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, value, 8 + (fieldIndex * BytesPerOop), object); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(8 + (fieldIndex * BytesPerOop))); + } +} + + +/* Generate a call to code that allocates a new Array of size. + The Array should be initialized with nils iff initialized is true. + The size arg is passed in SendNumArgsReg, the result + must come back in ReceiverResultReg. */ + + /* CogObjectRepresentationForSpur>>#genNewArrayOfSize:initialized: */ +static sqInt NoDbgRegParms +genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + sqInt constant; + usqLong header; + sqInt i; + sqInt offset; + sqInt offset1; + sqInt quickConstant; + sqInt quickConstant1; + AbstractInstruction *skip; + + assert(size < (numSlotsMask())); + header = headerForSlotsformatclassIndex(size, arrayFormat(), ClassArrayCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(header >> 32)); + } + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); + } + if (initialized + && (size > 0)) { + /* begin genMoveConstant:R: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction6 = genoperandoperand(MoveCqR, constant, TempReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(constant)); + } + } + for (i = 0; i < size; i += 1) { + /* begin MoveR:Mw:r: */ + offset = (i * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + } + } + /* begin LoadEffectiveAddressMw:r:R: */ + offset1 = smallObjectBytesForSlots(size); + /* begin gen:quickConstant:operand:operand: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset1, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset1)); + } + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + /* begin CmpCq:R: */ + quickConstant1 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. Do /not/ initialize the copied values. */ + + /* CogObjectRepresentationForSpur>>#genNoPopCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + usqLong header; + sqInt numSlots; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultRega and thence in ClassReg. */ + genGetActiveContextNumArgslargeinBlock(ctxtNumArgs, isLargeCtxt, isInBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + numSlots = ClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ReceiverResultReg)); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(header >> 32)); + } + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(4)); + } + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction4 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(byteSize)); + } + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + /* begin CmpCq:R: */ + quickConstant3 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + if (usesOutOfLineLiteral(anInstruction10)) { + (anInstruction10->dependent = locateLiteral(quickConstant3)); + } + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + offset = (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, ClassReg, offset, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset)); + } + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)bcpc << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(quickConstant1)); + } + /* begin MoveR:Mw:r: */ + offset1 = (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(offset1)); + } + /* begin MoveCq:R: */ + quickConstant2 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant2)); + } + /* begin MoveR:Mw:r: */ + offset2 = (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(offset2)); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveAsCharacter */ +static sqInt +genPrimitiveAsCharacter(void) +{ + AbstractInstruction *jumpNotInt; + AbstractInstruction *jumpOutOfRange; + sqInt reg; + + if (methodOrBlockNumArgs == 0) { + reg = ReceiverResultReg; + } + else { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + reg = Arg0Reg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotInt = genJumpNotSmallInteger(reg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + jumpOutOfRange = jumpNotCharacterUnsignedValueInRegister(TempReg); + genConvertSmallIntegerToCharacterInReg(reg); + if (reg != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOutOfRange, gLabel()); + if (reg != ReceiverResultReg) { + jmpTarget(jumpNotInt, getJmpTarget(jumpOutOfRange)); + } + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genPrimitiveIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *comp; + sqInt constant; + sqInt constant1; + AbstractInstruction *jumpCmp; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin CmpR:R: */ + comp = genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + if (orNot) { + /* begin JumpZero: */ + jumpCmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + else { + /* begin JumpNonZero: */ + jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCmp, gLabel()); + if (!orNot) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, ReceiverResultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant1)); + } + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveObjectAt */ +static sqInt +genPrimitiveObjectAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt headerReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBounds; + AbstractInstruction *jumpNotHeaderIndex; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); + /* begin CmpCq:R: */ + quickConstant1 = (((usqInt)1 << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpNonZero: */ + jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, headerReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); + /* begin SubCq:R: */ + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, headerReg, Arg0Reg); + /* begin JumpAbove: */ + jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin AddCq:R: */ + quickConstant2 = ((usqInt) BaseHeaderSize) >> (shiftForWord()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant2)); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpBounds, gAddCqR(((((usqInt)1 << 1) | 1)) - (smallIntegerTag()), Arg0Reg)); + jmpTarget(jumpBadIndex, gLabel()); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: lengthOf:baseHeader:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationForSpur>>#genPrimitiveSize */ +static sqInt +genPrimitiveSize(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt jic; + sqInt jnx; + AbstractInstruction *jump32BitLongsDone; + AbstractInstruction *jumpArrayDone; + AbstractInstruction * jumpBytesDone; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsContext1; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpNotIndexable1; + AbstractInstruction * jumpShortsDone; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + + jumpImm = genJumpImmediate(ReceiverResultReg); + /* begin genGetSizeOf:into:formatReg:scratchReg:abortJumpsInto: */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, SendNumArgsReg, TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpZero: */ + jumpArrayDone = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpLess: */ + jumpNotIndexable1 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpLessOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant3)); + } + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(quickConstant4)); + } + /* begin JumpGreaterOrEqual: */ + jump32BitLongsDone = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable1, gLabel()); + /* begin Jump: */ + jumpNotIndexable1 = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(BytesPerWord - 1)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpBytesDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + anInstruction6 = genoperandoperand(AndCqR, 1, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(1)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpShortsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SendNumArgsReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(ClassMethodContextCompactIndex)); + } + /* begin JumpZero: */ + jumpIsContext1 = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, ClassReg); + genGetClassObjectOfClassIndexintoscratchReg(SendNumArgsReg, ClassReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ClassReg, SendNumArgsReg); + genConvertSmallIntegerToIntegerInReg(SendNumArgsReg); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin AndCq:R: */ + quickConstant5 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant5, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(quickConstant5)); + } + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + jmpTarget(jumpArrayDone, jmpTarget(jump32BitLongsDone, jmpTarget(jumpShortsDone, jmpTarget(jumpBytesDone, gLabel())))); + jumpNotIndexable = jumpNotIndexable1; + jumpIsContext = jumpIsContext1; + + genConvertIntegerToSmallIntegerInReg(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImm, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genSetSmallIntegerTagsIn(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, scratchReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + return 0; +} + + +/* Create a trampoline to store-check the update of the receiver in a + closure's outerContext in compileBlockFrameBuild:. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckContextReceiverTrampoline */ +static sqInt +genStoreCheckContextReceiverTrampoline(void) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg0Reg, TempReg, 0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceStoreCheckContextReceiver", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate the code for a store check of valueReg into destReg. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckReceiverReg:valueReg:scratchReg:inFrame: */ +static sqInt NoDbgRegParms +genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, sqInt scratchReg, sqInt inFrame) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction * inst; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt wordConstant; + + + /* Is value stored an immediate? If so we're done */ + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(valueReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, scratchReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, valueReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + assert(destReg == ReceiverResultReg); + /* begin evaluateTrampolineCallBlock:protectLinkRegIfNot: */ + if (inFrame) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + } + else { + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + + /* begin PopR: */ + genoperand(PopR, LinkReg); + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:destReg:scratchReg:inFrame:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + if (needsStoreCheck) { + return genStoreCheckReceiverRegvalueRegscratchReginFrame(destReg, sourceReg, scratchReg, inFrame); + } + return 0; +} + + +/* This method is used for unchecked stores in objects after their creation + (typically, inlined creation of Array, closures and some temp vectors). + Currently there is no need to do the immutability check here + */ + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:intoNewObjectInDestReg: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin MoveR:Mw:r: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + return 0; +} + + +/* Convention: + - RcvrResultReg holds the object mutated. + If immutability failure: + - TempReg holds the instance variable index mutated + if instVarIndex > numDedicatedStoreTrampoline + - ClassReg holds the value to store + Registers are not lived across this trampoline as the + immutability failure may need new stack frames. */ + + /* CogObjectRepresentationForSpur>>#genStoreTrampolineCalled:instVarIndex: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex) +{ + AbstractInstruction *jumpRC; + AbstractInstruction *jumpSC; + + zeroOpcodeIndex(); + jumpSC = genJumpMutablescratchReg(ReceiverResultReg, SendNumArgsReg); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceCannotAssignTowithIndexvalueToAssign, 3, ReceiverResultReg, (instVarIndex < (NumStoreTrampolines - 1) + ? (/* begin trampolineArgConstant: */ + assert(instVarIndex >= 0), + -2 - instVarIndex) + : TempReg), ClassReg, null, 0, 1, NoReg); + jmpTarget(jumpSC, gLabel()); + if (CheckRememberedInTrampoline) { + jumpRC = genCheckRememberedBitOfscratch(ReceiverResultReg, SendNumArgsReg); + assert(((jumpRC->opcode)) == JumpNonZero); + (jumpRC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + + jmpTarget(jumpRC, gLabel()); + } + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, trampolineName, 1, ReceiverResultReg, null, null, null, 0, 1, NoReg, 1); +} +#endif /* IMMUTABILITY */ + + +/* Store check code is duplicated to use a single trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityAndStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutableJump; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt offset; + sqInt wordConstant; + + immutableJump = genJumpImmutablescratchReg(destReg, scratchReg); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(sourceReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, scratchReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, sourceReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + jmpTarget(immutableJump, gLabel()); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, index, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(index)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Gen an immutability check with no store check (e.g. assigning an immediate + literal) + */ +/* imm check has its own trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityButNoStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + sqInt offset; + + mutableJump = genJumpMutablescratchReg(destReg, scratchReg); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, index, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(index)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + offset = (index * BytesPerWord) + BaseHeaderSize; + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, offset, destReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + jmpTarget(immutabilityFailure, gLabel()); + return 0; +} +#endif /* IMMUTABILITY */ + + +/* We know there is a frame as immutability check requires a frame */ +/* needRestoreRcvr has to be true to keep RcvrResultReg live with the + receiver in it across the trampoline + */ +/* Trampoline convention... */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityCheckSourceReg:slotIndex:destReg:scratchReg:needsStoreCheck:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr) +{ + assert(destReg == ReceiverResultReg); + assert(scratchReg == TempReg); + assert(sourceReg == ClassReg); + if (needsStoreCheck) { + genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + else { + genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Make sure SendNumArgsReg and ClassReg are available in addition to + ReceiverResultReg and TempReg in + genGetActiveContextNumArgs:large:inBlock:. + */ + + /* CogObjectRepresentationForSpur>>#getActiveContextAllocatesInMachineCode */ +static sqInt +getActiveContextAllocatesInMachineCode(void) +{ + return 1; +} + + +/* Since all cache tags in Spur are class indices none of + them are young or have to be updated in a scavenge. */ + + /* CogObjectRepresentationForSpur>>#inlineCacheTagIsYoung: */ +static sqInt NoDbgRegParms +inlineCacheTagIsYoung(sqInt cacheTag) +{ + return 0; +} + + /* CogObjectRepresentationForSpur>>#jumpNotCharacterUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotCharacterUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin CmpCq:R: */ + quickConstant = (1U << (numCharacterBits())) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in a machine code instruction preceding address + in cogMethodOrNil. + Answer if code was modified. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + storeLiteralbeforeFollowingAddress(backEnd(), objOop, address); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + +/* Mark and trace a literal in a sqInt variable of cogMethod. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:at: */ +static void NoDbgRegParms +markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return; + } + objOop = followForwarded(literal); + address[0] = objOop; + markAndTraceUpdatedLiteralin(objOop, cogMethod); +} + + +/* Common code to mark a literal in cogMethod and add + the cogMethod to youngReferrers if the literal is young. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceUpdatedLiteral:in: */ +static void NoDbgRegParms +markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil) +{ + if (isNonImmediate(objOop)) { + if ((cogMethodOrNil != null) + && (isYoungObject(objOop))) { + ensureInYoungReferrers(cogMethodOrNil); + } + markAndTrace(objOop); + } +} + + +/* If primIndex has an accessorDepth and fails, or it is external and fails + with PrimErrNoMemory, + call ceCheckAndMaybeRetryPrimitive if so If ceCheck.... answers true, + retry the primitive. */ + + /* CogObjectRepresentationForSpur>>#maybeCompileRetryOnPrimitiveFail: */ +static sqInt NoDbgRegParms +maybeCompileRetryOnPrimitiveFail(sqInt primIndex) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmp; + + if ((accessorDepthForPrimitiveIndex(primIndex)) >= 0) { + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + } + else { + if ((primNumberExternalCall()) != primIndex) { + return 0; + } + /* begin MoveAw:R: */ + address1 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, TempReg)); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(PrimErrNoMemory)); + } + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + compileCallFornumArgsargargargargresultRegregsToSave(ceCheckAndMaybeRetryPrimitive, 1, trampolineArgConstant(primIndex), null, null, null, TempReg, 0); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* Generate a shift of the register containing the class tag in a method + cache probe. + c.f. SpurMemoryManager>>methodCacheHashOf:with: */ + + /* CogObjectRepresentationForSpur>>#maybeShiftClassTagRegisterForMethodCacheProbe: */ +static sqInt NoDbgRegParms +maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg) +{ + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 2, classTagReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#numCharacterBits */ +static sqInt +numCharacterBits(void) +{ + return 30; +} + + +/* Define how many register arguments a StackToRegisterMappingCogit can + and should use with the receiver. The value must be 0, 1 or 2. Note that a + SimpleStackBasedCogit always has 0 register args (although the receiver is + passed in a register). The Spur object representation is simple enough + that implementing at:put: is straight-forward and hence 2 register args + are worth + while. The method must be inlined in CoInterpreter, and dead code + eliminated so that the register-popping enilopmarts such as + enterRegisterArgCogMethod:- at:receiver: do not have to be implemented in + SimpleStackBasedCogit. */ + + /* CogObjectRepresentationForSpur>>#numRegArgs */ +sqInt +numRegArgs(void) +{ + return 2; +} + + /* CogObjectRepresentationForSpur>>#remapObject: */ +static sqInt NoDbgRegParms +remapObject(sqInt objOop) +{ + assert(addressCouldBeObj(objOop)); + return (shouldRemapObj(objOop) + ? remapObj(objOop) + : objOop); +} + + /* CogObjectRepresentationForSpur>>#remapOop: */ +static sqInt NoDbgRegParms +remapOop(sqInt objOop) +{ + return (shouldRemapOop(objOop) + ? remapObj(objOop) + : objOop); +} + + +/* Objects in newSpace or oldSpace except nil, true, false & + classTableRootObj need to be annotated. + */ + + /* CogObjectRepresentationForSpur>>#shouldAnnotateObjectReference: */ +static sqInt NoDbgRegParms +shouldAnnotateObjectReference(sqInt anOop) +{ + return (isNonImmediate(anOop)) + && ((oopisGreaterThan(anOop, classTableRootObj())) + || (oopisLessThan(anOop, nilObject()))); +} + + /* CogObjectRepresentationForSpur>>#slotOffsetOfInstVarIndex: */ +static sqInt NoDbgRegParms +slotOffsetOfInstVarIndex(sqInt index) +{ + return (index * BytesPerWord) + BaseHeaderSize; +} + + /* CogOutOfLineLiteralsARMCompiler>>#cmpC32RTempByteSize */ +static sqInt NoDbgRegParms +cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize) +{ + return 8; +} + + +/* Generate an out-of-line literal. Copy the value and any annotation from + the stand-in in the literals manager. */ + + /* CogOutOfLineLiteralsARMCompiler>>#concretizeLiteral */ +static AbstractInstruction * NoDbgRegParms +concretizeLiteral(AbstractInstruction * self_in_concretizeLiteral) +{ + usqIntptr_t literal; + AbstractInstruction * literalAsInstruction; + + literalAsInstruction = ((AbstractInstruction *) (((self_in_concretizeLiteral->operands))[0])); + literal = ((addressIsInInstructions(literalAsInstruction)) + || (literalAsInstruction == (methodLabel())) + ? (literalAsInstruction->address) + : ((usqInt)literalAsInstruction)); + assert((((self_in_concretizeLiteral->dependent)) != null) + && (((((self_in_concretizeLiteral->dependent))->opcode)) == Literal)); + if (!(((((self_in_concretizeLiteral->dependent))->annotation)) == null)) { + assert(((self_in_concretizeLiteral->annotation)) == null); + (self_in_concretizeLiteral->annotation) = (((self_in_concretizeLiteral->dependent))->annotation); + } + if (!(((((self_in_concretizeLiteral->dependent))->address)) == null)) { + assert(((((self_in_concretizeLiteral->dependent))->address)) == ((self_in_concretizeLiteral->address))); + } + (((self_in_concretizeLiteral->dependent))->address = (self_in_concretizeLiteral->address)); + /* begin machineCodeAt:put: */ + ((self_in_concretizeLiteral->machineCode))[0 / 4] = literal; + (self_in_concretizeLiteral->machineCodeSize) = 4; + return self_in_concretizeLiteral; +} + + /* CogOutOfLineLiteralsARMCompiler>>#inlineCacheTagAt: */ +static sqInt NoDbgRegParms +inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress) +{ + return longAt(pcRelativeAddressAt(self_in_inlineCacheTagAt, ((usqInt)(callSiteReturnAddress - 8)))); +} + + +/* Answer if the receiver is a pc-dependent instruction. With out-of-line + literals any instruction + that refers to a literal depends on the address of the literal, so add + them in addition to the jumps. */ + + /* CogOutOfLineLiteralsARMCompiler>>#isPCDependent */ +static sqInt NoDbgRegParms +isPCDependent(AbstractInstruction * self_in_isPCDependent) +{ + return (isJump(self_in_isPCDependent)) + || ((((self_in_isPCDependent->opcode)) == AlignmentNops) + || ((((self_in_isPCDependent->opcode)) != Literal) + && ((((self_in_isPCDependent->dependent)) != null) + && (((((self_in_isPCDependent->dependent))->opcode)) == Literal)))); +} + + +/* Return the literal referenced by the instruction immediately preceding + followingAddress. + */ + + /* CogOutOfLineLiteralsARMCompiler>>#literalBeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress) +{ + return longAt(pcRelativeAddressAt(self_in_literalBeforeFollowingAddress, (instructionIsLDR(self_in_literalBeforeFollowingAddress, longAt(followingAddress - 4)) + ? (/* begin instructionAddressBefore: */ + followingAddress - 4) + : (/* begin instructionAddressBefore: */ + (followingAddress - 4) - 4)))); +} + + +/* Answer the size of a literal load instruction (which does not include the + size of the literal). + With out-of-line literals this is always a single LDR instruction that + refers to the literal. + */ + + /* CogOutOfLineLiteralsARMCompiler>>#literalLoadInstructionBytes */ +static sqInt NoDbgRegParms +literalLoadInstructionBytes(AbstractInstruction * self_in_literalLoadInstructionBytes) +{ + return 4; +} + + +/* Answer the byte size of a MoveCwR opcode's corresponding machine code. On + ARM this is a single instruction pc-relative register load - unless we + have made a mistake and not turned on the out of line literals manager + */ + + /* CogOutOfLineLiteralsARMCompiler>>#loadLiteralByteSize */ +static sqInt NoDbgRegParms +loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize) +{ + return 4; +} + + +/* Answer the NSSendCache for the return address of a Newspeak + self, super, outer, or implicit receiver send. */ + + /* CogOutOfLineLiteralsARMCompiler>>#nsSendCacheAt: */ +static sqInt NoDbgRegParms +nsSendCacheAt(AbstractInstruction * self_in_nsSendCacheAt, sqInt callSiteReturnAddress) +{ + return longAt(pcRelativeAddressAt(self_in_nsSendCacheAt, ((usqInt)(callSiteReturnAddress - 8)))); +} + + +/* The maximum offset in a LDR is (1<<12)-1, or (1<<10)-1 instructions. + Be conservative. The issue is that one abstract instruction can emit + multiple hardware instructions so we assume a 2 to 1 worst case of + hardware instructions to abstract opcodes.. */ + + /* CogOutOfLineLiteralsARMCompiler>>#outOfLineLiteralOpcodeLimit */ +static sqInt NoDbgRegParms +outOfLineLiteralOpcodeLimit(AbstractInstruction * self_in_outOfLineLiteralOpcodeLimit) +{ + return (1U << ((12 - 2) - 1)) - 1; +} + + +/* Extract the address of the ldr rX, [pc, #NNN] instruction at address */ + + /* CogOutOfLineLiteralsARMCompiler>>#pcRelativeAddressAt: */ +static sqInt NoDbgRegParms +pcRelativeAddressAt(AbstractInstruction * self_in_pcRelativeAddressAt, sqInt instrAddress) +{ + sqInt inst; + sqInt offset; + + inst = longAt(instrAddress); + assert((inst & 4284416000U) == (ldrrnplusimm(self_in_pcRelativeAddressAt, 0, PC, 0, 0))); + offset = inst & 0xFFF; + return (instrAddress + 8) + ((inst & (1U << 23) + ? offset + : -offset)); +} + + +/* If possible we generate the method address using pc-relative addressing. + If so we don't need to relocate it in code. So check if pc-relative code + was generated, and if not, adjust a load literal. There are two cases, a + push or a register load. If a push, then there is a register load, but in + the instruction + before. */ + + /* CogOutOfLineLiteralsARMCompiler>>#relocateMethodReferenceBeforeAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta) +{ + sqInt litAddr; + sqInt pcPrecedingLoad; + sqInt reference; + + + /* If the load is not done via pc-relative addressing we have to relocate. */ + pcPrecedingLoad = (instructionIsPush(self_in_relocateMethodReferenceBeforeAddressby, longAt(pc - 4)) + ? pc - 4 + : pc); + if (!(isPCRelativeValueLoad(self_in_relocateMethodReferenceBeforeAddressby, longAt(pcPrecedingLoad - 4)))) { + litAddr = pcRelativeAddressAt(self_in_relocateMethodReferenceBeforeAddressby, pcPrecedingLoad); + reference = longAt(litAddr); + longAtput(litAddr, reference + delta); + } + return self_in_relocateMethodReferenceBeforeAddressby; +} + + +/* Rewrite a CallFull or JumpFull instruction to transfer to a different + target. This variant is used to rewrite cached primitive calls where we + load the target address into ip + and use the 'bx ip' or 'blx ip' instruction for the actual jump or call. + Answer the extent + of the code change which is used to compute the range of the icache to + flush. + */ + + /* CogOutOfLineLiteralsARMCompiler>>#rewriteFullTransferAt:target:expectedInstruction: */ +static sqInt NoDbgRegParms +rewriteFullTransferAttargetexpectedInstruction(AbstractInstruction * self_in_rewriteFullTransferAttargetexpectedInstruction, usqInt callSiteReturnAddress, usqInt callTargetAddress, sqInt expectedInstruction) +{ + assert((instructionBeforeAddress(self_in_rewriteFullTransferAttargetexpectedInstruction, callSiteReturnAddress)) == expectedInstruction); + longAtput(pcRelativeAddressAt(self_in_rewriteFullTransferAttargetexpectedInstruction, callSiteReturnAddress - 8), callTargetAddress); + return 0; +} + + +/* Rewrite an inline cache to call a different target for a new tag. This + variant is used + to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of + the code + change which is used to compute the range of the icache to flush. */ + + /* CogOutOfLineLiteralsARMCompiler>>#rewriteInlineCacheAt:tag:target: */ +static sqInt NoDbgRegParms +rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress) +{ + sqInt call; + usqInt callDistance; + + if (!(callTargetAddress >= (minCallAddress()))) { + error("linking callsite to invalid address"); + } + + /* pc offset */ + /* return offset */ + callDistance = ((usqInt) (callTargetAddress - ((callSiteReturnAddress + 8) - 4))); + assert(isInImmediateJumpRange(self_in_rewriteInlineCacheAttagtarget, callDistance)); + call = bl(self_in_rewriteInlineCacheAttagtarget, callDistance); + longAtput(callSiteReturnAddress - 4, call); + longAtput(pcRelativeAddressAt(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 8), cacheTag); + assert((inlineCacheTagAt(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress)) == cacheTag); + return 4; +} + + +/* Rewrite an inline cache with a new tag. This variant is used + by the garbage collector. */ + + /* CogOutOfLineLiteralsARMCompiler>>#rewriteInlineCacheTag:at: */ +static AbstractInstruction * NoDbgRegParms +rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, sqInt callSiteReturnAddress) +{ + longAtput(pcRelativeAddressAt(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 8), cacheTag); + return self_in_rewriteInlineCacheTagat; +} + + +/* Size a jump and set its address. The target may be another instruction + or an absolute address. On entry the address inst var holds our virtual + address. On exit address is set to eventualAbsoluteAddress, which is + where this instruction will be output. The span of a jump to a following + instruction is therefore between that instruction's address and this + instruction's address ((which are both still their virtual addresses), but + the span of a jump to a preceding instruction or to an absolute address is + between that instruction's address (which by now is its eventual absolute + address) or absolute address and eventualAbsoluteAddress. + + ARM is simple; the 26-bit call/jump range means no short jumps. This + routine only has to determine the targets of jumps, not determine sizes. + + This version also deals with out-of-line literals. If this is the real + literal, update the stand-in in literalsManager with the address (because + instructions referring to the literal are referring to the stand-in). If + this is annotated with + IsObjectReference transfer the annotation to the stand-in, whence it will + be transferred to the real literal, simplifying update of literals. */ + + /* CogOutOfLineLiteralsARMCompiler>>#sizePCDependentInstructionAt: */ +static usqInt NoDbgRegParms +sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress) +{ + usqIntptr_t alignment; + + if (((self_in_sizePCDependentInstructionAt->opcode)) == AlignmentNops) { + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + alignment = ((self_in_sizePCDependentInstructionAt->operands))[0]; + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = ((eventualAbsoluteAddress + (alignment - 1)) & (-alignment)) - eventualAbsoluteAddress); + } + assert((isJump(self_in_sizePCDependentInstructionAt)) + || ((((self_in_sizePCDependentInstructionAt->opcode)) == Call) + || ((((self_in_sizePCDependentInstructionAt->opcode)) == CallFull) + || ((((self_in_sizePCDependentInstructionAt->dependent)) != null) + && (((((self_in_sizePCDependentInstructionAt->dependent))->opcode)) == Literal))))); + if (isJump(self_in_sizePCDependentInstructionAt)) { + resolveJumpTarget(self_in_sizePCDependentInstructionAt); + } + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + if ((((self_in_sizePCDependentInstructionAt->dependent)) != null) + && (((((self_in_sizePCDependentInstructionAt->dependent))->opcode)) == Literal)) { + if (((self_in_sizePCDependentInstructionAt->opcode)) == Literal) { + (((self_in_sizePCDependentInstructionAt->dependent))->address = (self_in_sizePCDependentInstructionAt->address)); + } + if (((self_in_sizePCDependentInstructionAt->annotation)) == (getIsObjectReference())) { + (((self_in_sizePCDependentInstructionAt->dependent))->annotation = (self_in_sizePCDependentInstructionAt->annotation)); + (self_in_sizePCDependentInstructionAt->annotation) = null; + } + } + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = (self_in_sizePCDependentInstructionAt->maxSize)); +} + + +/* Rewrite the literal in the instruction immediately preceding + followingAddress. + */ + + /* CogOutOfLineLiteralsARMCompiler>>#storeLiteral:beforeFollowingAddress: */ +static AbstractInstruction * NoDbgRegParms +storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress) +{ + longAtput(pcRelativeAddressAt(self_in_storeLiteralbeforeFollowingAddress, (instructionIsLDR(self_in_storeLiteralbeforeFollowingAddress, longAt(followingAddress - 4)) + ? (/* begin instructionAddressBefore: */ + followingAddress - 4) + : (/* begin instructionAddressBefore: */ + (followingAddress - 4) - 4))), literal); + return self_in_storeLiteralbeforeFollowingAddress; +} + + +/* Update an instruction that depends on a label outside + of generated code (e.g. a method or block header). */ + + /* CogOutOfLineLiteralsARMCompiler>>#updateLabel: */ +static AbstractInstruction * NoDbgRegParms +updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction) +{ + if (((self_in_updateLabel->opcode)) != Literal) { + assert((((self_in_updateLabel->opcode)) == MoveCwR) + || (((self_in_updateLabel->opcode)) == PushCw)); + ((self_in_updateLabel->operands))[0] = (((labelInstruction->address)) + (labelOffset(labelInstruction))); + } + return self_in_updateLabel; +} + + +/* Answer if the receiver uses an out-of-line literal. Needs only + to work for the opcodes created with gen:literal:operand: et al. */ + + /* CogOutOfLineLiteralsARMCompiler>>#usesOutOfLineLiteral */ +static sqInt NoDbgRegParms +usesOutOfLineLiteral(AbstractInstruction * self_in_usesOutOfLineLiteral) +{ + sqInt constant; + sqInt constant1; + sqInt constant2; + sqInt constant3; + sqInt constant4; + sqInt constant5; + sqInt i; + sqInt i1; + sqInt i2; + sqInt i3; + sqInt i4; + sqInt n; + sqInt r; + sqInt u; + sqInt value; + unsigned int value1; + unsigned int value2; + + + switch ((self_in_usesOutOfLineLiteral->opcode)) { + case CallFull: + case JumpFull: + case AddCwR: + case AndCwR: + case CmpCwR: + case OrCwR: + case SubCwR: + case XorCwR: + return 1; + + case AddCqR: + case CmpCqR: + case SubCqR: + /* begin rotateable8bitSignedImmediate:ifTrue:ifFalse: */ + constant = ((self_in_usesOutOfLineLiteral->operands))[0]; + value = constant; + while (1) { + if ((value & 0xFF) == value) { + return 0; + + } + for (i1 = 2; i1 <= 30; i1 += 2) { + if ((value & (((0xFFU << i1) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i1)))) == value) { + return 0; + + } + } + if (!((value == constant) + && (constant != 0))) break; + value = -constant; + } + return 1; + + + case AndCqR: + case AndCqRR: + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + constant1 = ((self_in_usesOutOfLineLiteral->operands))[0]; + value1 = constant1; + while (1) { + if ((value1 & 0xFF) == value1) { + return 0; + + } + for (i2 = 2; i2 <= 30; i2 += 2) { + if ((value1 & (((0xFFU << i2) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i2)))) == value1) { + return 0; + + } + } + if (!(value1 == constant1)) break; + value1 = (constant1 < 0 + ? -1 - constant1 + : (unsigned int)~constant1); + } + return (1U << (highBit(((self_in_usesOutOfLineLiteral->operands))[0]))) != ((((self_in_usesOutOfLineLiteral->operands))[0]) + 1); + + + case OrCqR: + case TstCqR: + case LoadEffectiveAddressMwrR: + case MoveCqR: + case MoveM16rR: + case PushCq: + /* begin rotateable8bitImmediate:ifTrue:ifFalse: */ + constant2 = ((self_in_usesOutOfLineLiteral->operands))[0]; + if ((constant2 & 0xFF) == constant2) { + return 0; + + } + for (i3 = 2; i3 <= 30; i3 += 2) { + if ((constant2 & (((0xFFU << i3) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i3)))) == constant2) { + return 0; + + } + } + return 1; + + + case XorCqR: + /* begin rotateable8bitBitwiseImmediate:ifTrue:ifFalse: */ + constant3 = ((self_in_usesOutOfLineLiteral->operands))[0]; + value2 = constant3; + while (1) { + if ((value2 & 0xFF) == value2) { + return 0; + + } + for (i4 = 2; i4 <= 30; i4 += 2) { + if ((value2 & (((0xFFU << i4) & 0xFFFFFFFFU) | (((usqInt) 0xFF) >> (32 - i4)))) == value2) { + return 0; + + } + } + if (!(value2 == constant3)) break; + value2 = (constant3 < 0 + ? -1 - constant3 + : (unsigned int)~constant3); + } + return 1; + + + case MoveCwR: + case PushCw: + return !(inCurrentCompilation(self_in_usesOutOfLineLiteral, ((self_in_usesOutOfLineLiteral->operands))[0])); + + case MoveAwR: + case MoveAbR: + case PrefetchAw: + return (isAddressRelativeToVarBase(self_in_usesOutOfLineLiteral, ((self_in_usesOutOfLineLiteral->operands))[0]) + ? 0 + : 1); + + case MoveRAw: + case MoveRAb: + return (isAddressRelativeToVarBase(self_in_usesOutOfLineLiteral, ((self_in_usesOutOfLineLiteral->operands))[1]) + ? 0 + : 1); + + case MoveRMwr: + case MoveRdM64r: + case MoveRMbr: + case MoveRM16r: + /* begin is12BitValue:ifTrue:ifFalse: */ + constant4 = ((self_in_usesOutOfLineLiteral->operands))[1]; + if ((SQABS(constant4)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (constant4 >= 0) { + return 0; + + } + else { + return 0; + + } + } + else { + return 1; + + } + + case MoveMbrR: + case MoveM64rRd: + case MoveMwrR: + /* begin is12BitValue:ifTrue:ifFalse: */ + constant5 = ((self_in_usesOutOfLineLiteral->operands))[0]; + if ((SQABS(constant5)) <= 0xFFF) { + + /* (2 raisedTo: 12)-1 */ + if (constant5 >= 0) { + return 0; + + } + else { + return 0; + + } + } + else { + return 1; + + } + + default: + assert(0); + + } + return 0; +} + + /* CogSimStackEntry>>#ensureSpilledAt:from: */ +static SimStackEntry * NoDbgRegParms +ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg; + + if ((self_in_ensureSpilledAtfrom->spilled)) { + if (((self_in_ensureSpilledAtfrom->type)) == SSSpill) { + assert((((self_in_ensureSpilledAtfrom->offset)) == baseOffset) + && (((self_in_ensureSpilledAtfrom->registerr)) == baseRegister)); + return self_in_ensureSpilledAtfrom; + } + } + assert(((self_in_ensureSpilledAtfrom->type)) != SSSpill); + traceSpill(self_in_ensureSpilledAtfrom); + if (((self_in_ensureSpilledAtfrom->type)) == SSConstant) { + /* begin genPushConstant: */ + constant = (self_in_ensureSpilledAtfrom->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gPushCw(constant), constant); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); + } + inst = anInstruction1; + } + } + else { + if (((self_in_ensureSpilledAtfrom->type)) == SSBaseOffset) { + /* begin MoveMw:r:R: */ + offset = (self_in_ensureSpilledAtfrom->offset); + baseReg = (self_in_ensureSpilledAtfrom->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin PushR: */ + inst = genoperand(PushR, TempReg); + } + else { + assert(((self_in_ensureSpilledAtfrom->type)) == SSRegister); + /* begin PushR: */ + reg = (self_in_ensureSpilledAtfrom->registerr); + inst = genoperand(PushR, reg); + } + (self_in_ensureSpilledAtfrom->type) = SSSpill; + (self_in_ensureSpilledAtfrom->offset) = baseOffset; + (self_in_ensureSpilledAtfrom->registerr) = baseRegister; + } + (self_in_ensureSpilledAtfrom->spilled) = 1; + return self_in_ensureSpilledAtfrom; +} + + /* CogSimStackEntry>>#popToReg: */ +static SimStackEntry * NoDbgRegParms +popToReg(SimStackEntry * self_in_popToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + if ((self_in_popToReg->spilled)) { + /* begin PopR: */ + inst = genoperand(PopR, reg); + } + else { + + switch ((self_in_popToReg->type)) { + case SSBaseOffset: + /* begin MoveMw:r:R: */ + offset = (self_in_popToReg->offset); + baseReg = (self_in_popToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_popToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); + } + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_popToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_popToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_popToReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackEntry>>#registerMask */ +static sqInt NoDbgRegParms +registerMask(SimStackEntry * self_in_registerMask) +{ + sqInt reg; + + return ((((self_in_registerMask->type)) == SSBaseOffset) + || (((self_in_registerMask->type)) == SSRegister) + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerMaskOrNone */ +static sqInt NoDbgRegParms +registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone) +{ + sqInt reg; + + return (((self_in_registerMaskOrNone->type)) == SSRegister + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMaskOrNone->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerOrNone */ +static sqInt NoDbgRegParms +registerOrNone(SimStackEntry * self_in_registerOrNone) +{ + return (((self_in_registerOrNone->type)) == SSRegister + ? (self_in_registerOrNone->registerr) + : NoReg); +} + + /* CogSimStackEntry>>#storeToReg: */ +static SimStackEntry * NoDbgRegParms +storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + + switch ((self_in_storeToReg->type)) { + case SSBaseOffset: + case SSSpill: + /* begin MoveMw:r:R: */ + offset = (self_in_storeToReg->offset); + baseReg = (self_in_storeToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_storeToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); + } + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_storeToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_storeToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_storeToReg; +} + + /* CogSimStackNativeEntry>>#ensureIsMarkedAsSpilled */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled) +{ + if (!((self_in_ensureIsMarkedAsSpilled->spilled))) { + + switch ((self_in_ensureIsMarkedAsSpilled->type)) { + case SSNativeRegister: + case SSConstantInt32: + case SSConstantNativePointer: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + case SSConstantFloat32: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + case SSConstantFloat64: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat64; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureIsMarkedAsSpilled->spilled) = 1; + return self_in_ensureIsMarkedAsSpilled; +} + + /* CogSimStackNativeEntry>>#ensureSpilledSP:scratchRegister: */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt offset4; + sqInt offset5; + sqInt offset6; + sqInt offset7; + sqInt offset8; + sqInt quickConstant; + sqInt sourceDPReg; + sqInt sourceDPReg1; + sqInt sourceReg; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + sqInt wordConstant4; + + if (!((self_in_ensureSpilledSPscratchRegister->spilled))) { + + switch ((self_in_ensureSpilledSPscratchRegister->type)) { + case SSNativeRegister: + /* begin MoveR:Mw:r: */ + sourceReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, spRegister); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + /* begin MoveRs:M32:r: */ + sourceDPReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset1 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRsM32r, sourceDPReg, offset1, spRegister); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset1)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + /* begin MoveRd:M64:r: */ + sourceDPReg1 = (self_in_ensureSpilledSPscratchRegister->registerr); + offset2 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRdM64r, sourceDPReg1, offset2, spRegister); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset2)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantFloat32: + /* begin MoveCw:R: */ + wordConstant = asIEEE32BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, scratchRegister)); + /* begin MoveR:M32:r: */ + offset3 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction3 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset3, spRegister); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(offset3)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSConstantFloat64: + if (BytesPerWord == 4) { + /* begin MoveCw:R: */ + wordConstant1 = (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) & 0xFFFFFFFFU; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant1, genoperandoperand(MoveCwR, wordConstant1, scratchRegister)); + /* begin MoveR:M32:r: */ + offset4 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset4, spRegister); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(offset4)); + } + /* begin MoveCw:R: */ + wordConstant2 = (((((sqLong) -32)) < 0) ? ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) >> -(((sqLong) -32))) : ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) << (((sqLong) -32)))); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant2, genoperandoperand(MoveCwR, wordConstant2, scratchRegister)); + /* begin MoveR:M32:r: */ + offset5 = ((-((self_in_ensureSpilledSPscratchRegister->offset))) - 1) + 4; + /* begin gen:operand:quickConstant:operand: */ + anInstruction5 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset5, spRegister); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(offset5)); + } + } + else { + /* begin MoveCw:R: */ + wordConstant3 = asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant3, genoperandoperand(MoveCwR, wordConstant3, scratchRegister)); + /* begin MoveR:Mw:r: */ + offset6 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset6, spRegister); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(offset6)); + } + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_ensureSpilledSPscratchRegister->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction7 = genoperandoperand(MoveCqR, quickConstant, scratchRegister); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Mw:r: */ + offset7 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset7, spRegister); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(offset7)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant4 = (self_in_ensureSpilledSPscratchRegister->constantNativePointer); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant4, genoperandoperand(MoveCwR, wordConstant4, scratchRegister)); + /* begin MoveR:Mw:r: */ + offset8 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset8, spRegister); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(offset8)); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureSpilledSPscratchRegister->spilled) = 1; + return self_in_ensureSpilledSPscratchRegister; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeFloatRegisterMask */ +static sqInt NoDbgRegParms +nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask) +{ + sqInt reg; + + return ((((self_in_nativeFloatRegisterMask->type)) == SSRegisterSingleFloat) + || (((self_in_nativeFloatRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeFloatRegisterMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackNativeEntry>>#nativePopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + float constantFloat32; + double constantFloat64; + sqInt dpreg1; + sqInt dpreg11; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt quickConstant; + sqInt reg1; + sqInt wordConstant; + + if ((self_in_nativePopToReg->spilled)) { + loadNativeFramePointerInto(TempReg); + + switch ((self_in_nativePopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, TempReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, TempReg, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset1)); + } + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, TempReg, reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset2)); + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + else { + + switch ((self_in_nativePopToReg->type)) { + case SSNativeRegister: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRR, reg1, reg); + } + break; + case SSRegisterSingleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRs:Rs: */ + dpreg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRsRs, dpreg1, reg); + } + break; + case SSRegisterDoubleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRd:Rd: */ + dpreg11 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRdRd, dpreg11, reg); + } + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_nativePopToReg->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(MoveCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant)); + } + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant = (self_in_nativePopToReg->constantNativePointer); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, reg)); + break; + case SSConstantFloat32: + /* begin MoveCf32:Rs: */ + constantFloat32 = (self_in_nativePopToReg->constantFloat32); + genMoveCf32Rs(backEnd, constantFloat32, reg); + break; + case SSConstantFloat64: + /* begin MoveCf64:Rd: */ + constantFloat64 = (self_in_nativePopToReg->constantFloat64); + genMoveCf64Rd(backEnd, constantFloat64, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToReg; +} + + /* CogSimStackNativeEntry>>#nativePopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + sqInt reg1; + sqInt reg11; + sqInt reg12; + + assert(BytesPerWord == 4); + if ((self_in_nativePopToRegsecondReg->spilled)) { + /* begin PopR: */ + genoperand(PopR, reg); + /* begin PopR: */ + genoperand(PopR, secondReg); + } + else { + + switch ((self_in_nativePopToRegsecondReg->type)) { + case SSConstantInt64: + /* begin MoveCq:R: */ + quickConstant = ((sqInt) (((self_in_nativePopToRegsecondReg->constantInt64)) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin MoveCq:R: */ + quickConstant1 = ((sqInt) ((((usqInt) ((self_in_nativePopToRegsecondReg->constantInt64))) >> 32) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, secondReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + break; + case SSRegisterPair: + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (reg != ((self_in_nativePopToRegsecondReg->registerr))) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg1, TempReg); + } + /* begin MoveR:R: */ + reg11 = (self_in_nativePopToRegsecondReg->registerr); + genoperandoperand(MoveRR, reg11, reg); + } + if (((self_in_nativePopToRegsecondReg->registerSecond)) != secondReg) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, secondReg); + } + else { + /* begin MoveR:R: */ + reg12 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg12, secondReg); + } + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToRegsecondReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeRegisterMask */ +static sqInt NoDbgRegParms +nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask) +{ + sqInt reg; + + return ((((((self_in_nativeRegisterMask->type)) == SSBaseOffset) + || (((self_in_nativeRegisterMask->type)) == SSNativeRegister)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterSingleFloat)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeRegisterMask->registerr)), + 1U << reg) + : (((self_in_nativeRegisterMask->type)) == SSRegisterPair + ? (registerMaskFor((self_in_nativeRegisterMask->registerr))) | (registerMaskFor((self_in_nativeRegisterMask->registerSecond))) + : 0)); +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + sqInt offset1; + sqInt offset2; + + assert((self_in_nativeStackPopToReg->spilled)); + + switch ((self_in_nativeStackPopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset1)); + } + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset2)); + } + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToReg; +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + sqInt offset1; + + assert((self_in_nativeStackPopToRegsecondReg->spilled)); + + switch ((self_in_nativeStackPopToRegsecondReg->type)) { + case SSSpillInt64: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativeStackPopToRegsecondReg->offset))) + 4; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin MoveMw:r:R: */ + offset1 = -((self_in_nativeStackPopToRegsecondReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset1, FPReg, secondReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset1)); + } + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToRegsecondReg; +} + + /* CogSimStackNativeEntry>>#spillingNeedsScratchRegister */ +static sqInt NoDbgRegParms +spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister) +{ + if (!((self_in_spillingNeedsScratchRegister->spilled))) { + + switch ((self_in_spillingNeedsScratchRegister->type)) { + case SSConstantInt32: + case SSConstantInt64: + case SSConstantFloat32: + case SSConstantFloat64: + case SSConstantNativePointer: + return 1; + + default: + return 0; + + } + } + return 0; +} + + /* CogSimStackNativeEntry>>#stackSpillSize */ +static sqInt NoDbgRegParms +stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize) +{ + + switch ((self_in_stackSpillSize->type)) { + case SSConstantInt64: + case SSConstantFloat64: + case SSRegisterDoubleFloat: + case SSRegisterPair: + case SSSpillFloat64: + case SSSpillInt64: + return 8; + + default: + return BytesPerOop; + + } + return 0; +} + + /* CogSSBytecodeFixup>>#isMergeFixup */ +static sqInt NoDbgRegParms +isMergeFixup(BytecodeFixup * self_in_isMergeFixup) +{ + return (((usqInt)((self_in_isMergeFixup->targetInstruction)))) == NeedsMergeFixupFlag; +} + + +/* Allocate an unsharable Literal instruction for the literal and answer it. */ + + /* OutOfLineLiteralsManager>>#allocateLiteral: */ +static AbstractInstruction * NoDbgRegParms +allocateLiteral(sqInt aLiteral) +{ + AbstractInstruction *existingInst; + sqInt i; + sqInt iLimiT; + sqInt initialNumLiterals; + AbstractInstruction *litInst; + AbstractInstruction *newInst; + AbstractInstruction *newLiterals; + + if (nextLiteralIndex >= literalsSize) { + /* begin allocateLiterals: */ + initialNumLiterals = literalsSize + 8; + if (initialNumLiterals > literalsSize) { + + /* Must copy across state (not using realloc, cuz...) and + must also update existing instructions to refer to the new ones... + It's either this or modify all generation routines to be able to retry + with more literals after running out of literals. */ + newLiterals = calloc(initialNumLiterals, sizeof(CogAbstractInstruction)); + if (!(literals == null)) { + for (i = 0; i < nextLiteralIndex; i += 1) { + existingInst = literalInstructionAt(i); + newInst = (&(newLiterals[i])); + cloneLiteralFrom(newInst, existingInst); + assert(((existingInst->dependent)) == null); + (existingInst->dependent = newInst); + } + for (i = 0, iLimiT = (opcodeIndex - 1); i <= iLimiT; i += 1) { + existingInst = abstractInstructionAt(i); + if ((((existingInst->dependent)) != null) + && (((((existingInst->dependent))->opcode)) == Literal)) { + (existingInst->dependent = (((existingInst->dependent))->dependent)); + } + } + } + free(literals); + literals = newLiterals; + literalsSize = initialNumLiterals; + } + } + litInst = literalInstructionAt(nextLiteralIndex); + initializeUniqueLiteral(litInst, aLiteral); + + /* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */ + nextLiteralIndex += 1; + if (firstOpcodeIndex > opcodeIndex) { + firstOpcodeIndex = opcodeIndex - 1; + } + return litInst; +} + + /* OutOfLineLiteralsManager>>#checkLiteral:forInstruction: */ +static AbstractInstruction * NoDbgRegParms +checkLiteralforInstruction(sqInt literal, AbstractInstruction *anInstruction) +{ + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(literal)); + } + return anInstruction; +} + + +/* Output all pending literal instructions, making the originals dependents + of the generated ones + so that a later pass will copy the address of each generated literl inst + to its original in literals, + and hence allow the instruction using the literal to compute the correct + address.. + */ + + /* OutOfLineLiteralsManager>>#dumpLiterals: */ +static sqInt NoDbgRegParms +dumpLiterals(sqInt generateBranchAround) +{ + sqInt i; + sqInt index; + AbstractInstruction *jump; + AbstractInstruction *litInst; + + if (generateBranchAround) { + /* begin Jump: */ + jump = genoperand(Jump, ((sqInt)0)); + } + for (i = lastDumpedLiteralIndex; i < nextLiteralIndex; i += 1) { + litInst = literalInstructionAt(i); + ((genoperand(Literal, ((litInst->operands))[0]))->dependent = litInst); + /* begin setLiteralOpcodeIndex: */ + index = opcodeIndex; + assert(((litInst->opcode)) == Literal); + ((litInst->operands))[2] = index; + } + if (generateBranchAround) { + jmpTarget(jump, gLabel()); + } + /* begin getOpcodeIndex */ + firstOpcodeIndex = opcodeIndex; + lastDumpedLiteralIndex = nextLiteralIndex; + return 0; +} + + +/* return the offset need from the cPICEndSize in order to point to just + after the last instruction - here that means bytesPerOop * list size + */ + + /* OutOfLineLiteralsManager>>#endSizeOffset */ +static sqInt +endSizeOffset(void) +{ + return nextLiteralIndex * BytesPerOop; +} + + +/* A literal is in range if its opcode index is within + outOfLineLiteralOpcodeLimit, or if its index has yet to be assigned. */ + + /* OutOfLineLiteralsManager>>#literalInstructionInRange: */ +static sqInt NoDbgRegParms +literalInstructionInRange(AbstractInstruction *litInst) +{ + sqInt opcodeIdx; + + /* begin literalOpcodeIndex */ + assert(((litInst->opcode)) == Literal); + opcodeIdx = ((sqInt)(((litInst->operands))[2])); + return ((((sqInt)opcodeIdx)) < 0) + || ((assert((getOpcodeIndex()) >= opcodeIdx), + (opcodeIndex - opcodeIdx) < (outOfLineLiteralOpcodeLimit(backEnd())))); +} + + +/* Search for a Literal instruction that is in-range and answer it. Otherwise + allocate a new sharable Literal instruction for the literal and answer it. */ + + /* OutOfLineLiteralsManager>>#locateLiteral: */ +static AbstractInstruction * NoDbgRegParms +locateLiteral(sqInt aLiteral) +{ + AbstractInstruction *existingInst; + sqInt i; + sqInt i1; + sqInt iLimiT; + sqInt initialNumLiterals; + AbstractInstruction *litInst; + AbstractInstruction *newInst; + AbstractInstruction *newLiterals; + + for (i = 0; i < nextLiteralIndex; i += 1) { + litInst = literalInstructionAt(i); + if (((((litInst->operands))[0]) == aLiteral) + && (((assert(((litInst->opcode)) == Literal), + ((litInst->operands))[1])) + && (literalInstructionInRange(litInst)))) { + return litInst; + } + } + if (nextLiteralIndex >= literalsSize) { + /* begin allocateLiterals: */ + initialNumLiterals = literalsSize + 8; + if (initialNumLiterals > literalsSize) { + + /* Must copy across state (not using realloc, cuz...) and + must also update existing instructions to refer to the new ones... + It's either this or modify all generation routines to be able to retry + with more literals after running out of literals. */ + newLiterals = calloc(initialNumLiterals, sizeof(CogAbstractInstruction)); + if (!(literals == null)) { + for (i1 = 0; i1 < nextLiteralIndex; i1 += 1) { + existingInst = literalInstructionAt(i1); + newInst = (&(newLiterals[i1])); + cloneLiteralFrom(newInst, existingInst); + assert(((existingInst->dependent)) == null); + (existingInst->dependent = newInst); + } + for (i1 = 0, iLimiT = (opcodeIndex - 1); i1 <= iLimiT; i1 += 1) { + existingInst = abstractInstructionAt(i1); + if ((((existingInst->dependent)) != null) + && (((((existingInst->dependent))->opcode)) == Literal)) { + (existingInst->dependent = (((existingInst->dependent))->dependent)); + } + } + } + free(literals); + literals = newLiterals; + literalsSize = initialNumLiterals; + } + } + litInst = literalInstructionAt(nextLiteralIndex); + initializeSharableLiteral(litInst, aLiteral); + + /* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */ + nextLiteralIndex += 1; + if (firstOpcodeIndex > opcodeIndex) { + firstOpcodeIndex = opcodeIndex - 1; + } + return litInst; +} + + /* OutOfLineLiteralsManager>>#resetForBlockCompile */ +static sqInt +resetForBlockCompile(void) +{ + firstOpcodeIndex = savedFirstOpcodeIndex; + nextLiteralIndex = savedNextLiteralIndex; + lastDumpedLiteralIndex = savedLastDumpedLiteralIndex; + return 0; +} + + /* OutOfLineLiteralsManager>>#saveForBlockCompile */ +static sqInt +saveForBlockCompile(void) +{ + savedFirstOpcodeIndex = firstOpcodeIndex; + savedNextLiteralIndex = nextLiteralIndex; + savedLastDumpedLiteralIndex = lastDumpedLiteralIndex; + return 0; +} + + +/* Compile the jump instruction(s) at the end of the method that dispatch to + each block body. + */ + + /* SimpleStackBasedCogit>>#compileBlockDispatch */ +static sqInt +compileBlockDispatch(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpSkip; + + assert(blockCount > 0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + blockEntryNoContextSwitch = anInstruction; + /* begin Jump: */ + jumpSkip = genoperand(Jump, ((sqInt)0)); + /* begin MoveR:R: */ + blockEntryLabel = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpSkip, gLabel()); + if (blockCount > 1) { + genLoadSlotsourceRegdestReg(ClosureStartPCIndex, ReceiverResultReg, TempReg); + } + compileBlockDispatchFromto(0, blockCount - 1); + return 0; +} + + +/* After pushing the temporaries but before the stack limit check a primitive + method needs to fetch the error code, if any, and replace the last temp + with it. */ + + /* SimpleStackBasedCogit>>#compileGetErrorCode */ +static void +compileGetErrorCode(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpGotError; + AbstractInstruction *jmpIntError; + AbstractInstruction *jmpNoError; + sqInt primErrorTable; + sqInt primErrorTableSize; + + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpZero: */ + jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + primErrorTable = primErrTable(); + primErrorTableSize = lengthOf(primErrorTable); + flag("use CmpCqR if pc mapping means stable contexts never contain native pcs"); + /* begin CmpCw:R: */ + checkLiteralforInstruction(primErrorTableSize, genoperandoperand(CmpCwR, primErrorTableSize, TempReg)); + /* begin JumpAboveOrEqual: */ + jmpIntError = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + genFetchIndexRegisterfrominto(TempReg, primErrorTable, ClassReg); + /* begin Jump: */ + jmpGotError = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpIntError, gLabel()); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ClassReg); + jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + jmpTarget(jmpNoError, gLabel()); +} + + +/* Compile a call to an interpreter primitive. Call the C routine with the + usual stack-switching dance, test the primFailCode and then either + return on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compileInterpreterPrimitive: */ +static sqInt NoDbgRegParms +compileInterpreterPrimitive(void (*primitiveRoutine)(void)) +{ + sqInt address; + sqInt address1; + sqInt address10; + sqInt address11; + sqInt address12; + sqInt address13; + sqInt address3; + sqInt address4; + sqInt address5; + sqInt address6; + sqInt address8; + sqInt address9; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction8; + sqInt callTarget; + sqInt callTarget1; + AbstractInstruction *continuePostSampleNonPrim; + AbstractInstruction *continuePostSamplePrim; + sqInt flags; + AbstractInstruction *jmp; + AbstractInstruction *jmpSampleNonPrim; + AbstractInstruction *jmpSamplePrim; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt reg; + sqInt retpc; + + + /* Save processor fp, sp and return pc in the interpreter's frame stack and instruction pointers */ + genExternalizePointersForPrimitiveCall(); + genLoadCStackPointersForPrimCall(); + flags = primitivePropertyFlags(primitiveIndex); + if (flags & PrimCallDoNotJIT) { + return ShouldNotJIT; + } + if (flags & PrimCallCollectsProfileSamples) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick if so */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, ClassReg)); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSampleNonPrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSampleNonPrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + if (recordPrimTrace()) { + genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); + } + /* begin MoveCq:R: */ + anInstruction5 = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(0)); + } + /* begin MoveR:Aw: */ + address11 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address11, genoperandoperand(MoveRAw, TempReg, address11)); + if (methodOrBlockNumArgs != 0) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(methodOrBlockNumArgs)); + } + } + /* begin MoveR:Aw: */ + address12 = argumentCountAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address12, genoperandoperand(MoveRAw, TempReg, address12)); + if (flags & PrimCallNeedsPrimitiveFunction) { + /* begin MoveCw:R: */ + checkLiteralforInstruction(((sqInt)primitiveRoutine), genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg)); + /* begin MoveR:Aw: */ + address3 = primitiveFunctionPointerAddress(); + /* begin gen:operand:literal: */ + primSetFunctionLabel = checkLiteralforInstruction(address3, genoperandoperand(MoveRAw, TempReg, address3)); + } + if (flags & (PrimCallNeedsNewMethod + PrimCallMayCallBack)) { + + /* The ceActivateFailingPrimitiveMethod: machinery can't handle framelessness. */ + if (flags & PrimCallMayCallBack) { + needsFrame = 1; + } + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), ClassReg))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + /* begin MoveR:Aw: */ + address4 = newMethodAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address4, genoperandoperand(MoveRAw, TempReg, address4)); + } + /* begin PrefetchAw: */ + address13 = primFailCodeAddress(); + /* begin gen:literal: */ + checkLiteralforInstruction(address13, genoperand(PrefetchAw, address13)); + if (flags & PrimCallMayCallBack) { + + /* Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode. */ + /* On Spur ceActivateFailingPrimitiveMethod: would like to retry if forwarders + are found. So insist on PrimCallNeedsPrimitiveFunction being set too. */ + assert(flags & PrimCallNeedsPrimitiveFunction); + /* begin genSubstituteReturnAddress: */ + retpc = (flags & PrimCallCollectsProfileSamples + ? cePrimReturnEnterCogCodeProfiling + : cePrimReturnEnterCogCode); + /* begin MoveCw:R: */ + checkLiteralforInstruction(retpc, genoperandoperand(MoveCwR, retpc, LR)); + /* begin JumpFullRT: */ + /* begin JumpFull: */ + primInvokeInstruction = checkLiteralforInstruction(((sqInt)(((sqInt)primitiveRoutine))), genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine))))); + + jmp = (jmpSamplePrim = (continuePostSamplePrim = null)); + } + else { + + /* Call the C primitive routine. */ + /* begin CallFullRT: */ + /* begin CallFull: */ + primInvokeInstruction = checkLiteralforInstruction(((sqInt)primitiveRoutine), genoperand(CallFull, ((sqInt)primitiveRoutine))); + + if (flags & PrimCallCollectsProfileSamples) { + assert(flags & PrimCallNeedsNewMethod); + /* begin MoveAw:R: */ + address5 = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address5, genoperandoperand(MoveAwR, address5, TempReg)); + /* begin MoveAw:R: */ + address6 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address6, genoperandoperand(MoveAwR, address6, ClassReg)); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSamplePrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSamplePrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileRetryOnPrimitiveFail(primitiveIndex); + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = LinkReg; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address8, genoperandoperand(MoveAwR, address8, reg)); + genLoadStackPointers(backEnd); + /* begin MoveAw:R: */ + address9 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address9, genoperandoperand(MoveAwR, address9, TempReg)); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction8 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset1 = 0; + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); + } + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + } + if (flags & PrimCallCollectsProfileSamples) { + + /* The sample is collected by cePrimReturnEnterCogCode for external calls */ + if (!(jmpSamplePrim == null)) { + + /* Call ceCheckProfileTick: to record sample and then continue. */ + jmpTarget(jmpSamplePrim, gLabel()); + assert(flags & PrimCallNeedsNewMethod); + /* begin CallFullRT: */ + callTarget = ((usqIntptr_t)ceCheckProfileTick); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSamplePrim)); + } + jmpTarget(jmpSampleNonPrim, gLabel()); + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(0)); + } + /* begin MoveR:Aw: */ + address10 = newMethodAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address10, genoperandoperand(MoveRAw, TempReg, address10)); + /* begin CallFullRT: */ + callTarget1 = ((usqIntptr_t)ceCheckProfileTick); + /* begin CallFull: */ + checkLiteralforInstruction(callTarget1, genoperand(CallFull, callTarget1)); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSampleNonPrim)); + } + if (!(jmp == null)) { + + /* Jump to restore of receiver reg and proceed to frame build for failure. */ + jmpTarget(jmp, gLabel()); + /* begin MoveMw:r:R: */ + offset2 = BytesPerWord * (methodOrBlockNumArgs + (0)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(offset2)); + } + } + return 0; +} + + +/* Compile one method cache probe in an OpenPIC's lookup of selector. + Answer the jump taken if the selector probe fails. + The class tag of the receiver must be in SendNumArgsReg. ClassReg and + TempReg are used as scratch registers. + On a hit, the offset of the entry is in ClassReg. */ + + /* SimpleStackBasedCogit>>#compileOpenPICMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + annotateobjRef(gXorCwR(selector, ClassReg), selector); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); + } + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); + } + } + annotateobjRef(gCmpCwR(selector, TempReg), selector); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); + } + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); + } + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile the code for an open PIC. Perform a probe of the first-level + method lookup cache followed by a call of ceSendFromInLineCacheMiss: if + the probe fails. */ + + /* SimpleStackBasedCogit>>#compileOpenPIC:numArgs: */ +static void NoDbgRegParms +compileOpenPICnumArgs(sqInt selector, sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compilePICAbort(numArgs); + entry = genGetClassTagOfintoscratchReg(ReceiverResultReg, SendNumArgsReg, TempReg); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + jmpTarget(jumpBCMethod, picInterpretAbort); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(cmNoCheckEntryOffset)); + } + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + + genSmalltalkToCStackSwitch(1); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); + compileCallFornumArgsargargargargresultRegregsToSave(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, NoReg, 0); +} + + +/* Compile one method cache probe in a perform: primitive's lookup of + selector. Answer the jump taken if the selector probe fails. */ + + /* SimpleStackBasedCogit>>#compilePerformMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + /* begin XorR:R: */ + genoperandoperand(XorRR, selectorReg, ClassReg); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(((int)((usqInt)(MethodCacheMask) << (shiftForWord()))))); + } + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))))); + } + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, selectorReg, TempReg); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); + } + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(((int)((usqInt)(MethodCacheClass) << (shiftForWord()))))); + } + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile a primitive. If possible, performance-critical primtiives will + be generated by their own routines (primitiveGenerator). Otherwise, + if there is a primitive at all, we call the C routine with the usual + stack-switching dance, test the primFailCode and then either return + on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compilePrimitive */ +static sqInt +compilePrimitive(void) +{ + sqInt code; + sqInt opcodeIndexAtPrimitive; + PrimitiveDescriptor *primitiveDescriptor; + void (*primitiveRoutine)(void); + + if (primitiveIndex == 0) { + return 0; + } + + /* Note opcodeIndex so that compileFallbackToInterpreterPrimitive: + can discard arg load instructions for unimplemented primitives. */ + code = 0; + + /* If a descriptor specifies an argument count (by numArgs >= 0) then it must match + for the generated code to be correct. For example for speed many primitives use + ResultReceiverReg instead of accessing the stack, so the receiver better be at + numArgs down the stack. Use the interpreter version if not. */ + opcodeIndexAtPrimitive = opcodeIndex; + if ((((primitiveDescriptor = primitiveGeneratorOrNil())) != null) + && ((((primitiveDescriptor->primitiveGenerator)) != null) + && ((((primitiveDescriptor->primNumArgs)) < 0) + || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj)))))) { + code = ((primitiveDescriptor->primitiveGenerator))(); + } + if ((code < 0) + && (code != UnimplementedPrimitive)) { + + /* Generator failed, so no point continuing... */ + return code; + } + if (code == UnfailingPrimitive) { + return 0; + } + if ((code == CompletePrimitive) + && (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) { + return 0; + } + if (code == UnimplementedPrimitive) { + opcodeIndex = opcodeIndexAtPrimitive; + } + if ((((primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex))) == null) + || (primitiveRoutine == (functionPointerForinClass(0, null)))) { + return genFastPrimFail(); + } + minValidCallAddress = ((minValidCallAddress < (((usqInt)primitiveRoutine))) ? minValidCallAddress : (((usqInt)primitiveRoutine))); + return compileInterpreterPrimitive(primitiveRoutine); +} + + /* SimpleStackBasedCogit>>#extendedPushBytecode */ +static sqInt +extendedPushBytecode(void) +{ + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genPushReceiverVariable(variableIndex); + } + if (variableType == 1) { + return genPushTemporaryVariable(variableIndex); + } + if (variableType == 2) { + return genPushLiteralIndex(variableIndex); + } + return genPushLiteralVariable(variableIndex); +} + + /* SimpleStackBasedCogit>>#extendedStoreAndPopBytecode */ +static sqInt +extendedStoreAndPopBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(1, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#extendedStoreBytecode */ +static sqInt +extendedStoreBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(0, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFrameMark */ +static sqInt +frameOffsetOfNativeFrameMark(void) +{ + return FoxMFReceiver - BytesPerWord; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFramePointer */ +static sqInt +frameOffsetOfNativeFramePointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 3); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeStackPointer */ +static sqInt +frameOffsetOfNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 4); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfPreviousNativeStackPointer */ +static sqInt +frameOffsetOfPreviousNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 2); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfTemporary: */ +static sqInt NoDbgRegParms +frameOffsetOfTemporary(sqInt index) +{ + return (index < methodOrBlockNumArgs + ? FoxCallerSavedIP + ((methodOrBlockNumArgs - index) * BytesPerWord) + : (FoxMFReceiver - BytesPerWord) + ((methodOrBlockNumArgs - index) * BytesPerWord)); +} + + /* SimpleStackBasedCogit>>#genDoubleFailIfZeroArgRcvr:arg: */ +static AbstractInstruction * NoDbgRegParms +genDoubleFailIfZeroArgRcvrarg(int rcvrReg, int argReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, TempReg, DPFPReg2); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg2, argReg); + return gJumpFPEqual(0); +} + + +/* Can use any of the first 32 literals for the selector and pass up to 7 + arguments. + */ + + /* SimpleStackBasedCogit>>#genExtendedSendBytecode */ +static sqInt +genExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + /* SimpleStackBasedCogit>>#genExtendedSuperBytecode */ +static sqInt +genExtendedSuperBytecode(void) +{ + return genSendSupernumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfFalse */ +static sqInt +genExtJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + +/* SistaV1: * 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ +/* Non supported in non Sista VMs */ + + /* SimpleStackBasedCogit>>#genExtJumpIfNotInstanceOfBehaviorsBytecode */ +static sqInt +genExtJumpIfNotInstanceOfBehaviorsBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfTrue */ +static sqInt +genExtJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* NewspeakV4: 221 11011101 Nop */ +/* SistaV1: 91 01011011' Nop */ + + /* SimpleStackBasedCogit>>#genExtNopBytecode */ +static sqInt +genExtNopBytecode(void) +{ + extA = (numExtB = (extB = 0)); + return 0; +} + + +/* SistaV1: 233 11101001 iiiiiiii Push Character #iiiiiiii (+ Extend B * + 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushCharacterBytecode */ +static sqInt +genExtPushCharacterBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral(characterObjectOf(value)); +} + + +/* NewsqueakV4: 229 11100101 iiiiiiii Push Integer #iiiiiiii (+ Extend B * + 256, where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + SistaV1: 232 11101000 iiiiiiii Push Integer #iiiiiiii (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtPushIntegerBytecode */ +static sqInt +genExtPushIntegerBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral((((usqInt)value << 1) | 1)); +} + + +/* 228 11100100 i i i i i i i i Push Literal #iiiiiiii (+ Extend A * 256) */ + + /* SimpleStackBasedCogit>>#genExtPushLiteralBytecode */ +static sqInt +genExtPushLiteralBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralIndex(index); +} + + +/* 227 11100011 i i i i i i i i Push Literal Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushLitVarDirSupBytecode */ +static sqInt +genExtPushLitVarDirSupBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralVariableGivenDirectedSuper(index); +} + + +/* SistaV1: * 82 01010010 Push thisContext, (then Extend B = 1 => push + thisProcess) + */ + + /* SimpleStackBasedCogit>>#genExtPushPseudoVariable */ +static sqInt +genExtPushPseudoVariable(void) +{ + sqInt ext; + + ext = extB; + extB = 0; + numExtB = 0; + + switch (ext) { + case 0: + return genPushActiveContextBytecode(); + + default: + return unknownBytecode(); + + } + return 0; +} + + +/* 226 11100010 i i i i i i i i Push Receiver Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushReceiverVariableBytecode */ +static sqInt +genExtPushReceiverVariableBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return (isReadMediatedContextInstVarIndex(index) + ? genPushMaybeContextReceiverVariable(index) + : genPushReceiverVariable(index)); +} + + +/* 238 11101110 i i i i i j j j Send Literal Selector #iiiii (+ Extend A * + 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendBytecode */ +static sqInt +genExtSendBytecode(void) +{ + sqInt litIndex; + sqInt nArgs; + + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return genSendnumArgs(litIndex, nArgs); +} + + +/* 239 11101111 i i i i i j j j Send To Superclass Literal Selector #iiiii + (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendSuperBytecode */ +static sqInt +genExtSendSuperBytecode(void) +{ + int isDirected; + sqInt litIndex; + sqInt nArgs; + + if ((isDirected = extB >= 64)) { + extB = extB & 0x3F; + } + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return (isDirected + ? genSendDirectedSupernumArgs(litIndex, nArgs) + : genSendSupernumArgs(litIndex, nArgs)); +} + + /* SimpleStackBasedCogit>>#genExtStoreAndPopRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(1); +} + + /* SimpleStackBasedCogit>>#genExtStoreRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(0); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtUnconditionalJump */ +static sqInt +genExtUnconditionalJump(void) +{ + AbstractInstruction *abstractInstruction; + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + if (distance < 0) { + return genJumpBackTo(target); + } + genJumpTo(target); + /* begin annotateBytecode: */ + abstractInstruction = lastOpcode(); + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* SimpleStackBasedCogit>>#genFastPrimFail */ +static sqInt +genFastPrimFail(void) +{ + primitiveIndex = 0; + return UnfailingPrimitive; +} + + +/* Suport for compileInterpreterPrimitive. Generate inline code so as to + record the primitive + trace as fast as possible. */ + + /* SimpleStackBasedCogit>>#genFastPrimTraceUsing:and: */ +static void NoDbgRegParms +genFastPrimTraceUsingand(sqInt r1, sqInt r2) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + sqInt wordConstant; + + /* begin MoveAb:R: */ + address = primTraceLogIndexAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAbR, address, r2)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, r2, r1); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, 1, r1); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(1)); + } + /* begin MoveR:Ab: */ + address1 = primTraceLogIndexAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAb, r1, address1)); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), r1))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, selector); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + /* begin MoveCw:R: */ + wordConstant = ((sqInt)(primTraceLogAddress())); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, r1)); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, r2, r1); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfFalse */ +static sqInt +genLongJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfTrue */ +static sqInt +genLongJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* 230 11100110 i i i i i i i i Push Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongPushTemporaryVariableBytecode */ +static sqInt +genLongPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte1); +} + + +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreAndPopTemporaryVariableBytecode */ +static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + + +/* 234 11101010 i i i i i i i i Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreTemporaryVariableBytecode */ +static sqInt +genLongStoreTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(0, byte1); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalBackwardJump */ +static sqInt +genLongUnconditionalBackwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance < 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpBackTo(targetpc); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalForwardJump */ +static sqInt +genLongUnconditionalForwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance >= 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpTo(targetpc); +} + + +/* Compile the code for a probe of the first-level method cache for a perform + primtiive. The selector is assumed to be in Arg0Reg. Defer to + adjustArgumentsForPerform: to + adjust the arguments before the jump to the method. */ + + /* SimpleStackBasedCogit>>#genLookupForPerformNumArgs: */ +static sqInt NoDbgRegParms +genLookupForPerformNumArgs(sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpInterpret; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + + /* N.B. Can't assume TempReg already contains the tag because a method can + of course be invoked via the unchecked entry-point, e.g. as does perform:. */ + genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, SendNumArgsReg, 0); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + + /* Adjust arguments and jump to the method's unchecked entry-point. */ + jumpInterpret = genJumpImmediate(ClassReg); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(cmNoCheckEntryOffset)); + } + adjustArgumentsForPerform(numArgs); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpInterpret, gLabel())); + return 0; +} + + /* SimpleStackBasedCogit>>#genMoveTrueR: */ +static AbstractInstruction * NoDbgRegParms +genMoveTrueR(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveConstant:R: */ + constant = trueObject(); + return (shouldAnnotateObjectReference(constant) + ? annotateobjRef(gMoveCwR(constant, reg), constant) + : (/* begin MoveCq:R: */ + (anInstruction = genoperandoperand(MoveCqR, constant, reg)), + (usesOutOfLineLiteral(anInstruction) + ? (anInstruction->dependent = locateLiteral(constant)) + : 0), + anInstruction)); +} + + /* SimpleStackBasedCogit>>#genMustBeBooleanTrampolineFor:called: */ +static sqInt NoDbgRegParms +genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName) +{ + AbstractInstruction *anInstruction; + + zeroOpcodeIndex(); + assert(!(shouldAnnotateObjectReference(boolean))); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, boolean, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(boolean)); + } + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSendMustBeBoolean, trampolineName, 1, TempReg, null, null, null, 0, 1, NoReg, 1); +} + + +/* Generate the substitute return code for an external or FFI primitive call. + On success simply return, extracting numArgs from newMethod. + On primitive failure call ceActivateFailingPrimitiveMethod: newMethod. */ + + /* SimpleStackBasedCogit>>#genPrimReturnEnterCogCodeEnilopmart: */ +static void NoDbgRegParms +genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) +{ + sqInt address; + sqInt address1; + sqInt address3; + sqInt address6; + sqInt address7; + sqInt address8; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction7; + sqInt callTarget; + AbstractInstruction *continuePostSample; + AbstractInstruction * inst; + AbstractInstruction *jmpFail; + AbstractInstruction *jmpSample; + sqInt quickConstant; + sqInt reg; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + + if (profiling) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick: if so. + N.B. nextProfileTick is 64-bits so 32-bit systems need to test both halves. */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveAwR, address1, ClassReg)); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSample = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSample = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address6 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address6, genoperandoperand(MoveAwR, address6, TempReg)); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadStackPointers(backEnd); + /* begin PopR: */ + genoperand(PopR, ReceiverResultReg); + /* begin MoveAw:R: */ + address3 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address3, genoperandoperand(MoveAwR, address3, PCReg)); + + + jmpTarget(jmpFail, gMoveAwR(newMethodAddress(), SendNumArgsReg)); + /* begin MoveAw:R: */ + address7 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address7, genoperandoperand(MoveAwR, address7, SPReg)); + compileCallFornumArgsargargargargresultRegregsToSave(ceActivateFailingPrimitiveMethod, 1, SendNumArgsReg, null, null, null, NoReg, 0); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = LinkReg; + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address8, genoperandoperand(MoveAwR, address8, reg)); + genLoadStackPointers(backEnd); + /* begin MoveMw:r:R: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(0)); + } + + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + if (profiling) { + + /* Call ceCheckProfileTick: to record sample and then continue. newMethod + should be up-to-date. Need to save and restore the link reg around this call. */ + jmpTarget(jmpSample, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallFullRT: */ + callTarget = (usqIntptr_t)ceCheckProfileTick; + /* begin CallFull: */ + checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget)); + + + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSample)); + } +} + + +/* SistaV1: 230 11100110 iiiiiiii PushNClosureTemps iiiiiiii */ + + /* SimpleStackBasedCogit>>#genPushClosureTempsBytecode */ +static sqInt +genPushClosureTempsBytecode(void) +{ + sqInt i; + + for (i = 1; i <= byte1; i += 1) { + genPushLiteral(nilObject()); + } + return 0; +} + + /* SimpleStackBasedCogit>>#genPushConstantFalseBytecode */ +static sqInt +genPushConstantFalseBytecode(void) +{ + return genPushLiteral(falseObject()); +} + + /* SimpleStackBasedCogit>>#genPushConstantNilBytecode */ +static sqInt +genPushConstantNilBytecode(void) +{ + return genPushLiteral(nilObject()); +} + + +/* 79 01001111 Push 1 */ + + /* SimpleStackBasedCogit>>#genPushConstantOneBytecode */ +static sqInt +genPushConstantOneBytecode(void) +{ + return genPushLiteral((((usqInt)1 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushConstantTrueBytecode */ +static sqInt +genPushConstantTrueBytecode(void) +{ + return genPushLiteral(trueObject()); +} + + +/* 78 01001110 Push 0 */ + + /* SimpleStackBasedCogit>>#genPushConstantZeroBytecode */ +static sqInt +genPushConstantZeroBytecode(void) +{ + return genPushLiteral((((usqInt)0 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushLiteralConstantBytecode */ +static sqInt +genPushLiteralConstantBytecode(void) +{ + return genPushLiteralIndex(byte0 & 0x1F); +} + + +/* */ + + /* SimpleStackBasedCogit>>#genPushLiteralIndex: */ +static sqInt NoDbgRegParms +genPushLiteralIndex(sqInt literalIndex) +{ + sqInt literal; + + literal = getLiteral(literalIndex); + return genPushLiteral(literal); +} + + /* SimpleStackBasedCogit>>#genPushLiteralVariableBytecode */ +static sqInt +genPushLiteralVariableBytecode(void) +{ + return genPushLiteralVariable(byte0 & 0x1F); +} + + +/* e.g. SistaV1: 16-31 0001 iiii Push Literal Variable #iiii */ + + /* SimpleStackBasedCogit>>#genPushLitVarDirSup16CasesBytecode */ +static sqInt +genPushLitVarDirSup16CasesBytecode(void) +{ + return genPushLiteralVariableGivenDirectedSuper(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushQuickIntegerConstantBytecode */ +static sqInt +genPushQuickIntegerConstantBytecode(void) +{ + return genPushLiteral((((usqInt)(byte0 - 117) << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushReceiverVariableBytecode */ +static sqInt +genPushReceiverVariableBytecode(void) +{ + return genPushReceiverVariable(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushTemporaryVariableBytecode */ +static sqInt +genPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte0 & 15); +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnConst */ +sqInt +genQuickReturnConst(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + constant = quickPrimitiveConstantFor(primitiveIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnInstVar */ +sqInt +genQuickReturnInstVar(void) +{ + sqInt index; + + index = quickPrimitiveInstVarIndexFor(primitiveIndex); + genLoadSlotsourceRegdestReg(index, ReceiverResultReg, ReceiverResultReg); + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnSelf */ +sqInt +genQuickReturnSelf(void) +{ + genUpArrowReturn(); + return UnfailingPrimitive; +} + + /* SimpleStackBasedCogit>>#genReturnFalse */ +static sqInt +genReturnFalse(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNil */ +static sqInt +genReturnNil(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNilFromBlock */ +static sqInt +genReturnNilFromBlock(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + assert(inBlock > 0); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + return genBlockReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnTrue */ +static sqInt +genReturnTrue(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + return genUpArrowReturn(); +} + + +/* Can use any of the first 64 literals for the selector and pass up to 3 + arguments. + */ + + /* SimpleStackBasedCogit>>#genSecondExtendedSendBytecode */ +static sqInt +genSecondExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x3F, ((usqInt) byte1) >> 6); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector0ArgsBytecode */ +static sqInt +genSendLiteralSelector0ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 0); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector1ArgBytecode */ +static sqInt +genSendLiteralSelector1ArgBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 1); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector2ArgsBytecode */ +static sqInt +genSendLiteralSelector2ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 2); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfFalse */ +static sqInt +genShortJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfTrue */ +static sqInt +genShortJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortUnconditionalJump */ +static sqInt +genShortUnconditionalJump(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpTo(target); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopLiteralVariableBytecode */ +static sqInt +genSistaExtStoreAndPopLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopReceiverVariableBytecode */ +static sqInt +genSistaExtStoreAndPopReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = 1; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreLiteralVariableBytecode */ +static sqInt +genSistaExtStoreLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreReceiverVariableBytecode */ +static sqInt +genSistaExtStoreReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = extB & 2; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorEqualsEquals */ +static sqInt +genSpecialSelectorEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(0); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorNotEqualsEquals */ +static sqInt +genSpecialSelectorNotEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(1); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorSend */ +static sqInt +genSpecialSelectorSend(void) +{ + sqInt index; + sqInt numArgs; + + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + numArgs = specialSelectorNumArgs(index); + return genSendnumArgs((-index) - 1, numArgs); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopReceiverVariableBytecode */ +static sqInt +genStoreAndPopReceiverVariableBytecode(void) +{ + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, byte0 & 7, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopRemoteTempLongBytecode */ +static sqInt +genStoreAndPopRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(1, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopTemporaryVariableBytecode */ +static sqInt +genStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte0 & 7); +} + + /* SimpleStackBasedCogit>>#genStoreRemoteTempLongBytecode */ +static sqInt +genStoreRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(0, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + +/* SistaV1: * 217 Trap */ + + /* SimpleStackBasedCogit>>#genUnconditionalTrapBytecode */ +static sqInt +genUnconditionalTrapBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#loadNativeArgumentAddress:to: */ +static void NoDbgRegParms +loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(baseOffset - 1)); + } +} + + /* SimpleStackBasedCogit>>#loadNativeFramePointerInto: */ +static void NoDbgRegParms +loadNativeFramePointerInto(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } +} + + /* SimpleStackBasedCogit>>#loadNativeLocalAddress:to: */ +static void NoDbgRegParms +loadNativeLocalAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(baseOffset - 1)); + } +} + + +/* Collect the branch and send data for cogMethod, storing it into arrayObj. */ + + /* SimpleStackBasedCogit>>#mapPCDataFor:into: */ +sqInt +mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + CogBlockMethod *cogMethod1; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + sqInt errCode; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt startbcpc; + sqInt targetPC; + + latestContinuation = 0; + introspectionDataIndex = 0; + introspectionData = arrayObj; + if (((cogMethod->stackCheckOffset)) == 0) { + assert(introspectionDataIndex == 0); + if ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + return 4; + } + /* begin mapFor:bcpc:performUntil:arg: */ + cogMethod1 = ((CogBlockMethod *) cogMethod); + startbcpc = startPCOfMethod((cogMethod->methodObject)); + assert(((cogMethod1->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); + result = pcDataForAnnotationMcpcBcpcMethod(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc)), startbcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod1->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod1->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod1); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod1->startpc))); + homeMethod = cmHomeMethod(cogMethod1); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod1)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + errCode = 0; + goto l7; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + errCode = 0; + goto l7; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = pcDataForAnnotationMcpcBcpcMethod(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + errCode = 0; +l7: /* end mapFor:bcpc:performUntil:arg: */; + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + if (((cogMethod->blockEntryOffset)) != 0) { + errCode = blockDispatchTargetsForperformarg(cogMethod, pcDataForBlockEntryMethod, ((sqInt)cogMethod)); + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + } + return introspectionDataIndex; +} + + +/* If allocCheckFiller is true, words in newSpace from freeStart to + scavengeThreshold are filled with their address, and after each call of a + plugin primitive, the VM checks + that freeStart points to a word containing the value of freeStart. This is + a simple + check for primitives overwriting the ends of an object. */ + + /* SimpleStackBasedCogit>>#maybeCompileAllocFillerCheck */ +static void +maybeCompileAllocFillerCheck(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpOk; + + if (getCheckAllocFiller()) { + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, ClassReg)); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpZero: */ + jmpOk = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, PrimErrWritePastObject, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(PrimErrWritePastObject)); + } + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + jmpTarget(jmpOk, gLabel()); + } +} + + /* SimpleStackBasedCogit>>#numSpecialSelectors */ +static sqInt +numSpecialSelectors(void) +{ + return (bytecodeSetOffset == 256 + ? AltNumSpecialSelectors + : NumSpecialSelectors); +} + + +/* Collect the branch and send data for the block method starting at + blockEntryMcpc, storing it into picData. + */ + + /* SimpleStackBasedCogit>>#pcDataForBlockEntry:Method: */ +static usqInt NoDbgRegParms +pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod) +{ + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)(blockEntryMcpc - blockNoContextSwitchOffset) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)blockEntryMcpc << 1) | 1)); + introspectionDataIndex += 4; + return 0; +} + + /* SimpleStackBasedCogit>>#pcDataFor:Annotation:Mcpc:Bcpc:Method: */ +static sqInt NoDbgRegParms +pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg) +{ + sqInt actualBcpc; + usqInt actualMcpc; + + if (!(descriptor)) { + + /* this is the stackCheck offset */ + assert(introspectionDataIndex == 0); + if (((((CogMethod *) cogMethodArg))->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 4, introspectionData, (((usqInt)(bcpc + 1) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 5, introspectionData, (((((((CogMethod *) cogMethodArg))->stackCheckOffset)) << 1) | 1)); + introspectionDataIndex += 6; + return 0; + } + if ((((usqInt) isBackwardBranchAndAnnotation) >> 1) >= HasBytecodePC) { + actualBcpc = (isBackwardBranchAndAnnotation & 1 + ? bcpc + 1 + : (bcpc + ((descriptor->numBytes))) + 1); + actualMcpc = (((usqInt)mcpc)) - (((usqInt)cogMethodArg)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, (((usqInt)actualBcpc << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, ((actualMcpc << 1) | 1)); + introspectionDataIndex += 2; + } + return 0; +} + + +/* If there is a generator for the current primitive then answer it; + otherwise answer nil. */ + + /* SimpleStackBasedCogit>>#primitiveGeneratorOrNil */ +static PrimitiveDescriptor * +primitiveGeneratorOrNil(void) +{ + PrimitiveDescriptor *primitiveDescriptor; + static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = { + { 0, -1 }, + { genPrimitiveAdd, 1 }, + { genPrimitiveSubtract, 1 }, + { genPrimitiveLessThan, 1 }, + { genPrimitiveGreaterThan, 1 }, + { genPrimitiveLessOrEqual, 1 }, + { genPrimitiveGreaterOrEqual, 1 }, + { genPrimitiveEqual, 1 }, + { genPrimitiveNotEqual, 1 }, + { genPrimitiveMultiply, 1 }, + { genPrimitiveDivide, 1 }, + { genPrimitiveMod, 1 }, + { genPrimitiveDiv, 1 }, + { genPrimitiveQuo, 1 }, + { genPrimitiveBitAnd, 1 }, + { genPrimitiveBitOr, 1 }, + { genPrimitiveBitXor, 1 }, + { genPrimitiveBitShift, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveAsFloat, 0 }, + { genPrimitiveFloatAdd, 1 }, + { genPrimitiveFloatSubtract, 1 }, + { genPrimitiveFloatLessThan, 1 }, + { genPrimitiveFloatGreaterThan, 1 }, + { genPrimitiveFloatLessOrEqual, 1 }, + { genPrimitiveFloatGreaterOrEqual, 1 }, + { genPrimitiveFloatEqual, 1 }, + { genPrimitiveFloatNotEqual, 1 }, + { genPrimitiveFloatMultiply, 1 }, + { genPrimitiveFloatDivide, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveFloatSquareRoot, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveAt, 1 }, + { genPrimitiveAtPut, 2 }, + { genPrimitiveSize, 0 }, + { genPrimitiveStringAt, 1 }, + { genPrimitiveStringAtPut, 2 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genPrimitiveObjectAt, 1 }, + { 0, -1 }, + { genPrimitiveNew, 0 }, + { genPrimitiveNewWithArg, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNewMethod, 2 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitivePerform, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentical, 1 }, + { genPrimitiveClass, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveShallowCopy, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNotIdentical, 1 }, + { genPrimitiveAsCharacter, -1 }, + { genPrimitiveImmediateAsInteger, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 }, + { genPrimitiveClosureValue, 2 }, + { genPrimitiveClosureValue, 3 }, + { genPrimitiveClosureValue, 4 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 } +}; + + if (isQuickPrimitiveIndex(primitiveIndex)) { + + /* an unused one */ + primitiveDescriptor = (&(primitiveGeneratorTable[0])); + (primitiveDescriptor->primitiveGenerator = quickPrimitiveGeneratorFor(primitiveIndex)); + return primitiveDescriptor; + } + if (((primitiveIndex >= 1) && (primitiveIndex <= MaxCompiledPrimitiveIndex))) { + return (&(primitiveGeneratorTable[primitiveIndex])); + } + return null; +} + + /* SimpleStackBasedCogit>>#recordCallOffsetIn: */ +void +recordCallOffsetIn(CogMethod *cogMethod) +{ + usqIntptr_t offset; + sqInt *offsetTable; + + offset = ((primSetFunctionLabel->address)) - (((sqInt)cogMethod)); + if ((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == null) { + externalSetPrimOffsets[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == offset); + } + offsetTable = (isJump(primInvokeInstruction) + ? externalPrimJumpOffsets + : externalPrimCallOffsets); + offset = (((primInvokeInstruction->address)) + ((primInvokeInstruction->machineCodeSize))) - (((sqInt)cogMethod)); + if ((offsetTable[(cogMethod->cmNumArgs)]) == null) { + offsetTable[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((offsetTable[(cogMethod->cmNumArgs)]) == offset); + } +} + + /* SimpleStackBasedCogit>>#rewritePrimInvocationIn:to: */ +void +rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)) +{ + usqInt address; + sqInt callTargetAddress; + sqInt callTargetAddress1; + sqInt extent; + sqInt flags; + sqInt primIndex; + + assert(((cogMethod->cmType)) == CMMethod); + primIndex = primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader)); + flags = primitivePropertyFlags(primIndex); + if (flags & PrimCallNeedsPrimitiveFunction) { + storeLiteralbeforeFollowingAddress(backEnd, ((usqInt)primFunctionPointer), (((usqInt)cogMethod)) + (externalSetPrimOffsets[(cogMethod->cmNumArgs)])); + } + if (flags & PrimCallMayCallBack) { + address = (((usqInt)cogMethod)) + (externalPrimJumpOffsets[(cogMethod->cmNumArgs)]); + /* begin rewriteJumpFullAt:target: */ + callTargetAddress = ((usqInt)primFunctionPointer); + extent = rewriteFullTransferAttargetexpectedInstruction(((AbstractInstruction *) backEnd), address, callTargetAddress, 3778019100U); + } + else { + address = (((usqInt)cogMethod)) + (externalPrimCallOffsets[(cogMethod->cmNumArgs)]); + /* begin rewriteCallFullAt:target: */ + callTargetAddress1 = ((usqInt)primFunctionPointer); + extent = rewriteFullTransferAttargetexpectedInstruction(((AbstractInstruction *) backEnd), address, callTargetAddress1, 3778019132U); + } + flushICacheFromto(processor, (((usqInt)cogMethod)) + cmNoCheckEntryOffset, (((usqInt)address)) + extent); +} + + /* SimpleStackBasedCogit>>#v3:Block:Code:Size: */ +static sqInt NoDbgRegParms +v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts <= 0); + return (((sqInt)((usqInt)((fetchByteofObject(pc + 2, aMethodObj))) << 8))) + (fetchByteofObject(pc + 3, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)(((fetchByteofObject(pc, aMethodObj)) & 3)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)((((fetchByteofObject(pc, aMethodObj)) & 7) - 4)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* N.B. This serves for both BlueBook/V3 and V4 short jumps. */ + + /* SimpleStackBasedCogit>>#v3:ShortForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return ((fetchByteofObject(pc, aMethodObj)) & 7) + 1; +} + + +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* SimpleStackBasedCogit>>#v4:Block:Code:Size: */ +static sqInt NoDbgRegParms +v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt byteOne; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + + /* If nExts < 0 it isn't known and we rely on the number of extensions encoded in the eeiiikkk byte. */ + byteOne = fetchByteofObject(pc + 1, aMethodObj); + assert((nExts < 0) + || (nExts == (((usqInt) byteOne) >> 6))); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - (((usqInt) byteOne) >> 6)) - (((usqInt) byteOne) >> 6); + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend A * 256) + */ +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend A * 256) + */ + + /* SimpleStackBasedCogit>>#v4:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* ** 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#v4:Long:BranchIfNotInstanceOf:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#v4:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + /* SimpleStackBasedCogit>>#voidCogCompiledCode */ +void +voidCogCompiledCode(void) +{ + sqInt i; + + clearCogCompiledCode(); + for (i = 0; i <= MaxNumArgs; i += 1) { + externalPrimJumpOffsets[i] = null; + externalPrimCallOffsets[i] = null; + externalSetPrimOffsets[i] = null; + } +} + + +/* Add a blockStart for an embedded block. For a binary tree walk block + dispatch blocks must be compiled in pc/depth-first order but are scanned + in breadth-first + order, so do an insertion sort (which of course is really a bubble sort + because we + have to move everything higher to make room). */ + + /* StackToRegisterMappingCogit>>#addBlockStartAt:numArgs:numCopied:span: */ +static BlockStart * NoDbgRegParms +addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span) +{ + BlockStart *blockStart; + sqInt i; + sqInt j; + + + /* Transcript ensureCr; nextPutAll: 'addBlockStartAt: '; print: bytecodepc; cr; flush. */ + if (blockCount > 0) { + i = blockCount - 1; + while (1) { + + /* check for repeat addition during recompilation due to initialNil miscount. */ + blockStart = (&(blockStarts[i])); + if (((blockStart->startpc)) == bytecodepc) { + return blockStart; + } + if (!((((blockStart->startpc)) > bytecodepc) + && (i > 0))) break; + i -= 1; + } + for (j = blockCount; j >= (i + 1); j += -1) { + blockStarts[j] = (blockStarts[j - 1]); + } + blockStart = (&(blockStarts[i + 1])); + } + else { + blockStart = (&(blockStarts[blockCount])); + } + blockCount += 1; + (blockStart->startpc = bytecodepc); + (blockStart->numArgs = numArgs); + (blockStart->numCopied = numCopied); + (blockStart->numInitialNils = 0); + (blockStart->stackCheckLabel = null); + (blockStart->hasInstVarRef = 0); + (blockStart->span = span); + return blockStart; +} + + +/* e.g. Receiver Receiver or Receiver Receiver (RISC) + Selector/Arg0 => Arg1 Selector/Arg0 => Arg1 + Arg1 Arg2 Arg1 Arg2 + Arg2 Arg3 Arg2 sp-> Arg3 + Arg3 sp-> retpc sp-> Arg3 + sp-> retpc */ +/* Generate code to adjust the possibly stacked arguments immediately + before jumping to a method looked up by a perform primitive. */ + + /* StackToRegisterMappingCogit>>#adjustArgumentsForPerform: */ +static void NoDbgRegParms +adjustArgumentsForPerform(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt index; + sqInt offset; + sqInt quickConstant; + + assert((numRegArgs()) <= 2); + assert(numArgs >= 1); + if (numArgs <= 2) { + if (numArgs == 2) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, Arg0Reg); + } + return; + } + if ((2 + 1) == numArgs) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); + } + + /* begin AddCq:R: */ + quickConstant = (numArgs + 1) * BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AddCqR, quickConstant, SPReg); + if (usesOutOfLineLiteral(anInstruction13)) { + (anInstruction13->dependent = locateLiteral(quickConstant)); + } + + return; + } + for (index = (numArgs - 2); index >= 0; index += -1) { + /* begin MoveMw:r:R: */ + anInstruction8 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction8)) { + (anInstruction8->dependent = locateLiteral(index * BytesPerWord)); + } + /* begin MoveR:Mw:r: */ + offset = (index + 1) * BytesPerWord; + /* begin gen:operand:quickConstant:operand: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg); + if (usesOutOfLineLiteral(anInstruction9)) { + (anInstruction9->dependent = locateLiteral(offset)); + } + } + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction15)) { + (anInstruction15->dependent = locateLiteral(BytesPerWord)); + } + +} + + +/* If the stack entry is already in a register not conflicting with regMask, + answers it, + else allocate a new register not conflicting with reg mask + */ + + /* StackToRegisterMappingCogit>>#allocateRegForStackEntryAt:notConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask) +{ + sqInt mask; + CogSimStackEntry *stackEntry; + + stackEntry = ssValue(index); + mask = registerMaskOrNone(stackEntry); + if ((mask != 0) + && ((mask & regMask) == 0)) { + return registerOrNone(stackEntry); + } + return allocateRegNotConflictingWith(regMask); +} + + +/* if there's a free register, use it */ + + /* StackToRegisterMappingCogit>>#allocateRegNotConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegNotConflictingWith(sqInt regMask) +{ + sqInt reg; + + reg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (reg == NoReg) { + + /* No free register, choose one that does not conflict with regMask */ + reg = freeAnyRegNotConflictingWith(regMask); + } + if (reg == ReceiverResultReg) { + + /* If we've allocated RcvrResultReg, it's not live anymore */ + voidReceiverResultRegContainsSelf(); + } + return reg; +} + + /* StackToRegisterMappingCogit>>#anyReferencesToRegister:inTopNItems: */ +static sqInt NoDbgRegParms +anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n) +{ + sqInt i; + sqInt regMask; + + /* begin registerMaskFor: */ + regMask = 1U << reg; + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((registerMask(simStackAt(i))) & regMask) { + return 1; + } + } + return 0; +} + + +/* Store the smalltalk pointers */ + + /* StackToRegisterMappingCogit>>#beginHighLevelCall: */ +static void NoDbgRegParms +beginHighLevelCall(sqInt alignment) +{ + sqInt actualAlignment; + sqInt address; + sqInt address1; + sqInt address2; + sqInt address3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt mask; + sqInt offset; + + ssFlushAll(); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, SPReg, address1)); + /* begin MoveR:Aw: */ + address2 = framePointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address2, genoperandoperand(MoveRAw, FPReg, address2)); + /* begin MoveAw:R: */ + address = instructionPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, LinkReg)); + + /* begin MoveAw:R: */ + address3 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address3, genoperandoperand(MoveAwR, address3, SPReg)); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, FPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 1, FPReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(1)); + } + actualAlignment = ((alignment < BytesPerWord) ? BytesPerWord : alignment); + if (actualAlignment > BytesPerWord) { + mask = -actualAlignment; + /* begin AndCq:R: */ + anInstruction2 = genoperandoperand(AndCqR, mask, SPReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(mask)); + } + } + currentCallCleanUpSize = 0; +} + + +/* This is a static version of ceCallCogCodePopReceiverArg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg0Regs */ +void +callCogCodePopReceiverArg0Regs(void) +{ + realCECallCogCodePopReceiverArg0Regs(); +} + + +/* This is a static version of ceCallCogCodePopReceiverArg1Arg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg1Arg0Regs */ +void +callCogCodePopReceiverArg1Arg0Regs(void) +{ + realCECallCogCodePopReceiverArg1Arg0Regs(); +} + + /* StackToRegisterMappingCogit>>#callSwitchToCStack */ +static sqInt +callSwitchToCStack(void) +{ + sqInt address; + + /* begin MoveAw:R: */ + address = cFramePointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, FPReg)); + return 0; +} + + +/* Restore the link register */ + + /* StackToRegisterMappingCogit>>#callSwitchToSmalltalkStack */ +static void +callSwitchToSmalltalkStack(void) +{ + sqInt address; + + /* begin MoveAw:R: */ + address = instructionPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, LinkReg)); + + genLoadStackPointers(backEnd); +} + + +/* Loop over bytecodes, dispatching to the generator for each bytecode, + handling fixups in due course. + */ + + /* StackToRegisterMappingCogit>>#compileAbstractInstructionsFrom:through: */ +static sqInt NoDbgRegParms +compileAbstractInstructionsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + BytecodeFixup *fixup; + sqInt nExts; + sqInt nextOpcodeIndex; + sqInt result; + + traceSimStack(); + bytecodePC = start; + nExts = (result = 0); + descriptor = null; + deadCode = 0; + while (1) { + fixup = fixupAt(bytecodePC - initialPC); + mergeWithFixupIfRequired(fixup); + /* begin assertCorrectSimStackPtr */ + descriptor = loadBytesAndGetDescriptor(); + nextOpcodeIndex = opcodeIndex; + result = (deadCode + ? mapDeadDescriptorIfNeeded(descriptor) + : ((descriptor->generator))()); + /* begin assertExtsAreConsumed: */ + if (!((descriptor->isExtension))) { + assert((extA == 0) + && ((extB == 0) + && (numExtB == 0))); + } + traceDescriptor(descriptor); + traceSimStack(); + /* begin patchFixupTargetIfNeeded:nextOpcodeIndex: */ + if ((((((usqInt)((fixup->targetInstruction)))) >= NeedsNonMergeFixupFlag) && ((((usqInt)((fixup->targetInstruction)))) <= NeedsMergeFixupFlag))) { + + /* There is a fixup for this bytecode. It must point to the first generated + instruction for this bytecode. If there isn't one we need to add a label. */ + if (opcodeIndex == nextOpcodeIndex) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (fixup->targetInstruction = abstractInstructionAt(nextOpcodeIndex)); + } + /* begin maybeDumpLiterals: */ + if (((opcodeIndex >= firstOpcodeIndex) + && ((opcodeIndex - firstOpcodeIndex) >= (outOfLineLiteralOpcodeLimit(backEnd())))) + || ((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn)))) { + dumpLiterals(!((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn)))); + } + /* begin nextBytecodePCFor:exts: */ + bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) + : 0)); + if (!((result == 0) + && (bytecodePC <= end))) break; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + /* begin checkEnoughOpcodes */ + if (opcodeIndex > numAbstractOpcodes) { + error("Cog JIT internal error. Too many abstract opcodes. Num opcodes heuristic is too optimistic."); + } + return result; +} + + /* StackToRegisterMappingCogit>>#compileBlockBodies */ +static sqInt +compileBlockBodies(void) +{ + BlockStart *blockStart; + sqInt compiledBlocksCount; + sqInt i; + sqInt initialCounterIndex; + sqInt initialOpcodeIndex; + sqInt initialStackPtr; + sqInt result; + sqInt savedNeedsFrame; + sqInt savedNumArgs; + sqInt savedNumTemps; + + assert(blockCount > 0); + savedNeedsFrame = needsFrame; + savedNumArgs = methodOrBlockNumArgs; + savedNumTemps = methodOrBlockNumTemps; + inBlock = InVanillaBlock; + compiledBlocksCount = 0; + while (compiledBlocksCount < blockCount) { + blockPass = 1; + blockStart = blockStartAt(compiledBlocksCount); + if (((result = scanBlock(blockStart))) < 0) { + return result; + } + initialOpcodeIndex = opcodeIndex; + + /* for SistaCogit */ + initialCounterIndex = 0; + saveForBlockCompile(); + while (1) { + compileBlockEntry(blockStart); + initialStackPtr = simStackPtr; + if (((result = compileAbstractInstructionsFromthrough(((blockStart->startpc)) + (pushNilSizenumInitialNils(methodObj, (blockStart->numInitialNils))), (((blockStart->startpc)) + ((blockStart->span))) - 1))) < 0) { + return result; + } + if (initialStackPtr == simStackPtr) break; + assert(initialStackPtr > simStackPtr); + + /* for asserts :-( */ + blockPass += 1; + (blockStart->numInitialNils = (((blockStart->numInitialNils)) + simStackPtr) - initialStackPtr); + (((blockStart->fakeHeader))->dependent = null); + reinitializeFixupsFromthrough(((blockStart->startpc)) + ((blockStart->numInitialNils)), (((blockStart->startpc)) + ((blockStart->span))) - 1); + bzero(abstractOpcodes + initialOpcodeIndex, + (opcodeIndex - initialOpcodeIndex) * sizeof(AbstractInstruction)); + opcodeIndex = initialOpcodeIndex; + resetForBlockCompile(); + } + compiledBlocksCount += 1; + } + needsFrame = savedNeedsFrame; + methodOrBlockNumArgs = savedNumArgs; + methodOrBlockNumTemps = savedNumTemps; + return 0; +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any, and to correctly + initialize the explicitly nilled/pushed temp entries (they are /not/ of + type constant nil). */ + + /* StackToRegisterMappingCogit>>#compileBlockFrameBuild: */ +static void NoDbgRegParms +compileBlockFrameBuild(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cascade0; + sqInt constant; + sqInt constant1; + sqInt i; + sqInt ign; + + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + cascade0 = (blockStart->fakeHeader); + addDependent(cascade0, annotateAbsolutePCRef(gPushCw(((sqInt)((blockStart->fakeHeader)))))); + /* begin setLabelOffset: */ + ((cascade0->operands))[1] = MFMethodFlagIsBlockFlag; + annotateobjRef(gPushCw(nilObject()), nilObject()); + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, Arg0Reg); + genLoadSlotsourceRegdestReg(ReceiverIndex, Arg0Reg, ReceiverResultReg); + } + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < ((blockStart->numCopied)); i += 1) { + genLoadSlotsourceRegdestReg(i + ClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + (blockStart->stackCheckLabel = annotateBytecode(gLabel())); + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramefulMethod((blockStart->startpc)); + if (((blockStart->numInitialNils)) > 0) { + if (((blockStart->numInitialNils)) > 1) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { + /* begin PushR: */ + genoperand(PushR, TempReg); + } + } + else { + /* begin genPushConstant: */ + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant1); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant1)); + } + } + } + } +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. We must annotate the + first instruction in vanilla blocks so that + findMethodForStartBcpc:inHomeMethod: can function. We need two annotations + because the first is a fiducial. */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileBlockFramelessEntry: */ +static void NoDbgRegParms +compileBlockFramelessEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramelessBlock((blockStart->startpc)); + if (!(((blockStart->entryLabel)) == null)) { + /* begin annotateBytecode: */ + abstractInstruction = (blockStart->entryLabel); + (abstractInstruction->annotation = HasBytecodePC); + /* begin annotateBytecode: */ + abstractInstruction1 = (blockStart->entryLabel); + (abstractInstruction1->annotation = HasBytecodePC); + } + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, TempReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, TempReg, ReceiverResultReg); + } +} + + /* StackToRegisterMappingCogit>>#compileCogFullBlockMethod: */ +static CogMethod * NoDbgRegParms +compileCogFullBlockMethod(sqInt numCopied) +{ + usqIntptr_t allocBytes; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = isYoungObject(methodObj); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = InFullBlock; + postCompileHook = null; + maxLitIndex = -1; + assert((primitiveIndexOf(methodObj)) == 0); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = numBytesOf(methodObj); + numBytecodes = (endPC - initialPC) + 1; + primitiveIndex = 0; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + 10) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + flag("TODO"); + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + assert(numBlocks == 0); + numCleanBlocks = scanForCleanBlocks(); + assert(numCleanBlocks == 0); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireFullBlockMethod(numCopied))) < 0) { + return ((CogMethod *) result); + } + return generateCogFullBlock(); +} + + /* StackToRegisterMappingCogit>>#compileCogMethod: */ +static CogMethod * NoDbgRegParms +compileCogMethod(sqInt selector) +{ + usqIntptr_t allocBytes; + int extra; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = (isYoungObject(methodObj)) + || (isYoung(selector)); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = 0; + postCompileHook = null; + maxLitIndex = -1; + extra = ((((primitiveIndex = primitiveIndexOf(methodObj))) > 0) + && (!(isQuickPrimitiveIndex(primitiveIndex))) + ? 30 + : 10); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = (isQuickPrimitiveIndex(primitiveIndex) + ? initialPC - 1 + : numBytesOf(methodObj)); + numBytecodes = (endPC - initialPC) + 1; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + extra) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + numCleanBlocks = scanForCleanBlocks(); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireMethod())) < 0) { + return ((CogMethod *) result); + } + return generateCogMethod(selector); +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Compile the abstract instructions for the entire method, including blocks. */ + + /* StackToRegisterMappingCogit>>#compileEntireMethod */ +static sqInt +compileEntireMethod(void) +{ + sqInt result; + + regArgsHaveBeenPushed = 0; + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileAbort(); + compileEntry(); + if (((result = compilePrimitive())) < 0) { + return result; + } + compileFrameBuild(); + if (((result = compileMethodBody())) < 0) { + return result; + } + if (blockCount == 0) { + return 0; + } + if (((result = compileBlockBodies())) < 0) { + return result; + } + return compileBlockDispatch(); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#compileFrameBuild */ +static void +compileFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction *jumpSkip; + + +# if IMMUTABILITY + if (useTwoPaths) { + compileTwoPathFrameBuild(); + return; + } + +# endif /* IMMUTABILITY */ + + if (!needsFrame) { + if (useTwoPaths) { + compileTwoPathFramelessInit(); + } + initSimStackForFramelessMethod(initialPC); + return; + } + assert(!(useTwoPaths)); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); + } + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. */ +/* Use ReceiverResultReg for Context to agree with store check trampoline */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileFullBlockFramelessEntry: */ +static void NoDbgRegParms +compileFullBlockFramelessEntry(sqInt numCopied) +{ + initSimStackForFramelessBlock(initialPC); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + flag("TODO"); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ + + /* StackToRegisterMappingCogit>>#compileFullBlockMethodFrameBuild: */ +static void NoDbgRegParms +compileFullBlockMethodFrameBuild(sqInt numCopied) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + sqInt constant; + sqInt i; + sqInt iLimiT; + + if (useTwoPaths) { + + /* method with only inst var store, we compile only slow path for now */ + useTwoPaths = 0; + +# if IMMUTABILITY + needsFrame = 1; + +# endif /* IMMUTABILITY */ + + } + if (!needsFrame) { + assert(numCopied == 0); + compileFullBlockFramelessEntry(numCopied); + initSimStackForFramelessBlock(initialPC); + return; + } + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin setLabelOffset: */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = MFMethodFlagIsBlockFlag; + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + flag("TODO"); + genLoadSlotsourceRegdestReg(FullClosureReceiverIndex, ClassReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, FullClosureReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < numCopied; i += 1) { + genLoadSlotsourceRegdestReg(i + FullClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + for (i = ((methodOrBlockNumArgs + numCopied) + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + stackCheckLabel = abstractInstruction; + initSimStackForFramefulMethod(initialPC); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* We are in a method where the frame is needed *only* for instance variable + store, typically a setter method. + This case has 20% overhead with Immutability compared to setter without + immutability because of the stack + frame creation. We compile two path, one where the object is immutable, + one where it isn't. At the beginning + of the frame build, we take one path or the other depending on the + receiver mutability. + + Note: this specific case happens only where there are only instance + variabel stores. We could do something + similar for literal variable stores, but we don't as it's too uncommon. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFrameBuild */ +#if IMMUTABILITY +static void +compileTwoPathFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction * jumpImmutable; + AbstractInstruction * jumpOld; + AbstractInstruction *jumpSkip; + sqInt quickConstant; + + assert(useTwoPaths); + assert(blockCount == 0); + jumpImmutable = genJumpImmutablescratchReg(ReceiverResultReg, TempReg); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + assert(!needsFrame); + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l8; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l8: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + needsFrame = 1; + jmpTarget(jumpOld, jmpTarget(jumpImmutable, gLabel())); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant)); + } + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} +#endif /* IMMUTABILITY */ + + +/* We are in a frameless method with at least two inst var stores. We compile + two paths, + one where the object is in new space, and one where it isn't. At the + beginning + of the method, we take one path or the other depending on the receiver + being in newSpace. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFramelessInit */ +static void +compileTwoPathFramelessInit(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * jumpOld; + sqInt quickConstant; + + assert(!(IMMUTABILITY)); + assert(!(needsFrame)); + assert(useTwoPaths); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l1; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l1: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + jmpTarget(jumpOld, gLabel()); +} + + /* StackToRegisterMappingCogit>>#cPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +cPICMissTrampolineFor(sqInt numArgs) +{ + return picMissTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + +/* Replaces the Blue Book double-extended send [132], in which the first byte + was wasted on 8 bits of argument count. + Here we use 3 bits for the operation sub-type (opType), and the remaining + 5 bits for argument count where needed. + The last byte give access to 256 instVars or literals. + See also secondExtendedSendBytecode + */ + + /* StackToRegisterMappingCogit>>#doubleExtendedDoAnythingBytecode */ +static sqInt +doubleExtendedDoAnythingBytecode(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + sqInt opType; + + opType = ((usqInt) byte1) >> 5; + if (opType == 0) { + return genSendnumArgs(byte2, byte1 & 0x1F); + } + if (opType == 1) { + return genSendSupernumArgs(byte2, byte1 & 0x1F); + } + + switch (opType) { + case 2: + if (isReadMediatedContextInstVarIndex(byte2)) { + genPushMaybeContextReceiverVariable(byte2); + } + else { + genPushReceiverVariable(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + break; + case 3: + genPushLiteralIndex(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction1 = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + + case 4: + genPushLiteralVariable(byte2); + break; + case 7: + genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + + break; + default: + + /* 5 & 6 */ + if (isWriteMediatedContextInstVarIndex(byte2)) { + genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + else { + genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + +; + } + assert(needsFrame); + assert(!(prevInstIsPCAnnotated())); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#duplicateTopBytecode */ +static sqInt +duplicateTopBytecode(void) +{ + SimStackEntry desc; + + desc = ssTopDescriptor(); + return ssPushDesc(desc); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithCleanup */ +static void +endHighLevelCallWithCleanup(void) +{ + AbstractInstruction *anInstruction; + + if (currentCallCleanUpSize > 0) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, currentCallCleanUpSize, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(currentCallCleanUpSize)); + } + } + callSwitchToSmalltalkStack(); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithoutCleanup */ +static void +endHighLevelCallWithoutCleanup(void) +{ + callSwitchToSmalltalkStack(); +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + traceFixup(fixup); + if ((((usqInt)((fixup->targetInstruction)))) <= NeedsNonMergeFixupFlag) { + + /* convert a non-merge into a merge */ + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + + /* this is the target of a backward branch and + so doesn't have a simStackPtr assigned yet. */ + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + assert(((fixup->simStackPtr)) == simStackPtr); + assert(((fixup->simNativeStackPtr)) == simNativeStackPtr); + assert(((fixup->simNativeStackSize)) == simNativeStackSize); + + } + } + /* begin recordBcpc: */ + return fixup; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureNonMergeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureNonMergeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + if (((fixup->targetInstruction)) == 0) { + /* begin becomeNonMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsNonMergeFixupFlag); + } + /* begin recordBcpc: */ + return fixup; +} + + /* StackToRegisterMappingCogit>>#ensureReceiverResultRegContainsSelf */ +static void +ensureReceiverResultRegContainsSelf(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + ssAllocateRequiredReg(ReceiverResultReg); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + (optStatus.isReceiverResultRegLive = 1); + } + else { + assert((((simSelf.type)) == SSRegister) + && (((simSelf.registerr)) == ReceiverResultReg)); + assert(((optStatus.isReceiverResultRegLive)) + && (((optStatus.ssEntry)) == ((&simSelf)))); + } +} + + /* StackToRegisterMappingCogit>>#evaluate:at: */ +static void NoDbgRegParms +evaluateat(BytecodeDescriptor *descriptor, sqInt pc) +{ + byte0 = fetchByteofObject(pc, methodObj); + assert(descriptor == (generatorAt(bytecodeSetOffset + byte0))); + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); +} + + +/* Spill the closest register on stack not conflicting with regMask. + Assertion Failure if regMask has already all the registers */ + + /* StackToRegisterMappingCogit>>#freeAnyRegNotConflictingWith: */ +static sqInt NoDbgRegParms +freeAnyRegNotConflictingWith(sqInt regMask) +{ + CogSimStackEntry *desc; + sqInt index; + sqInt reg; + + assert(needsFrame); + reg = NoReg; + index = ((simSpillBase < 0) ? 0 : simSpillBase); + while ((reg == NoReg) + && (index < simStackPtr)) { + desc = simStackAt(index); + if (((desc->type)) == SSRegister) { + if (!(regMask & (registerMaskFor((desc->registerr))))) { + reg = (desc->registerr); + } + } + index += 1; + } + assert(!((reg == NoReg))); + ssAllocateRequiredReg(reg); + return reg; +} + + +/* Return from block, assuming result already loaded into ReceiverResultReg. */ +/* Return from block, assuming result already loaded into ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#genBlockReturn */ +static sqInt +genBlockReturn(void) +{ + if (needsFrame) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + + } + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + + /* can't fall through */ + deadCode = 1; + return 0; +} + + +/* Generate special versions of the ceCallCogCodePopReceiverAndClassRegs + enilopmart that also pop register args from the stack to undo the pushing + of register args in the abort/miss trampolines. */ + + /* StackToRegisterMappingCogit>>#genCallPICEnilopmartNumArgs: */ +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) + +{ + AbstractInstruction *anInstruction; + sqInt endAddress; + sqInt enilopmart; + sqInt quickConstant; + sqInt reg; + sqInt size; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + + genLoadStackPointers(backEnd); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin PopR: */ + reg = LinkReg; + genoperand(PopR, reg); + if (numArgs > 0) { + if (numArgs > 1) { + /* begin PopR: */ + genoperand(PopR, Arg1Reg); + assert((numRegArgs()) == 2); + } + /* begin PopR: */ + genoperand(PopR, Arg0Reg); + } + /* begin PopR: */ + genoperand(PopR, ReceiverResultReg); + /* begin JumpR: */ + genoperand(JumpR, TempReg); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineNamenumRegArgs("ceCallPIC", numArgs), enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after + execution. See EncoderForSistaV1's class comment and + StackInterpreter>>#inlinePrimitiveBytecode: + */ + + /* StackToRegisterMappingCogit>>#genCallPrimitiveBytecode */ +static sqInt +genCallPrimitiveBytecode(void) +{ + sqInt prim; + sqInt primSet; + + if (byte2 < 128) { + return (bytecodePC == initialPC + ? 0 + : EncounteredUnknownBytecode); + } + prim = (((sqInt)((usqInt)((byte2 - 128)) << 8))) + byte1; + primSet = (((usqInt) prim) >> 13) & 3; + prim = prim & 0x1FFF; + if (primSet == 1) { + if (prim < 1000) { + return genLowcodeNullaryInlinePrimitive(prim); + } + if (prim < 2000) { + return genLowcodeUnaryInlinePrimitive(prim - 1000); + } + if (prim < 3000) { + return genLowcodeBinaryInlinePrimitive(prim - 2000); + } + if (prim < 4000) { + return genLowcodeTrinaryInlinePrimitive(prim - 3000); + } + } + + return EncounteredUnknownBytecode; +} + + +/* Override to push the register receiver and register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#genExternalizePointersForPrimitiveCall */ +static sqInt +genExternalizePointersForPrimitiveCall(void) +{ + sqInt address; + sqInt address1; + sqInt address4; + + genPushRegisterArgs(); + /* begin MoveR:Aw: */ + address4 = framePointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address4, genoperandoperand(MoveRAw, FPReg, address4)); + + /* Set coInterpreter stackPointer to the topmost argument, skipping the return address. */ + /* begin MoveR:Aw: */ + address = stackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, SPReg, address)); + /* begin MoveR:Aw: */ + address1 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, LinkReg, address1)); + + return 0; +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* StackToRegisterMappingCogit>>#genExtPushClosureBytecode */ +static sqInt +genExtPushClosureBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); + extA = (numExtB = (extB = 0)); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* Full Block creation compilation. The block's actual code will be compiled + separatedly. + */ +/* * 255 11111111 xxxxxxxx siyyyyyy push Closure Compiled block literal + index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 + ignoreOuterContext: i = 1 + */ + + /* StackToRegisterMappingCogit>>#genExtPushFullClosureBytecode */ +static sqInt +genExtPushFullClosureBytecode(void) +{ + sqInt compiledBlock; + sqInt i; + int ignoreContext; + sqInt numCopied; + int receiverIsOnStack; + sqInt reg; + + assert(needsFrame); + compiledBlock = getLiteral(byte1 + (((sqInt)((usqInt)(extA) << 8)))); + extA = 0; + numCopied = byte2 & ((1U << 6) - 1); + receiverIsOnStack = byte2 & (1U << 7); + ignoreContext = byte2 & (1U << 6); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(compiledBlock, argumentCountOf(compiledBlock), numCopied, ignoreContext, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (FullClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + if (receiverIsOnStack) { + reg = ssStorePoptoPreferredReg(1, TempReg); + } + else { + storeToReg((&simSelf), (reg = TempReg)); + } + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, FullClosureReceiverIndex, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genExtPushRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtPushRemoteTempOrInstVarLongBytecode(void) +{ + sqInt index; + sqInt maybeContext; + + return ((byte2 & (remoteIsInstVarAccess())) == 0 + ? genPushRemoteTempLongBytecode() + : (/* begin extBSpecifiesMaybeContext */ + (maybeContext = extB & 2), + (index = byte1 + (((sqInt)((usqInt)(extA) << 8)))), + (extA = 0), + (extB = 0), + (numExtB = 0), + ((isReadMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genPushMaybeContextRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess())) + : genPushRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess()))))); +} + + /* StackToRegisterMappingCogit>>#genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean: */ +static sqInt NoDbgRegParms +genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesMaybeContext */ + maybeContext = extB & 2; + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + extB = 0; + numExtB = 0; + if ((byte2 & (remoteIsInstVarAccess())) == 0) { + genStorePopRemoteTempAtneedsStoreCheck(boolean, byte1, byte2, needsStoreCheck); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + } + else { + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + if ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext)) { + genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + else { + genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + } + return 0; +} + + +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). + */ +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). Override to add version for generic and PIC-specific entry + with reg args. */ + + /* StackToRegisterMappingCogit>>#generateEnilopmarts */ +static void +generateEnilopmarts(void) +{ + +# if Debug + /* begin genEnilopmartFor:forCall:called: */ + realCEEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "realCEEnterCogCodePopReceiverReg"); + ceEnterCogCodePopReceiverReg = enterCogCodePopReceiver; + /* begin genEnilopmartFor:forCall:called: */ + realCECallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "realCEEnterCogCodePopReceiverReg"); + ceCallCogCodePopReceiverReg = callCogCodePopReceiver; + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "realCECallCogCodePopReceiverAndClassRegs"); + ceCallCogCodePopReceiverAndClassRegs = callCogCodePopReceiverAndClassRegs; + +# else /* Debug */ + /* begin genEnilopmartFor:forCall:called: */ + ceEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "ceEnterCogCodePopReceiverReg"); + /* begin genEnilopmartFor:forCall:called: */ + ceCallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "ceCallCogCodePopReceiverReg"); + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "ceCallCogCodePopReceiverAndClassRegs"); + +# endif /* Debug */ + + genPrimReturnEnterCogCodeEnilopmart(0); + cePrimReturnEnterCogCode = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCode); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCode", cePrimReturnEnterCogCode); + genPrimReturnEnterCogCodeEnilopmart(1); + cePrimReturnEnterCogCodeProfiling = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCodeProfiling); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCodeProfiling", cePrimReturnEnterCogCodeProfiling); + +# if Debug + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "realCECallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg0Regs = callCogCodePopReceiverArg0Regs; + realCECallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "realCECallCogCodePopReceiverArg1Arg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = callCogCodePopReceiverArg1Arg0Regs; + +# else /* Debug */ + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "ceCallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "ceCallCogCodePopReceiverArg1Arg0Regs"); + +# endif /* Debug */ + + ceCall0ArgsPIC = genCallPICEnilopmartNumArgs(0); + ceCall1ArgsPIC = genCallPICEnilopmartNumArgs(1); + ceCall2ArgsPIC = genCallPICEnilopmartNumArgs(2); + assert((numRegArgs()) == 2); + + +} + + +/* Generate the run-time entries for the various method and PIC entry misses + and aborts. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* StackToRegisterMappingCogit>>#generateMissAbortTrampolines */ +static void +generateMissAbortTrampolines(void) +{ + sqInt numArgs; + sqInt numArgsLimiT; + + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + methodAbortTrampolines[numArgs] = (genMethodAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picAbortTrampolines[numArgs] = (genPICAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picMissTrampolines[numArgs] = (genPICMissTrampolineFor(numArgs)); + } +} + + +/* Override to generate code to push the register arg(s) for <= numRegArg + arity sends. + */ + + /* StackToRegisterMappingCogit>>#generateSendTrampolines */ +static void +generateSendTrampolines(void) +{ + sqInt numArgs; + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + ordinarySendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSend", numArgs), ClassReg, trampolineArgConstant(0), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + directedSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + superSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSuperSend", numArgs), ClassReg, trampolineArgConstant(1), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + firstSend = ordinarySendTrampolines[0]; + lastSend = superSendTrampolines[NumSendTrampolines - 1]; +} + + +/* Generate trampolines for tracing. In the simulator we can save a lot of + time and avoid noise instructions in the lastNInstructions log by + short-cutting these + trampolines, but we need them in the real vm. */ + + /* StackToRegisterMappingCogit>>#generateTracingTrampolines */ +static void +generateTracingTrampolines(void) +{ + ceTraceLinkedSendTrampoline = genTrampolineForcalledargregsToSave(ceTraceLinkedSend, "ceTraceLinkedSendTrampoline", ReceiverResultReg, CallerSavedRegisterMask); + ceTraceBlockActivationTrampoline = genTrampolineForcalledregsToSave(ceTraceBlockActivation, "ceTraceBlockActivationTrampoline", CallerSavedRegisterMask); + ceTraceStoreTrampoline = genTrampolineForcalledargargregsToSave(ceTraceStoreOfinto, "ceTraceStoreTrampoline", TempReg, ReceiverResultReg, CallerSavedRegisterMask); +} + + /* StackToRegisterMappingCogit>>#genForwardersInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genForwardersInlinedIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt arg; + sqInt argReg; + sqInt argReg1; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt constant; + sqInt constant1; + sqInt descr; + AbstractInstruction *finished; + AbstractInstruction *finished1; + usqInt fixup; + AbstractInstruction *imm; + AbstractInstruction *imm1; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + void *jumpTarget3; + AbstractInstruction *label; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + AbstractInstruction *ok; + AbstractInstruction *ok1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + sqInt quickConstant; + sqInt quickConstant1; + sqInt rcvr; + sqInt rcvrReg; + sqInt rcvrReg1; + sqInt reg; + sqInt rNext; + sqInt rNext1; + sqInt rTop; + sqInt rTop1; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + sqInt topRegistersMask; + int unforwardArg; + int unforwardRcvr; + + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + unforwardRcvr = !(isUnannotatableConstant(ssValue(1))); + unforwardArg = !(isUnannotatableConstant(ssTop())); + /* begin allocateEqualsEqualsRegistersArgNeedsReg:rcvrNeedsReg:into: */ + assert(unforwardArg + || (unforwardRcvr)); + argReg1 = (rcvrReg1 = NoReg); + if (unforwardArg) { + if (unforwardRcvr) { + /* begin allocateRegForStackTopTwoEntriesInto: */ + topRegistersMask = 0; + rTop1 = (rNext1 = NoReg); + if ((registerOrNone(ssTop())) != NoReg) { + rTop1 = registerOrNone(ssTop()); + } + if ((registerOrNone(ssValue(1))) != NoReg) { + /* begin registerMaskFor: */ + reg = (rNext1 = registerOrNone(ssValue(1))); + topRegistersMask = 1U << reg; + } + if (rTop1 == NoReg) { + rTop1 = allocateRegNotConflictingWith(topRegistersMask); + } + if (rNext1 == NoReg) { + rNext1 = allocateRegNotConflictingWith(1U << rTop1); + } + assert(!(((rTop1 == NoReg) + || (rNext1 == NoReg)))); + argReg1 = rTop1; + rcvrReg1 = rNext1; + + popToReg(ssTop(), argReg1); + popToReg(ssValue(1), rcvrReg1); + } + else { + argReg1 = allocateRegForStackEntryAtnotConflictingWith(0, 0); + popToReg(ssTop(), argReg1); + if (((ssValue(1))->spilled)) { + /* begin AddCq:R: */ + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(BytesPerWord)); + } + } + } + } + else { + assert(unforwardRcvr); + assert(!((((ssTop())->spilled)))); + rcvrReg1 = allocateRegForStackEntryAtnotConflictingWith(1, 0); + popToReg(ssValue(1), rcvrReg1); + } + assert(!((unforwardArg + && (argReg1 == NoReg)))); + assert(!((unforwardRcvr + && (rcvrReg1 == NoReg)))); + rcvrReg = rcvrReg1; + argReg = argReg1; + + if (!(((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)))) { + return genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(!unforwardArg, !unforwardRcvr, argReg, rcvrReg, orNot); + } + ssFlushTo(simStackPtr - 2); + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrReg != NoReg)); + if (!unforwardArg) { + /* begin genCmpConstant:R: */ + constant = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gCmpCwR(constant, rcvrReg), constant); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(constant)); + } + } + } + else { + if (!unforwardRcvr) { + /* begin genCmpConstant:R: */ + constant1 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gCmpCwR(constant1, argReg), constant1); + } + else { + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); + if (usesOutOfLineLiteral(anInstruction12)) { + (anInstruction12->dependent = locateLiteral(constant1)); + } + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrReg); + } + } + ssPop(2); + if ((((fixupAt(nextPC - initialPC))->targetInstruction)) == 0) { + + /* The next instruction is dead. we can skip it. */ + deadCode = 1; + ensureFixupAt(targetBytecodePC - initialPC); + ensureFixupAt(postBranchPC - initialPC); + } + else { + assert(!(deadCode)); + } + assert(unforwardArg + || (unforwardRcvr)); + if (orNot) { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget1 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget1)); + } + } + else { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget2 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget2)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget3 = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget3)); + } + } + if (!deadCode) { + ssPushConstant(trueObject()); + } + if (unforwardArg) { + if (unforwardRcvr) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + else { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(argReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(argReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, argReg, argReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished = ((AbstractInstruction *) fixup); + } + jmpTarget(imm, jmpTarget(ok, finished)); + } + } + if (unforwardRcvr) { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(rcvrReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm1 = genJumpImmediate(rcvrReg); + /* begin MoveMw:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(0)); + } + /* begin AndCq:R: */ + quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpNonZero: */ + ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, rcvrReg, rcvrReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished1 = ((AbstractInstruction *) fixup); + } + jmpTarget(imm1, jmpTarget(ok1, finished1)); + } + return 0; +} + + +/* Generates the machine code for #== in the case where the instruction is + not followed by a branch + */ + + /* StackToRegisterMappingCogit>>#genIdenticalNoBranchArgIsConstant:rcvrIsConstant:argReg:rcvrReg:orNotIf: */ +static sqInt NoDbgRegParms +genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt constant; + sqInt constant1; + sqInt constant11; + sqInt constant2; + sqInt constant3; + sqInt constant4; + AbstractInstruction *jumpEqual; + AbstractInstruction *jumpNotEqual; + AbstractInstruction *label; + sqInt resultReg; + + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrRegOrNone != NoReg)); + if (argIsConstant) { + /* begin genCmpConstant:R: */ + constant4 = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant4)) { + annotateobjRef(gCmpCwR(constant4, rcvrRegOrNone), constant4); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(constant4)); + } + } + } + else { + if (rcvrIsConstant) { + /* begin genCmpConstant:R: */ + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); + } + else { + /* begin CmpCq:R: */ + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); + if (usesOutOfLineLiteral(anInstruction11)) { + (anInstruction11->dependent = locateLiteral(constant11)); + } + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrRegOrNone); + } + } + ssPop(2); + resultReg = (rcvrRegOrNone == NoReg + ? argReg + : rcvrRegOrNone); + /* begin JumpZero: */ + jumpEqual = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + if (!argIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + if (!rcvrIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(rcvrRegOrNone, TempReg, label); + } + if (orNot) { + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, resultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(constant)); + } + } + } + else { + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, resultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(constant1)); + } + } + } + /* begin Jump: */ + jumpNotEqual = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpEqual, (orNot + ? (/* begin genMoveFalseR: */ + (constant2 = falseObject()), + (shouldAnnotateObjectReference(constant2) + ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) + : (/* begin MoveCq:R: */ + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + (usesOutOfLineLiteral(anInstruction2) + ? (anInstruction2->dependent = locateLiteral(constant2)) + : 0), + anInstruction2))) + : (/* begin genMoveTrueR: */ + (constant3 = trueObject()), + (shouldAnnotateObjectReference(constant3) + ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) + : (/* begin MoveCq:R: */ + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + (usesOutOfLineLiteral(anInstruction3) + ? (anInstruction3->dependent = locateLiteral(constant3)) + : 0), + anInstruction3))))); + jmpTarget(jumpNotEqual, gLabel()); + ssPushRegister(resultReg); + return 0; +} + + +/* Decompose code generation for #== into a common constant-folding version, + followed by a double dispatch throguh the objectRepresentation to a + version that doesn't deal with forwarders and a version that does. */ + + /* StackToRegisterMappingCogit>>#genInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genInlinedIdenticalOrNotIf(sqInt orNot) +{ + BytecodeDescriptor *primDescriptor; + sqInt result; + + primDescriptor = generatorAt(byte0); + if ((isUnannotatableConstant(ssTop())) + && (isUnannotatableConstant(ssValue(1)))) { + assert(!((primDescriptor->isMapped))); + result = ((orNot + ? (((ssTop())->constant)) != (((ssValue(1))->constant)) + : (((ssTop())->constant)) == (((ssValue(1))->constant))) + ? trueObject() + : falseObject()); + ssPop(2); + return ssPushConstant(result); + } + /* begin genInlinedIdenticalOrNotIfGuts: */ + return genForwardersInlinedIdenticalOrNotIf(orNot); +} + + /* StackToRegisterMappingCogit>>#genJumpBackTo: */ +static sqInt NoDbgRegParms +genJumpBackTo(sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt address; + void *jumpTarget; + void *jumpTarget1; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpAboveOrEqual: */ + jumpTarget = fixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)jumpTarget)); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceCheckForInterruptTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + jumpTarget1 = fixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget1)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpIf:to: */ +static sqInt NoDbgRegParms +genJumpIfto(sqInt boolean, sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + CogSimStackEntry *desc; + BytecodeFixup *fixup; + void *jumpTarget; + AbstractInstruction *ok; + sqInt quickConstant; + + ssFlushTo(simStackPtr - 1); + desc = ssTop(); + ssPop(1); + if ((((desc->type)) == SSConstant) + && ((((desc->constant)) == (trueObject())) + || (((desc->constant)) == (falseObject())))) { + + /* Must arrange there's a fixup at the target whether it is jumped to or + not so that the simStackPtr can be kept correct. */ + + /* Must annotate the bytecode for correct pc mapping. */ + fixup = ensureFixupAt(targetBytecodePC - initialPC); + /* begin annotateBytecode: */ + if (((desc->constant)) == boolean) { + /* begin Jump: */ + abstractInstruction = genoperand(Jump, ((sqInt)fixup)); + } + else { + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + (abstractInstruction->annotation = HasBytecodePC); + extA = 0; + return 0; + } + popToReg(desc, TempReg); + assert((objectAfter(falseObject())) == (trueObject())); + /* begin genSubConstant:R: */ + if (shouldAnnotateObjectReference(boolean)) { + annotateobjRef(gSubCwR(boolean, TempReg), TempReg); + } + else { + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(boolean)); + } + } + /* begin JumpZero: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + if (extA & 1) { + extA = 0; + /* begin annotateBytecode: */ + abstractInstruction1 = lastOpcode(); + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + } + extA = 0; + /* begin CmpCq:R: */ + quickConstant = (boolean == (falseObject()) + ? (trueObject()) - (falseObject()) + : (falseObject()) - (trueObject())); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant)); + } + /* begin JumpZero: */ + ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genCallMustBeBooleanFor(boolean); + jmpTarget(ok, annotateBytecode(gLabel())); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpTo: */ +static sqInt NoDbgRegParms +genJumpTo(sqInt targetBytecodePC) +{ + void *jumpTarget; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin Jump: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genLoadTemp:in: */ +static void NoDbgRegParms +genLoadTempin(sqInt objectIndex, sqInt destReg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (destReg == ReceiverResultReg) { + voidReceiverResultRegContainsSelf(); + } + ssAllocateRequiredReg(destReg); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(objectIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, destReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd32 */ +static sqInt +genLowcodeAdd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd64 */ +static sqInt +genLowcodeAdd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, secondLow, firstLow); + /* begin AddcR:R: */ + genoperandoperand(AddcRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca32 */ +static sqInt +genLowcodeAlloca32(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (size == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin SubR:R: */ + genoperandoperand(SubRR, size, TempReg); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, -16, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(-16)); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, size); + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, size, address1)); + ssPushNativeRegister(size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca64 */ +static sqInt +genLowcodeAlloca64(void) +{ + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if ((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, sizeLow, SPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, sizeLow); + ssPushNativeRegister(sizeLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd32 */ +static sqInt +genLowcodeAnd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd64 */ +static sqInt +genLowcodeAnd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondLow, firstLow); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift32 */ +static sqInt +genLowcodeArithmeticRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift64 */ +static sqInt +genLowcodeArithmeticRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBeginCall */ +static sqInt +genLowcodeBeginCall(void) +{ + sqInt alignment; + + alignment = extA; + beginHighLevelCall(alignment); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeBinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeBinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeByteSizeOf(); + + case 1: + return genLowcodeFirstFieldPointer(); + + case 2: + return genLowcodeFirstIndexableFieldPointer(); + + case 3: + return genLowcodeIsBytes(); + + case 4: + return genLowcodeIsFloatObject(); + + case 5: + return genLowcodeIsIndexable(); + + case 6: + return genLowcodeIsIntegerObject(); + + case 7: + return genLowcodeIsPointers(); + + case 8: + return genLowcodeIsWords(); + + case 9: + return genLowcodeIsWordsOrBytes(); + + case 10: + return genLowcodeOopSmallIntegerToInt32(); + + case 11: + return genLowcodeOopSmallIntegerToInt64(); + + case 12: + return genLowcodeOopToBoolean32(); + + case 13: + return genLowcodeOopToBoolean64(); + + case 14: + return genLowcodeOopToFloat32(); + + case 15: + return genLowcodeOopToFloat64(); + + case 16: + return genLowcodeOopToInt32(); + + case 17: + return genLowcodeOopToInt64(); + + case 18: + return genLowcodeOopToPointer(); + + case 19: + return genLowcodeOopToPointerReinterpret(); + + case 20: + return genLowcodeOopToUInt32(); + + case 21: + return genLowcodeOopToUInt64(); + + case 22: + return genLowcodePin(); + + case 23: + return genLowcodeUnpin(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean32ToOop */ +static sqInt +genLowcodeBoolean32ToOop(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt value; + sqInt wordConstant; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), value), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + inst = checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, value)); + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean64ToOop */ +static sqInt +genLowcodeBoolean64ToOop(void) +{ + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt valueHigh; + sqInt valueLow; + sqInt wordConstant; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, valueLow, valueHigh); + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), valueLow), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + inst = checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, valueLow)); + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeByteSizeOf */ +static sqInt +genLowcodeByteSizeOf(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcByteSizeOfto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat32 */ +static sqInt +genLowcodeCallArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, DPFPReg0, -BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(-BytesPerWord)); + } + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(BytesPerWord)); + } + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat64 */ +static sqInt +genLowcodeCallArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, DPFPReg0, -8, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(-8)); + } + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 8, SPReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(8)); + } + currentCallCleanUpSize += 8; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt32 */ +static sqInt +genLowcodeCallArgumentInt32(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt64 */ +static sqInt +genLowcodeCallArgumentInt64(void) +{ + nativeStackPopToRegsecondReg(ssNativeTop(), TempReg, ReceiverResultReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + currentCallCleanUpSize += 8; + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentPointer */ +static sqInt +genLowcodeCallArgumentPointer(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ +/* Allocate space */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentSpace */ +static sqInt +genLowcodeCallArgumentSpace(void) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(extA)); + } + currentCallCleanUpSize += extA; + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Fetch the pointer */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentStructure */ +static sqInt +genLowcodeCallArgumentStructure(void) +{ + AbstractInstruction *anInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(extA)); + } + + /* Copy the structure */ + currentCallCleanUpSize += extA; + genMemCopytoconstantSize(backEnd, TempReg, SPReg, extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallInstruction */ +static sqInt +genLowcodeCallInstruction(void) +{ + AbstractInstruction *abstractInstruction; + sqInt function; + + function = extA; + /* begin CallRT: */ + abstractInstruction = genoperand(Call, function); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallPhysical */ +static sqInt +genLowcodeCallPhysical(void) +{ + sqInt registerID; + + registerID = extA; + /* begin CallR: */ + genoperand(CallR, registerID); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCheckSessionIdentifier */ +static sqInt +genLowcodeCheckSessionIdentifier(void) +{ + sqInt expectedSession; + + expectedSession = extA; + ssPushNativeConstantInt32((expectedSession == (getThisSessionID()) + ? 1 + : 0)); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCompareAndSwap32 */ +static sqInt +genLowcodeCompareAndSwap32(void) +{ + sqInt check; + sqInt newValue; + sqInt oldValue; + sqInt value; + + if (((newValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((newValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((oldValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << newValue)))) == NoReg) { + ssAllocateRequiredReg((oldValue = Arg1Reg)); + } + if (((check = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << newValue)) | (1U << oldValue)))) == NoReg) { + ssAllocateRequiredReg((check = SendNumArgsReg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << newValue)) | (1U << oldValue)) | (1U << check)))) == NoReg) { + ssAllocateRequiredReg((value = ClassReg)); + } + if ((((newValue == ReceiverResultReg) + || (oldValue == ReceiverResultReg)) + || (check == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), newValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), oldValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), check); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv32 */ +static sqInt +genLowcodeDiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv64 */ +static sqInt +genLowcodeDiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat32 */ +static sqInt +genLowcodeDuplicateFloat32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRs:Rs: */ + genoperandoperand(MoveRsRs, value, dup2); + ssPushNativeRegisterSingleFloat(value); + ssPushNativeRegisterSingleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat64 */ +static sqInt +genLowcodeDuplicateFloat64(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, dup2); + ssPushNativeRegisterDoubleFloat(value); + ssPushNativeRegisterDoubleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt32 */ +static sqInt +genLowcodeDuplicateInt32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, dup2); + ssPushNativeRegister(value); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt64 */ +static sqInt +genLowcodeDuplicateInt64(void) +{ + sqInt dup2High; + sqInt dup2Low; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((dup2Low = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((dup2Low = SendNumArgsReg)); + } + if (((dup2High = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << dup2Low)))) == NoReg) { + ssAllocateRequiredReg((dup2High = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (dup2Low == ReceiverResultReg)) + || (dup2High == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, dup2Low); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, dup2High); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + ssPushNativeRegistersecondRegister(dup2Low, dup2High); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicatePointer */ +static sqInt +genLowcodeDuplicatePointer(void) +{ + sqInt dup2; + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointerValue)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((pointerValue == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointerValue, dup2); + ssPushNativeRegister(pointerValue); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress32 */ +static sqInt +genLowcodeEffectiveAddress32(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if ((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, scale, index); + /* begin AddR:R: */ + genoperandoperand(AddRR, index, base); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress64 */ +static sqInt +genLowcodeEffectiveAddress64(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt result; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)) | (1U << base)))) == NoReg) { + ssAllocateRequiredReg((result = ReceiverResultReg)); + } + if (((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCall */ +static sqInt +genLowcodeEndCall(void) +{ + endHighLevelCallWithCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCallNoCleanup */ +static sqInt +genLowcodeEndCallNoCleanup(void) +{ + endHighLevelCallWithoutCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstFieldPointer */ +static sqInt +genLowcodeFirstFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstIndexableFieldPointer */ +static sqInt +genLowcodeFirstIndexableFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstIndexableFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Add */ +static sqInt +genLowcodeFloat32Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRs:Rs: */ + genoperandoperand(AddRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Div */ +static sqInt +genLowcodeFloat32Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRs:Rs: */ + genoperandoperand(DivRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Equal */ +static sqInt +genLowcodeFloat32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Great */ +static sqInt +genLowcodeFloat32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32GreatEqual */ +static sqInt +genLowcodeFloat32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Less */ +static sqInt +genLowcodeFloat32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32LessEqual */ +static sqInt +genLowcodeFloat32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Mul */ +static sqInt +genLowcodeFloat32Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRs:Rs: */ + genoperandoperand(MulRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Neg */ +static sqInt +genLowcodeFloat32Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRs:Rs: */ + genoperandoperand(XorRsRs, result, result); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32NotEqual */ +static sqInt +genLowcodeFloat32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sqrt */ +static sqInt +genLowcodeFloat32Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRs: */ + genoperand(SqrtRs, value); + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sub */ +static sqInt +genLowcodeFloat32Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToFloat64 */ +static sqInt +genLowcodeFloat32ToFloat64(void) +{ + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, singleFloatValue, singleFloatValue); + ssPushNativeRegisterDoubleFloat(singleFloatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt32 */ +static sqInt +genLowcodeFloat32ToInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt64 */ +static sqInt +genLowcodeFloat32ToInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToOop */ +static sqInt +genLowcodeFloat32ToOop(void) +{ + sqInt object; + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat32toOop(singleFloatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt32 */ +static sqInt +genLowcodeFloat32ToUInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt64 */ +static sqInt +genLowcodeFloat32ToUInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Add */ +static sqInt +genLowcodeFloat64Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRd:Rd: */ + genoperandoperand(AddRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Div */ +static sqInt +genLowcodeFloat64Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRd:Rd: */ + genoperandoperand(DivRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Equal */ +static sqInt +genLowcodeFloat64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Great */ +static sqInt +genLowcodeFloat64Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64GreatEqual */ +static sqInt +genLowcodeFloat64GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Less */ +static sqInt +genLowcodeFloat64Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64LessEqual */ +static sqInt +genLowcodeFloat64LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Mul */ +static sqInt +genLowcodeFloat64Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRd:Rd: */ + genoperandoperand(MulRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Neg */ +static sqInt +genLowcodeFloat64Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRd:Rd: */ + genoperandoperand(XorRdRd, result, result); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64NotEqual */ +static sqInt +genLowcodeFloat64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sqrt */ +static sqInt +genLowcodeFloat64Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRd: */ + genoperand(SqrtRd, value); + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sub */ +static sqInt +genLowcodeFloat64Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToFloat32 */ +static sqInt +genLowcodeFloat64ToFloat32(void) +{ + sqInt floatValue; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, floatValue, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt32 */ +static sqInt +genLowcodeFloat64ToInt32(void) +{ + sqInt floatValue; + sqInt int32Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int32Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int32Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int32Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int32Result); + ssPushNativeRegister(int32Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt64 */ +static sqInt +genLowcodeFloat64ToInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToOop */ +static sqInt +genLowcodeFloat64ToOop(void) +{ + sqInt floatValue; + sqInt object; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat64toOop(floatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt32 */ +static sqInt +genLowcodeFloat64ToUInt32(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int64Result); + ssPushNativeRegister(int64Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt64 */ +static sqInt +genLowcodeFloat64ToUInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFree */ +static sqInt +genLowcodeFree(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + if (pointer != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFreeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexable32Oop */ +static sqInt +genLowcodeInstantiateIndexable32Oop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + if (((indexableSize = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((indexableSize = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((classOop = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << indexableSize)))) == NoReg) { + ssAllocateRequiredReg((classOop = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << indexableSize)) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((indexableSize == ReceiverResultReg) + || (classOop == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), indexableSize); + ssNativePop(1); + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopindexableSize(classOop, indexableSize); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexableOop */ +static sqInt +genLowcodeInstantiateIndexableOop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + indexableSize = extA; + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((classOop == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopconstantIndexableSize(classOop, indexableSize); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateOop */ +static sqInt +genLowcodeInstantiateOop(void) +{ + sqInt classOop; + + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (classOop == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOop(classOop); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Equal */ +static sqInt +genLowcodeInt32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Great */ +static sqInt +genLowcodeInt32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLessOrEqual: */ + falseJump = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32GreatEqual */ +static sqInt +genLowcodeInt32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLess: */ + falseJump = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Less */ +static sqInt +genLowcodeInt32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreaterOrEqual: */ + falseJump = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32LessEqual */ +static sqInt +genLowcodeInt32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreater: */ + falseJump = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32NotEqual */ +static sqInt +genLowcodeInt32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat32 */ +static sqInt +genLowcodeInt32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat64 */ +static sqInt +genLowcodeInt32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToOop */ +static sqInt +genLowcodeInt32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToPointer */ +static sqInt +genLowcodeInt32ToPointer(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Equal */ +static sqInt +genLowcodeInt64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, firstLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, firstLow); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Great */ +static sqInt +genLowcodeInt64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64GreatEqual */ +static sqInt +genLowcodeInt64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Less */ +static sqInt +genLowcodeInt64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64LessEqual */ +static sqInt +genLowcodeInt64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64NotEqual */ +static sqInt +genLowcodeInt64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, firstLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 1, firstLow); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(1)); + } + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat32 */ +static sqInt +genLowcodeInt64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat64 */ +static sqInt +genLowcodeInt64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToOop */ +static sqInt +genLowcodeInt64ToOop(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToPointer */ +static sqInt +genLowcodeInt64ToPointer(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsBytes */ +static sqInt +genLowcodeIsBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsFloatObject */ +static sqInt +genLowcodeIsFloatObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsFloatObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIndexable */ +static sqInt +genLowcodeIsIndexable(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIndexableto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIntegerObject */ +static sqInt +genLowcodeIsIntegerObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIntegerObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsPointers */ +static sqInt +genLowcodeIsPointers(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsPointersto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWords */ +static sqInt +genLowcodeIsWords(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWordsOrBytes */ +static sqInt +genLowcodeIsWordsOrBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsOrBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift32 */ +static sqInt +genLowcodeLeftShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift64 */ +static sqInt +genLowcodeLeftShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentAddress */ +static sqInt +genLowcodeLoadArgumentAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat32 */ +static sqInt +genLowcodeLoadArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat64 */ +static sqInt +genLowcodeLoadArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt16 */ +static sqInt +genLowcodeLoadArgumentInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt32 */ +static sqInt +genLowcodeLoadArgumentInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt64 */ +static sqInt +genLowcodeLoadArgumentInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt8 */ +static sqInt +genLowcodeLoadArgumentInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentPointer */ +static sqInt +genLowcodeLoadArgumentPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt16 */ +static sqInt +genLowcodeLoadArgumentUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt32 */ +static sqInt +genLowcodeLoadArgumentUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt64 */ +static sqInt +genLowcodeLoadArgumentUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt8 */ +static sqInt +genLowcodeLoadArgumentUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat32FromMemory */ +static sqInt +genLowcodeLoadFloat32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat64FromMemory */ +static sqInt +genLowcodeLoadFloat64FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt16FromMemory */ +static sqInt +genLowcodeLoadInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt32FromMemory */ +static sqInt +genLowcodeLoadInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt64FromMemory */ +static sqInt +genLowcodeLoadInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt8FromMemory */ +static sqInt +genLowcodeLoadInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalAddress */ +static sqInt +genLowcodeLoadLocalAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat32 */ +static sqInt +genLowcodeLoadLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat64 */ +static sqInt +genLowcodeLoadLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt16 */ +static sqInt +genLowcodeLoadLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt32 */ +static sqInt +genLowcodeLoadLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt64 */ +static sqInt +genLowcodeLoadLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt8 */ +static sqInt +genLowcodeLoadLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalPointer */ +static sqInt +genLowcodeLoadLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt16 */ +static sqInt +genLowcodeLoadLocalUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt32 */ +static sqInt +genLowcodeLoadLocalUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt64 */ +static sqInt +genLowcodeLoadLocalUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt8 */ +static sqInt +genLowcodeLoadLocalUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectAt */ +static sqInt +genLowcodeLoadObjectAt(void) +{ + sqInt fieldIndex; + sqInt object; + + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((fieldIndex == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectat(object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectField */ +static sqInt +genLowcodeLoadObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + + fieldIndex = extA; + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectfield(object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadPointerFromMemory */ +static sqInt +genLowcodeLoadPointerFromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt pointerResult; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerResult = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((pointerResult = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (pointerResult == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, pointer, pointerResult); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(pointerResult); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt16FromMemory */ +static sqInt +genLowcodeLoadUInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt32FromMemory */ +static sqInt +genLowcodeLoadUInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt64FromMemory */ +static sqInt +genLowcodeLoadUInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt8FromMemory */ +static sqInt +genLowcodeLoadUInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLocalFrameSize */ +static sqInt +genLowcodeLocalFrameSize(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt quickConstant; + sqInt size; + + size = extA; + assert(needsFrame); + + /* Mark the stack frame */ + hasNativeFrame = 1; + annotateobjRef(gMoveCwR(splObj(LowcodeContextMark), TempReg), splObj(LowcodeContextMark)); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfNativeFrameMark(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, FPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + checkLiteralforInstruction(address, genoperandoperand(MoveAwR, address, TempReg)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(1)); + } + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset1)); + } + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, size, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(size)); + } + /* begin MoveR:Mw:r: */ + offset2 = frameOffsetOfNativeFramePointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, FPReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(offset2)); + } + /* begin MoveR:Mw:r: */ + offset3 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, FPReg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(offset3)); + } + /* begin SubCq:R: */ + quickConstant = 1 + (defaultNativeStackFrameSize()); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(SubCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(quickConstant)); + } + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, TempReg, address1)); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockRegisters */ +static sqInt +genLowcodeLockRegisters(void) +{ + ssFlushAll(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockVM */ +static sqInt +genLowcodeLockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc32 */ +static sqInt +genLowcodeMalloc32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((size == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + ssFlushAll(); + if (size != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, size, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc64 */ +static sqInt +genLowcodeMalloc64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << sizeLow)) | (1U << sizeHigh)))) == NoReg) { + ssAllocateRequiredReg((pointer = SendNumArgsReg)); + } + if (((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + ssFlushAll(); + if (sizeLow != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, sizeLow, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy32 */ +static sqInt +genLowcodeMemcpy32(void) +{ + sqInt dest; + sqInt size; + sqInt source; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy64 */ +static sqInt +genLowcodeMemcpy64(void) +{ + sqInt dest; + sqInt size; + sqInt sizeLow; + sqInt source; + + sizeLow = 0; + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, sizeLow); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpyFixed */ +static sqInt +genLowcodeMemcpyFixed(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt dest; + sqInt size; + sqInt source; + + size = extA; + if (((source = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((source = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dest = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = Arg1Reg)); + } + if ((source == ReceiverResultReg) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + if (size == BytesPerWord) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, source, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, dest); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + } + else { + ssFlushAll(); + genMemCopytoconstantSize(backEnd, source, dest, size); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat32ToPhysical */ +static sqInt +genLowcodeMoveFloat32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat64ToPhysical */ +static sqInt +genLowcodeMoveFloat64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt32ToPhysical */ +static sqInt +genLowcodeMoveInt32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt64ToPhysical */ +static sqInt +genLowcodeMoveInt64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMovePointerToPhysical */ +static sqInt +genLowcodeMovePointerToPhysical(void) +{ + sqInt pointerValue; + sqInt registerID; + + registerID = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul32 */ +static sqInt +genLowcodeMul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul64 */ +static sqInt +genLowcodeMul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg32 */ +static sqInt +genLowcodeNeg32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NegateR: */ + genoperand(NegateR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg64 */ +static sqInt +genLowcodeNeg64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin AddcCq:R: */ + anInstruction1 = genoperandoperand(AddcCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot32 */ +static sqInt +genLowcodeNot32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot64 */ +static sqInt +genLowcodeNot64(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeNullaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeNullaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeBoolean32ToOop(); + + case 1: + return genLowcodeBoolean64ToOop(); + + case 2: + return genLowcodeFloat32ToOop(); + + case 3: + return genLowcodeFloat64ToOop(); + + case 4: + return genLowcodeInt32ToOop(); + + case 5: + return genLowcodeInt64ToOop(); + + case 6: + return genLowcodePointerToOop(); + + case 7: + return genLowcodePointerToOopReinterprer(); + + case 8: + return genLowcodeSmallInt32ToOop(); + + case 9: + return genLowcodeUint32ToOop(); + + case 10: + return genLowcodeUint64ToOop(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopEqual */ +static sqInt +genLowcodeOopEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopNotEqual */ +static sqInt +genLowcodeOopNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt32 */ +static sqInt +genLowcodeOopSmallIntegerToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt64 */ +static sqInt +genLowcodeOopSmallIntegerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean32 */ +static sqInt +genLowcodeOopToBoolean32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean64 */ +static sqInt +genLowcodeOopToBoolean64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat32 */ +static sqInt +genLowcodeOopToFloat32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat32(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat64 */ +static sqInt +genLowcodeOopToFloat64(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat64(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt32 */ +static sqInt +genLowcodeOopToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt64 */ +static sqInt +genLowcodeOopToInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointer */ +static sqInt +genLowcodeOopToPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcOopToPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointerReinterpret */ +static sqInt +genLowcodeOopToPointerReinterpret(void) +{ + sqInt object; + sqInt pointer; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt32 */ +static sqInt +genLowcodeOopToUInt32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToUInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt64 */ +static sqInt +genLowcodeOopToUInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoUInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr32 */ +static sqInt +genLowcodeOr32(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr64 */ +static sqInt +genLowcodeOr64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondLow, firstLow); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat32 */ +static sqInt +genLowcodePerformCallFloat32(void) +{ + AbstractInstruction *abstractInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat64 */ +static sqInt +genLowcodePerformCallFloat64(void) +{ + AbstractInstruction *abstractInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat32 */ +static sqInt +genLowcodePerformCallIndirectFloat32(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat64 */ +static sqInt +genLowcodePerformCallIndirectFloat64(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt32 */ +static sqInt +genLowcodePerformCallIndirectInt32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt64 */ +static sqInt +genLowcodePerformCallIndirectInt64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + sqInt reg11; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectPointer */ +static sqInt +genLowcodePerformCallIndirectPointer(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectStructure */ +static sqInt +genLowcodePerformCallIndirectStructure(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectVoid */ +static sqInt +genLowcodePerformCallIndirectVoid(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt32 */ +static sqInt +genLowcodePerformCallInt32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt64 */ +static sqInt +genLowcodePerformCallInt64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + sqInt reg11; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallPointer */ +static sqInt +genLowcodePerformCallPointer(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallStructure */ +static sqInt +genLowcodePerformCallStructure(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = R0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallVoid */ +static sqInt +genLowcodePerformCallVoid(void) +{ + AbstractInstruction *abstractInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + checkLiteralforInstruction(extA, genoperandoperand(MoveCwR, extA, TempReg)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePin */ +static sqInt +genLowcodePin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePlaftormCode */ +static sqInt +genLowcodePlaftormCode(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddConstantOffset */ +static sqInt +genLowcodePointerAddConstantOffset(void) +{ + AbstractInstruction *anInstruction; + sqInt base; + sqInt offset; + + offset = extB; + if (((base = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((base = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (base == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, offset, base); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + ssPushNativeRegister(base); + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset32 */ +static sqInt +genLowcodePointerAddOffset32(void) +{ + sqInt base; + sqInt offset; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((base = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((base = Arg1Reg)); + } + if ((offset == ReceiverResultReg) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset64 */ +static sqInt +genLowcodePointerAddOffset64(void) +{ + sqInt base; + sqInt offsetHigh; + sqInt offsetLow; + + if (((offsetLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offsetLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((offsetHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offsetLow)))) == NoReg) { + ssAllocateRequiredReg((offsetHigh = Arg1Reg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offsetLow)) | (1U << offsetHigh)))) == NoReg) { + ssAllocateRequiredReg((base = SendNumArgsReg)); + } + if (((offsetLow == ReceiverResultReg) + || (offsetHigh == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), offsetLow, offsetHigh); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offsetLow, base); + ssPushNativeRegister(base); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerEqual */ +static sqInt +genLowcodePointerEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerNotEqual */ +static sqInt +genLowcodePointerNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt32 */ +static sqInt +genLowcodePointerToInt32(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt64 */ +static sqInt +genLowcodePointerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt resultHigh; + sqInt resultLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOop */ +static sqInt +genLowcodePointerToOop(void) +{ + sqInt pointer; + sqInt pointerClassLiteral; + + pointerClassLiteral = getLiteral(extA); + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + genLcPointerToOopclass(pointer, pointerClassLiteral); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOopReinterprer */ +static sqInt +genLowcodePointerToOopReinterprer(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat32 */ +static sqInt +genLowcodePopFloat32(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat64 */ +static sqInt +genLowcodePopFloat64(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt32 */ +static sqInt +genLowcodePopInt32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt64 */ +static sqInt +genLowcodePopInt64(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopMultipleNative */ +static sqInt +genLowcodePopMultipleNative(void) +{ + ssPopNativeSize(extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopPointer */ +static sqInt +genLowcodePopPointer(void) +{ + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt32 */ +static sqInt +genLowcodePushConstantUInt32(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt32(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt64 */ +static sqInt +genLowcodePushConstantUInt64(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt64(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushNullPointer */ +static sqInt +genLowcodePushNullPointer(void) +{ + ssPushNativeConstantPointer(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne32 */ +static sqInt +genLowcodePushOne32(void) +{ + ssPushNativeConstantInt32(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne64 */ +static sqInt +genLowcodePushOne64(void) +{ + ssPushNativeConstantInt64(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat32 */ +static sqInt +genLowcodePushOneFloat32(void) +{ + ssPushNativeConstantFloat32(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat64 */ +static sqInt +genLowcodePushOneFloat64(void) +{ + ssPushNativeConstantFloat64(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat32 */ +static sqInt +genLowcodePushPhysicalFloat32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat64 */ +static sqInt +genLowcodePushPhysicalFloat64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt32 */ +static sqInt +genLowcodePushPhysicalInt32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt64 */ +static sqInt +genLowcodePushPhysicalInt64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalPointer */ +static sqInt +genLowcodePushPhysicalPointer(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushSessionIdentifier */ +static sqInt +genLowcodePushSessionIdentifier(void) +{ + ssPushNativeConstantInt32(getThisSessionID()); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero32 */ +static sqInt +genLowcodePushZero32(void) +{ + ssPushNativeConstantInt32(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero64 */ +static sqInt +genLowcodePushZero64(void) +{ + ssPushNativeConstantInt64(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat32 */ +static sqInt +genLowcodePushZeroFloat32(void) +{ + ssPushNativeConstantFloat32(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat64 */ +static sqInt +genLowcodePushZeroFloat64(void) +{ + ssPushNativeConstantFloat64(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem32 */ +static sqInt +genLowcodeRem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem64 */ +static sqInt +genLowcodeRem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift32 */ +static sqInt +genLowcodeRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftRightR:R: */ + genoperandoperand(LogicalShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift64 */ +static sqInt +genLowcodeRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From16 */ +static sqInt +genLowcodeSignExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From8 */ +static sqInt +genLowcodeSignExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From16 */ +static sqInt +genLowcodeSignExtend64From16(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From32 */ +static sqInt +genLowcodeSignExtend64From32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, value); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, resultHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From8 */ +static sqInt +genLowcodeSignExtend64From8(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((resultLow = SendNumArgsReg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSmallInt32ToOop */ +static sqInt +genLowcodeSmallInt32ToOop(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, value); + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat32ToMemory */ +static sqInt +genLowcodeStoreFloat32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt floatValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, floatValue, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat64ToMemory */ +static sqInt +genLowcodeStoreFloat64ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt doubleValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), doubleValue); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, doubleValue, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt16ToMemory */ +static sqInt +genLowcodeStoreInt16ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt32ToMemory */ +static sqInt +genLowcodeStoreInt32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt64ToMemory */ +static sqInt +genLowcodeStoreInt64ToMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, pointer); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt8ToMemory */ +static sqInt +genLowcodeStoreInt8ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, pointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat32 */ +static sqInt +genLowcodeStoreLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, value, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat64 */ +static sqInt +genLowcodeStoreLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, value, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt16 */ +static sqInt +genLowcodeStoreLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt32 */ +static sqInt +genLowcodeStoreLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt64 */ +static sqInt +genLowcodeStoreLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(4)); + } + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt8 */ +static sqInt +genLowcodeStoreLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalPointer */ +static sqInt +genLowcodeStoreLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerValue; + + baseOffset = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectField */ +static sqInt +genLowcodeStoreObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + fieldIndex = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectfield(value, object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectFieldAt */ +static sqInt +genLowcodeStoreObjectFieldAt(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (fieldIndex == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectat(value, object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStorePointerToMemory */ +static sqInt +genLowcodeStorePointerToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt memoryPointer; + sqInt pointerValue; + + if (((memoryPointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((memoryPointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << memoryPointer)))) == NoReg) { + ssAllocateRequiredReg((pointerValue = Arg1Reg)); + } + if ((memoryPointer == ReceiverResultReg) + || (pointerValue == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), memoryPointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, memoryPointer); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub32 */ +static sqInt +genLowcodeSub32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub64 */ +static sqInt +genLowcodeSub64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, secondLow, firstLow); + /* begin SubbR:R: */ + genoperandoperand(SubbRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeTrinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeTrinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeOopEqual(); + + case 1: + return genLowcodeOopNotEqual(); + + case 2: + return genLowcodeStoreObjectField(); + + case 3: + return genLowcodeStoreObjectFieldAt(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To16 */ +static sqInt +genLowcodeTruncate32To16(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0xFFFF)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To8 */ +static sqInt +genLowcodeTruncate32To8(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, value); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0xFF)); + } + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To16 */ +static sqInt +genLowcodeTruncate64To16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0xFFFF)); + } + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To32 */ +static sqInt +genLowcodeTruncate64To32(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To8 */ +static sqInt +genLowcodeTruncate64To8(void) +{ + AbstractInstruction *anInstruction; + sqInt result; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, valueLow); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0xFF)); + } + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv32 */ +static sqInt +genLowcodeUdiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv64 */ +static sqInt +genLowcodeUdiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Great */ +static sqInt +genLowcodeUint32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelowOrEqual: */ + falseJump = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32GreatEqual */ +static sqInt +genLowcodeUint32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelow: */ + falseJump = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Less */ +static sqInt +genLowcodeUint32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAboveOrEqual: */ + falseJump = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32LessEqual */ +static sqInt +genLowcodeUint32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAbove: */ + falseJump = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(1)); + } + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat32 */ +static sqInt +genLowcodeUint32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat64 */ +static sqInt +genLowcodeUint32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToOop */ +static sqInt +genLowcodeUint32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcUInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Great */ +static sqInt +genLowcodeUint64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64GreatEqual */ +static sqInt +genLowcodeUint64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Less */ +static sqInt +genLowcodeUint64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64LessEqual */ +static sqInt +genLowcodeUint64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat32 */ +static sqInt +genLowcodeUint64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat64 */ +static sqInt +genLowcodeUint64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToOop */ +static sqInt +genLowcodeUint64ToOop(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcUInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul32 */ +static sqInt +genLowcodeUmul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul64 */ +static sqInt +genLowcodeUmul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive2: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive2(sqInt prim) +{ + + switch (prim) { + case 60: + return genLowcodeFloat64ToFloat32(); + + case 61: + return genLowcodeFloat64ToInt32(); + + case 0x3E: + return genLowcodeFloat64ToInt64(); + + case 0x3F: + return genLowcodeFloat64ToUInt32(); + + case 64: + return genLowcodeFloat64ToUInt64(); + + case 65: + return genLowcodeFree(); + + case 66: + return genLowcodeInstantiateIndexable32Oop(); + + case 67: + return genLowcodeInstantiateIndexableOop(); + + case 68: + return genLowcodeInstantiateOop(); + + case 69: + return genLowcodeInt32Equal(); + + case 70: + return genLowcodeInt32Great(); + + case 71: + return genLowcodeInt32GreatEqual(); + + case 72: + return genLowcodeInt32Less(); + + case 73: + return genLowcodeInt32LessEqual(); + + case 74: + return genLowcodeInt32NotEqual(); + + case 75: + return genLowcodeInt32ToFloat32(); + + case 76: + return genLowcodeInt32ToFloat64(); + + case 77: + return genLowcodeInt32ToPointer(); + + case 78: + return genLowcodeInt64Equal(); + + case 79: + return genLowcodeInt64Great(); + + case 80: + return genLowcodeInt64GreatEqual(); + + case 81: + return genLowcodeInt64Less(); + + case 82: + return genLowcodeInt64LessEqual(); + + case 83: + return genLowcodeInt64NotEqual(); + + case 84: + return genLowcodeInt64ToFloat32(); + + case 85: + return genLowcodeInt64ToFloat64(); + + case 86: + return genLowcodeInt64ToPointer(); + + case 87: + return genLowcodeLeftShift32(); + + case 88: + return genLowcodeLeftShift64(); + + case 89: + return genLowcodeLoadArgumentAddress(); + + case 90: + return genLowcodeLoadArgumentFloat32(); + + case 91: + return genLowcodeLoadArgumentFloat64(); + + case 92: + return genLowcodeLoadArgumentInt16(); + + case 93: + return genLowcodeLoadArgumentInt32(); + + case 94: + return genLowcodeLoadArgumentInt64(); + + case 95: + return genLowcodeLoadArgumentInt8(); + + case 96: + return genLowcodeLoadArgumentPointer(); + + case 97: + return genLowcodeLoadArgumentUInt16(); + + case 98: + return genLowcodeLoadArgumentUInt32(); + + case 99: + return genLowcodeLoadArgumentUInt64(); + + case 100: + return genLowcodeLoadArgumentUInt8(); + + case 101: + return genLowcodeLoadFloat32FromMemory(); + + case 102: + return genLowcodeLoadFloat64FromMemory(); + + case 103: + return genLowcodeLoadInt16FromMemory(); + + case 104: + return genLowcodeLoadInt32FromMemory(); + + case 105: + return genLowcodeLoadInt64FromMemory(); + + case 106: + return genLowcodeLoadInt8FromMemory(); + + case 107: + return genLowcodeLoadLocalAddress(); + + case 108: + return genLowcodeLoadLocalFloat32(); + + case 109: + return genLowcodeLoadLocalFloat64(); + + case 110: + return genLowcodeLoadLocalInt16(); + + case 111: + return genLowcodeLoadLocalInt32(); + + case 112: + return genLowcodeLoadLocalInt64(); + + case 113: + return genLowcodeLoadLocalInt8(); + + case 114: + return genLowcodeLoadLocalPointer(); + + case 115: + return genLowcodeLoadLocalUInt16(); + + case 116: + return genLowcodeLoadLocalUInt32(); + + case 117: + return genLowcodeLoadLocalUInt64(); + + case 118: + return genLowcodeLoadLocalUInt8(); + + case 119: + return genLowcodeLoadObjectAt(); + + default: + return genLowcodeUnaryInlinePrimitive3(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive3: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive3(sqInt prim) +{ + + switch (prim) { + case 120: + return genLowcodeLoadObjectField(); + + case 121: + return genLowcodeLoadPointerFromMemory(); + + case 122: + return genLowcodeLoadUInt16FromMemory(); + + case 123: + return genLowcodeLoadUInt32FromMemory(); + + case 0x7C: + return genLowcodeLoadUInt64FromMemory(); + + case 125: + return genLowcodeLoadUInt8FromMemory(); + + case 0x7E: + return genLowcodeLocalFrameSize(); + + case 0x7F: + return genLowcodeLockRegisters(); + + case 128: + return genLowcodeLockVM(); + + case 129: + return genLowcodeMalloc32(); + + case 130: + return genLowcodeMalloc64(); + + case 131: + return genLowcodeMemcpy32(); + + case 132: + return genLowcodeMemcpy64(); + + case 133: + return genLowcodeMemcpyFixed(); + + case 134: + return genLowcodeMoveFloat32ToPhysical(); + + case 135: + return genLowcodeMoveFloat64ToPhysical(); + + case 136: + return genLowcodeMoveInt32ToPhysical(); + + case 137: + return genLowcodeMoveInt64ToPhysical(); + + case 138: + return genLowcodeMovePointerToPhysical(); + + case 139: + return genLowcodeMul32(); + + case 140: + return genLowcodeMul64(); + + case 141: + return genLowcodeNeg32(); + + case 142: + return genLowcodeNeg64(); + + case 143: + return genLowcodeNot32(); + + case 144: + return genLowcodeNot64(); + + case 145: + return genLowcodeOr32(); + + case 146: + return genLowcodeOr64(); + + case 147: + return genLowcodePerformCallFloat32(); + + case 148: + return genLowcodePerformCallFloat64(); + + case 149: + return genLowcodePerformCallIndirectFloat32(); + + case 150: + return genLowcodePerformCallIndirectFloat64(); + + case 151: + return genLowcodePerformCallIndirectInt32(); + + case 152: + return genLowcodePerformCallIndirectInt64(); + + case 153: + return genLowcodePerformCallIndirectPointer(); + + case 154: + return genLowcodePerformCallIndirectStructure(); + + case 155: + return genLowcodePerformCallIndirectVoid(); + + case 156: + return genLowcodePerformCallInt32(); + + case 157: + return genLowcodePerformCallInt64(); + + case 158: + return genLowcodePerformCallPointer(); + + case 159: + return genLowcodePerformCallStructure(); + + case 160: + return genLowcodePerformCallVoid(); + + case 161: + return genLowcodePlaftormCode(); + + case 162: + return genLowcodePointerAddConstantOffset(); + + case 163: + return genLowcodePointerAddOffset32(); + + case 164: + return genLowcodePointerAddOffset64(); + + case 165: + return genLowcodePointerEqual(); + + case 166: + return genLowcodePointerNotEqual(); + + case 167: + return genLowcodePointerToInt32(); + + case 168: + return genLowcodePointerToInt64(); + + case 169: + return genLowcodePopFloat32(); + + case 170: + return genLowcodePopFloat64(); + + case 171: + return genLowcodePopInt32(); + + case 172: + return genLowcodePopInt64(); + + case 173: + return genLowcodePopMultipleNative(); + + case 174: + return genLowcodePopPointer(); + + case 175: + return genLowcodePushConstantUInt32(); + + case 176: + return genLowcodePushConstantUInt64(); + + case 177: + return genLowcodePushNullPointer(); + + case 178: + return genLowcodePushOne32(); + + case 179: + return genLowcodePushOne64(); + + default: + return genLowcodeUnaryInlinePrimitive4(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive4: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive4(sqInt prim) +{ + + switch (prim) { + case 180: + return genLowcodePushOneFloat32(); + + case 181: + return genLowcodePushOneFloat64(); + + case 182: + return genLowcodePushPhysicalFloat32(); + + case 183: + return genLowcodePushPhysicalFloat64(); + + case 184: + return genLowcodePushPhysicalInt32(); + + case 185: + return genLowcodePushPhysicalInt64(); + + case 186: + return genLowcodePushPhysicalPointer(); + + case 187: + return genLowcodePushSessionIdentifier(); + + case 188: + return genLowcodePushZero32(); + + case 189: + return genLowcodePushZero64(); + + case 190: + return genLowcodePushZeroFloat32(); + + case 191: + return genLowcodePushZeroFloat64(); + + case 192: + return genLowcodeRem32(); + + case 193: + return genLowcodeRem64(); + + case 194: + return genLowcodeRightShift32(); + + case 195: + return genLowcodeRightShift64(); + + case 196: + return genLowcodeSignExtend32From16(); + + case 197: + return genLowcodeSignExtend32From8(); + + case 198: + return genLowcodeSignExtend64From16(); + + case 199: + return genLowcodeSignExtend64From32(); + + case 200: + return genLowcodeSignExtend64From8(); + + case 201: + return genLowcodeStoreFloat32ToMemory(); + + case 202: + return genLowcodeStoreFloat64ToMemory(); + + case 203: + return genLowcodeStoreInt16ToMemory(); + + case 204: + return genLowcodeStoreInt32ToMemory(); + + case 205: + return genLowcodeStoreInt64ToMemory(); + + case 206: + return genLowcodeStoreInt8ToMemory(); + + case 207: + return genLowcodeStoreLocalFloat32(); + + case 208: + return genLowcodeStoreLocalFloat64(); + + case 209: + return genLowcodeStoreLocalInt16(); + + case 210: + return genLowcodeStoreLocalInt32(); + + case 211: + return genLowcodeStoreLocalInt64(); + + case 212: + return genLowcodeStoreLocalInt8(); + + case 213: + return genLowcodeStoreLocalPointer(); + + case 214: + return genLowcodeStorePointerToMemory(); + + case 215: + return genLowcodeSub32(); + + case 216: + return genLowcodeSub64(); + + case 217: + return genLowcodeTruncate32To16(); + + case 218: + return genLowcodeTruncate32To8(); + + case 219: + return genLowcodeTruncate64To16(); + + case 220: + return genLowcodeTruncate64To32(); + + case 221: + return genLowcodeTruncate64To8(); + + case 222: + return genLowcodeUdiv32(); + + case 223: + return genLowcodeUdiv64(); + + case 224: + return genLowcodeUint32Great(); + + case 225: + return genLowcodeUint32GreatEqual(); + + case 226: + return genLowcodeUint32Less(); + + case 227: + return genLowcodeUint32LessEqual(); + + case 228: + return genLowcodeUint32ToFloat32(); + + case 229: + return genLowcodeUint32ToFloat64(); + + case 230: + return genLowcodeUint64Great(); + + case 231: + return genLowcodeUint64GreatEqual(); + + case 232: + return genLowcodeUint64Less(); + + case 233: + return genLowcodeUint64LessEqual(); + + case 234: + return genLowcodeUint64ToFloat32(); + + case 235: + return genLowcodeUint64ToFloat64(); + + case 236: + return genLowcodeUmul32(); + + case 237: + return genLowcodeUmul64(); + + case 238: + return 0; + + case 239: + return genLowcodeUnlockVM(); + + default: + return genLowcodeUnaryInlinePrimitive5(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive5: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive5(sqInt prim) +{ + + switch (prim) { + case 240: + return genLowcodeUrem32(); + + case 241: + return genLowcodeUrem64(); + + case 242: + return genLowcodeXor32(); + + case 243: + return genLowcodeXor64(); + + case 244: + return genLowcodeZeroExtend32From16(); + + case 245: + return genLowcodeZeroExtend32From8(); + + case 246: + return genLowcodeZeroExtend64From16(); + + case 247: + return genLowcodeZeroExtend64From32(); + + case 0xF8: + return genLowcodeZeroExtend64From8(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeAdd32(); + + case 1: + return genLowcodeAdd64(); + + case 2: + return genLowcodeAlloca32(); + + case 3: + return genLowcodeAlloca64(); + + case 4: + return genLowcodeAnd32(); + + case 5: + return genLowcodeAnd64(); + + case 6: + return genLowcodeArithmeticRightShift32(); + + case 7: + return genLowcodeArithmeticRightShift64(); + + case 8: + return genLowcodeBeginCall(); + + case 9: + return genLowcodeCallArgumentFloat32(); + + case 10: + return genLowcodeCallArgumentFloat64(); + + case 11: + return genLowcodeCallArgumentInt32(); + + case 12: + return genLowcodeCallArgumentInt64(); + + case 13: + return genLowcodeCallArgumentPointer(); + + case 14: + return genLowcodeCallArgumentSpace(); + + case 15: + return genLowcodeCallArgumentStructure(); + + case 16: + return genLowcodeCallInstruction(); + + case 17: + return genLowcodeCallPhysical(); + + case 18: + return genLowcodeCheckSessionIdentifier(); + + case 19: + return genLowcodeCompareAndSwap32(); + + case 20: + return genLowcodeDiv32(); + + case 21: + return genLowcodeDiv64(); + + case 22: + return genLowcodeDuplicateFloat32(); + + case 23: + return genLowcodeDuplicateFloat64(); + + case 24: + return genLowcodeDuplicateInt32(); + + case 25: + return genLowcodeDuplicateInt64(); + + case 26: + return genLowcodeDuplicatePointer(); + + case 27: + return genLowcodeEffectiveAddress32(); + + case 28: + return genLowcodeEffectiveAddress64(); + + case 29: + return genLowcodeEndCall(); + + case 30: + return genLowcodeEndCallNoCleanup(); + + case 0x1F: + return genLowcodeFloat32Add(); + + case 32: + return genLowcodeFloat32Div(); + + case 33: + return genLowcodeFloat32Equal(); + + case 34: + return genLowcodeFloat32Great(); + + case 35: + return genLowcodeFloat32GreatEqual(); + + case 36: + return genLowcodeFloat32Less(); + + case 37: + return genLowcodeFloat32LessEqual(); + + case 38: + return genLowcodeFloat32Mul(); + + case 39: + return genLowcodeFloat32Neg(); + + case 40: + return genLowcodeFloat32NotEqual(); + + case 41: + return genLowcodeFloat32Sqrt(); + + case 42: + return genLowcodeFloat32Sub(); + + case 43: + return genLowcodeFloat32ToFloat64(); + + case 44: + return genLowcodeFloat32ToInt32(); + + case 45: + return genLowcodeFloat32ToInt64(); + + case 46: + return genLowcodeFloat32ToUInt32(); + + case 47: + return genLowcodeFloat32ToUInt64(); + + case 48: + return genLowcodeFloat64Add(); + + case 49: + return genLowcodeFloat64Div(); + + case 50: + return genLowcodeFloat64Equal(); + + case 51: + return genLowcodeFloat64Great(); + + case 52: + return genLowcodeFloat64GreatEqual(); + + case 53: + return genLowcodeFloat64Less(); + + case 54: + return genLowcodeFloat64LessEqual(); + + case 55: + return genLowcodeFloat64Mul(); + + case 56: + return genLowcodeFloat64Neg(); + + case 57: + return genLowcodeFloat64NotEqual(); + + case 58: + return genLowcodeFloat64Sqrt(); + + case 59: + return genLowcodeFloat64Sub(); + + default: + return genLowcodeUnaryInlinePrimitive2(prim); + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnlockVM */ +static sqInt +genLowcodeUnlockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnpin */ +static sqInt +genLowcodeUnpin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem32 */ +static sqInt +genLowcodeUrem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem64 */ +static sqInt +genLowcodeUrem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor32 */ +static sqInt +genLowcodeXor32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor64 */ +static sqInt +genLowcodeXor64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondLow, firstLow); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From16 */ +static sqInt +genLowcodeZeroExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From8 */ +static sqInt +genLowcodeZeroExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From16 */ +static sqInt +genLowcodeZeroExtend64From16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From32 */ +static sqInt +genLowcodeZeroExtend64From32(void) +{ + AbstractInstruction *anInstruction; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From8 */ +static sqInt +genLowcodeZeroExtend64From8(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + /* StackToRegisterMappingCogit>>#genMarshalledSend:numArgs:sendTable: */ +static sqInt NoDbgRegParms +genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt annotation; + + assert(needsFrame); + /* begin annotationForSendTable: */ + if (sendTable == directedSuperSendTrampolines) { + annotation = IsDirectedSuperSend; + goto l1; + } + if (sendTable == superSendTrampolines) { + annotation = IsSuperSend; + goto l1; + } + assert(sendTable == ordinarySendTrampolines); + annotation = IsSendCall; +l1: /* end annotationForSendTable: */; + if ((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) { + genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + } + if (numArgs >= (NumSendTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(numArgs)); + } + } + if (annotation == IsDirectedSuperSend) { + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tempOop)) { + annotateobjRef(gMoveCwR(tempOop, TempReg), tempOop); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tempOop, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(tempOop)); + } + } + } + genLoadInlineCacheWithSelector(selectorIndex); + ((gCall(sendTable[((numArgs < (NumSendTrampolines - 1)) ? numArgs : (NumSendTrampolines - 1))]))->annotation = annotation); + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + return ssPushRegister(ReceiverResultReg); +} + + +/* Generate the abort for a method. This abort performs either a call of + ceSICMiss: to handle a single-in-line cache miss or a call of + ceStackOverflow: to handle a + stack overflow. It distinguishes the two by testing ResultReceiverReg. If + the register is zero then this is a stack-overflow because a) the receiver + has already + been pushed and so can be set to zero before calling the abort, and b) the + receiver must always contain an object (and hence be non-zero) on SIC + miss. */ + + /* StackToRegisterMappingCogit>>#genMethodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genMethodAbortTrampolineFor(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpSICMiss; + + zeroOpcodeIndex(); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(0)); + } + /* begin JumpNonZero: */ + jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(0)); + } + + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); + jmpTarget(jumpSICMiss, gLabel()); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSICMiss, trampolineNamenumRegArgs("ceMethodAbort", numArgs), 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged + target or a call of ceMNUFromPICMNUMethod:receiver: to handle an + MNU dispatch in a closed PIC. It distinguishes the two by testing + ClassReg. If the register is zero then this is an MNU. */ + + /* StackToRegisterMappingCogit>>#genPICAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genPICAbortTrampolineFor(sqInt numArgs) +{ + zeroOpcodeIndex(); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genInnerPICAbortTrampoline(trampolineNamenumRegArgs("cePICAbort", numArgs)); +} + + /* StackToRegisterMappingCogit>>#genPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +genPICMissTrampolineFor(sqInt numArgs) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumRegArgs("cePICMiss", numArgs), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genPopStackBytecode */ +static sqInt +genPopStackBytecode(void) +{ + AbstractInstruction *anInstruction; + + if (((ssTop())->spilled)) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, BytesPerWord, SPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(BytesPerWord)); + } + } + ssPop(1); + return 0; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. + Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveClosureValue */ +static sqInt +genPrimitiveClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail1; + AbstractInstruction *jumpFail2; + AbstractInstruction *jumpFail3; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailNArgs; + sqInt offset; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ClassReg); + jumpFail1 = genJumpImmediate(ClassReg); + genGetCompactClassIndexNonImmOfinto(ClassReg, TempReg); + genCmpClassMethodContextCompactIndexR(TempReg); + /* begin JumpNonZero: */ + jumpFail2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(MethodIndex, ClassReg, SendNumArgsReg); + jumpFail3 = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + /* begin MoveM16:r:R: */ + offset = offsetof(CogMethod, blockEntryOffset); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(offset)); + } + /* begin AddR:R: */ + genoperandoperand(AddRR, ClassReg, TempReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + if (primitiveRoutine == primitiveClosureValueNoContextSwitch) { + if (blockNoContextSwitchOffset == null) { + return NotFullyInitialized; + } + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(blockNoContextSwitchOffset)); + } + } + /* begin JumpR: */ + genoperand(JumpR, TempReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFail1, jmpTarget(jumpFail2, jmpTarget(jumpFail3, jmpTarget(jumpFail4, gLabel()))))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveFullClosureValue */ +static sqInt +genPrimitiveFullClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailImmediateMethod; + AbstractInstruction *jumpFailNArgs; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(quickConstant)); + } + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(FullClosureCompiledBlockIndex, ReceiverResultReg, SendNumArgsReg); + jumpFailImmediateMethod = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(quickConstant1)); + } + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + /* begin AddCq:R: */ + quickConstant2 = (primitiveRoutine == primitiveFullClosureValueNoContextSwitch + ? fullBlockNoContextSwitchEntryOffset() + : fullBlockEntryOffset()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, ClassReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(quickConstant2)); + } + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFailImmediateMethod, jmpTarget(jumpFail4, gLabel()))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Generate an in-line perform primitive. The lookup code requires the + selector to be in Arg0Reg. + adjustArgumentsForPerform: adjusts the arguments once + genLookupForPerformNumArgs: has generated the code for the lookup. */ + + /* StackToRegisterMappingCogit>>#genPrimitivePerform */ +static sqInt +genPrimitivePerform(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (methodOrBlockNumArgs > 2) { + /* begin MoveMw:r:R: */ + offset = (methodOrBlockNumArgs - 1) * BytesPerWord; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, SPReg, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + } + return genLookupForPerformNumArgs(methodOrBlockNumArgs); +} + + /* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */ +static sqInt +genPushActiveContextBytecode(void) +{ + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + + genGetActiveContextNumArgslargeinBlock(methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + return ssPushRegister(ReceiverResultReg); +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 143 10001111 llllkkkk jjjjjjjj iiiiiiii Push Closure Num Copied llll Num + Args kkkk BlockSize jjjjjjjjiiiiiiii */ + + /* StackToRegisterMappingCogit>>#genPushClosureCopyCopiedValuesBytecode */ +static sqInt +genPushClosureCopyCopiedValuesBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = byte1 & 15), (numCopied = ((usqInt) byte1) >> 4), (((sqInt)((usqInt)(byte2) << 8))) + byte3); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* This is a version of genPushLiteralVariable: that looks ahead for a + directed super send bytecode + and does not generate any code for the dereference yet if followed by a + directed super send. + */ + + /* StackToRegisterMappingCogit>>#genPushLiteralVariableGivenDirectedSuper: */ +static sqInt NoDbgRegParms +genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex) +{ + sqInt bcpc; + sqInt descriptor; + BytecodeDescriptor *descriptor1; + sqInt eA; + sqInt eB; + sqInt exta; + sqInt extb; + sqInt savedB0; + sqInt savedB1; + sqInt savedB2; + sqInt savedB3; + sqInt savedEA; + sqInt savedEB; + sqInt savedNEB; + + /* begin nextDescriptorAndExtensionsInto: */ + descriptor1 = generatorAt(byte0); + savedB0 = byte0; + savedB1 = byte1; + savedB2 = byte2; + savedB3 = byte3; + savedEA = extA; + savedEB = extB; + savedNEB = numExtB; + bcpc = bytecodePC + ((descriptor1->numBytes)); + do { + if (bcpc > endPC) { + goto l1; + } + byte0 = (fetchByteofObject(bcpc, methodObj)) + bytecodeSetOffset; + descriptor1 = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor1, bcpc); + if (!((descriptor1->isExtension))) { + eA = extA; + eB = extB; + extA = savedEA; + extB = savedEB; + numExtB = savedNEB; + byte0 = savedB0; + byte1 = savedB1; + byte2 = savedB2; + byte3 = savedB3; + if ((descriptor1 != null) + && ((((descriptor1->generator)) == genExtSendSuperBytecode) + && (eB >= 64))) { + ssPushConstant(getLiteral(literalIndex)); + return 0; + } + + goto l1; + } + ((descriptor1->generator))(); + bcpc += (descriptor1->numBytes); + } while(1); +l1: /* end nextDescriptorAndExtensionsInto: */; + return genPushLiteralVariable(literalIndex); +} + + /* StackToRegisterMappingCogit>>#genPushLiteralVariable: */ +static sqInt NoDbgRegParms +genPushLiteralVariable(sqInt literalIndex) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt freeReg; + + freeReg = allocateRegNotConflictingWith(0); + + /* N.B. Do _not_ use ReceiverResultReg to avoid overwriting receiver in assignment in frameless methods. */ + /* So far descriptors are not rich enough to describe the entire dereference so generate the register + load but don't push the result. There is an order-of-evaluation issue if we defer the dereference. */ + association = getLiteral(literalIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, TempReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(association)); + } + } + genEnsureObjInRegNotForwardedscratchReg(TempReg, freeReg); + genLoadSlotsourceRegdestReg(ValueIndex, TempReg, freeReg); + ssPushRegister(freeReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genPushLiteral: */ +static sqInt NoDbgRegParms +genPushLiteral(sqInt literal) +{ + return ssPushConstant(literal); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextReceiverVariable: */ +static sqInt NoDbgRegParms +genPushMaybeContextReceiverVariable(sqInt slotIndex) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + ensureReceiverResultRegContainsSelf(); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + genLoadTempin(index, ReceiverResultReg); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushNewArrayBytecode */ +static sqInt +genPushNewArrayBytecode(void) +{ + sqInt i; + int popValues; + sqInt size; + + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + if ((popValues = byte1 > 0x7F)) { + ssFlushTo(simStackPtr); + } + else { + ssAllocateCallRegand(SendNumArgsReg, ReceiverResultReg); + } + size = byte1 & 0x7F; + if (!popValues) { + if (tryCollapseTempVectorInitializationOfSize(size)) { + return 0; + } + } + genNewArrayOfSizeinitialized(size, !popValues); + if (popValues) { + for (i = (size - 1); i >= 0; i += -1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(TempReg, i, ReceiverResultReg); + } + ssPop(size); + } + return ssPushRegister(ReceiverResultReg); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverBytecode */ +static sqInt +genPushReceiverBytecode(void) +{ + if ((optStatus.isReceiverResultRegLive)) { + return ssPushRegister(ReceiverResultReg); + } + assert((registerOrNone(&simSelf)) == NoReg); + return ssPushDesc(simSelf); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverVariable: */ +static sqInt NoDbgRegParms +genPushReceiverVariable(sqInt index) +{ + ensureReceiverResultRegContainsSelf(); + return ssPushBaseoffset(ReceiverResultReg, slotOffsetOfInstVarIndex(index)); +} + + +/* Ensure that the register args are pushed before the retpc for methods with + arity <= self numRegArgs. + */ +/* This won't be as clumsy on a RISC. But putting the receiver and + args above the return address means the CoInterpreter has a + single machine-code frame format which saves us a lot of work. */ + + /* StackToRegisterMappingCogit>>#genPushRegisterArgs */ +static void +genPushRegisterArgs(void) +{ + if (!(regArgsHaveBeenPushed + || (methodOrBlockNumArgs > 2))) { + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); + regArgsHaveBeenPushed = 1; + } +} + + /* StackToRegisterMappingCogit>>#genPushRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex) +{ + sqInt objectReg; + sqInt regMask; + sqInt resultReg; + + assert(needsFrame); + objectReg = allocateRegNotConflictingWith(0); + genLoadTempin(objectIndex, objectReg); + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << objectReg; + resultReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (resultReg == NoReg) { + resultReg = objectReg; + } + genLoadSlotsourceRegdestReg(byte1, objectReg, resultReg); + return ssPushRegister(resultReg); +} + + /* StackToRegisterMappingCogit>>#genPushRemoteTempLongBytecode */ +static sqInt +genPushRemoteTempLongBytecode(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt regMask; + sqInt remoteTempReg; + sqInt tempVectReg; + + tempVectReg = allocateRegNotConflictingWith(0); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(byte2); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, tempVectReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << tempVectReg; + remoteTempReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (remoteTempReg == NoReg) { + remoteTempReg = tempVectReg; + } + genLoadSlotsourceRegdestReg(byte1, tempVectReg, remoteTempReg); + return ssPushRegister(remoteTempReg); +} + + +/* If a frameless method (not a block), only argument temps can be accessed. + This is assured by the use of needsFrameIfMod16GENumArgs: in pushTemp. */ + + /* StackToRegisterMappingCogit>>#genPushTemporaryVariable: */ +static sqInt NoDbgRegParms +genPushTemporaryVariable(sqInt index) +{ + assert((inBlock > 0) + || (needsFrame + || (index < methodOrBlockNumArgs))); + return ssPushDesc(simStack[index]); +} + + +/* In a frameless method ReceiverResultReg already contains self. + In a frameful method, ReceiverResultReg /may/ contain self. */ + + /* StackToRegisterMappingCogit>>#genReturnReceiver */ +static sqInt +genReturnReceiver(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + } + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromBlock */ +static sqInt +genReturnTopFromBlock(void) +{ + assert(inBlock > 0); + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genBlockReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromMethod */ +static sqInt +genReturnTopFromMethod(void) +{ + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genSendDirectedSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + assert((((ssTop())->type)) == SSConstant); + tempOop = ((ssTop())->constant); + ssPop(1); + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, directedSuperSendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSendSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, superSendTrampolines); +} + + +/* Generate a trampoline with four arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* StackToRegisterMappingCogit>>#genSendTrampolineFor:numArgs:called:arg:arg:arg:arg: */ +static sqInt NoDbgRegParms +genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3) +{ + sqInt routine; + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + /* begin selectorIndexDereferenceRoutine */ + routine = null; + if (!(routine == null)) { + /* begin Call: */ + genoperand(Call, routine); + } + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genSend:numArgs: */ +static sqInt NoDbgRegParms +genSendnumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, ordinarySendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorArithmetic */ +static sqInt +genSpecialSelectorArithmetic(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + sqInt argInt; + int argIsConst; + sqInt argIsInt; + sqInt index; + AbstractInstruction *jumpContinue; + AbstractInstruction *jumpNotSmallInts; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int rcvrIsConst; + sqInt rcvrIsInt; + sqInt result; + + primDescriptor = generatorAt(byte0); + argIsInt = ((argIsConst = (((ssTop())->type)) == SSConstant)) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((rcvrIsConst = (((ssValue(1))->type)) == SSConstant)) + && ((((rcvrInt = ((ssValue(1))->constant))) & 1)); + if (argIsInt + && (rcvrIsInt)) { + rcvrInt = (rcvrInt >> 1); + argInt = (argInt >> 1); + + switch ((primDescriptor->opcode)) { + case AddRR: + result = rcvrInt + argInt; + break; + case SubRR: + result = rcvrInt - argInt; + break; + case AndRR: + result = rcvrInt & argInt; + break; + case OrRR: + result = rcvrInt | argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + if (isIntegerValue(result)) { + + /* Must annotate the bytecode for correct pc mapping. */ + return (ssPop(2), + ssPushAnnotatedConstant((((usqInt)result << 1) | 1))); + } + return genSpecialSelectorSend(); + } + if ((rcvrIsConst + && (!rcvrIsInt)) + || (argIsConst + && (!argIsInt))) { + return genSpecialSelectorSend(); + } + if (!(argIsInt + || (rcvrIsInt))) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + ssFlushTo(simStackPtr - 2); + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + + switch ((primDescriptor->opcode)) { + case AddRR: + if (argIsInt) { + /* begin AddCq:R: */ + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction5)) { + (anInstruction5->dependent = locateLiteral(argInt - ConstZero)); + } + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(argInt - ConstZero)); + } + } + else { + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + if (rcvrIsInt) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(rcvrInt)); + } + } + else { + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(ReceiverResultReg); + } + } + break; + case SubRR: + if (argIsInt) { + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(argInt - ConstZero)); + } + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction6)) { + (anInstruction6->dependent = locateLiteral(argInt - ConstZero)); + } + } + else { + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(Arg0Reg); + } + break; + case AndRR: + if (argIsInt) { + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction7)) { + (anInstruction7->dependent = locateLiteral(argInt)); + } + } + else { + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + case OrRR: + if (argIsInt) { + /* begin OrCq:R: */ + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction3)) { + (anInstruction3->dependent = locateLiteral(argInt)); + } + } + else { + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + default: + error("Case not found and no otherwise clause"); + } + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction4)) { + (anInstruction4->dependent = locateLiteral(argInt)); + } + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); + jmpTarget(jumpContinue, gLabel()); + return 0; +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorClass */ +static sqInt +genSpecialSelectorClass(void) +{ + sqInt topReg; + + topReg = registerOrNone(ssTop()); + ssPop(1); + if ((topReg == NoReg) + || (topReg == ClassReg)) { + ssAllocateRequiredRegand((topReg = SendNumArgsReg), ClassReg); + } + else { + ssAllocateRequiredReg(ClassReg); + } + ssPush(1); + popToReg(ssTop(), topReg); + genGetClassObjectOfintoscratchReginstRegIsReceiver(topReg, ClassReg, TempReg, 0); + return (ssPop(1), + ssPushRegister(ClassReg)); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorComparison */ +static sqInt +genSpecialSelectorComparison(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt argInt; + sqInt argIsInt; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt descr; + sqInt index; + sqInt inlineCAB; + AbstractInstruction *jumpNotSmallInts; + void *jumpTarget; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + BytecodeDescriptor *primDescriptor1; + sqInt rcvrIsInt; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + + ssFlushTo(simStackPtr - 2); + primDescriptor = generatorAt(byte0); + argIsInt = ((((ssTop())->type)) == SSConstant) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((((ssValue(1))->type)) == SSConstant) + && (((((ssValue(1))->constant)) & 1)); + if (argIsInt + && (rcvrIsInt)) { + return genStaticallyResolvedSpecialSelectorComparison(); + } + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor1 = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor1->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + + /* Further, only interested in inlining = and ~= if there's a SmallInteger constant involved. + The relational operators successfully statically predict SmallIntegers; the equality operators do not. */ + inlineCAB = ((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)); + if (inlineCAB + && ((((primDescriptor->opcode)) == JumpZero) + || (((primDescriptor->opcode)) == JumpNonZero))) { + inlineCAB = argIsInt + || (rcvrIsInt); + } + if (!inlineCAB) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + if (argIsInt) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(argInt)); + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + } + genConditionalBranchoperand(((branchDescriptor->isBranchTrue) + ? (primDescriptor->opcode) + : inverseBranchFor((primDescriptor->opcode))), ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC)))); + /* begin Jump: */ + jumpTarget = ensureNonMergeFixupAt(postBranchPC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(argInt)); + } + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + return genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); +} + + +/* Assumes both operands are ints */ + + /* StackToRegisterMappingCogit>>#genStaticallyResolvedSpecialSelectorComparison */ +static sqInt +genStaticallyResolvedSpecialSelectorComparison(void) +{ + sqInt argInt; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int result; + + primDescriptor = generatorAt(byte0); + argInt = ((ssTop())->constant); + rcvrInt = ((ssValue(1))->constant); + + switch ((primDescriptor->opcode)) { + case JumpLess: + result = rcvrInt < argInt; + break; + case JumpLessOrEqual: + result = rcvrInt <= argInt; + break; + case JumpGreater: + result = rcvrInt > argInt; + break; + case JumpGreaterOrEqual: + result = rcvrInt >= argInt; + break; + case JumpZero: + result = rcvrInt == argInt; + break; + case JumpNonZero: + result = rcvrInt != argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + ssPop(2); + return ssPushAnnotatedConstant((result + ? trueObject() + : falseObject())); +} + + +/* We need a frame because the association has to be in ReceiverResultReg for + the various trampolines + and ReceiverResultReg holds only the receiver in frameless methods. + */ + + /* StackToRegisterMappingCogit>>#genStorePop:LiteralVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt topReg; + + assert(needsFrame); + /* begin genLoadLiteralVariable:in: */ + association = getLiteral(litVarIndex); + voidReceiverResultRegContainsSelf(); + + ssAllocateRequiredReg(ReceiverResultReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, ReceiverResultReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(association)); + } + } + genEnsureObjInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, ValueIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, ValueIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextRemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(slotIndex)); + } + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + /* StackToRegisterMappingCogit>>#genStorePop:ReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt needsImmCheck1; + sqInt needsStoreCheck1; + sqInt topReg; + + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + needsStoreCheck1 = (!useTwoPaths) + && (needsStoreCheck); + needsImmCheck1 = needsImmCheck + && (!useTwoPaths); + +# if IMMUTABILITY + if (needsImmCheck1) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck1, 1); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck1); +} + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt topReg; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The only reason we assert needsFrame here is that in a frameless method + ReceiverResultReg must and does contain only self, but the ceStoreCheck + trampoline expects the target of the store to be in ReceiverResultReg. So + in a frameless method we would have a conflict between the receiver and + the temote temp store, unless we we smart enough to realise that + ReceiverResultReg was unused after the literal variable store, unlikely + given that methods return self by default. */ + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteTemp:At:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt topReg; + + assert(needsFrame); + ssAllocateRequiredReg(ReceiverResultReg); + voidReceiverResultRegContainsSelf(); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(remoteTempIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, ReceiverResultReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + /* StackToRegisterMappingCogit>>#genStorePop:TemporaryVariable: */ +static sqInt NoDbgRegParms +genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt reg; + + ssFlushUpThroughTemporaryVariable(tempIndex); + reg = ssStorePoptoPreferredReg(popBoolean, TempReg); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfTemporary(tempIndex); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, reg, offset, FPReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + return 0; +} + + +/* Generate a method return from within a method or a block. + Frameless method activation looks like + CISCs (x86): + receiver + args + sp-> ret pc. + RISCs (ARM): + receiver + args + ret pc in LR. + A fully framed activation is described in CoInterpreter + class>initializeFrameIndices. Return pops receiver and arguments off the + stack. Callee pushes the result. */ + + /* StackToRegisterMappingCogit>>#genUpArrowReturn */ +static sqInt +genUpArrowReturn(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt framelessReturn; + sqInt offset; + + + /* can't fall through */ + deadCode = 1; + if (inBlock > 0) { + assert(needsFrame); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceNonLocalReturnTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + +# if IMMUTABILITY + framelessReturn = needsFrame + && (!useTwoPaths); + +# else /* IMMUTABILITY */ + framelessReturn = needsFrame; + +# endif /* IMMUTABILITY */ + + if (framelessReturn) { + if (hasNativeFrame) { + leaveNativeFrame(); + } + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + } + else { + /* begin RetN: */ + offset = ((methodOrBlockNumArgs > 2) + || (regArgsHaveBeenPushed) + ? (methodOrBlockNumArgs + 1) * BytesPerWord + : 0); + genoperand(RetN, offset); + } + return 0; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + These are the targets of backward branches. A backward branch fixup's + simStackPtr needs to be set when generating the code for the bytecode at + the targetIndex. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#initializeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +initializeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + /* begin setIsBackwardBranchFixup */ + (fixup->simStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackSize) = 0; + + return fixup; +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramefulMethod: */ +static void NoDbgRegParms +initSimStackForFramefulMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSBaseOffset); + (simSelf.spilled = 1); + (simSelf.registerr = FPReg); + (simSelf.offset = FoxMFReceiver); + (optStatus.isReceiverResultRegLive = 0); + (optStatus.ssEntry = (&simSelf)); + + /* N.B. Includes num args */ + simSpillBase = methodOrBlockNumTemps; + simStackPtr = simSpillBase - 1; + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxCallerSavedIP + ((methodOrBlockNumArgs - i) * BytesPerWord)); + (desc->bcptr = startpc); + } + for (i = methodOrBlockNumArgs; i <= simStackPtr; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerWord)); + (desc->bcptr = startpc); + } +} + + +/* The register receiver (the closure itself) and args are pushed by the + closure value primitive(s) + and hence a frameless block has all arguments and copied values pushed to + the stack. However, + the method receiver (self) is put in the ReceiverResultRegister by the + block entry. */ + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessBlock: */ +static void NoDbgRegParms +initSimStackForFramelessBlock(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps >= methodOrBlockNumArgs); + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = SPReg); + (desc->offset = ((methodOrBlockNumArgs - 1) - i) * BytesPerWord); + (desc->bcptr = startpc); + } + simSpillBase = (simStackPtr = methodOrBlockNumTemps - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessMethod: */ +static void NoDbgRegParms +initSimStackForFramelessMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps == methodOrBlockNumArgs); + assert((numRegArgs()) <= 2); + if (((methodOrBlockNumArgs >= 1) && (methodOrBlockNumArgs <= 2))) { + desc = simStackAt(0); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg0Reg); + (desc->bcptr = startpc); + if (methodOrBlockNumArgs > 1) { + desc = simStackAt(1); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg1Reg); + (desc->bcptr = startpc); + } + } + else { + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->registerr = SPReg); + (desc->spilled = 1); + (desc->offset = ((methodOrBlockNumArgs - 1) - i) * BytesPerWord); + (desc->bcptr = startpc); + } + } + simSpillBase = (simStackPtr = methodOrBlockNumArgs - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#leaveNativeFrame */ +static void +leaveNativeFrame(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + assert(needsFrame); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 1, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(1)); + } + /* begin MoveR:Aw: */ + address = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + checkLiteralforInstruction(address, genoperandoperand(MoveRAw, TempReg, address)); +} + + /* StackToRegisterMappingCogit>>#liveFloatRegisters */ +static sqInt +liveFloatRegisters(void) +{ + sqInt i; + sqInt regsSet; + + regsSet = 0; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | 0; + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeFloatRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + /* StackToRegisterMappingCogit>>#liveRegisters */ +static sqInt +liveRegisters(void) +{ + sqInt i; + sqInt regsSet; + + if (needsFrame) { + regsSet = 0; + } + else { + /* begin registerMaskFor: */ + regsSet = 1U << ReceiverResultReg; + if ((methodOrBlockNumArgs <= 2) + && (methodOrBlockNumArgs > 0)) { + regsSet = regsSet | (1U << Arg0Reg); + if (methodOrBlockNumArgs > 1) { + regsSet = regsSet | (1U << Arg1Reg); + } + } + } + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | (registerMask(simStackAt(i))); + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + +/* insert nops for dead code that is mapped so that bc + to mc mapping is not many to one */ + + /* StackToRegisterMappingCogit>>#mapDeadDescriptorIfNeeded: */ +static sqInt NoDbgRegParms +mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor) +{ + AbstractInstruction *abstractInstruction; + + flag("annotateInstruction"); + if (((descriptor->isMapped)) + || ((inBlock > 0) + && ((descriptor->isMappedInBlock)))) { + /* begin annotateBytecode: */ + abstractInstruction = gen(Nop); + (abstractInstruction->annotation = HasBytecodePC); + } + return 0; +} + + +/* Spill everything on the simulated stack that needs spilling (that below + receiver and arguments). + Marshall receiver and arguments to stack and/or registers depending on arg + count. If the args don't fit in registers push receiver and args (spill + everything), but still assign + the receiver to ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#marshallSendArguments: */ +static void NoDbgRegParms +marshallSendArguments(sqInt numArgs) +{ + sqInt anyRefs; + CogSimStackEntry * cascade0; + sqInt numSpilled; + + ssFlushTo((simStackPtr - numArgs) - 1); + if (numArgs > 2) { + + /* If there are no spills and no references to ReceiverResultReg + the fetch of ReceiverResultReg from the stack can be avoided + by assigning directly to ReceiverResultReg and pushing it. */ + numSpilled = numberOfSpillsInTopNItems(numArgs + 1); + anyRefs = anyReferencesToRegisterinTopNItems(ReceiverResultReg, numArgs + 1); + if ((numSpilled > 0) + || (anyRefs)) { + ssFlushTo(simStackPtr); + storeToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + else { + cascade0 = simStackAt(simStackPtr - numArgs); + storeToReg(cascade0, ReceiverResultReg); + (cascade0->type = SSRegister); + (cascade0->registerr = ReceiverResultReg); + ssFlushTo(simStackPtr); + } + } + else { + + /* Move the args to the register arguments, being careful to do + so last to first so e.g. previous contents don't get overwritten. + Also check for any arg registers in use by other args. */ + if (numArgs > 0) { + if (numArgs > 1) { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 2); + ssAllocateRequiredRegupThrough(Arg1Reg, simStackPtr - 1); + } + else { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 1); + } + } + if (numArgs > 1) { + popToReg(simStackAt(simStackPtr), Arg1Reg); + } + if (numArgs > 0) { + popToReg(simStackAt((simStackPtr - numArgs) + 1), Arg0Reg); + } + popToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + ssPop(numArgs + 1); +} + + +/* For assert checking; or rather for avoiding assert fails when dealing with + the hack for block temps in the SqueakV3PlusClosures bytecode set. + */ + + /* StackToRegisterMappingCogit>>#maybeCompilingFirstPassOfBlockWithInitialPushNil */ +static sqInt +maybeCompilingFirstPassOfBlockWithInitialPushNil(void) +{ + return (inBlock == InVanillaBlock) + && ((methodOrBlockNumTemps > methodOrBlockNumArgs) + && (blockPass == 1)); +} + + +/* If this bytecode has a fixup, some kind of merge needs to be done. There + are 4 cases: + 1) the bytecode has no fixup (fixup isNotAFixup) + do nothing + 2) the bytecode has a non merge fixup + the fixup has needsNonMergeFixup. + The code generating non merge fixup (currently only special selector code) + is responsible + for the merge so no need to do it. + We set deadCode to false as the instruction can be reached from jumps. + 3) the bytecode has a merge fixup, but execution flow *cannot* fall + through to the merge point. + the fixup has needsMergeFixup and deadCode = true. + ignores the current simStack as it does not mean anything + restores the simStack to the state the jumps to the merge point expects it + to be. + 4) the bytecode has a merge fixup and execution flow *can* fall through to + the merge point. + the fixup has needsMergeFixup and deadCode = false. + flushes the stack to the stack pointer so the fall through execution path + simStack is + in the state the merge point expects it to be. + restores the simStack to the state the jumps to the merge point expects it + to be. + + In addition, if this is a backjump merge point, we patch the fixup to hold + the current simStackPtr + for later assertions. */ +/* case 1 */ + + /* StackToRegisterMappingCogit>>#mergeWithFixupIfRequired: */ +static sqInt NoDbgRegParms +mergeWithFixupIfRequired(BytecodeFixup *fixup) +{ + CogSimStackEntry * cascade0; + sqInt i; + + if (((fixup->targetInstruction)) == 0) { + return 0; + } + if ((((usqInt)((fixup->targetInstruction)))) == NeedsNonMergeFixupFlag) { + deadCode = 0; + return 0; + } + assert(isMergeFixup(fixup)); + traceMerge(fixup); + if (deadCode) { + + /* case 3 */ + simStackPtr = (fixup->simStackPtr); + simNativeStackPtr = (fixup->simNativeStackPtr); + simNativeStackSize = (fixup->simNativeStackSize); + + } + else { + + /* case 4 */ + ssFlushTo(simStackPtr); + } + deadCode = 0; + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + (fixup->targetInstruction = gLabel()); + assert(simStackPtr == ((fixup->simStackPtr))); + assert(simNativeStackPtr == ((fixup->simNativeStackPtr))); + assert(simNativeStackSize == ((fixup->simNativeStackSize))); + + /* begin restoreSimStackAtMergePoint: */ + simSpillBase = methodOrBlockNumTemps; + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + for (i = methodOrBlockNumTemps; i <= simStackPtr; i += 1) { + cascade0 = simStackAt(i); + (cascade0->type = SSSpill); + (cascade0->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerOop)); + (cascade0->registerr = FPReg); + (cascade0->spilled = 1); + } + for (i = 0; i <= simNativeStackPtr; i += 1) { + ensureIsMarkedAsSpilled(simNativeStackAt(i)); + } + simNativeSpillBase = simNativeStackPtr + 1; + + return 0; +} + + /* StackToRegisterMappingCogit>>#methodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +methodAbortTrampolineFor(sqInt numArgs) +{ + return methodAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#needsFrameIfMod16GENumArgs: */ +static sqInt NoDbgRegParms +needsFrameIfMod16GENumArgs(sqInt stackDelta) +{ + return (byte0 % 16) >= methodOrBlockNumArgs; +} + + +/* As of August 2013, the code generator can't deal with spills in frameless + methods (the + issue is to do with the stack offset to get at an argument, which is + changed when there's a spill). + In e.g. TextColor>>#dominates: other ^other class == self class the second + send of class + needs also rto allocate a register that the first one used, but the first + one's register can't be + spilled. So avoid this by only allowing class to be sent if the stack + contains a single element. */ + + /* StackToRegisterMappingCogit>>#needsFrameIfStackGreaterThanOne: */ +static sqInt NoDbgRegParms +needsFrameIfStackGreaterThanOne(sqInt stackDelta) +{ + return stackDelta > 1; +} + + /* StackToRegisterMappingCogit>>#numberOfSpillsInTopNItems: */ +static sqInt NoDbgRegParms +numberOfSpillsInTopNItems(sqInt n) +{ + sqInt i; + + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((((simStackAt(i))->type)) == SSSpill) { + return n - (simStackPtr - i); + } + } + return 0; +} + + /* StackToRegisterMappingCogit>>#picAbortTrampolineFor: */ +static sqInt NoDbgRegParms +picAbortTrampolineFor(sqInt numArgs) +{ + return picAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#prevInstIsPCAnnotated */ +static sqInt +prevInstIsPCAnnotated(void) +{ + sqInt prevIndex; + AbstractInstruction *prevInst; + + if (!(opcodeIndex > 0)) { + return 0; + } + prevIndex = opcodeIndex - 1; + while (1) { + if (prevIndex <= 0) { + return 0; + } + prevInst = abstractInstructionAt(prevIndex); + if (isPCMappedAnnotation((!((prevInst->annotation)) + ? 0 + : (prevInst->annotation)))) { + return 1; + } + if (!(((prevInst->opcode)) == Label)) break; + prevIndex -= 1; + } + return 0; +} + + /* StackToRegisterMappingCogit>>#pushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + sqInt (* const pushNilSizeFunction)(sqInt,sqInt) = squeakV3orSistaV1PushNilSizenumInitialNils; + + return pushNilSizeFunction(aMethodObj, numInitialNils); +} + + +/* When a block must be recompiled due to overestimating the + numInitialNils fixups must be restored, which means rescannning + since backward branches need their targets initialized. */ + + /* StackToRegisterMappingCogit>>#reinitializeFixupsFrom:through: */ +static void NoDbgRegParms +reinitializeFixupsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt nExts; + sqInt pc; + BytecodeFixup * self_in_reinitialize; + sqInt targetPC; + + pc = start; + nExts = 0; + while (pc <= end) { + /* begin reinitialize */ + self_in_reinitialize = fixupAt(pc - initialPC); + (self_in_reinitialize->targetInstruction) = 0; + (self_in_reinitialize->simStackPtr) = 0; + (self_in_reinitialize->simNativeStackPtr) = 0; + + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0))) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + initializeFixupAt(targetPC - initialPC); + } + if ((descriptor->isBlockCreation)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + pc = (pc + ((descriptor->numBytes))) + distance; + } + else { + pc += (descriptor->numBytes); + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } +} + + +/* Scan the block to determine if the block needs a frame or not */ + + /* StackToRegisterMappingCogit>>#scanBlock: */ +static sqInt NoDbgRegParms +scanBlock(BlockStart *blockStart) +{ + BytecodeDescriptor *descriptor; + sqInt end; + sqInt framelessStackDelta; + sqInt nExts; + sqInt numPushNils; + sqInt (* const numPushNilsFunction)(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt) = squeakV3orSistaV1NumPushNils; + sqInt pc; + sqInt pushingNils; + + needsFrame = 0; + hasNativeFrame = 0; + + prevBCDescriptor = null; + methodOrBlockNumArgs = (blockStart->numArgs); + inBlock = InVanillaBlock; + pc = (blockStart->startpc); + end = ((blockStart->startpc)) + ((blockStart->span)); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); + pushingNils = 1; + while (pc < end) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + needsFrame = 1; + } + else { + framelessStackDelta += (descriptor->stackDelta); + } + } + /* begin maybeNoteDescriptor:blockStart: */ + if ((descriptor->isInstVarRef)) { + (blockStart->hasInstVarRef = 1); + } + if (pushingNils + && (!((descriptor->isExtension)))) { + + /* Count the initial number of pushed nils acting as temp initializers. We can't tell + whether an initial pushNil is an operand reference or a temp initializer, except + when the pushNil is a jump target (has a fixup), which never happens: + self systemNavigation browseAllSelect: + [:m| | ebc | + (ebc := m embeddedBlockClosures + select: [:ea| ea decompile statements first isMessage] + thenCollect: [:ea| ea decompile statements first selector]) notEmpty + and: [(#(whileTrue whileFalse whileTrue: whileFalse:) intersection: ebc) notEmpty]] + or if the bytecode set has a push multiple nils bytecode. We simply count initial nils. + Rarely we may end up over-estimating. We will correct by checking the stack depth + at the end of the block in compileBlockBodies. */ + if (((numPushNils = numPushNilsFunction(descriptor, pc, nExts, methodObj))) > 0) { + assert((((descriptor->numBytes)) == 1) + || (((descriptor->generator)) == genPushClosureTempsBytecode)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) + numPushNils); + } + else { + pushingNils = 0; + } + } + /* begin nextBytecodePCFor:at:exts:in: */ + pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) + : 0)); + if ((descriptor->isExtension)) { + nExts += 1; + } + else { + nExts = (extA = (numExtB = (extB = 0))); + } + prevBCDescriptor = descriptor; + } + if (!needsFrame) { + assert((framelessStackDelta >= 0) + && (((blockStart->numInitialNils)) >= framelessStackDelta)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) - framelessStackDelta); + } + return 0; +} + + +/* Scan the method (and all embedded blocks) to determine + - what the last bytecode is; extra bytes at the end of a method are used + to encode things like source pointers or temp names + - if the method needs a frame or not + - what are the targets of any backward branches. + - how many blocks it creates + Answer the block count or on error a negative error code */ + + /* StackToRegisterMappingCogit>>#scanMethod */ +static sqInt +scanMethod(void) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt framelessStackDelta; + sqInt latestContinuation; + sqInt nExts; + sqInt numBlocks; + sqInt pc; + sqInt seenInstVarStore; + sqInt targetPC; + + needsFrame = (useTwoPaths = (seenInstVarStore = 0)); + hasNativeFrame = 0; + + prevBCDescriptor = null; + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { + return 0; + } + pc = (latestContinuation = initialPC); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); + while (pc <= endPC) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + if (((descriptor->opcode)) == Nop) { + + /* unknown bytecode tag; see Cogit class>>#generatorTableFrom: */ + return EncounteredUnknownBytecode; + } + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + endPC = pc; + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + + /* With immutability we win simply by avoiding a frame build if the receiver is young and not immutable. */ + +# if IMMUTABILITY + if ((descriptor->is1ByteInstVarStore)) { + useTwoPaths = 1; + } + else { + needsFrame = 1; + useTwoPaths = 0; + } + +# else /* IMMUTABILITY */ + needsFrame = 1; + useTwoPaths = 0; + +# endif /* IMMUTABILITY */ + + } + else { + + /* Without immutability we win if there are two or more stores and the receiver is new. */ + framelessStackDelta += (descriptor->stackDelta); + +# if IMMUTABILITY + +# else /* IMMUTABILITY */ + if ((descriptor->is1ByteInstVarStore)) { + if (seenInstVarStore) { + useTwoPaths = 1; + } + else { + seenInstVarStore = 1; + } + } + +# endif /* IMMUTABILITY */ + + } + } + if (isBranch(descriptor)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + if ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0)) { + initializeFixupAt(targetPC - initialPC); + } + else { + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + if ((descriptor->isBlockCreation)) { + numBlocks += 1; + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + pc += (descriptor->numBytes); + nExts = ((descriptor->isExtension) + ? nExts + 1 + : (extA = (numExtB = (extB = 0)))); + prevBCDescriptor = descriptor; + } + return numBlocks; +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1PushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + return (methodUsesAlternateBytecodeSet(aMethodObj) + ? (/* begin sistaV1PushNilSize:numInitialNils: */ + numInitialNils) + : numInitialNils); +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1:Num:Push:Nils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + return (bytecodeSetOffset == 0 + ? (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0) + : (/* begin sistaV1:Num:Push:Nils: */ + (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0))); +} + + +/* Allocate a register needed in a run-time call (i.e. flush uses of the + register to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg: */ +static void NoDbgRegParms +ssAllocateCallReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | (1U << requiredReg), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and: */ +static void NoDbgRegParms +ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | (1U << requiredReg2)), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and:and: */ +static void NoDbgRegParms +ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | ((1U << requiredReg2) | (1U << requiredReg3))), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + liveRegs = NoReg; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveFloatRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatReg: */ +static void NoDbgRegParms +ssAllocateRequiredFloatReg(sqInt requiredReg) +{ + ssAllocateRequiredFloatRegMaskupThroughupThroughNative(1U << requiredReg, simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThroughupThroughNative(requiredRegsMask, stackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + /* begin registerMaskFor:and: */ + liveRegs = (1U << FPReg) | (1U << SPReg); + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if (((registerMask(simStackAt(i))) & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if (((nativeRegisterMask(simNativeStackAt(i))) & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg: */ +static void NoDbgRegParms +ssAllocateRequiredReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:and: */ +static void NoDbgRegParms +ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough((1U << requiredReg1) | (1U << requiredReg2), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, stackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushAll */ +static void +ssFlushAll(void) +{ + ssFlushTonativeFlushTo(simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo: */ +static void NoDbgRegParms +ssFlushTo(sqInt index) +{ + ssFlushTonativeFlushTo(index, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo:nativeFlushTo: */ +static void NoDbgRegParms +ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex) +{ + sqInt i; + + ssNativeFlushTo(nativeIndex); + + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + assert(((((simStackAt(i))->type)) == SSBaseOffset) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil())); + } + for (i = methodOrBlockNumTemps; i < simSpillBase; i += 1) { + assert(((simStackAt(i))->spilled)); + } + if (simSpillBase <= index) { + for (i = (((simSpillBase < methodOrBlockNumTemps) ? methodOrBlockNumTemps : simSpillBase)); i <= index; i += 1) { + assert(needsFrame); + ensureSpilledAtfrom(simStackAt(i), frameOffsetOfTemporary(i), FPReg); + } + simSpillBase = index + 1; + } +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughReceiverVariable: */ +static void NoDbgRegParms +ssFlushUpThroughReceiverVariable(sqInt slotIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == ReceiverResultReg) + && ((((simStackAt(index))->offset)) == (slotOffsetOfInstVarIndex(slotIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughTemporaryVariable: */ +static void NoDbgRegParms +ssFlushUpThroughTemporaryVariable(sqInt tempIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == FPReg) + && ((((simStackAt(index))->offset)) == (frameOffsetOfTemporary(tempIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + /* StackToRegisterMappingCogit>>#ssNativeFlushTo: */ +static void NoDbgRegParms +ssNativeFlushTo(sqInt index) +{ + sqInt allocatedScratchRegister; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt i; + sqInt loadedPointer; + sqInt offset; + sqInt offset1; + + if (simNativeSpillBase <= index) { + loadedPointer = 0; + allocatedScratchRegister = 0; + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= index; i += 1) { + if (!loadedPointer) { + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + if (usesOutOfLineLiteral(anInstruction)) { + (anInstruction->dependent = locateLiteral(offset)); + } + loadedPointer = 1; + } + if ((spillingNeedsScratchRegister(simNativeStackAt(i))) + && (!allocatedScratchRegister)) { + /* begin PushR: */ + genoperand(PushR, FPReg); + allocatedScratchRegister = 1; + } + ensureSpilledSPscratchRegister(simNativeStackAt(i), TempReg, FPReg); + } + simNativeSpillBase = index + 1; + if (allocatedScratchRegister) { + /* begin PopR: */ + genoperand(PopR, FPReg); + } + if (loadedPointer) { + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, simNativeStackSize, TempReg); + if (usesOutOfLineLiteral(anInstruction1)) { + (anInstruction1->dependent = locateLiteral(simNativeStackSize)); + } + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + if (usesOutOfLineLiteral(anInstruction2)) { + (anInstruction2->dependent = locateLiteral(offset1)); + } + } + } +} + + /* StackToRegisterMappingCogit>>#ssNativePop: */ +static void NoDbgRegParms +ssNativePop(sqInt n) +{ + assert((simNativeStackPtr - n) >= -1); + simNativeStackPtr -= n; + if (simNativeStackPtr >= 0) { + simNativeStackSize = ((ssNativeTop())->offset); + } + else { + simNativeStackSize = 0; + } +} + + /* StackToRegisterMappingCogit>>#ssNativePush: */ +static void NoDbgRegParms +ssNativePush(sqInt n) +{ + simNativeStackPtr += n; +} + + /* StackToRegisterMappingCogit>>#ssNativeTop */ +static CogSimStackNativeEntry * +ssNativeTop(void) +{ + assert(simNativeStackPtr >= 0); + return simNativeStackAt(simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssPopNativeSize: */ +static void NoDbgRegParms +ssPopNativeSize(sqInt popSize) +{ + sqInt popCount; + sqInt poppingSize; + sqInt stackPosition; + + poppingSize = 0; + stackPosition = simNativeStackPtr; + while ((poppingSize < popSize) + && (stackPosition >= 0)) { + poppingSize += stackSpillSize(simNativeStackAt(stackPosition)); + stackPosition -= 1; + } + assert(poppingSize == popSize); + popCount = simNativeStackPtr - stackPosition; + ssNativePop(popCount); +} + + /* StackToRegisterMappingCogit>>#ssPop: */ +static void NoDbgRegParms +ssPop(sqInt n) +{ + assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1)) + || (((!needsFrame) + && ((simStackPtr - n) >= -1)) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil()))); + simStackPtr -= n; +} + + /* StackToRegisterMappingCogit>>#ssPushAnnotatedConstant: */ +static sqInt NoDbgRegParms +ssPushAnnotatedConstant(sqInt literal) +{ + AbstractInstruction *abstractInstruction; + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushBase:offset: */ +static sqInt NoDbgRegParms +ssPushBaseoffset(sqInt reg, sqInt offset) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSBaseOffset); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->offset = offset); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushConstant: */ +static sqInt NoDbgRegParms +ssPushConstant(sqInt literal) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushDesc: */ +static sqInt NoDbgRegParms +ssPushDesc(SimStackEntry simStackEntry) +{ + if (((simStackEntry.type)) == SSSpill) { + (simStackEntry.type = SSBaseOffset); + } + (simStackEntry.spilled = 0); + (simStackEntry.bcptr = bytecodePC); + simStack[(simStackPtr += 1)] = simStackEntry; + updateSimSpillBase(); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat32(float aFloat32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat32 = aFloat32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat64(double aFloat64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat64 = aFloat64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt32(sqInt anInt32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt32 = anInt32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt64(sqLong anInt64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt64 = anInt64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantPointer: */ +static sqInt NoDbgRegParms +ssPushNativeConstantPointer(sqInt aNativePointer) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantNativePointer); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantNativePointer = aNativePointer); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterDoubleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterDoubleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterDoubleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterSingleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterSingleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterSingleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegister(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSNativeRegister); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister:secondRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterPair); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->registerSecond = secondReg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushRegister: */ +static sqInt NoDbgRegParms +ssPushRegister(sqInt reg) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSRegister); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPush: */ +static void NoDbgRegParms +ssPush(sqInt n) +{ + simStackPtr += n; +} + + +/* In addition to ssStorePop:toReg:, if this is a store and not + a popInto I change the simulated stack to use the register + for the top value */ + + /* StackToRegisterMappingCogit>>#ssStoreAndReplacePop:toReg: */ +static void NoDbgRegParms +ssStoreAndReplacePoptoReg(sqInt popBoolean, sqInt reg) +{ + char topSpilled; + + topSpilled = ((ssTop())->spilled); + ssStorePoptoReg(popBoolean + || (topSpilled), reg); + if (!popBoolean) { + if (!topSpilled) { + ssPop(1); + } + ssPushRegister(reg); + } +} + + +/* Store or pop the top simulated stack entry to a register. + Use preferredReg if the entry is not itself a register. + Answer the actual register the result ends up in. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toPreferredReg: */ +static sqInt NoDbgRegParms +ssStorePoptoPreferredReg(sqInt popBoolean, sqInt preferredReg) +{ + sqInt actualReg; + + actualReg = preferredReg; + if ((((ssTop())->type)) == SSRegister) { + assert(!(((ssTop())->spilled))); + actualReg = ((ssTop())->registerr); + } + ssStorePoptoReg(popBoolean, actualReg); + return actualReg; +} + + +/* Store or pop the top simulated stack entry to a register. + N.B.: popToReg: and storeToReg: does not generate anything if + it moves a register to the same register. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toReg: */ +static void NoDbgRegParms +ssStorePoptoReg(sqInt popBoolean, sqInt reg) +{ + if (popBoolean) { + popToReg(ssTop(), reg); + ssPop(1); + } + else { + storeToReg(ssTop(), reg); + } +} + + /* StackToRegisterMappingCogit>>#ssTop */ +static CogSimStackEntry * +ssTop(void) +{ + return simStackAt(simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssTopDescriptor */ +static SimStackEntry +ssTopDescriptor(void) +{ + return simStack[simStackPtr]; +} + + /* StackToRegisterMappingCogit>>#ssValue: */ +static CogSimStackEntry * NoDbgRegParms +ssValue(sqInt n) +{ + return simStackAt(simStackPtr - n); +} + + +/* If the sequence of bytecodes is + push: (Array new: 1) + popIntoTemp: tempIndex + pushConstant: const or pushTemp: n + popIntoTemp: 0 inVectorAt: tempIndex + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. + One might think that we should look for a sequence of more than + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */ + + /* StackToRegisterMappingCogit>>#tryCollapseTempVectorInitializationOfSize: */ +static sqInt NoDbgRegParms +tryCollapseTempVectorInitializationOfSize(sqInt slots) +{ + BytecodeDescriptor *pushArrayDesc; + BytecodeDescriptor *pushValueDesc; + sqInt reg; + sqInt remoteTempIndex; + BytecodeDescriptor *storeArrayDesc; + BytecodeDescriptor *storeValueDesc; + sqInt tempIndex; + + if (slots != 1) { + return 0; + } + pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); + assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); + storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; + } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } + pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { + return 0; + } + storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { + return 0; + } + genNewArrayOfSizeinitialized(1, 0); + evaluateat(pushValueDesc, (bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))); + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, 0, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + evaluateat(storeArrayDesc, bytecodePC + ((pushArrayDesc->numBytes))); + + /* + pushArrayDesc numBytes this gets added by nextBytecodePCFor:at:exts:in: */ + bytecodePC = ((bytecodePC + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + ((storeValueDesc->numBytes)); + return 1; +} + + /* StackToRegisterMappingCogit>>#updateSimSpillBase */ +static void +updateSimSpillBase(void) +{ + if (simSpillBase > simStackPtr) { + simSpillBase = ((simStackPtr < 0) ? 0 : simStackPtr); + } +} + + +/* Used when ReceiverResultReg is allocated for other than simSelf, and + there may be references to ReceiverResultReg which need to be spilled. */ + + /* StackToRegisterMappingCogit>>#voidReceiverResultRegContainsSelf */ +static void +voidReceiverResultRegContainsSelf(void) +{ + sqInt i; + sqInt spillIndex; + + (optStatus.isReceiverResultRegLive = 0); + spillIndex = -1; + for (i = (((methodOrBlockNumTemps < simSpillBase) ? simSpillBase : methodOrBlockNumTemps)); i <= simStackPtr; i += 1) { + if ((registerOrNone(simStackAt(i))) == ReceiverResultReg) { + spillIndex = i; + } + } + if (spillIndex > 0) { + ssFlushTo(simStackPtr - spillIndex); + } +} diff --git a/spurlowcodesrc/vm/cogitIA32.c b/spurlowcodesrc/vm/cogitIA32.c new file mode 100644 index 0000000000..8926c1d05a --- /dev/null +++ b/spurlowcodesrc/vm/cogitIA32.c @@ -0,0 +1,41105 @@ +/* Automatically generated by + CCodeGenerator VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + from + StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a " __DATE__ ; +char *__cogitBuildInfo = __buildInfo; + + + +#include +#include "sq.h" +#include "sqCogStackAlignment.h" +#include "dispdbg.h" +#include "cogmethod.h" +#if COGMTVM +#include "cointerpmt.h" +#else +#include "cointerp.h" +#endif +#include "cogit.h" + + +/*** Constants ***/ +#define AddCqR 105 +#define AddCwR 113 +#define AddcCqR 119 +#define AddcRR 118 +#define AddRdRd 123 +#define AddRR 99 +#define AddRsRs 130 +#define AlignmentNops 3 +#define AltBlockCreationBytecodeSize 3 +#define AltFirstSpecialSelector 96 +#define AltNumSpecialSelectors 32 +#define AndCqR 107 +#define AndCqRR 121 +#define AndCwR 115 +#define AndRR 101 +#define AnnotationShift 5 +#define Arg0Reg 6 +#define Arg1Reg 7 +#define ArithmeticShiftRightCqR 90 +#define ArithmeticShiftRightRR 91 +#define BadRegisterSet 1 +#define BlockCreationBytecodeSize 4 +#define BytecodeSetHasDirectedSuperSend 1 +#define Call 6 +#define CallerSavedRegisterMask 0x7 +#define CallFull 7 +#define CallR 8 +#define CDQ 146 +#if !defined(CheckRememberedInTrampoline) /* Allow this to be overridden on the compiler command line */ +# define CheckRememberedInTrampoline 0 +#endif +#define CLD 161 +#define ClassArrayCompactIndex 51 +#define ClassBlockClosureCompactIndex 37 +#define ClassFloatCompactIndex 34 +#define ClassFullBlockClosureCompactIndex 38 +#define ClassLargeNegativeInteger 42 +#define ClassLargePositiveInteger 13 +#define ClassMethodContextCompactIndex 36 +#define ClassReg 1 +#define ClosureFirstCopiedValueIndex 3 +#define ClosureIndex 4 +#define ClosureNumArgsIndex 2 +#define ClosureOuterContextIndex 0 +#define ClosureStartPCIndex 1 +#define CMBlock 3 +#define CMClosedPIC 4 +#define CMFree 1 +#define CMMaxUsageCount 7 +#define CMMethod 2 +#define CMOpenPIC 5 +#define CMPXCHGAwR 154 +#define CMPXCHGMwrR 155 +#define CmpC32R 112 +#define CmpCqR 104 +#define CmpCwR 111 +#define CmpRdRd 122 +#define CmpRR 98 +#define CmpRsRs 129 +#define CompletePrimitive 4 +#define ConstZero 1 +#define ConvertRdR 137 +#define ConvertRdRs 139 +#define ConvertRRd 136 +#define ConvertRRs 141 +#define ConvertRsR 140 +#define ConvertRsRd 138 +#define CPUID 149 +#define Debug DEBUGVM +#define DisplacementMask 0x1F +#define DisplacementX2N 0 +#define DivRdRd 126 +#define DivRsRs 133 +#define DPFPReg0 0 +#define DPFPReg1 1 +#define DPFPReg2 2 +#define DPFPReg3 3 +#define DPFPReg4 4 +#define DPFPReg5 5 +#define DPFPReg6 6 +#define DPFPReg7 7 +#define EAX 0 +#define EBP 5 +#define EBX 3 +#define ECX 1 +#define EDI 7 +#define EDX 2 +#define EncounteredUnknownBytecode -6 +#define ESI 6 +#define ESP 4 +#undef Extra0Reg +#define Fill32 4 +#define FirstAnnotation 64 +#define FirstJump 12 +#define FirstShortJump 16 +#define FirstSpecialSelector 176 +#define FoxCallerSavedIP 4 +#define FoxMethod -4 +#define FoxMFReceiver -12 +#define FoxSavedFP 0 +#define FoxThisContext -8 +#define FPReg 5 +#define FSTPD 160 +#define FSTPS 159 +#define FullClosureCompiledBlockIndex 1 +#define FullClosureFirstCopiedValueIndex 4 +#define FullClosureReceiverIndex 3 +#define GCModeBecome 8 +#define GCModeFull 1 +#define GCModeNewSpace 2 +#define HasBytecodePC 5 +#define HeaderIndex 0 +#define IDIVR 147 +#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ +# define IMMUTABILITY 0 +#endif +#define IMULRR 148 +#define InFullBlock 2 +#define InstanceSpecificationIndex 2 +#define InstructionPointerIndex 1 +#define InsufficientCodeSpace -2 +#define InVanillaBlock 1 +#define IsAbsPCReference 3 +#define IsAnnotationExtension 1 +#define IsDirectedSuperSend 9 +#define IsDisplacementX2N 0 +#define IsNSDynamicSuperSend null +#define IsNSImplicitReceiverSend null +#define IsNSSelfSend null +#define IsNSSendCall null +#define IsObjectReference 2 +#define IsRelativeCall 4 +#define IsSendCall 7 +#define IsSuperSend 8 +#define Jump 16 +#define JumpAbove 31 +#define JumpAboveOrEqual 30 +#define JumpBelow 29 +#define JumpBelowOrEqual 32 +#define JumpCarry 23 +#define JumpFPEqual 33 +#define JumpFPGreater 37 +#define JumpFPGreaterOrEqual 38 +#define JumpFPLess 35 +#define JumpFPLessOrEqual 36 +#define JumpFPNotEqual 34 +#define JumpFPOrdered 39 +#define JumpFPUnordered 40 +#define JumpFull 12 +#define JumpGreater 27 +#define JumpGreaterOrEqual 26 +#define JumpLess 25 +#define JumpLessOrEqual 28 +#define JumpLong 13 +#define JumpLongNonZero 15 +#define JumpLongZero 14 +#define JumpNegative 19 +#define JumpNoCarry 24 +#define JumpNonNegative 20 +#define JumpNonZero 18 +#define JumpNoOverflow 22 +#define JumpOverflow 21 +#define JumpR 10 +#define JumpZero 17 +#define Label 1 +#define LargeContextSlots 62 +#define LastJump 40 +#define LFENCE 150 +#undef LinkReg +#define Literal 2 +#define LiteralStart 1 +#define LOCK 153 +#define LoadEffectiveAddressMwrR 86 +#define LogicalShiftLeftCqR 94 +#define LogicalShiftLeftRR 95 +#define LogicalShiftRightCqR 92 +#define LogicalShiftRightRR 93 +#define LowcodeContextMark 60 +#define LowcodeVM 1 +#define MapEnd 0 +#define MaxCompiledPrimitiveIndex 222 +#define MaxCPICCases 6 +#define MaxMethodSize 65535 +#define MaxNegativeErrorCode -8 +#define MaxNumArgs 15 +#define MaxStackAllocSize 1572864 +#define MaxStackCheckOffset 0xFFF +#define MaxX2NDisplacement 992 +#define MethodCacheClass 2 +#define MethodCacheMask 0xFFC +#define MethodCacheMethod 3 +#define MethodCacheSelector 1 +#define MethodIndex 3 +#define MethodTooBig -4 +#define MFENCE 151 +#define MFMethodFlagHasContextFlag 1 +#define MFMethodFlagIsBlockFlag 2 +#define MOVSB 163 +#define MOVSD 164 +#define ModReg 3 +#define ModRegInd 0 +#define ModRegRegDisp32 2 +#define ModRegRegDisp8 1 +#define MoveAbR 46 +#define MoveAwR 42 +#define MoveC32R 71 +#define MoveCqR 69 +#define MoveCwR 70 +#define MoveM16rR 57 +#define MoveM32rR 61 +#define MoveM32rRs 79 +#define MoveM64rRd 76 +#define MoveM8rR 54 +#define MoveMbrR 65 +#define MoveMwrR 48 +#define MoveRAb 47 +#define MoveRAw 44 +#define MoveRdM64r 77 +#define MoveRdRd 75 +#define MoveRM16r 58 +#define MoveRM32r 62 +#define MoveRM8r 56 +#define MoveRMbr 66 +#define MoveRMwr 49 +#define MoveRR 41 +#define MoveRsM32r 80 +#define MoveRsRs 78 +#define MoveRXbrR 68 +#define MoveRXwrR 51 +#define MoveXbrRR 67 +#define MoveXwrRR 50 +#define MULTIPLEBYTECODESETS 1 +#define MulRdRd 125 +#define MulRsRs 132 +#define NeedsMergeFixupFlag 2 +#define NeedsNonMergeFixupFlag 1 +#define NegateR 88 +#define NewspeakVM 0 +#define Nop 5 +#define NoReg -1 +#define NotFullyInitialized -1 +#define NotR 89 +#define NumObjRefsInRuntime 0 +#define NumOopsPerNSC 6 +#define NumSendTrampolines 4 +#define NumSpecialSelectors 32 +#define NumStoreTrampolines 5 +#define NumTrampolines (IMMUTABILITY ? 82 : 77) +#define OrCqR 108 +#define OrCwR 116 +#define OrRR 102 +#undef PCReg +#define PopR 81 +#define PrefetchAw 85 +#define PrimCallCollectsProfileSamples 8 +#define PrimCallDoNotJIT 32 +#define PrimCallMayCallBack 4 +#define PrimCallNeedsNewMethod 1 +#define PrimCallNeedsPrimitiveFunction 2 +#define PrimErrNoMemory 9 +#define PrimErrWritePastObject 17 +#define PushCq 83 +#define PushCw 84 +#define PushR 82 +#define REP 162 +#define ReceiverIndex 5 +#define ReceiverResultReg 2 +#define RetN 9 +#undef RISCTempReg +#define SelectorCannotInterpret 34 +#define SelectorDoesNotUnderstand 20 +#define SenderIndex 0 +#define SendNumArgsReg 3 +#define SFENCE 152 +#define ShouldNotJIT -8 +#define SIB1 0 +#define SIB4 2 +#define SignExtend16RR 143 +#define SignExtend8RR 142 +#define SistaV1BytecodeSet 1 +#define SistaVM 1 +#define SmallContextSlots 22 +#define SPReg 4 +#define SPURVM 1 +#define SqrtRd 127 +#define SqrtRs 134 +#define SSBaseOffset 1 +#define SSConstant 2 +#define SSConstantFloat32 15 +#define SSConstantFloat64 16 +#define SSConstantInt32 13 +#define SSConstantInt64 14 +#define SSConstantNativePointer 17 +#define SSNativeRegister 5 +#define SSRegister 3 +#define SSRegisterDoubleFloat 7 +#define SSRegisterPair 6 +#define SSRegisterSingleFloat 8 +#define SSSpill 4 +#define SSSpillFloat32 11 +#define SSSpillFloat64 12 +#define SSSpillInt64 10 +#define SSSpillNative 9 +#define StackPointerIndex 2 +#define Stop 11 +#define SubbRR 120 +#define SubCqR 106 +#define SubCwR 114 +#define SubRdRd 124 +#define SubRR 100 +#define SubRsRs 131 +#define TempReg 0 +#define TstCqR 109 +#define UnfailingPrimitive 3 +#define UnimplementedPrimitive -7 +#define UnknownSimStackPtrFlag -2 +#define ValueIndex 1 +#undef VarBaseReg +#define XCHGAwR 156 +#define XCHGMwrR 157 +#define XCHGRR 158 +#define XorCwR 117 +#define XorRdRd 128 +#define XorRR 103 +#define XorRsRs 135 +#define YoungSelectorInPIC -5 +#define ZeroExtend16RR 145 +#define ZeroExtend8RR 144 + +typedef struct _AbstractInstruction { + unsigned char opcode; + unsigned char machineCodeSize; + unsigned char maxSize; + unsigned char annotation; + usqIntptr_t operands [3]; + usqIntptr_t address; + struct _AbstractInstruction *dependent; + unsigned char machineCode [10]; + } AbstractInstruction; + +#define CogIA32Compiler AbstractInstruction +#define CogAbstractInstruction AbstractInstruction + + +typedef struct { + AbstractInstruction *fakeHeader; + AbstractInstruction *fillInstruction; + sqInt numArgs; + sqInt numCopied; + sqInt numInitialNils; + sqInt startpc; + AbstractInstruction *entryLabel; + AbstractInstruction *stackCheckLabel; + sqInt span; + sqInt hasInstVarRef; + } BlockStart; + +#define CogBlockStart BlockStart + + +typedef struct _BytecodeDescriptor { + sqInt (*generator )(void); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); + signed char stackDelta; + unsigned char opcode; + unsigned char numBytes; + unsigned isBranchTrue : 1; + unsigned isBranchFalse : 1; + unsigned isReturn : 1; + unsigned isBlockCreation : 1; + unsigned isMapped : 1; + unsigned isMappedInBlock : 1; + unsigned isExtension : 1; + unsigned isInstVarRef : 1; + unsigned is1ByteInstVarStore : 1; + unsigned isCallPrimitive : 1; + } BytecodeDescriptor; + +#define CogBytecodeDescriptor BytecodeDescriptor + + +typedef struct { + sqInt (*primitiveGenerator )(void); + sqInt primNumArgs; + } PrimitiveDescriptor; + +#define CogPrimitiveDescriptor PrimitiveDescriptor + + +typedef struct { + char type; + char spilled; + sqInt annotateUse; + sqInt registerr; + sqInt offset; + sqInt constant; + sqInt bcptr; + } SimStackEntry; + +#define CogSimStackEntry SimStackEntry + + +typedef struct { + AbstractInstruction *targetInstruction; + sqInt instructionIndex; + sqInt simStackPtr; + sqInt simNativeStackPtr; + sqInt simNativeStackSize; + } BytecodeFixup; + +#define CogSSBytecodeFixup BytecodeFixup +#define CogBytecodeFixup BytecodeFixup + + +typedef struct { + sqInt isReceiverResultRegLive; + CogSimStackEntry *ssEntry; + } CogSSOptStatus; + + +typedef struct { + char type; + char spilled; + sqInt registerr; + sqInt registerSecond; + sqInt offset; + sqInt constant; + sqInt constantInt32; + sqLong constantInt64; + float constantFloat32; + double constantFloat64; + sqInt constantNativePointer; + sqInt bcptr; + } CogSimStackNativeEntry; + + + +/*** Function Prototypes ***/ + + +#if !PRODUCTION && defined(PlatformNoDbgRegParms) +# define NoDbgRegParms PlatformNoDbgRegParms +#endif + +#if !defined(NoDbgRegParms) +# define NoDbgRegParms /*empty*/ +#endif + + + +#if !defined(NeverInline) +# define NeverInline /*empty*/ +#endif + +static AbstractInstruction * NoDbgRegParms addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction); +static sqInt NoDbgRegParms availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask); +static sqInt NoDbgRegParms availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask); +static AbstractInstruction * NoDbgRegParms cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral); +static sqInt NoDbgRegParms concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress); +static AbstractInstruction * NoDbgRegParms genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms getJmpTarget(AbstractInstruction * self_in_getJmpTarget); +static AbstractInstruction * NoDbgRegParms initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal); +static AbstractInstruction * NoDbgRegParms initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal); +static sqInt NoDbgRegParms isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress); +static sqInt NoDbgRegParms isJump(AbstractInstruction * self_in_isJump); +static sqInt NoDbgRegParms isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress); +static usqIntptr_t NoDbgRegParms labelOffset(AbstractInstruction * self_in_labelOffset); +static sqInt NoDbgRegParms literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress); +static AbstractInstruction * NoDbgRegParms relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget); +static sqInt NoDbgRegParms rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction); +static sqInt NoDbgRegParms wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject); +static CogMethod * NoDbgRegParms cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod); +static sqInt NoDbgRegParms isBranch(BytecodeDescriptor * self_in_isBranch); +static sqInt NoDbgRegParms isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch); +static sqInt NoDbgRegParms callFullTargetFromReturnAddress(AbstractInstruction * self_in_callFullTargetFromReturnAddress, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize); +static sqInt NoDbgRegParms callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress); +static AbstractInstruction * NoDbgRegParms cFloatResultToRd(AbstractInstruction * self_in_cFloatResultToRd, sqInt reg); +static AbstractInstruction * NoDbgRegParms cFloatResultToRs(AbstractInstruction * self_in_cFloatResultToRs, sqInt reg); +static sqInt NoDbgRegParms cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize); +static sqInt NoDbgRegParms computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize); +static sqInt NoDbgRegParms computeShiftRRSize(AbstractInstruction * self_in_computeShiftRRSize); +static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32); +static usqInt NoDbgRegParms concretizeOpRR(AbstractInstruction * self_in_concretizeOpRR, sqInt x86opcode); +static usqInt NoDbgRegParms concretizeReverseOpRR(AbstractInstruction * self_in_concretizeReverseOpRR, sqInt x86opcode); +static usqInt NoDbgRegParms concretizeZeroExtend16RR(AbstractInstruction * self_in_concretizeZeroExtend16RR); +static sqInt NoDbgRegParms cResultRegisterHigh(AbstractInstruction * self_in_cResultRegisterHigh); +static sqInt NoDbgRegParms cResultRegisterLow(AbstractInstruction * self_in_cResultRegisterLow); +static void NoDbgRegParms dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize); +static void NoDbgRegParms dispatchConcretizeProcessorSpecific(AbstractInstruction * self_in_dispatchConcretizeProcessorSpecific); +static sqInt NoDbgRegParms fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative); +static AbstractInstruction * NoDbgRegParms genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder); +static AbstractInstruction * NoDbgRegParms generateCheckFeatures(AbstractInstruction * self_in_generateCheckFeatures); +static AbstractInstruction * NoDbgRegParms generateLowLevelTryLock(AbstractInstruction * self_in_generateLowLevelTryLock, sqInt vmOwnerLockAddress); +static AbstractInstruction * NoDbgRegParms generateLowLevelUnlock(AbstractInstruction * self_in_generateLowLevelUnlock, sqInt vmOwnerLockAddress); +static sqInt NoDbgRegParms genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer); +static sqInt NoDbgRegParms genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers); +static sqInt NoDbgRegParms genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers); +static AbstractInstruction * NoDbgRegParms genMemCopytoconstantSize(AbstractInstruction * self_in_genMemCopytoconstantSize, sqInt originalSourceReg, sqInt originalDestReg, sqInt size); +static AbstractInstruction * NoDbgRegParms genMemCopytosize(AbstractInstruction * self_in_genMemCopytosize, sqInt originalSourceReg, sqInt originalDestReg, sqInt originalSize); +static AbstractInstruction * NoDbgRegParms genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest); +static AbstractInstruction * NoDbgRegParms genPushC64(AbstractInstruction * self_in_genPushC64, sqLong constant64Bits); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg); +static sqInt NoDbgRegParms genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n); +static sqInt NoDbgRegParms genRemoveNFloatArgsFromStack(AbstractInstruction * self_in_genRemoveNFloatArgsFromStack, sqInt n); +static sqInt NoDbgRegParms genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt preservedReg); +static sqInt NoDbgRegParms genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs, sqInt regMask); +static sqInt NoDbgRegParms genSaveRegs(AbstractInstruction * self_in_genSaveRegs, sqInt regMask); +static sqInt NoDbgRegParms genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers); +static AbstractInstruction * NoDbgRegParms genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc); +static sqInt NoDbgRegParms hasSSE2Instructions(AbstractInstruction * self_in_hasSSE2Instructions); +static sqInt NoDbgRegParms hasSSEInstructions(AbstractInstruction * self_in_hasSSEInstructions); +static sqInt NoDbgRegParms inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc); +static sqInt NoDbgRegParms isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc); +static sqInt NoDbgRegParms isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc); +static sqInt NoDbgRegParms isPCDependent(AbstractInstruction * self_in_isPCDependent); +static sqInt NoDbgRegParms isQuick(AbstractInstruction * self_in_isQuick, usqIntptr_t operand); +static AbstractInstruction * NoDbgRegParms jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction); +static sqInt NoDbgRegParms jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize); +static sqInt NoDbgRegParms jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize); +static sqInt NoDbgRegParms jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc); +static sqInt NoDbgRegParms jumpShortByteSize(AbstractInstruction * self_in_jumpShortByteSize); +static usqInt NoDbgRegParms jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc); +static sqInt NoDbgRegParms leafCallStackPointerDelta(AbstractInstruction * self_in_leafCallStackPointerDelta); +static sqInt NoDbgRegParms literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress); +static sqInt NoDbgRegParms literalBeforeInlineCacheTagAt(AbstractInstruction * self_in_literalBeforeInlineCacheTagAt, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize); +static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize); +static usqInt NoDbgRegParms machineCodeAt(AbstractInstruction * self_in_machineCodeAt, sqInt anOffset); +static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes); +static sqInt NoDbgRegParms modRMRO(AbstractInstruction * self_in_modRMRO, sqInt mod, sqInt regMode, sqInt regOpcode); +static sqInt NoDbgRegParms numCheckFeaturesOpcodes(AbstractInstruction * self_in_numCheckFeaturesOpcodes); +static sqInt NoDbgRegParms numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs); +static sqInt NoDbgRegParms numLowLevelLockOpcodes(AbstractInstruction * self_in_numLowLevelLockOpcodes); +static AbstractInstruction * NoDbgRegParms padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr); +static AbstractInstruction * NoDbgRegParms relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta); +static sqInt NoDbgRegParms rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteCPICJumpAttarget(AbstractInstruction * self_in_rewriteCPICJumpAttarget, usqInt addressFollowingJump, usqInt jumpTargetAddress); +static sqInt NoDbgRegParms rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode); +static sqInt NoDbgRegParms sizeHasModrmat(AbstractInstruction * self_in_sizeHasModrmat, sqInt op, sqInt pc); +static sqInt NoDbgRegParms sizeImmediateGroup1at(AbstractInstruction * self_in_sizeImmediateGroup1at, sqInt op, sqInt pc); +static usqInt NoDbgRegParms sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress); +static sqInt NoDbgRegParms stackBytesForNumArgs(AbstractInstruction * self_in_stackBytesForNumArgs, sqInt numArgs); +static sqInt NoDbgRegParms stackPageInterruptHeadroomBytes(AbstractInstruction * self_in_stackPageInterruptHeadroomBytes); +static AbstractInstruction * NoDbgRegParms stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr); +static AbstractInstruction * NoDbgRegParms storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress); +static sqInt NoDbgRegParms sib(AbstractInstruction * self_in_sib, sqInt scale, sqInt indexReg, sqInt baseReg); +static sqInt NoDbgRegParms twoByteInstructionSizeAt(AbstractInstruction * self_in_twoByteInstructionSizeAt, sqInt pc); +static sqInt NoDbgRegParms unsignedShortAt(AbstractInstruction * self_in_unsignedShortAt, sqInt byteAddress); +static sqInt NoDbgRegParms zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative); +static AbstractInstruction * NoDbgRegParms gAddCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gArithmeticShiftRightRR(sqInt reg1, sqInt reg2); +extern sqInt abortOffset(void); +static sqInt NoDbgRegParms abstractInstructionfollows(AbstractInstruction *theAbstractInstruction, AbstractInstruction *anAbstractInstruction); +static void addCleanBlockStarts(void); +extern void addCogMethodsToHeapMap(void); +static sqInt NoDbgRegParms addressIsInFixups(AbstractInstruction *address); +static sqInt NoDbgRegParms addressIsInInstructions(AbstractInstruction *address); +static sqInt NoDbgRegParms addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC); +static sqInt NoDbgRegParms alignUptoRoutineBoundary(sqInt anAddress); +static sqInt allMachineCodeObjectReferencesValid(void); +static sqInt allMethodsHaveCorrectHeader(void); +static AbstractInstruction * NoDbgRegParms annotateAbsolutePCRef(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); +static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); +static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); +extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +static AbstractInstruction * NoDbgRegParms CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved); +static AbstractInstruction * NoDbgRegParms gCall(sqInt callTarget); +static AbstractInstruction * NoDbgRegParms gCmpCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpRR(sqInt reg1, sqInt reg2); +extern void callCogCodePopReceiver(void); +extern void callCogCodePopReceiverAndClassRegs(void); +extern sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver); +extern void ceFree(void*pointer); +extern void* ceMalloc(size_t size); +extern sqInt ceSICMiss(sqInt receiver); +extern void checkAssertsEnabledInCogit(void); +static sqInt NoDbgRegParms checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes); +static sqInt NoDbgRegParms checkMaybeObjRefInClosedPIC(sqInt maybeObject); +static sqInt NoDbgRegParms checkValidObjectReferencesInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms closedPICRefersToUnmarkedObject(CogMethod *cPIC); +extern char * codeEntryFor(char *address); +extern char * codeEntryNameFor(char *address); +extern sqInt cogCodeBase(void); +extern sqInt cogCodeConstituents(void); +static sqInt NoDbgRegParms cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase); +extern CogMethod * cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied); +extern void cogitPostGCAction(sqInt gcMode); +extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod); +extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs); +static CogMethod * NoDbgRegParms cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs); +static CogMethod * NoDbgRegParms cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase); +extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop); +extern void compactCogCompiledCode(void); +static void compactPICsWithFreedTargets(void); +static AbstractInstruction * compileAbort(void); +static sqInt NoDbgRegParms compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex); +static void NoDbgRegParms compileBlockEntry(BlockStart *blockStart); +static void NoDbgRegParms compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static AbstractInstruction * compileCPICEntry(void); +static sqInt NoDbgRegParms compileEntireFullBlockMethod(sqInt numCopied); +static void compileEntry(void); +static sqInt compileFullBlockEntry(void); +static sqInt compileMethodBody(void); +static sqInt NoDbgRegParms compilePICAbort(sqInt numArgs); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone); +static void NoDbgRegParms compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void computeEntryOffsets(void); +static void computeFullBlockEntryOffsets(void); +static void computeMaximumSizes(void); +static sqInt NoDbgRegParms configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms cPICCompactAndIsNowEmpty(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasForwardedClass(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasFreedTargets(CogMethod *cPIC); +static usqInt cPICPrototypeCaseOffset(void); +static sqInt NoDbgRegParms cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod); +static AbstractInstruction * NoDbgRegParms gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder); +extern sqInt defaultCogCodeSize(void); +static sqInt NoDbgRegParms deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader); +static sqInt NoDbgRegParms endPCOf(sqInt aMethod); +extern void enterCogCodePopReceiver(void); +static sqInt NoDbgRegParms expectedClosedPICPrototype(CogMethod *cPIC); +static sqInt extABytecode(void); +static sqInt extBBytecode(void); +static sqInt NoDbgRegParms fillInBlockHeadersAt(sqInt startAddress); +static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector); +static sqInt NoDbgRegParms findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc); +static usqInt NoDbgRegParms findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc); +static sqInt NoDbgRegParms findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod); +extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod); +static sqInt NoDbgRegParms findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc); +static usqInt NoDbgRegParms firstMappedPCFor(CogMethod *cogMethod); +static sqInt firstPrototypeMethodOop(void); +extern void followForwardedLiteralsIn(CogMethod *cogMethod); +extern void followForwardedMethods(void); +static sqInt NoDbgRegParms followMaybeObjRefInClosedPICAt(sqInt mcpc); +static sqInt NoDbgRegParms followMethodReferencesInClosedPIC(CogMethod *cPIC); +extern void freeUnmarkedMachineCode(void); +static AbstractInstruction * NoDbgRegParms genCallMustBeBooleanFor(sqInt boolean); +static sqInt genCheckForInterruptsTrampoline(void); +static AbstractInstruction * NoDbgRegParms genConditionalBranchoperand(sqInt opcode, sqInt operandOne); +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) ; +static void NoDbgRegParms genEnilopmartReturn(sqInt forCall); +static void NoDbgRegParms generateCaptureCStackPointers(sqInt captureFramePointer); +static void generateClosedPICPrototype(void); +static CogMethod * generateCogFullBlock(void); +static CogMethod * NoDbgRegParms generateCogMethod(sqInt selector); +static sqInt NoDbgRegParms generateInstructionsAt(sqInt eventualAbsoluteAddress); +static sqInt NoDbgRegParms generateMapAtstart(sqInt addressOrNull, sqInt startAddress); +static void generateOpenPICPrototype(void); +static void generateRunTimeTrampolines(void); +static void generateStackPointerCapture(void); +static void generateTrampolines(void); +static sqInt genFFICalloutTrampoline(void); +static void genGetLeafCallStackPointer(void); +static sqInt NoDbgRegParms genInnerPICAbortTrampoline(char *name); +static sqInt genLoadCStackPointersForPrimCall(void); +static void NoDbgRegParms genLoadInlineCacheWithSelector(sqInt selectorIndex); +static sqInt genNonLocalReturnTrampoline(void); +static sqInt NoDbgRegParms genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genSmalltalkToCStackSwitch(sqInt pushLinkReg); +static sqInt NoDbgRegParms genTrampolineForcalled(void *aRoutine, char *aString); +static sqInt NoDbgRegParms genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2); +static sqInt NoDbgRegParms genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask); +static AbstractInstruction * NoDbgRegParms gen(sqInt opcode); +static AbstractInstruction * NoDbgRegParms genoperand(sqInt opcode, sqInt operand); +static AbstractInstruction * NoDbgRegParms genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo); +static AbstractInstruction * NoDbgRegParms genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree); +static sqInt NoDbgRegParms getLiteral(sqInt litIndex); +static sqInt NoDbgRegParms incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc); +static sqInt initialClosedPICUsageCount(void); +static void initializeBackend(void); +extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress); +static sqInt initialMethodUsageCount(void); +static sqInt initialOpenPICUsageCount(void); +static sqInt NoDbgRegParms inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc); +static sqInt NoDbgRegParms inverseBranchFor(sqInt opcode); +static sqInt NoDbgRegParms isPCMappedAnnotation(sqInt annotation); +extern sqInt isPCWithinMethodZone(void *address); +extern sqInt isSendReturnPC(sqInt retpc); +static AbstractInstruction * NoDbgRegParms gJumpFPEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreaterOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreater(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLessOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLess(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPNotEqual(void *jumpTarget); +static AbstractInstruction * gLabel(void); +static AbstractInstruction * NoDbgRegParms gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * lastOpcode(void); +extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver); +static BytecodeDescriptor * loadBytesAndGetDescriptor(void); +static void NoDbgRegParms loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc); +static AbstractInstruction * NoDbgRegParms gMoveAwR(sqInt address, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg); +static AbstractInstruction * NoDbgRegParms gMoveRR(sqInt reg1, sqInt reg2); +static usqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); +static sqInt NoDbgRegParms mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg); +static sqInt NoDbgRegParms mapObjectReferencesInClosedPIC(CogMethod *cPIC); +static void mapObjectReferencesInGeneratedRuntime(void); +static void mapObjectReferencesInMachineCodeForBecome(void); +static void mapObjectReferencesInMachineCodeForFullGC(void); +static void mapObjectReferencesInMachineCodeForYoungGC(void); +extern void mapObjectReferencesInMachineCode(sqInt gcMode); +extern void markAndTraceMachineCodeOfMarkedMethods(void); +static void markAndTraceObjectReferencesInGeneratedRuntime(void); +static sqInt NoDbgRegParms markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit); +static sqInt NoDbgRegParms markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC); +static sqInt NoDbgRegParms markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern void markMethodAndReferents(CogBlockMethod *aCogMethod); +extern usqInt maxCogMethodAddress(void); +static sqInt maybeAllocAndInitIRCs(void); +static sqInt NoDbgRegParms maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod); +static void NoDbgRegParms maybeMarkCountersIn(CogMethod *cogMethod); +static sqInt mclassIsSmallInteger(void); +extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +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); +static sqInt noCogMethodsMaximallyMarked(void); +static sqInt NoDbgRegParms noTargetsFreeInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms outputInstructionsAt(sqInt startAddress); +static sqInt NoDbgRegParms outputInstructionsForGeneratedRuntimeAt(sqInt startAddress); +static AbstractInstruction * NoDbgRegParms gPopR(sqInt reg); +static AbstractInstruction * NoDbgRegParms gPushCw(sqInt wordConstant); +extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver); +static sqInt picAbortDiscriminatorValue(void); +static sqInt picInterpretAbortOffset(void); +static AbstractInstruction * previousInstruction(void); +extern void printCogMethodFor(void *address); +extern void printPCMapPairsFor(CogMethod *cogMethod); +extern void printTrampolineTable(void); +static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(void); +static sqInt processorHasDoublePrecisionFloatingPointSupport(void); +static sqInt processorHasMultiplyAndMClassIsSmallInteger(void); +static void NoDbgRegParms recordGeneratedRunTimeaddress(char *aString, sqInt address); +extern sqInt recordPrimTraceFunc(void); +static void recordRunTimeObjectReferences(void); +static sqInt NoDbgRegParms registerMaskFor(sqInt reg); +static sqInt NoDbgRegParms registerMaskForand(sqInt reg1, sqInt reg2); +static void NoDbgRegParms relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod); +static void NoDbgRegParms relocateCallsInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta); +static sqInt NoDbgRegParms remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr); +static sqInt NoDbgRegParms remapMaybeObjRefInClosedPICAt(sqInt mcpc); +static void NoDbgRegParms rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget); +static AbstractInstruction * NoDbgRegParms gSubCwR(sqInt wordConstant, sqInt reg); +static sqInt scanForCleanBlocks(void); +extern void setBreakMethod(sqInt anObj); +extern void setPostCompileHook(void (*aFunction)(CogMethod *)); +extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop); +static sqInt NoDbgRegParms spanForCleanBlockStartingAt(sqInt startPC); +static sqInt subsequentPrototypeMethodOop(void); +extern sqInt traceLinkedSendOffset(void); +static sqInt NoDbgRegParms trampolineArgConstant(sqInt booleanOrInteger); +static char * NoDbgRegParms trampolineNamenumArgs(char *routinePrefix, sqInt numArgs); +static char * NoDbgRegParms trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit); +static char * NoDbgRegParms trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs); +static sqInt unknownBytecode(void); +extern void unlinkAllSends(void); +static sqInt NoDbgRegParms unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector); +static sqInt NoDbgRegParms unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod); +extern void unlinkSendsLinkedForInvalidClasses(void); +extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector); +extern void unlinkSendsToFree(void); +extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue); +static AbstractInstruction * NoDbgRegParms gXorCwR(sqInt wordConstant, sqInt reg); +static void zeroOpcodeIndex(void); +static void zeroOpcodeIndexForNewOpcodes(void); +extern void addAllToYoungReferrers(void); +static void NoDbgRegParms addToOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms addToYoungReferrers(CogMethod *cogMethod); +static sqInt NoDbgRegParms allocate(sqInt numBytes); +static void clearCogCompiledCode(void); +static void NoDbgRegParms clearSavedPICUsageCount(CogMethod *cogMethod); +static void compactCompiledCode(void); +static void NoDbgRegParms ensureInYoungReferrers(CogMethod *cogMethod); +static void followForwardedLiteralsInOpenPICList(void); +extern void freeMethod(CogMethod *cogMethod); +static void freeOlderMethodsForCompaction(void); +static sqInt kosherYoungReferrers(void); +static void NoDbgRegParms manageFromto(sqInt theStartAddress, sqInt theLimitAddress); +extern CogMethod * methodFor(void *address); +extern sqInt methodsCompiledToMachineCodeInto(sqInt arrayObj); +extern sqInt numMethods(void); +extern sqInt numMethodsOfType(sqInt cogMethodType); +static sqInt NoDbgRegParms occurrencesInYoungReferrers(CogMethod *cogMethod); +static CogMethod * NoDbgRegParms openPICWithSelector(sqInt aSelector); +static void planCompaction(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 NoDbgRegParms removeFromOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms restorePICUsageCount(CogMethod *cogMethod); +static void NoDbgRegParms savePICUsageCount(CogMethod *cogMethod); +static void voidYoungReferrersPostTenureAll(void); +extern char * whereIsMaybeCodeThing(sqInt anOop); +static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop); +static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg); +static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg); +static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)); +static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison); +static sqInt NoDbgRegParms genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg); +static void NoDbgRegParms genLcByteSizeOfto(sqInt oop, sqInt resultRegister); +static void NoDbgRegParms genLcFloat32toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcFloat64toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcInstantiateOop(sqInt classOop); +static void NoDbgRegParms genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInt64ToOop(sqInt value); +static void NoDbgRegParms genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOopToInt64(sqInt value); +static void NoDbgRegParms genLcOopToPointer(sqInt object); +static void NoDbgRegParms genLcOopToUInt64(sqInt value); +static void NoDbgRegParms genLcOoptoFloat32(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoFloat64(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcPointerToOopclass(sqInt pointer, sqInt pointerClass); +static void NoDbgRegParms genLcUInt64ToOop(sqInt value); +static void NoDbgRegParms genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +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 * NoDbgRegParms (*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); +static sqInt NoDbgRegParms genClearAndSetSmallIntegerTagsIn(sqInt scratchReg); +static void NoDbgRegParms genConvertCharacterToSmallIntegerInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToSmallIntegerInReg(sqInt reg); +static void NoDbgRegParms genConvertSmallIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertSmallIntegerToIntegerInReg(sqInt reg); +static void generateLowcodeObjectTrampolines(void); +static sqInt NoDbgRegParms genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg); +static sqInt NoDbgRegParms genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg); +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 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 void NoDbgRegParms genLcInt32ToOop(sqInt value); +static void NoDbgRegParms genLcOopToInt32(sqInt value); +static void NoDbgRegParms genLcOopToUInt32(sqInt value); +static void NoDbgRegParms genLcUInt32ToOop(sqInt value); +static sqInt genPrimitiveAt(void); +static sqInt genPrimitiveAtPut(void); +static sqInt genPrimitiveIdentityHash(void); +static sqInt genPrimitiveImmediateAsInteger(void); +static sqInt genPrimitiveNew(void); +static sqInt genPrimitiveNewWithArg(void); +static sqInt genPrimitiveShallowCopy(void); +static sqInt genPrimitiveStringAt(void); +static sqInt genPrimitiveStringAtPut(void); +static sqInt NoDbgRegParms genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg); +static sqInt NoDbgRegParms inlineCacheTagForInstance(sqInt oop); +static AbstractInstruction * NoDbgRegParms jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static sqInt numSmallIntegerBits(void); +static sqInt NoDbgRegParms validInlineCacheTag(usqInt classIndexOrTagPattern); +static sqInt NoDbgRegParms cacheTagIsMarked(sqInt cacheTag); +static sqInt NoDbgRegParms checkValidOopReference(sqInt anOop); +static sqInt NoDbgRegParms couldBeObject(sqInt literal); +static sqInt NoDbgRegParms genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString); +static AbstractInstruction * NoDbgRegParms genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt scratch1, sqInt scratch2); +static AbstractInstruction * NoDbgRegParms genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg); +static sqInt NoDbgRegParms genConvertCharacterToCodeInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock); +static sqInt NoDbgRegParms genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock); +static sqInt NoDbgRegParms genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg); +static void generateObjectRepresentationTrampolines(void); +static sqInt NoDbgRegParms genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock); +static sqInt NoDbgRegParms genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock); +static sqInt NoDbgRegParms genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver); +static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg); +static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg); +static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg); +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 AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister); +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +static AbstractInstruction * NoDbgRegParms genJumpNotCharacterInScratchReg(sqInt reg); +static void NoDbgRegParms genLcFirstFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcFirstIndexableFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcIsBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIndexableto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsPointersto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcLoadObjectat(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcLoadObjectfield(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex); +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 NoDbgRegParms genPrimitiveIdenticalOrNotIf(sqInt orNot); +static sqInt genPrimitiveObjectAt(void); +static sqInt genPrimitiveSize(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 genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg); +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +static sqInt getActiveContextAllocatesInMachineCode(void); +static sqInt NoDbgRegParms inlineCacheTagIsYoung(sqInt cacheTag); +static AbstractInstruction * NoDbgRegParms jumpNotCharacterUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static void NoDbgRegParms markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address); +static void NoDbgRegParms markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil); +static sqInt NoDbgRegParms maybeCompileRetryOnPrimitiveFail(sqInt primIndex); +static sqInt NoDbgRegParms maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg); +static sqInt numCharacterBits(void); +extern sqInt numRegArgs(void); +static sqInt NoDbgRegParms remapObject(sqInt objOop); +static sqInt NoDbgRegParms remapOop(sqInt objOop); +static sqInt NoDbgRegParms shouldAnnotateObjectReference(sqInt anOop); +static sqInt NoDbgRegParms slotOffsetOfInstVarIndex(sqInt index); +static SimStackEntry * NoDbgRegParms ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister); +static SimStackEntry * NoDbgRegParms popToReg(SimStackEntry * self_in_popToReg, sqInt reg); +static sqInt NoDbgRegParms registerMask(SimStackEntry * self_in_registerMask); +static sqInt NoDbgRegParms registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone); +static sqInt NoDbgRegParms registerOrNone(SimStackEntry * self_in_registerOrNone); +static SimStackEntry * NoDbgRegParms storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled); +static CogSimStackNativeEntry * NoDbgRegParms ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister); +static sqInt NoDbgRegParms nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister); +static sqInt NoDbgRegParms stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize); +static sqInt NoDbgRegParms isMergeFixup(BytecodeFixup * self_in_isMergeFixup); +static sqInt compileBlockDispatch(void); +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); +static sqInt frameOffsetOfNativeFrameMark(void); +static sqInt frameOffsetOfNativeFramePointer(void); +static sqInt frameOffsetOfNativeStackPointer(void); +static sqInt frameOffsetOfPreviousNativeStackPointer(void); +static sqInt NoDbgRegParms frameOffsetOfTemporary(sqInt index); +static AbstractInstruction * NoDbgRegParms genDoubleFailIfZeroArgRcvrarg(int rcvrReg, int argReg); +static sqInt genExtendedSendBytecode(void); +static sqInt genExtendedSuperBytecode(void); +static sqInt genExtJumpIfFalse(void); +static sqInt genExtJumpIfNotInstanceOfBehaviorsBytecode(void); +static sqInt genExtJumpIfTrue(void); +static sqInt genExtNopBytecode(void); +static sqInt genExtPushCharacterBytecode(void); +static sqInt genExtPushIntegerBytecode(void); +static sqInt genExtPushLiteralBytecode(void); +static sqInt genExtPushLitVarDirSupBytecode(void); +static sqInt genExtPushPseudoVariable(void); +static sqInt genExtPushReceiverVariableBytecode(void); +static sqInt genExtSendBytecode(void); +static sqInt genExtSendSuperBytecode(void); +static sqInt genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtStoreRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtUnconditionalJump(void); +static sqInt genFastPrimFail(void); +static void NoDbgRegParms genFastPrimTraceUsingand(sqInt r1, sqInt r2); +static sqInt genLongJumpIfFalse(void); +static sqInt genLongJumpIfTrue(void); +static sqInt genLongPushTemporaryVariableBytecode(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); +static sqInt genLongStoreTemporaryVariableBytecode(void); +static sqInt genLongUnconditionalBackwardJump(void); +static sqInt genLongUnconditionalForwardJump(void); +static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg); +static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName); +static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling); +static sqInt genPushClosureTempsBytecode(void); +static sqInt genPushConstantFalseBytecode(void); +static sqInt genPushConstantNilBytecode(void); +static sqInt genPushConstantOneBytecode(void); +static sqInt genPushConstantTrueBytecode(void); +static sqInt genPushConstantZeroBytecode(void); +static sqInt genPushLiteralConstantBytecode(void); +static sqInt NoDbgRegParms genPushLiteralIndex(sqInt literalIndex); +static sqInt genPushLiteralVariableBytecode(void); +static sqInt genPushLitVarDirSup16CasesBytecode(void); +static sqInt genPushQuickIntegerConstantBytecode(void); +static sqInt genPushReceiverVariableBytecode(void); +static sqInt genPushTemporaryVariableBytecode(void); +extern sqInt genQuickReturnConst(void); +extern sqInt genQuickReturnInstVar(void); +extern sqInt genQuickReturnSelf(void); +static sqInt genReturnFalse(void); +static sqInt genReturnNil(void); +static sqInt genReturnNilFromBlock(void); +static sqInt genReturnTrue(void); +static sqInt genSecondExtendedSendBytecode(void); +static sqInt genSendLiteralSelector0ArgsBytecode(void); +static sqInt genSendLiteralSelector1ArgBytecode(void); +static sqInt genSendLiteralSelector2ArgsBytecode(void); +static sqInt genShortJumpIfFalse(void); +static sqInt genShortJumpIfTrue(void); +static sqInt genShortUnconditionalJump(void); +static sqInt genSistaExtStoreAndPopLiteralVariableBytecode(void); +static sqInt genSistaExtStoreAndPopReceiverVariableBytecode(void); +static sqInt genSistaExtStoreLiteralVariableBytecode(void); +static sqInt genSistaExtStoreReceiverVariableBytecode(void); +static sqInt genSpecialSelectorEqualsEquals(void); +static sqInt genSpecialSelectorNotEqualsEquals(void); +static sqInt genSpecialSelectorSend(void); +static sqInt genStoreAndPopReceiverVariableBytecode(void); +static sqInt genStoreAndPopRemoteTempLongBytecode(void); +static sqInt genStoreAndPopTemporaryVariableBytecode(void); +static sqInt genStoreRemoteTempLongBytecode(void); +static sqInt genUnconditionalTrapBytecode(void); +static void NoDbgRegParms loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg); +static void NoDbgRegParms loadNativeFramePointerInto(sqInt reg); +static void NoDbgRegParms loadNativeLocalAddressto(sqInt baseOffset, sqInt reg); +extern sqInt mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj); +static void maybeCompileAllocFillerCheck(void); +static sqInt numSpecialSelectors(void); +static usqInt NoDbgRegParms pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod); +static sqInt NoDbgRegParms pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg); +static PrimitiveDescriptor * primitiveGeneratorOrNil(void); +extern void recordCallOffsetIn(CogMethod *cogMethod); +extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)); +static sqInt NoDbgRegParms v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +extern void voidCogCompiledCode(void); +static BlockStart * NoDbgRegParms addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span); +static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs); +static sqInt NoDbgRegParms allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask); +static sqInt NoDbgRegParms allocateRegNotConflictingWith(sqInt regMask); +static sqInt NoDbgRegParms anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n); +static void NoDbgRegParms beginHighLevelCall(sqInt alignment); +extern void callCogCodePopReceiverArg0Regs(void); +extern void callCogCodePopReceiverArg1Arg0Regs(void); +static sqInt callSwitchToCStack(void); +static void callSwitchToSmalltalkStack(void); +static sqInt NoDbgRegParms compileAbstractInstructionsFromthrough(sqInt start, sqInt end); +static sqInt compileBlockBodies(void); +static void NoDbgRegParms compileBlockFrameBuild(BlockStart *blockStart); +static void NoDbgRegParms compileBlockFramelessEntry(BlockStart *blockStart); +static CogMethod * NoDbgRegParms compileCogFullBlockMethod(sqInt numCopied); +static CogMethod * NoDbgRegParms compileCogMethod(sqInt selector); +static sqInt compileEntireMethod(void); +static void compileFrameBuild(void); +static void NoDbgRegParms compileFullBlockFramelessEntry(sqInt numCopied); +static void NoDbgRegParms compileFullBlockMethodFrameBuild(sqInt numCopied); +#if IMMUTABILITY +static void compileTwoPathFrameBuild(void); +#endif /* IMMUTABILITY */ +static void compileTwoPathFramelessInit(void); +static sqInt NoDbgRegParms cPICMissTrampolineFor(sqInt numArgs); +static sqInt doubleExtendedDoAnythingBytecode(void); +static sqInt duplicateTopBytecode(void); +static void endHighLevelCallWithCleanup(void); +static void endHighLevelCallWithoutCleanup(void); +static BytecodeFixup * NoDbgRegParms ensureFixupAt(sqInt targetIndex); +static BytecodeFixup * NoDbgRegParms ensureNonMergeFixupAt(sqInt targetIndex); +static void ensureReceiverResultRegContainsSelf(void); +static void NoDbgRegParms evaluateat(BytecodeDescriptor *descriptor, sqInt pc); +static sqInt NoDbgRegParms freeAnyRegNotConflictingWith(sqInt regMask); +static sqInt genBlockReturn(void); +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) ; +static sqInt genCallPrimitiveBytecode(void); +static sqInt genExternalizePointersForPrimitiveCall(void); +static sqInt genExtPushClosureBytecode(void); +static sqInt genExtPushFullClosureBytecode(void); +static sqInt genExtPushRemoteTempOrInstVarLongBytecode(void); +static sqInt NoDbgRegParms genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean); +static void generateEnilopmarts(void); +static void generateMissAbortTrampolines(void); +static void generateSendTrampolines(void); +static void generateTracingTrampolines(void); +static sqInt NoDbgRegParms genForwardersInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot); +static sqInt NoDbgRegParms genInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genJumpBackTo(sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpIfto(sqInt boolean, sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpTo(sqInt targetBytecodePC); +static void NoDbgRegParms genLoadTempin(sqInt objectIndex, sqInt destReg); +static sqInt genLowcodeAdd32(void); +static sqInt genLowcodeAdd64(void); +static sqInt genLowcodeAlloca32(void); +static sqInt genLowcodeAlloca64(void); +static sqInt genLowcodeAnd32(void); +static sqInt genLowcodeAnd64(void); +static sqInt genLowcodeArithmeticRightShift32(void); +static sqInt genLowcodeArithmeticRightShift64(void); +static sqInt genLowcodeBeginCall(void); +static sqInt NoDbgRegParms genLowcodeBinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeBoolean32ToOop(void); +static sqInt genLowcodeBoolean64ToOop(void); +static sqInt genLowcodeByteSizeOf(void); +static sqInt genLowcodeCallArgumentFloat32(void); +static sqInt genLowcodeCallArgumentFloat64(void); +static sqInt genLowcodeCallArgumentInt32(void); +static sqInt genLowcodeCallArgumentInt64(void); +static sqInt genLowcodeCallArgumentPointer(void); +static sqInt genLowcodeCallArgumentSpace(void); +static sqInt genLowcodeCallArgumentStructure(void); +static sqInt genLowcodeCallInstruction(void); +static sqInt genLowcodeCallPhysical(void); +static sqInt genLowcodeCheckSessionIdentifier(void); +static sqInt genLowcodeCompareAndSwap32(void); +static sqInt genLowcodeDiv32(void); +static sqInt genLowcodeDiv64(void); +static sqInt genLowcodeDuplicateFloat32(void); +static sqInt genLowcodeDuplicateFloat64(void); +static sqInt genLowcodeDuplicateInt32(void); +static sqInt genLowcodeDuplicateInt64(void); +static sqInt genLowcodeDuplicatePointer(void); +static sqInt genLowcodeEffectiveAddress32(void); +static sqInt genLowcodeEffectiveAddress64(void); +static sqInt genLowcodeEndCall(void); +static sqInt genLowcodeEndCallNoCleanup(void); +static sqInt genLowcodeFirstFieldPointer(void); +static sqInt genLowcodeFirstIndexableFieldPointer(void); +static sqInt genLowcodeFloat32Add(void); +static sqInt genLowcodeFloat32Div(void); +static sqInt genLowcodeFloat32Equal(void); +static sqInt genLowcodeFloat32Great(void); +static sqInt genLowcodeFloat32GreatEqual(void); +static sqInt genLowcodeFloat32Less(void); +static sqInt genLowcodeFloat32LessEqual(void); +static sqInt genLowcodeFloat32Mul(void); +static sqInt genLowcodeFloat32Neg(void); +static sqInt genLowcodeFloat32NotEqual(void); +static sqInt genLowcodeFloat32Sqrt(void); +static sqInt genLowcodeFloat32Sub(void); +static sqInt genLowcodeFloat32ToFloat64(void); +static sqInt genLowcodeFloat32ToInt32(void); +static sqInt genLowcodeFloat32ToInt64(void); +static sqInt genLowcodeFloat32ToOop(void); +static sqInt genLowcodeFloat32ToUInt32(void); +static sqInt genLowcodeFloat32ToUInt64(void); +static sqInt genLowcodeFloat64Add(void); +static sqInt genLowcodeFloat64Div(void); +static sqInt genLowcodeFloat64Equal(void); +static sqInt genLowcodeFloat64Great(void); +static sqInt genLowcodeFloat64GreatEqual(void); +static sqInt genLowcodeFloat64Less(void); +static sqInt genLowcodeFloat64LessEqual(void); +static sqInt genLowcodeFloat64Mul(void); +static sqInt genLowcodeFloat64Neg(void); +static sqInt genLowcodeFloat64NotEqual(void); +static sqInt genLowcodeFloat64Sqrt(void); +static sqInt genLowcodeFloat64Sub(void); +static sqInt genLowcodeFloat64ToFloat32(void); +static sqInt genLowcodeFloat64ToInt32(void); +static sqInt genLowcodeFloat64ToInt64(void); +static sqInt genLowcodeFloat64ToOop(void); +static sqInt genLowcodeFloat64ToUInt32(void); +static sqInt genLowcodeFloat64ToUInt64(void); +static sqInt genLowcodeFree(void); +static sqInt genLowcodeInstantiateIndexable32Oop(void); +static sqInt genLowcodeInstantiateIndexableOop(void); +static sqInt genLowcodeInstantiateOop(void); +static sqInt genLowcodeInt32Equal(void); +static sqInt genLowcodeInt32Great(void); +static sqInt genLowcodeInt32GreatEqual(void); +static sqInt genLowcodeInt32Less(void); +static sqInt genLowcodeInt32LessEqual(void); +static sqInt genLowcodeInt32NotEqual(void); +static sqInt genLowcodeInt32ToFloat32(void); +static sqInt genLowcodeInt32ToFloat64(void); +static sqInt genLowcodeInt32ToOop(void); +static sqInt genLowcodeInt32ToPointer(void); +static sqInt genLowcodeInt64Equal(void); +static sqInt genLowcodeInt64Great(void); +static sqInt genLowcodeInt64GreatEqual(void); +static sqInt genLowcodeInt64Less(void); +static sqInt genLowcodeInt64LessEqual(void); +static sqInt genLowcodeInt64NotEqual(void); +static sqInt genLowcodeInt64ToFloat32(void); +static sqInt genLowcodeInt64ToFloat64(void); +static sqInt genLowcodeInt64ToOop(void); +static sqInt genLowcodeInt64ToPointer(void); +static sqInt genLowcodeIsBytes(void); +static sqInt genLowcodeIsFloatObject(void); +static sqInt genLowcodeIsIndexable(void); +static sqInt genLowcodeIsIntegerObject(void); +static sqInt genLowcodeIsPointers(void); +static sqInt genLowcodeIsWords(void); +static sqInt genLowcodeIsWordsOrBytes(void); +static sqInt genLowcodeLeftShift32(void); +static sqInt genLowcodeLeftShift64(void); +static sqInt genLowcodeLoadArgumentAddress(void); +static sqInt genLowcodeLoadArgumentFloat32(void); +static sqInt genLowcodeLoadArgumentFloat64(void); +static sqInt genLowcodeLoadArgumentInt16(void); +static sqInt genLowcodeLoadArgumentInt32(void); +static sqInt genLowcodeLoadArgumentInt64(void); +static sqInt genLowcodeLoadArgumentInt8(void); +static sqInt genLowcodeLoadArgumentPointer(void); +static sqInt genLowcodeLoadArgumentUInt16(void); +static sqInt genLowcodeLoadArgumentUInt32(void); +static sqInt genLowcodeLoadArgumentUInt64(void); +static sqInt genLowcodeLoadArgumentUInt8(void); +static sqInt genLowcodeLoadFloat32FromMemory(void); +static sqInt genLowcodeLoadFloat64FromMemory(void); +static sqInt genLowcodeLoadInt16FromMemory(void); +static sqInt genLowcodeLoadInt32FromMemory(void); +static sqInt genLowcodeLoadInt64FromMemory(void); +static sqInt genLowcodeLoadInt8FromMemory(void); +static sqInt genLowcodeLoadLocalAddress(void); +static sqInt genLowcodeLoadLocalFloat32(void); +static sqInt genLowcodeLoadLocalFloat64(void); +static sqInt genLowcodeLoadLocalInt16(void); +static sqInt genLowcodeLoadLocalInt32(void); +static sqInt genLowcodeLoadLocalInt64(void); +static sqInt genLowcodeLoadLocalInt8(void); +static sqInt genLowcodeLoadLocalPointer(void); +static sqInt genLowcodeLoadLocalUInt16(void); +static sqInt genLowcodeLoadLocalUInt32(void); +static sqInt genLowcodeLoadLocalUInt64(void); +static sqInt genLowcodeLoadLocalUInt8(void); +static sqInt genLowcodeLoadObjectAt(void); +static sqInt genLowcodeLoadObjectField(void); +static sqInt genLowcodeLoadPointerFromMemory(void); +static sqInt genLowcodeLoadUInt16FromMemory(void); +static sqInt genLowcodeLoadUInt32FromMemory(void); +static sqInt genLowcodeLoadUInt64FromMemory(void); +static sqInt genLowcodeLoadUInt8FromMemory(void); +static sqInt genLowcodeLocalFrameSize(void); +static sqInt genLowcodeLockRegisters(void); +static sqInt genLowcodeLockVM(void); +static sqInt genLowcodeMalloc32(void); +static sqInt genLowcodeMalloc64(void); +static sqInt genLowcodeMemcpy32(void); +static sqInt genLowcodeMemcpy64(void); +static sqInt genLowcodeMemcpyFixed(void); +static sqInt genLowcodeMoveFloat32ToPhysical(void); +static sqInt genLowcodeMoveFloat64ToPhysical(void); +static sqInt genLowcodeMoveInt32ToPhysical(void); +static sqInt genLowcodeMoveInt64ToPhysical(void); +static sqInt genLowcodeMovePointerToPhysical(void); +static sqInt genLowcodeMul32(void); +static sqInt genLowcodeMul64(void); +static sqInt genLowcodeNeg32(void); +static sqInt genLowcodeNeg64(void); +static sqInt genLowcodeNot32(void); +static sqInt genLowcodeNot64(void); +static sqInt NoDbgRegParms genLowcodeNullaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeOopEqual(void); +static sqInt genLowcodeOopNotEqual(void); +static sqInt genLowcodeOopSmallIntegerToInt32(void); +static sqInt genLowcodeOopSmallIntegerToInt64(void); +static sqInt genLowcodeOopToBoolean32(void); +static sqInt genLowcodeOopToBoolean64(void); +static sqInt genLowcodeOopToFloat32(void); +static sqInt genLowcodeOopToFloat64(void); +static sqInt genLowcodeOopToInt32(void); +static sqInt genLowcodeOopToInt64(void); +static sqInt genLowcodeOopToPointer(void); +static sqInt genLowcodeOopToPointerReinterpret(void); +static sqInt genLowcodeOopToUInt32(void); +static sqInt genLowcodeOopToUInt64(void); +static sqInt genLowcodeOr32(void); +static sqInt genLowcodeOr64(void); +static sqInt genLowcodePerformCallFloat32(void); +static sqInt genLowcodePerformCallFloat64(void); +static sqInt genLowcodePerformCallIndirectFloat32(void); +static sqInt genLowcodePerformCallIndirectFloat64(void); +static sqInt genLowcodePerformCallIndirectInt32(void); +static sqInt genLowcodePerformCallIndirectInt64(void); +static sqInt genLowcodePerformCallIndirectPointer(void); +static sqInt genLowcodePerformCallIndirectStructure(void); +static sqInt genLowcodePerformCallIndirectVoid(void); +static sqInt genLowcodePerformCallInt32(void); +static sqInt genLowcodePerformCallInt64(void); +static sqInt genLowcodePerformCallPointer(void); +static sqInt genLowcodePerformCallStructure(void); +static sqInt genLowcodePerformCallVoid(void); +static sqInt genLowcodePin(void); +static sqInt genLowcodePlaftormCode(void); +static sqInt genLowcodePointerAddConstantOffset(void); +static sqInt genLowcodePointerAddOffset32(void); +static sqInt genLowcodePointerAddOffset64(void); +static sqInt genLowcodePointerEqual(void); +static sqInt genLowcodePointerNotEqual(void); +static sqInt genLowcodePointerToInt32(void); +static sqInt genLowcodePointerToInt64(void); +static sqInt genLowcodePointerToOop(void); +static sqInt genLowcodePointerToOopReinterprer(void); +static sqInt genLowcodePopFloat32(void); +static sqInt genLowcodePopFloat64(void); +static sqInt genLowcodePopInt32(void); +static sqInt genLowcodePopInt64(void); +static sqInt genLowcodePopMultipleNative(void); +static sqInt genLowcodePopPointer(void); +static sqInt genLowcodePushConstantUInt32(void); +static sqInt genLowcodePushConstantUInt64(void); +static sqInt genLowcodePushNullPointer(void); +static sqInt genLowcodePushOne32(void); +static sqInt genLowcodePushOne64(void); +static sqInt genLowcodePushOneFloat32(void); +static sqInt genLowcodePushOneFloat64(void); +static sqInt genLowcodePushPhysicalFloat32(void); +static sqInt genLowcodePushPhysicalFloat64(void); +static sqInt genLowcodePushPhysicalInt32(void); +static sqInt genLowcodePushPhysicalInt64(void); +static sqInt genLowcodePushPhysicalPointer(void); +static sqInt genLowcodePushSessionIdentifier(void); +static sqInt genLowcodePushZero32(void); +static sqInt genLowcodePushZero64(void); +static sqInt genLowcodePushZeroFloat32(void); +static sqInt genLowcodePushZeroFloat64(void); +static sqInt genLowcodeRem32(void); +static sqInt genLowcodeRem64(void); +static sqInt genLowcodeRightShift32(void); +static sqInt genLowcodeRightShift64(void); +static sqInt genLowcodeSignExtend32From16(void); +static sqInt genLowcodeSignExtend32From8(void); +static sqInt genLowcodeSignExtend64From16(void); +static sqInt genLowcodeSignExtend64From32(void); +static sqInt genLowcodeSignExtend64From8(void); +static sqInt genLowcodeSmallInt32ToOop(void); +static sqInt genLowcodeStoreFloat32ToMemory(void); +static sqInt genLowcodeStoreFloat64ToMemory(void); +static sqInt genLowcodeStoreInt16ToMemory(void); +static sqInt genLowcodeStoreInt32ToMemory(void); +static sqInt genLowcodeStoreInt64ToMemory(void); +static sqInt genLowcodeStoreInt8ToMemory(void); +static sqInt genLowcodeStoreLocalFloat32(void); +static sqInt genLowcodeStoreLocalFloat64(void); +static sqInt genLowcodeStoreLocalInt16(void); +static sqInt genLowcodeStoreLocalInt32(void); +static sqInt genLowcodeStoreLocalInt64(void); +static sqInt genLowcodeStoreLocalInt8(void); +static sqInt genLowcodeStoreLocalPointer(void); +static sqInt genLowcodeStoreObjectField(void); +static sqInt genLowcodeStoreObjectFieldAt(void); +static sqInt genLowcodeStorePointerToMemory(void); +static sqInt genLowcodeSub32(void); +static sqInt genLowcodeSub64(void); +static sqInt NoDbgRegParms genLowcodeTrinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeTruncate32To16(void); +static sqInt genLowcodeTruncate32To8(void); +static sqInt genLowcodeTruncate64To16(void); +static sqInt genLowcodeTruncate64To32(void); +static sqInt genLowcodeTruncate64To8(void); +static sqInt genLowcodeUdiv32(void); +static sqInt genLowcodeUdiv64(void); +static sqInt genLowcodeUint32Great(void); +static sqInt genLowcodeUint32GreatEqual(void); +static sqInt genLowcodeUint32Less(void); +static sqInt genLowcodeUint32LessEqual(void); +static sqInt genLowcodeUint32ToFloat32(void); +static sqInt genLowcodeUint32ToFloat64(void); +static sqInt genLowcodeUint32ToOop(void); +static sqInt genLowcodeUint64Great(void); +static sqInt genLowcodeUint64GreatEqual(void); +static sqInt genLowcodeUint64Less(void); +static sqInt genLowcodeUint64LessEqual(void); +static sqInt genLowcodeUint64ToFloat32(void); +static sqInt genLowcodeUint64ToFloat64(void); +static sqInt genLowcodeUint64ToOop(void); +static sqInt genLowcodeUmul32(void); +static sqInt genLowcodeUmul64(void); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive2(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive3(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive4(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive5(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeUnlockVM(void); +static sqInt genLowcodeUnpin(void); +static sqInt genLowcodeUrem32(void); +static sqInt genLowcodeUrem64(void); +static sqInt genLowcodeXor32(void); +static sqInt genLowcodeXor64(void); +static sqInt genLowcodeZeroExtend32From16(void); +static sqInt genLowcodeZeroExtend32From8(void); +static sqInt genLowcodeZeroExtend64From16(void); +static sqInt genLowcodeZeroExtend64From32(void); +static sqInt genLowcodeZeroExtend64From8(void); +static sqInt NoDbgRegParms genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable); +static sqInt NoDbgRegParms genMethodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICMissTrampolineFor(sqInt numArgs); +static sqInt genPopStackBytecode(void); +static sqInt genPrimitiveClosureValue(void); +static sqInt genPrimitiveFullClosureValue(void); +static sqInt genPrimitivePerform(void); +static sqInt genPushActiveContextBytecode(void); +static sqInt genPushClosureCopyCopiedValuesBytecode(void); +static sqInt NoDbgRegParms genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteralVariable(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteral(sqInt literal); +static sqInt NoDbgRegParms genPushMaybeContextReceiverVariable(sqInt slotIndex); +static sqInt NoDbgRegParms genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index); +static sqInt genPushNewArrayBytecode(void); +static sqInt genPushReceiverBytecode(void); +static sqInt NoDbgRegParms genPushReceiverVariable(sqInt index); +static void genPushRegisterArgs(void); +static sqInt NoDbgRegParms genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex); +static sqInt genPushRemoteTempLongBytecode(void); +static sqInt NoDbgRegParms genPushTemporaryVariable(sqInt index); +static sqInt genReturnReceiver(void); +static sqInt genReturnTopFromBlock(void); +static sqInt genReturnTopFromMethod(void); +static sqInt NoDbgRegParms genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs); +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 genSpecialSelectorArithmetic(void); +static sqInt genSpecialSelectorClass(void); +static sqInt genSpecialSelectorComparison(void); +static sqInt genStaticallyResolvedSpecialSelectorComparison(void); +static sqInt NoDbgRegParms genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex); +static sqInt genUpArrowReturn(void); +static BytecodeFixup * NoDbgRegParms initializeFixupAt(sqInt targetIndex); +static void NoDbgRegParms initSimStackForFramefulMethod(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessBlock(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessMethod(sqInt startpc); +static void leaveNativeFrame(void); +static sqInt liveFloatRegisters(void); +static sqInt liveRegisters(void); +static sqInt NoDbgRegParms mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor); +static void NoDbgRegParms marshallSendArguments(sqInt numArgs); +static sqInt maybeCompilingFirstPassOfBlockWithInitialPushNil(void); +static sqInt NoDbgRegParms mergeWithFixupIfRequired(BytecodeFixup *fixup); +static sqInt NoDbgRegParms methodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms needsFrameIfMod16GENumArgs(sqInt stackDelta); +static sqInt NoDbgRegParms needsFrameIfStackGreaterThanOne(sqInt stackDelta); +static sqInt NoDbgRegParms numberOfSpillsInTopNItems(sqInt n); +static sqInt NoDbgRegParms picAbortTrampolineFor(sqInt numArgs); +static sqInt prevInstIsPCAnnotated(void); +static sqInt NoDbgRegParms pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static void NoDbgRegParms reinitializeFixupsFromthrough(sqInt start, sqInt end); +static sqInt NoDbgRegParms scanBlock(BlockStart *blockStart); +static sqInt scanMethod(void); +static sqInt NoDbgRegParms squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static sqInt NoDbgRegParms squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static void NoDbgRegParms ssAllocateCallReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3); +static void NoDbgRegParms ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredFloatReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr); +static void ssFlushAll(void); +static void NoDbgRegParms ssFlushTo(sqInt index); +static void NoDbgRegParms ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex); +static void NoDbgRegParms ssFlushUpThroughReceiverVariable(sqInt slotIndex); +static void NoDbgRegParms ssFlushUpThroughTemporaryVariable(sqInt tempIndex); +static void NoDbgRegParms ssNativeFlushTo(sqInt index); +static void NoDbgRegParms ssNativePop(sqInt n); +static void NoDbgRegParms ssNativePush(sqInt n); +static CogSimStackNativeEntry * ssNativeTop(void); +static void NoDbgRegParms ssPopNativeSize(sqInt popSize); +static void NoDbgRegParms ssPop(sqInt n); +static sqInt NoDbgRegParms ssPushAnnotatedConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushBaseoffset(sqInt reg, sqInt offset); +static sqInt NoDbgRegParms ssPushConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushDesc(SimStackEntry simStackEntry); +static sqInt NoDbgRegParms ssPushNativeConstantFloat32(float aFloat32); +static sqInt NoDbgRegParms ssPushNativeConstantFloat64(double aFloat64); +static sqInt NoDbgRegParms ssPushNativeConstantInt32(sqInt anInt32); +static sqInt NoDbgRegParms ssPushNativeConstantInt64(sqLong anInt64); +static sqInt NoDbgRegParms ssPushNativeConstantPointer(sqInt aNativePointer); +static sqInt NoDbgRegParms ssPushNativeRegisterDoubleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegisterSingleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegister(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg); +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); +static SimStackEntry ssTopDescriptor(void); +static CogSimStackEntry * NoDbgRegParms ssValue(sqInt n); +static sqInt NoDbgRegParms tryCollapseTempVectorInitializationOfSize(sqInt slots); +static void updateSimSpillBase(void); +static void voidReceiverResultRegContainsSelf(void); + + +/*** Variables ***/ +static AbstractInstruction * abstractOpcodes; +static AbstractInstruction aMethodLabel; +static AbstractInstruction * const backEnd = &aMethodLabel; +static usqInt baseAddress; +static sqInt blockCount; +static AbstractInstruction * blockEntryLabel; +static AbstractInstruction * blockEntryNoContextSwitch; +sqInt blockNoContextSwitchOffset; +static sqInt blockPass; +static BlockStart * blockStarts; +static sqInt breakBlock; +static sqInt breakMethod; +sqInt breakPC; +static sqInt byte0; +static sqInt byte1; +static sqInt byte2; +static sqInt byte3; +static sqInt bytecodePC; +static sqInt bytecodeSetOffset; +void * CFramePointer; +void * CStackPointer; +sqInt cbEntryOffset; +sqInt cbNoSwitchEntryOffset; +sqInt ceBaseFrameReturnTrampoline; +static sqInt ceByteSizeOfTrampoline; +void (*ceCall0ArgsPIC)(void); +void (*ceCall1ArgsPIC)(void); +void (*ceCall2ArgsPIC)(void); +void (*ceCallCogCodePopReceiverAndClassRegs)(void); +void (*ceCallCogCodePopReceiverArg0Regs)(void); +void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void); +void (*ceCallCogCodePopReceiverReg)(void); +sqInt ceCannotResumeTrampoline; +void (*ceCaptureCStackPointers)(void); +static usqIntptr_t (*ceCheckFeaturesFunction)(void); +sqInt ceCheckForInterruptTrampoline; +static sqInt ceCPICMissTrampoline; +void (*ceEnterCogCodePopReceiverReg)(void); +static sqInt ceFetchContextInstVarTrampoline; +static sqInt ceFFICalloutTrampoline; +static sqInt ceFloatObjectOfTrampoline; +static sqInt ceFloatValueOfTrampoline; +static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to); +static sqInt ceFreeTrampoline; +usqIntptr_t (*ceGetFP)(void); +usqIntptr_t (*ceGetSP)(void); +static sqInt ceInstantiateClassIndexableSizeTrampoline; +static sqInt ceInstantiateClassTrampoline; +static sqInt ceLargeActiveContextInBlockTrampoline; +static sqInt ceLargeActiveContextInFullBlockTrampoline; +static sqInt ceLargeActiveContextInMethodTrampoline; +static sqInt ceMallocTrampoline; +static sqInt ceMethodAbortTrampoline; +static sqInt ceNonLocalReturnTrampoline; +static sqInt cePICAbortTrampoline; +static sqInt cePositive32BitIntegerTrampoline; +static sqInt cePositive32BitValueOfTrampoline; +static sqInt cePositive64BitIntegerTrampoline; +static sqInt cePositive64BitValueOfTrampoline; +static sqInt cePrimReturnEnterCogCode; +static sqInt cePrimReturnEnterCogCodeProfiling; +sqInt ceReturnToInterpreterTrampoline; +static sqInt ceScheduleScavengeTrampoline; +static sqInt ceSendMustBeBooleanAddFalseTrampoline; +static sqInt ceSendMustBeBooleanAddTrueTrampoline; +static sqInt ceSigned32BitIntegerTrampoline; +static sqInt ceSigned32BitValueOfTrampoline; +static sqInt ceSigned64BitIntegerTrampoline; +static sqInt ceSigned64BitValueOfTrampoline; +static sqInt ceSmallActiveContextInBlockTrampoline; +static sqInt ceSmallActiveContextInFullBlockTrampoline; +static sqInt ceSmallActiveContextInMethodTrampoline; +static sqInt ceStoreCheckContextReceiverTrampoline; +static sqInt ceStoreCheckTrampoline; +static sqInt ceStoreContextInstVarTrampoline; +#if IMMUTABILITY +sqInt ceStoreTrampolines[5]; +#endif +static sqInt ceTraceBlockActivationTrampoline; +static sqInt ceTraceLinkedSendTrampoline; +static sqInt ceTraceStoreTrampoline; +usqIntptr_t (*ceTryLockVMOwner)(void); +void (*ceUnlockVMOwner)(void); +sqInt cFramePointerInUse; +static sqInt checkedEntryAlignment; +static sqInt closedPICSize; +sqInt cmEntryOffset; +sqInt cmNoCheckEntryOffset; +static sqInt codeBase; +static sqInt codeModified; +static sqInt compilationTrace; +static sqInt cPICCaseSize; +static sqInt cPICEndOfCodeOffset; +static sqInt cPICEndSize; +static sqInt cPICPrototype; +static const int cStackAlignment = STACK_ALIGN_BYTES; +static sqInt currentCallCleanUpSize; +static sqInt deadCode; +static sqInt debugBytecodePointers; +static sqInt debugFixupBreaks; +static sqInt debugOpcodeIndices; +usqIntptr_t debugPrimCallStackOffset; +static sqInt debugStackPointers; +static sqInt directedSuperSendTrampolines[NumSendTrampolines]; +static sqInt disassemblingMethod; +static AbstractInstruction * endCPICCase0; +static sqInt endPC; +static AbstractInstruction * entry; +static sqInt entryPointMask; +static CogMethod * enumeratingCogMethod; +static sqInt expectedFPAlignment; +static sqInt expectedSPAlignment; +static sqInt extA; +static sqInt extB; +static sqInt externalPrimCallOffsets[MaxNumArgs + 1]; +static sqInt externalPrimJumpOffsets[MaxNumArgs + 1]; +static sqInt externalSetPrimOffsets[MaxNumArgs + 1]; +static sqInt firstCPICCaseOffset; +static sqInt firstSend; +static BytecodeFixup * fixups; +static AbstractInstruction * fullBlockEntry; +static AbstractInstruction * fullBlockNoContextSwitchEntry; +static BytecodeDescriptor generatorTable[512] = { + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extendedPushBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { extendedStoreBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { extendedStoreAndPopBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { doubleExtendedDoAnythingBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtendedSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, + { genSecondExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushActiveContextBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushClosureCopyCopiedValuesBytecode, v3BlockCodeSize, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantZeroBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantOneBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushPseudoVariable, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNilFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genExtNopBytecode, 0, needsFrameNever, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genUnconditionalTrapBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extABytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extBBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtPushReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genExtPushLitVarDirSupBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushLiteralBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongPushTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushIntegerBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushCharacterBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtSendSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtUnconditionalJump, v4LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfTrue, v4LongBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfFalse, v4LongBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSistaExtStoreAndPopReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreAndPopLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSistaExtStoreReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushFullClosureBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushClosureBytecode, v4BlockCodeSize, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genExtPushRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtStoreRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtStoreAndPopRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtJumpIfNotInstanceOfBehaviorsBytecode, v4LongBranchIfNotInstanceOfDistance, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 } +}; +static sqInt guardPageSize; +static sqInt hasNativeFrame; +static sqInt hasYoungReferent; +static sqInt inBlock; +static sqInt initialPC; +static sqInt introspectionData; +static sqInt introspectionDataIndex; +static int labelCounter; +static sqInt lastSend; +static usqInt limitAddress; +static sqInt maxCPICCases; +static sqInt maxLitIndex; +static sqInt methodAbortTrampolines[4]; +static sqInt methodBytesFreedSinceLastCompaction; +static sqInt methodCount; +static sqInt methodHeader; +static AbstractInstruction * const methodLabel = &aMethodLabel; +static sqInt methodObj; +static sqInt methodOrBlockNumArgs; +static sqInt methodOrBlockNumTemps; +static sqInt methodZoneBase; +static usqIntptr_t minValidCallAddress; +sqInt missOffset; +static usqInt mzFreeStart; +static sqInt needsFrame; +static AbstractInstruction * noCheckEntry; +static sqInt numAbstractOpcodes; +static sqInt numExtB; +static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; +static sqInt opcodeIndex; +static CogMethod *openPICList = 0; +static sqInt openPICSize; +static CogSSOptStatus optStatus; +static sqInt ordinarySendTrampolines[NumSendTrampolines]; +static sqInt picAbortTrampolines[4]; +static AbstractInstruction * picInterpretAbort; +static sqInt picMissTrampolines[4]; +static void (*postCompileHook)(CogMethod *); +static BytecodeDescriptor * prevBCDescriptor; +static AbstractInstruction * primInvokeInstruction; +static sqInt primitiveIndex; +static AbstractInstruction * primSetFunctionLabel; +void (*realCECallCogCodePopReceiverAndClassRegs)(void); +void (*realCECallCogCodePopReceiverArg0Regs)(void); +void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void); +void (*realCECallCogCodePopReceiverReg)(void); +void (*realCEEnterCogCodePopReceiverReg)(void); +static sqInt regArgsHaveBeenPushed; +static sqInt runtimeObjectRefIndex; +static AbstractInstruction * sendMiss; +static sqInt simNativeSpillBase; +static CogSimStackNativeEntry simNativeStack[19]; +static sqInt simNativeStackPtr; +static sqInt simNativeStackSize; +static CogSimStackEntry simSelf; +static sqInt simSpillBase; +static SimStackEntry simStack[70]; +static sqInt simStackPtr; +static AbstractInstruction * stackCheckLabel; +static AbstractInstruction * stackOverflowCall; +static sqInt superSendTrampolines[NumSendTrampolines]; +static sqInt tempOop; +int traceFlags = 8 /* prim trace log on by default */; +sqInt traceStores; +static char *trampolineAddresses[NumTrampolines*2]; +static sqInt trampolineTableIndex; +static sqInt uncheckedEntryAlignment; +static usqInt unpairedMethodList; +static sqInt useTwoPaths; +static usqInt youngReferrers; + + +/*** Macros ***/ +#define cPICNumCases stackCheckOffset +#define cPICNumCasesHack hack hack hack i.e. the getter macro does all the work +#define flushICacheFromto(me,startAddress,endAddress) 0 +#define numberOfSaveableRegisters(self) 6 +#define unalignedLongAt(byteAddress) longAt(byteAddress) +#define unalignedLongAtput(byteAddress,aWord) longAtput(byteAddress,aWord) +#define abstractInstructionAt(index) (&abstractOpcodes[index]) +#define allocateBlockStarts(numBlocks) do { \ + blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \ +} while (0) +#define backEnd() backEnd +#define blockAlignment(self) 8 +#define blockStartAt(index) (&blockStarts[index]) +#define breakOnImplicitReceiver() (traceFlags & 64) +#define ceBaseFrameReturnPC() ceBaseFrameReturnTrampoline +#define ceCannotResumePC() ((usqInt)ceCannotResumeTrampoline) +#define ceCheckFeatures() ceCheckFeaturesFunction() +#define ceReturnToInterpreterPC() ((usqInt)ceReturnToInterpreterTrampoline) +#define cFramePointerAddress() ((usqIntptr_t)&CFramePointer) +#define compileSendTrace() ((traceFlags & 258) == 258) +#define cr() putchar('\n') +#define cStackPointerAddress() ((usqIntptr_t)&CStackPointer) +#define entryOffset() cmEntryOffset +#define generatorAt(index) (&generatorTable[index]) +#define getCFramePointer() CFramePointer +#define getCStackPointer() CStackPointer +#define getIsObjectReference() 2 +#define halt() warning("halt") +#define haltmsg(msg) warning("halt: " msg) +#define interpretOffset() missOffset +#define methodLabel() methodLabel +#define methodZoneBase() methodZoneBase +#define minCallAddress() minValidCallAddress +#define noCheckEntryOffset() cmNoCheckEntryOffset +#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset +#define notYetImplemented() warning("not yet implemented") +#define printNum(n) printf("%ld", (long) n) +#define printOnTrace() (traceFlags & 1) +#define print(aString) printf(aString) +#define recordBlockTrace() (traceFlags & 4) +#define recordEventTrace() (traceFlags & 16) +#define recordOverflowTrace() (traceFlags & 32) +#define recordPrimTrace() (traceFlags & 8) +#define recordSendTrace() (traceFlags & 2) +#define reportError(n) warning("compilation error") +#define setCFramePointer(theFP) (CFramePointer = (void *)(theFP)) +#define setCStackPointer(theSP) (CStackPointer = (void *)(theSP)) +#define tryLockVMOwner() (ceTryLockVMOwner() != 0) +#define unlockVMOwner() ceUnlockVMOwner() +#define nextOpenPIC methodObject +#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work +#define freeStart() mzFreeStart +#define limitZony() ((CogMethod *)mzFreeStart) +#define methodBytesFreedSinceLastCompaction() methodBytesFreedSinceLastCompaction +#define roundUpLength(numBytes) ((numBytes) + 7 & -8) +#define youngReferrers() youngReferrers +#define maybeConstant(sse) ((sse)->constant) +#define fullBlockEntryOffset() cbEntryOffset +#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset +#define fixupAt(index) (&fixups[index]) +#define simNativeStackAt(index) (simNativeStack + (index)) +#define simStackAt(index) (simStack + (index)) +#define traceDescriptor(ign) 0 +#define traceFixup(ign) 0 +#define traceMerge(ign) 0 +#define traceSimStack() 0 +#define traceSpill(ign) 0 +#define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType)) +#define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0])) +#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop)) +#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop)) +#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop)) +#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop)) +#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop)) + + + /* CogAbstractInstruction>>#addDependent: */ +static AbstractInstruction * NoDbgRegParms +addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) +{ + if (!(((self_in_addDependent->dependent)) == null)) { + (anInstruction->dependent = (self_in_addDependent->dependent)); + } + return ((self_in_addDependent->dependent) = anInstruction); +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. */ + + /* CogAbstractInstruction>>#availableFloatRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << DPFPReg0))) { + return DPFPReg0; + } + if (!(liveRegsMask & (1U << DPFPReg1))) { + return DPFPReg1; + } + if (!(liveRegsMask & (1U << DPFPReg2))) { + return DPFPReg2; + } + if (!(liveRegsMask & (1U << DPFPReg3))) { + return DPFPReg3; + } + if (!(liveRegsMask & (1U << DPFPReg4))) { + return DPFPReg4; + } + if (!(liveRegsMask & (1U << DPFPReg5))) { + return DPFPReg5; + } + if (!(liveRegsMask & (1U << DPFPReg6))) { + return DPFPReg6; + } + if (!(liveRegsMask & (1U << DPFPReg7))) { + return DPFPReg7; + } + return NoReg; +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. + N.B. Do /not/ allocate TempReg. */ + + /* CogAbstractInstruction>>#availableRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << Arg1Reg))) { + return Arg1Reg; + } + if (!(liveRegsMask & (1U << Arg0Reg))) { + return Arg0Reg; + } + if (!(liveRegsMask & (1U << SendNumArgsReg))) { + return SendNumArgsReg; + } + if (!(liveRegsMask & (1U << ClassReg))) { + return ClassReg; + } + if (!(liveRegsMask & (1U << ReceiverResultReg))) { + return ReceiverResultReg; + } + return NoReg; +} + + +/* For out-of-line literal support, clone a literal from a literal. */ + + /* CogAbstractInstruction>>#cloneLiteralFrom: */ +static AbstractInstruction * NoDbgRegParms +cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) +{ + assert((((existingLiteral->opcode)) == Literal) + && ((((self_in_cloneLiteralFrom->dependent)) == null) + && (((self_in_cloneLiteralFrom->address)) == null))); + (self_in_cloneLiteralFrom->opcode) = Literal; + (self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation); + ((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]); + ((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]); + ((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]); + return self_in_cloneLiteralFrom; +} + + +/* Generate concrete machine code for the instruction at actualAddress, + setting machineCodeSize, and answer the following address. */ + + /* CogAbstractInstruction>>#concretizeAt: */ +static sqInt NoDbgRegParms +concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress) +{ + (self_in_concretizeAt->address) = actualAddress; + dispatchConcretize(self_in_concretizeAt); + assert((((self_in_concretizeAt->maxSize)) == null) + || (((self_in_concretizeAt->maxSize)) >= ((self_in_concretizeAt->machineCodeSize)))); + return actualAddress + ((self_in_concretizeAt->machineCodeSize)); +} + + /* CogAbstractInstruction>>#genWriteCResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = EAX; + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCResultIntoReg; +} + + /* CogAbstractInstruction>>#genWriteCSecondResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = cResultRegisterHigh(self_in_genWriteCSecondResultIntoReg); + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCSecondResultIntoReg; +} + + +/* Get the target of a jump instruction. Jumps have the target in the first + operand. + */ + + /* CogAbstractInstruction>>#getJmpTarget */ +static AbstractInstruction * NoDbgRegParms +getJmpTarget(AbstractInstruction * self_in_getJmpTarget) +{ + return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0])); +} + + +/* For out-of-line literal support, initialize a sharable literal. */ + + /* CogAbstractInstruction>>#initializeSharableLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) +{ + (self_in_initializeSharableLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeSharableLiteral->annotation) = null; + (self_in_initializeSharableLiteral->address) = null; + (self_in_initializeSharableLiteral->dependent) = null; + ((self_in_initializeSharableLiteral->operands))[0] = literal; + ((self_in_initializeSharableLiteral->operands))[1] = 1; + ((self_in_initializeSharableLiteral->operands))[2] = -1; + return self_in_initializeSharableLiteral; +} + + +/* For out-of-line literal support, initialize an unsharable literal. */ + + /* CogAbstractInstruction>>#initializeUniqueLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) +{ + (self_in_initializeUniqueLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeUniqueLiteral->annotation) = null; + (self_in_initializeUniqueLiteral->address) = null; + (self_in_initializeUniqueLiteral->dependent) = null; + ((self_in_initializeUniqueLiteral->operands))[0] = literal; + ((self_in_initializeUniqueLiteral->operands))[1] = 0; + ((self_in_initializeUniqueLiteral->operands))[2] = -1; + return self_in_initializeUniqueLiteral; +} + + /* CogAbstractInstruction>>#isAFixup: */ +static sqInt NoDbgRegParms +isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) +{ + return addressIsInFixups(fixupOrAddress); +} + + /* CogAbstractInstruction>>#isJump */ +static sqInt NoDbgRegParms +isJump(AbstractInstruction * self_in_isJump) +{ + return ((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump)); +} + + +/* 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 + to answer false + for values in the interpreter or the object memory. */ + + /* CogAbstractInstruction>>#isWithinMwOffsetRange: */ +static sqInt NoDbgRegParms +isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress) +{ + return 1; +} + + +/* 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 usqIntptr_t NoDbgRegParms +labelOffset(AbstractInstruction * self_in_labelOffset) +{ + return ((self_in_labelOffset->operands))[1]; +} + + +/* Answer the constant loaded by the instruction sequence just before this + address: + */ + + /* CogAbstractInstruction>>#literal32BeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress) +{ + return literalBeforeFollowingAddress(self_in_literal32BeforeFollowingAddress, followingAddress); +} + + +/* We assume here that calls and jumps look the same as regards their + displacement. This works on at least x86, ARM and x86_64. Processors on + which that isn't the + case can override as necessary. */ + + /* CogAbstractInstruction>>#relocateJumpLongBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + relocateCallBeforeReturnPCby(self_in_relocateJumpLongBeforeFollowingAddressby, pc, delta); + return self_in_relocateJumpLongBeforeFollowingAddressby; +} + + +/* Relocate a long conditional jump before pc. Default to relocating a + non-conditional jump. + Processors that have different formats for conditional and unconditional + jumps override. */ + + /* CogAbstractInstruction>>#relocateJumpLongConditionalBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + relocateJumpLongBeforeFollowingAddressby(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc, delta); + return self_in_relocateJumpLongConditionalBeforeFollowingAddressby; +} + + /* CogAbstractInstruction>>#resolveJumpTarget */ +static AbstractInstruction * NoDbgRegParms +resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget) +{ + BytecodeFixup *fixup; + + assert(isJump(self_in_resolveJumpTarget)); + fixup = ((BytecodeFixup *) (((self_in_resolveJumpTarget->operands))[0])); + if (isAFixup(self_in_resolveJumpTarget, fixup)) { + assert(addressIsInInstructions((fixup->targetInstruction))); + jmpTarget(self_in_resolveJumpTarget, (fixup->targetInstruction)); + } + return self_in_resolveJumpTarget; +} + + +/* Rewrite a CallFull instruction to call a different target. This variant is + used to rewrite cached primitive calls. + Answer the extent of the code change which is used to compute the range of + the icache to flush. + This defaults to rewriteCallAt:target:; processors that differentiate + between Call and CallFull will override. */ + + /* CogAbstractInstruction>>#rewriteCallFullAt:target: */ +static sqInt NoDbgRegParms +rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteCallAttarget(self_in_rewriteCallFullAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Rewrite a conditional jump long to jump to target. This version defaults + to using + rewriteJumpLongAt:, which works for many ISAs. Subclasses override if + necessary. */ + + /* CogAbstractInstruction>>#rewriteConditionalJumpLongAt:target: */ +static sqInt NoDbgRegParms +rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteJumpLongAttarget(self_in_rewriteConditionalJumpLongAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Rewrite a JumpFull instruction to jump to a different target. This variant + is used to rewrite cached primitive calls. + Answer the extent of the code change which is used to compute the range of + the icache to flush. + This defaults to rewriteJumpLongAt:target:; processors that differentiate + between Jump and JumpFull will override. */ + + /* CogAbstractInstruction>>#rewriteJumpFullAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteJumpLongAttarget(self_in_rewriteJumpFullAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Update an instruction that depends on a label outside + of generated code (e.g. a method or block header). */ + + /* CogAbstractInstruction>>#updateLabel: */ +static AbstractInstruction * NoDbgRegParms +updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction) +{ + assert((((self_in_updateLabel->opcode)) == MoveCwR) + || (((self_in_updateLabel->opcode)) == PushCw)); + ((self_in_updateLabel->operands))[0] = (((labelInstruction->address)) + (labelOffset(labelInstruction))); + return self_in_updateLabel; +} + + +/* A hack hook to allow ARM to override the simulated address for the + short-cut trampolines, + and to allow x64 to address CStackPointer and CFramePointer relative to + VarBaseReg. + */ + + /* CogAbstractInstruction>>#wantsNearAddressFor: */ +static sqInt NoDbgRegParms +wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject) +{ + return 0; +} + + /* CogBlockMethod>>#cmHomeMethod */ +static CogMethod * NoDbgRegParms +cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) +{ + return ((self_in_cmHomeMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) self_in_cmHomeMethod) + : ((CogMethod *) ((((usqInt)self_in_cmHomeMethod)) - ((self_in_cmHomeMethod->homeOffset))))); +} + + /* CogBytecodeDescriptor>>#isBranch */ +static sqInt NoDbgRegParms +isBranch(BytecodeDescriptor * self_in_isBranch) +{ + return (((self_in_isBranch->spanFunction)) != null) + && (!((self_in_isBranch->isBlockCreation))); +} + + /* CogBytecodeDescriptor>>#isUnconditionalBranch */ +static sqInt NoDbgRegParms +isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch) +{ + return (isBranch(self_in_isUnconditionalBranch)) + && (!(((self_in_isUnconditionalBranch->isBranchTrue)) + || ((self_in_isUnconditionalBranch->isBranchFalse)))); +} + + +/* Answer the address the call immediately preceding callSiteReturnAddress + will jump to. + */ + + /* CogIA32Compiler>>#callFullTargetFromReturnAddress: */ +static sqInt NoDbgRegParms +callFullTargetFromReturnAddress(AbstractInstruction * self_in_callFullTargetFromReturnAddress, sqInt callSiteReturnAddress) +{ + return callTargetFromReturnAddress(self_in_callFullTargetFromReturnAddress, callSiteReturnAddress); +} + + /* CogIA32Compiler>>#callInstructionByteSize */ +static sqInt NoDbgRegParms +callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize) +{ + return 5; +} + + +/* Answer the address the call immediately preceding callSiteReturnAddress + will jump to. + */ + + /* CogIA32Compiler>>#callTargetFromReturnAddress: */ +static sqInt NoDbgRegParms +callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress) +{ + sqInt callDistance; + + callDistance = literalBeforeFollowingAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress); + return callSiteReturnAddress + (((int) callDistance)); +} + + /* CogIA32Compiler>>#cFloatResultToRd: */ +static AbstractInstruction * NoDbgRegParms +cFloatResultToRd(AbstractInstruction * self_in_cFloatResultToRd, sqInt reg) +{ + AbstractInstruction *anInstruction; + + genoperandoperand(FSTPD, -8, SPReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, -8, SPReg, reg); + return self_in_cFloatResultToRd; +} + + /* CogIA32Compiler>>#cFloatResultToRs: */ +static AbstractInstruction * NoDbgRegParms +cFloatResultToRs(AbstractInstruction * self_in_cFloatResultToRs, sqInt reg) +{ + AbstractInstruction *anInstruction; + + genoperandoperand(FSTPS, -4, SPReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, -4, SPReg, reg); + return self_in_cFloatResultToRs; +} + + /* CogIA32Compiler>>#cmpC32RTempByteSize */ +static sqInt NoDbgRegParms +cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize) +{ + return 5; +} + + +/* Compute the maximum size for each opcode. This allows jump offsets to + be determined, provided that all backward branches are long branches. */ +/* N.B. The ^N forms are to get around the bytecode compiler's long branch + limits which are exceeded when each case jumps around the otherwise. */ + + /* CogIA32Compiler>>#computeMaximumSize */ +static sqInt NoDbgRegParms +computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize) +{ + + switch ((self_in_computeMaximumSize->opcode)) { + case Label: + return 0; + + case AlignmentNops: + return (((self_in_computeMaximumSize->operands))[0]) - 1; + + case Fill32: + case AddRdRd: + case CmpRdRd: + case SubRdRd: + case MulRdRd: + case DivRdRd: + case SqrtRd: + case XorRdRd: + case AddRsRs: + case SubRsRs: + case MulRsRs: + case DivRsRs: + case SqrtRs: + case MoveRdRd: + case MoveRsRs: + case ConvertRRd: + case ConvertRdR: + case ConvertRsRd: + case ConvertRdRs: + case ConvertRsR: + case ConvertRRs: + return 4; + + case Nop: + case REP: + case CLD: + case MOVSB: + case MOVSD: + case CDQ: + case LOCK: + case Stop: + case PopR: + case PushR: + return 1; + + case IDIVR: + case CPUID: + case CallR: + case JumpR: + case AddRR: + case AndRR: + case CmpRR: + case OrRR: + case XorRR: + case SubRR: + case NegateR: + case NotR: + case MoveRR: + return 2; + + case IMULRR: + case LFENCE: + case MFENCE: + case SFENCE: + case CmpRsRs: + case XorRsRs: + case SignExtend8RR: + case SignExtend16RR: + case ZeroExtend8RR: + case ZeroExtend16RR: + return 3; + + case CMPXCHGAwR: + case FSTPS: + case FSTPD: + case MoveAbR: + return 7; + + case CMPXCHGMwrR: + case MoveMbrR: + case MoveM8rR: + case MoveM16rR: + return ((((self_in_computeMaximumSize->operands))[1]) == ESP + ? (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 5 + : 8) + : (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 4 + : 7)); + + case XCHGAwR: + return 6; + + case XCHGMwrR: + return ((((self_in_computeMaximumSize->operands))[1]) == ESP + ? (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 4 + : 7) + : (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 3 + : 6)); + + case XCHGRR: + return (((((self_in_computeMaximumSize->operands))[0]) == EAX) + || ((((self_in_computeMaximumSize->operands))[1]) == EAX) + ? 1 + : 2); + + case CallFull: + case Call: + case MoveCwR: + case PushCw: + return 5; + + case JumpFull: + case JumpLong: + case Jump: + resolveJumpTarget(self_in_computeMaximumSize); + return 5; + + case JumpZero: + case JumpNonZero: + case JumpNegative: + case JumpNonNegative: + case JumpOverflow: + case JumpNoOverflow: + case JumpCarry: + case JumpNoCarry: + case JumpLess: + case JumpGreaterOrEqual: + case JumpGreater: + case JumpLessOrEqual: + case JumpBelow: + case JumpAboveOrEqual: + case JumpAbove: + case JumpBelowOrEqual: + case JumpLongZero: + case JumpLongNonZero: + case JumpFPEqual: + case JumpFPNotEqual: + case JumpFPLess: + case JumpFPGreaterOrEqual: + case JumpFPGreater: + case JumpFPLessOrEqual: + case JumpFPOrdered: + case JumpFPUnordered: + resolveJumpTarget(self_in_computeMaximumSize); + return 6; + + case RetN: + return ((((self_in_computeMaximumSize->operands))[0]) == 0 + ? 1 + : 3); + + case AddCqR: + case AddcCqR: + case AndCqR: + case CmpCqR: + case OrCqR: + case SubCqR: + return (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 3 + : ((((self_in_computeMaximumSize->operands))[1]) == EAX + ? 5 + : 6)); + + case TstCqR: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0])) + && ((((self_in_computeMaximumSize->operands))[1]) < 4) + ? 3 + : ((((self_in_computeMaximumSize->operands))[1]) == EAX + ? 5 + : 6)); + + case AddCwR: + case AndCwR: + case CmpCwR: + case OrCwR: + case SubCwR: + case XorCwR: + case MoveAwR: + return ((((self_in_computeMaximumSize->operands))[1]) == EAX + ? 5 + : 6); + + case LoadEffectiveAddressMwrR: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 3 + : 6)) + (((((self_in_computeMaximumSize->operands))[1]) == ESP + ? 1 + : 0)); + + case LogicalShiftLeftCqR: + case LogicalShiftRightCqR: + case ArithmeticShiftRightCqR: + return ((((self_in_computeMaximumSize->operands))[0]) == 1 + ? 2 + : 3); + + case LogicalShiftLeftRR: + case LogicalShiftRightRR: + case ArithmeticShiftRightRR: + return computeShiftRRSize(self_in_computeMaximumSize); + + case MoveCqR: + return ((((self_in_computeMaximumSize->operands))[0]) == 0 + ? 2 + : 5); + + case MoveRAw: + case MoveRAb: + return ((((self_in_computeMaximumSize->operands))[0]) == EAX + ? 5 + : 6); + + case MoveRM32r: + case MoveRMwr: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? (((((self_in_computeMaximumSize->operands))[1]) == 0) + && ((((self_in_computeMaximumSize->operands))[2]) != EBP) + ? 2 + : 3) + : 6)) + (((((self_in_computeMaximumSize->operands))[2]) == ESP + ? 1 + : 0)); + + case MoveRdM64r: + case MoveRsM32r: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? 5 + : 8)) + (((((self_in_computeMaximumSize->operands))[2]) == ESP + ? 1 + : 0)); + + case MoveRMbr: + case MoveRM8r: + return ((((self_in_computeMaximumSize->operands))[2]) == ESP + ? 7 + : (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? 3 + : 6)); + + case MoveRM16r: + return ((((self_in_computeMaximumSize->operands))[2]) == ESP + ? 8 + : (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? 4 + : 7)); + + case MoveM64rRd: + case MoveM32rRs: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 5 + : 8)) + (((((self_in_computeMaximumSize->operands))[1]) == ESP + ? 1 + : 0)); + + case MoveM32rR: + case MoveMwrR: + return ((isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? (((((self_in_computeMaximumSize->operands))[0]) == 0) + && ((((self_in_computeMaximumSize->operands))[1]) != EBP) + ? 2 + : 3) + : 6)) + (((((self_in_computeMaximumSize->operands))[1]) == ESP + ? 1 + : 0)); + + case MoveXbrRR: + assert((((self_in_computeMaximumSize->operands))[0]) != ESP); + return ((((self_in_computeMaximumSize->operands))[1]) == EBP + ? 5 + : 4); + + case MoveRXbrR: + assert((((self_in_computeMaximumSize->operands))[1]) != ESP); + return (((((self_in_computeMaximumSize->operands))[2]) == EBP + ? 4 + : 3)) + (((((self_in_computeMaximumSize->operands))[0]) >= 4 + ? 2 + : 0)); + + case MoveXwrRR: + assert((((self_in_computeMaximumSize->operands))[0]) != ESP); + return ((((self_in_computeMaximumSize->operands))[1]) == EBP + ? 4 + : 3); + + case MoveRXwrR: + assert((((self_in_computeMaximumSize->operands))[1]) != ESP); + return ((((self_in_computeMaximumSize->operands))[2]) == EBP + ? 4 + : 3); + + case PushCq: + return (isQuick(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 2 + : 5); + + case PrefetchAw: + return (hasSSEInstructions(self_in_computeMaximumSize) + ? 7 + : 0); + + default: + error("Case not found and no otherwise clause"); + } + return 0; +} + + +/* On the x86 the only instructions that shift by the value of a + register require the shift count to be in %ecx. So we may + have to use swap instructions to get the count into ecx. */ + + /* CogIA32Compiler>>#computeShiftRRSize */ +static sqInt NoDbgRegParms +computeShiftRRSize(AbstractInstruction * self_in_computeShiftRRSize) +{ + usqIntptr_t shiftCountReg; + + shiftCountReg = ((self_in_computeShiftRRSize->operands))[0]; + return (shiftCountReg == ECX + ? 2 + : (shiftCountReg == EAX + ? (1 + 2) + 1 + : (2 + 2) + 2)); +} + + /* CogIA32Compiler>>#concretizeFill32 */ +static usqInt NoDbgRegParms +concretizeFill32(AbstractInstruction * self_in_concretizeFill32) +{ + usqIntptr_t word; + + word = ((self_in_concretizeFill32->operands))[0]; + ((self_in_concretizeFill32->machineCode))[0] = (word & 0xFF); + ((self_in_concretizeFill32->machineCode))[1] = ((((usqInt) word) >> 8) & 0xFF); + ((self_in_concretizeFill32->machineCode))[2] = ((((usqInt) word) >> 16) & 0xFF); + ((self_in_concretizeFill32->machineCode))[3] = ((((usqInt) word) >> 24) & 0xFF); + return ((self_in_concretizeFill32->machineCodeSize) = 4); +} + + /* CogIA32Compiler>>#concretizeOpRR: */ +static usqInt NoDbgRegParms +concretizeOpRR(AbstractInstruction * self_in_concretizeOpRR, sqInt x86opcode) +{ + usqIntptr_t regLHS; + usqIntptr_t regRHS; + + regLHS = ((self_in_concretizeOpRR->operands))[0]; + regRHS = ((self_in_concretizeOpRR->operands))[1]; + ((self_in_concretizeOpRR->machineCode))[0] = x86opcode; + ((self_in_concretizeOpRR->machineCode))[1] = (modRMRO(self_in_concretizeOpRR, ModReg, regLHS, regRHS)); + return ((self_in_concretizeOpRR->machineCodeSize) = 2); +} + + /* CogIA32Compiler>>#concretizeReverseOpRR: */ +static usqInt NoDbgRegParms +concretizeReverseOpRR(AbstractInstruction * self_in_concretizeReverseOpRR, sqInt x86opcode) +{ + usqIntptr_t regLHS; + usqIntptr_t regRHS; + + regRHS = ((self_in_concretizeReverseOpRR->operands))[0]; + regLHS = ((self_in_concretizeReverseOpRR->operands))[1]; + ((self_in_concretizeReverseOpRR->machineCode))[0] = x86opcode; + ((self_in_concretizeReverseOpRR->machineCode))[1] = (modRMRO(self_in_concretizeReverseOpRR, ModReg, regLHS, regRHS)); + return ((self_in_concretizeReverseOpRR->machineCodeSize) = 2); +} + + +/* Will get inlined into concretizeAt: switch. */ +/* movzwl */ + + /* CogIA32Compiler>>#concretizeZeroExtend16RR */ +static usqInt NoDbgRegParms +concretizeZeroExtend16RR(AbstractInstruction * self_in_concretizeZeroExtend16RR) +{ + usqIntptr_t destReg; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeZeroExtend16RR->operands))[0]; + destReg = ((self_in_concretizeZeroExtend16RR->operands))[1]; + ((self_in_concretizeZeroExtend16RR->machineCode))[0] = 15; + ((self_in_concretizeZeroExtend16RR->machineCode))[1] = 183; + ((self_in_concretizeZeroExtend16RR->machineCode))[2] = (modRMRO(self_in_concretizeZeroExtend16RR, ModReg, srcReg, destReg)); + return ((self_in_concretizeZeroExtend16RR->machineCodeSize) = 3); +} + + +/* Answer the abstract register for the C result register. + Only partially implemented. Works on x86 since TempReg = EAX = C result + reg. */ + + /* CogIA32Compiler>>#cResultRegisterHigh */ +static sqInt NoDbgRegParms +cResultRegisterHigh(AbstractInstruction * self_in_cResultRegisterHigh) +{ + return EDX; +} + + +/* Answer the abstract register for the C result register. + Only partially implemented. Works on x86 since TempReg = EAX = C result + reg. */ + + /* CogIA32Compiler>>#cResultRegisterLow */ +static sqInt NoDbgRegParms +cResultRegisterLow(AbstractInstruction * self_in_cResultRegisterLow) +{ + return EAX; +} + + +/* Attempt to generate concrete machine code for the instruction at address. + This is the inner dispatch of concretizeAt: actualAddress which exists + only to get around the branch size limits in the SqueakV3 (blue book + derived) bytecode set. */ + + /* CogIA32Compiler>>#dispatchConcretize */ +static void NoDbgRegParms +dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) +{ + usqIntptr_t addressOperand; + usqIntptr_t addressOperand1; + usqIntptr_t addressOperand2; + usqIntptr_t addressOperand3; + usqIntptr_t addressOperand4; + usqIntptr_t base; + usqIntptr_t base1; + usqIntptr_t base2; + usqIntptr_t base3; + AbstractInstruction *dependentChain; + usqIntptr_t dest; + usqIntptr_t dest1; + usqIntptr_t destReg; + usqIntptr_t destReg1; + usqIntptr_t destReg10; + usqIntptr_t destReg11; + usqIntptr_t destReg12; + usqIntptr_t destReg13; + usqIntptr_t destReg14; + usqIntptr_t destReg15; + usqIntptr_t destReg16; + usqIntptr_t destReg17; + usqIntptr_t destReg18; + usqIntptr_t destReg19; + usqIntptr_t destReg2; + usqIntptr_t destReg20; + usqIntptr_t destReg21; + usqIntptr_t destReg22; + usqIntptr_t destReg23; + usqIntptr_t destReg24; + usqIntptr_t destReg3; + usqIntptr_t destReg4; + usqIntptr_t destReg5; + usqIntptr_t destReg6; + usqIntptr_t destReg7; + usqIntptr_t destReg8; + usqIntptr_t destReg9; + sqInt distance; + sqInt distance1; + sqInt i; + usqIntptr_t index; + usqIntptr_t index1; + usqIntptr_t index2; + usqIntptr_t index3; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + AbstractInstruction *jumpTarget10; + AbstractInstruction *jumpTarget11; + AbstractInstruction *jumpTarget110; + AbstractInstruction *jumpTarget111; + AbstractInstruction *jumpTarget1110; + AbstractInstruction *jumpTarget1111; + AbstractInstruction *jumpTarget1112; + AbstractInstruction *jumpTarget1113; + AbstractInstruction *jumpTarget1114; + AbstractInstruction *jumpTarget1115; + AbstractInstruction *jumpTarget1116; + AbstractInstruction *jumpTarget112; + AbstractInstruction *jumpTarget113; + AbstractInstruction *jumpTarget114; + AbstractInstruction *jumpTarget115; + AbstractInstruction *jumpTarget116; + AbstractInstruction *jumpTarget117; + AbstractInstruction *jumpTarget118; + AbstractInstruction *jumpTarget119; + AbstractInstruction *jumpTarget12; + AbstractInstruction *jumpTarget120; + AbstractInstruction *jumpTarget121; + AbstractInstruction *jumpTarget122; + AbstractInstruction *jumpTarget123; + AbstractInstruction *jumpTarget124; + AbstractInstruction *jumpTarget125; + AbstractInstruction *jumpTarget13; + AbstractInstruction *jumpTarget14; + AbstractInstruction *jumpTarget15; + AbstractInstruction *jumpTarget16; + AbstractInstruction *jumpTarget17; + AbstractInstruction *jumpTarget18; + AbstractInstruction *jumpTarget19; + AbstractInstruction *jumpTarget2; + AbstractInstruction *jumpTarget20; + AbstractInstruction *jumpTarget21; + AbstractInstruction *jumpTarget210; + AbstractInstruction *jumpTarget211; + AbstractInstruction *jumpTarget212; + AbstractInstruction *jumpTarget213; + AbstractInstruction *jumpTarget214; + AbstractInstruction *jumpTarget215; + AbstractInstruction *jumpTarget216; + AbstractInstruction *jumpTarget22; + AbstractInstruction *jumpTarget23; + AbstractInstruction *jumpTarget24; + AbstractInstruction *jumpTarget25; + AbstractInstruction *jumpTarget26; + AbstractInstruction *jumpTarget27; + AbstractInstruction *jumpTarget28; + AbstractInstruction *jumpTarget29; + AbstractInstruction *jumpTarget3; + AbstractInstruction *jumpTarget30; + AbstractInstruction *jumpTarget31; + AbstractInstruction *jumpTarget32; + AbstractInstruction *jumpTarget33; + AbstractInstruction *jumpTarget34; + AbstractInstruction *jumpTarget35; + AbstractInstruction *jumpTarget4; + AbstractInstruction *jumpTarget5; + AbstractInstruction *jumpTarget6; + AbstractInstruction *jumpTarget7; + AbstractInstruction *jumpTarget8; + AbstractInstruction *jumpTarget9; + usqIntptr_t mask; + usqIntptr_t mask1; + usqIntptr_t mask2; + sqInt mcIdx; + sqInt offset; + sqInt offset1; + usqIntptr_t offset10; + usqIntptr_t offset11; + sqInt offset110; + sqInt offset111; + sqInt offset112; + sqInt offset113; + sqInt offset114; + sqInt offset115; + sqInt offset116; + sqInt offset117; + sqInt offset118; + sqInt offset119; + usqIntptr_t offset12; + sqInt offset120; + sqInt offset121; + sqInt offset122; + sqInt offset123; + usqIntptr_t offset13; + usqIntptr_t offset14; + usqIntptr_t offset15; + sqInt offset16; + sqInt offset17; + sqInt offset18; + sqInt offset19; + sqInt offset2; + sqInt offset20; + sqInt offset21; + sqInt offset22; + sqInt offset23; + sqInt offset24; + sqInt offset25; + sqInt offset26; + sqInt offset27; + sqInt offset28; + sqInt offset29; + usqIntptr_t offset3; + sqInt offset30; + sqInt offset31; + sqInt offset32; + sqInt offset33; + usqIntptr_t offset4; + usqIntptr_t offset5; + usqIntptr_t offset6; + usqIntptr_t offset7; + usqIntptr_t offset8; + usqIntptr_t offset9; + usqIntptr_t reg; + usqIntptr_t reg1; + usqIntptr_t reg10; + usqIntptr_t reg11; + usqIntptr_t reg12; + usqIntptr_t reg13; + usqIntptr_t reg14; + usqIntptr_t reg15; + usqIntptr_t reg16; + usqIntptr_t reg17; + usqIntptr_t reg18; + usqIntptr_t reg19; + usqIntptr_t reg2; + usqIntptr_t reg20; + usqIntptr_t reg21; + usqIntptr_t reg22; + usqIntptr_t reg23; + usqIntptr_t reg24; + usqIntptr_t reg25; + usqIntptr_t reg26; + usqIntptr_t reg3; + usqIntptr_t reg4; + usqIntptr_t reg5; + usqIntptr_t reg6; + usqIntptr_t reg7; + usqIntptr_t reg8; + usqIntptr_t reg9; + usqIntptr_t regLHS; + usqIntptr_t regLHS1; + usqIntptr_t regLHS10; + usqIntptr_t regLHS11; + usqIntptr_t regLHS12; + usqIntptr_t regLHS13; + usqIntptr_t regLHS2; + usqIntptr_t regLHS3; + usqIntptr_t regLHS4; + usqIntptr_t regLHS5; + usqIntptr_t regLHS6; + usqIntptr_t regLHS7; + usqIntptr_t regLHS8; + usqIntptr_t regLHS9; + usqIntptr_t regRHS; + usqIntptr_t regRHS1; + usqIntptr_t regRHS10; + usqIntptr_t regRHS11; + usqIntptr_t regRHS12; + usqIntptr_t regRHS13; + usqIntptr_t regRHS2; + usqIntptr_t regRHS3; + usqIntptr_t regRHS4; + usqIntptr_t regRHS5; + usqIntptr_t regRHS6; + usqIntptr_t regRHS7; + usqIntptr_t regRHS8; + usqIntptr_t regRHS9; + usqIntptr_t regToShift; + usqIntptr_t regToShift1; + sqInt shiftCount; + usqIntptr_t shiftCountReg; + usqIntptr_t shiftCountReg1; + usqIntptr_t src; + usqIntptr_t src1; + usqIntptr_t srcReg; + usqIntptr_t srcReg1; + usqIntptr_t srcReg10; + usqIntptr_t srcReg11; + usqIntptr_t srcReg12; + usqIntptr_t srcReg13; + usqIntptr_t srcReg14; + usqIntptr_t srcReg15; + usqIntptr_t srcReg16; + usqIntptr_t srcReg17; + usqIntptr_t srcReg18; + usqIntptr_t srcReg19; + usqIntptr_t srcReg2; + usqIntptr_t srcReg20; + usqIntptr_t srcReg21; + usqIntptr_t srcReg22; + usqIntptr_t srcReg3; + usqIntptr_t srcReg4; + usqIntptr_t srcReg5; + usqIntptr_t srcReg6; + usqIntptr_t srcReg7; + usqIntptr_t srcReg8; + usqIntptr_t srcReg9; + sqInt swapreg; + usqIntptr_t value; + usqIntptr_t value1; + usqIntptr_t value10; + usqIntptr_t value11; + usqIntptr_t value12; + usqIntptr_t value13; + usqIntptr_t value2; + usqIntptr_t value3; + usqIntptr_t value4; + usqIntptr_t value5; + usqIntptr_t value6; + usqIntptr_t value7; + usqIntptr_t value8; + usqIntptr_t value9; + usqIntptr_t word; + + if (((self_in_dispatchConcretize->opcode)) >= CDQ) { + dispatchConcretizeProcessorSpecific(self_in_dispatchConcretize); + return; + } + + switch ((self_in_dispatchConcretize->opcode)) { + case Label: + /* begin concretizeLabel */ + dependentChain = (self_in_dispatchConcretize->dependent); + while (!(dependentChain == null)) { + updateLabel(dependentChain, self_in_dispatchConcretize); + dependentChain = (dependentChain->dependent); + } + (self_in_dispatchConcretize->machineCodeSize) = 0; + return; + + case AlignmentNops: + /* begin concretizeAlignmentNops */ + for (i = 0; i < ((self_in_dispatchConcretize->machineCodeSize)); i += 1) { + ((self_in_dispatchConcretize->machineCode))[i] = 144; + } + return; + + case Fill32: + /* begin concretizeFill32 */ + word = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = (word & 0xFF); + ((self_in_dispatchConcretize->machineCode))[1] = ((((usqInt) word) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) word) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) word) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case Nop: + /* begin concretizeNop */ + ((self_in_dispatchConcretize->machineCode))[0] = 144; + (self_in_dispatchConcretize->machineCodeSize) = 1; + return; + + case Call: + case CallFull: + /* begin concretizeCall */ + assert((((self_in_dispatchConcretize->operands))[0]) != 0); + offset = (((int) (((self_in_dispatchConcretize->operands))[0]))) - (((int) (((self_in_dispatchConcretize->address)) + 5))); + ((self_in_dispatchConcretize->machineCode))[0] = 232; + ((self_in_dispatchConcretize->machineCode))[1] = (offset & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + return; + + case CallR: + /* begin concretizeCallR */ + reg = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 0xFF; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg, 2)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case JumpR: + /* begin concretizeJumpR */ + reg1 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 0xFF; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg1, 4)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case JumpFull: + case JumpLong: + /* begin concretizeJumpLong */ + jumpTarget = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + if ((addressIsInInstructions(jumpTarget)) + || (jumpTarget == (methodLabel()))) { + jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); + } + assert(jumpTarget != 0); + offset1 = (((int) jumpTarget)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); + ((self_in_dispatchConcretize->machineCode))[0] = 233; + ((self_in_dispatchConcretize->machineCode))[1] = (offset1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + return; + + case JumpLongZero: + case JumpZero: + case JumpFPEqual: + /* begin concretizeConditionalJump: */ + jumpTarget12 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget12); + if ((addressIsInInstructions(jumpTarget12)) + || (jumpTarget12 == (methodLabel()))) { + jumpTarget12 = ((AbstractInstruction *) ((jumpTarget12->address))); + } + assert(jumpTarget12 != 0); + jumpTarget3 = jumpTarget12; + offset16 = (((int) jumpTarget3)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset16) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 4); + ((self_in_dispatchConcretize->machineCode))[1] = (offset16 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l89; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget11 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget11); + if ((addressIsInInstructions(jumpTarget11)) + || (jumpTarget11 == (methodLabel()))) { + jumpTarget11 = ((AbstractInstruction *) ((jumpTarget11->address))); + } + assert(jumpTarget11 != 0); + jumpTarget2 = jumpTarget11; + offset17 = (((int) jumpTarget2)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 4); + ((self_in_dispatchConcretize->machineCode))[2] = (offset17 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset17) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset17) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset17) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l89: /* end concretizeConditionalJump: */; + return; + + case JumpLongNonZero: + case JumpNonZero: + case JumpFPNotEqual: + /* begin concretizeConditionalJump: */ + jumpTarget13 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget13); + if ((addressIsInInstructions(jumpTarget13)) + || (jumpTarget13 == (methodLabel()))) { + jumpTarget13 = ((AbstractInstruction *) ((jumpTarget13->address))); + } + assert(jumpTarget13 != 0); + jumpTarget4 = jumpTarget13; + offset18 = (((int) jumpTarget4)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset18) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 5); + ((self_in_dispatchConcretize->machineCode))[1] = (offset18 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l94; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget111); + if ((addressIsInInstructions(jumpTarget111)) + || (jumpTarget111 == (methodLabel()))) { + jumpTarget111 = ((AbstractInstruction *) ((jumpTarget111->address))); + } + assert(jumpTarget111 != 0); + jumpTarget21 = jumpTarget111; + offset19 = (((int) jumpTarget21)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 5); + ((self_in_dispatchConcretize->machineCode))[2] = (offset19 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset19) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset19) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset19) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l94: /* end concretizeConditionalJump: */; + return; + + case Jump: + /* begin concretizeJump */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset2) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = 235; + ((self_in_dispatchConcretize->machineCode))[1] = (offset2 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l9; + } + offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); + ((self_in_dispatchConcretize->machineCode))[0] = 233; + ((self_in_dispatchConcretize->machineCode))[1] = (offset2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) offset2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + l9: /* end concretizeJump */; + return; + + case JumpNegative: + /* begin concretizeConditionalJump: */ + jumpTarget14 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget14); + if ((addressIsInInstructions(jumpTarget14)) + || (jumpTarget14 == (methodLabel()))) { + jumpTarget14 = ((AbstractInstruction *) ((jumpTarget14->address))); + } + assert(jumpTarget14 != 0); + jumpTarget5 = jumpTarget14; + offset20 = (((int) jumpTarget5)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset20) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 8); + ((self_in_dispatchConcretize->machineCode))[1] = (offset20 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l99; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget112); + if ((addressIsInInstructions(jumpTarget112)) + || (jumpTarget112 == (methodLabel()))) { + jumpTarget112 = ((AbstractInstruction *) ((jumpTarget112->address))); + } + assert(jumpTarget112 != 0); + jumpTarget22 = jumpTarget112; + offset110 = (((int) jumpTarget22)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 8); + ((self_in_dispatchConcretize->machineCode))[2] = (offset110 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset110) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset110) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset110) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l99: /* end concretizeConditionalJump: */; + return; + + case JumpNonNegative: + /* begin concretizeConditionalJump: */ + jumpTarget15 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget15); + if ((addressIsInInstructions(jumpTarget15)) + || (jumpTarget15 == (methodLabel()))) { + jumpTarget15 = ((AbstractInstruction *) ((jumpTarget15->address))); + } + assert(jumpTarget15 != 0); + jumpTarget6 = jumpTarget15; + offset21 = (((int) jumpTarget6)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset21) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 9); + ((self_in_dispatchConcretize->machineCode))[1] = (offset21 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l104; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget113); + if ((addressIsInInstructions(jumpTarget113)) + || (jumpTarget113 == (methodLabel()))) { + jumpTarget113 = ((AbstractInstruction *) ((jumpTarget113->address))); + } + assert(jumpTarget113 != 0); + jumpTarget23 = jumpTarget113; + offset111 = (((int) jumpTarget23)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 9); + ((self_in_dispatchConcretize->machineCode))[2] = (offset111 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset111) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset111) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset111) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l104: /* end concretizeConditionalJump: */; + return; + + case JumpOverflow: + /* begin concretizeConditionalJump: */ + jumpTarget16 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget16); + if ((addressIsInInstructions(jumpTarget16)) + || (jumpTarget16 == (methodLabel()))) { + jumpTarget16 = ((AbstractInstruction *) ((jumpTarget16->address))); + } + assert(jumpTarget16 != 0); + jumpTarget7 = jumpTarget16; + offset22 = (((int) jumpTarget7)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset22) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112); + ((self_in_dispatchConcretize->machineCode))[1] = (offset22 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l109; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget114); + if ((addressIsInInstructions(jumpTarget114)) + || (jumpTarget114 == (methodLabel()))) { + jumpTarget114 = ((AbstractInstruction *) ((jumpTarget114->address))); + } + assert(jumpTarget114 != 0); + jumpTarget24 = jumpTarget114; + offset112 = (((int) jumpTarget24)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128); + ((self_in_dispatchConcretize->machineCode))[2] = (offset112 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset112) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset112) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset112) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l109: /* end concretizeConditionalJump: */; + return; + + case JumpNoOverflow: + /* begin concretizeConditionalJump: */ + jumpTarget17 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget17); + if ((addressIsInInstructions(jumpTarget17)) + || (jumpTarget17 == (methodLabel()))) { + jumpTarget17 = ((AbstractInstruction *) ((jumpTarget17->address))); + } + assert(jumpTarget17 != 0); + jumpTarget8 = jumpTarget17; + offset23 = (((int) jumpTarget8)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset23) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 1); + ((self_in_dispatchConcretize->machineCode))[1] = (offset23 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l114; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget115); + if ((addressIsInInstructions(jumpTarget115)) + || (jumpTarget115 == (methodLabel()))) { + jumpTarget115 = ((AbstractInstruction *) ((jumpTarget115->address))); + } + assert(jumpTarget115 != 0); + jumpTarget25 = jumpTarget115; + offset113 = (((int) jumpTarget25)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 1); + ((self_in_dispatchConcretize->machineCode))[2] = (offset113 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset113) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset113) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset113) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l114: /* end concretizeConditionalJump: */; + return; + + case JumpCarry: + case JumpBelow: + case JumpFPLess: + /* begin concretizeConditionalJump: */ + jumpTarget18 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget18); + if ((addressIsInInstructions(jumpTarget18)) + || (jumpTarget18 == (methodLabel()))) { + jumpTarget18 = ((AbstractInstruction *) ((jumpTarget18->address))); + } + assert(jumpTarget18 != 0); + jumpTarget9 = jumpTarget18; + offset24 = (((int) jumpTarget9)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset24) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 2); + ((self_in_dispatchConcretize->machineCode))[1] = (offset24 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l119; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget116); + if ((addressIsInInstructions(jumpTarget116)) + || (jumpTarget116 == (methodLabel()))) { + jumpTarget116 = ((AbstractInstruction *) ((jumpTarget116->address))); + } + assert(jumpTarget116 != 0); + jumpTarget26 = jumpTarget116; + offset114 = (((int) jumpTarget26)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 2); + ((self_in_dispatchConcretize->machineCode))[2] = (offset114 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset114) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset114) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset114) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l119: /* end concretizeConditionalJump: */; + return; + + case JumpNoCarry: + case JumpAboveOrEqual: + case JumpFPGreaterOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget19 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget19); + if ((addressIsInInstructions(jumpTarget19)) + || (jumpTarget19 == (methodLabel()))) { + jumpTarget19 = ((AbstractInstruction *) ((jumpTarget19->address))); + } + assert(jumpTarget19 != 0); + jumpTarget10 = jumpTarget19; + offset25 = (((int) jumpTarget10)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset25) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 3); + ((self_in_dispatchConcretize->machineCode))[1] = (offset25 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l124; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget117 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget117); + if ((addressIsInInstructions(jumpTarget117)) + || (jumpTarget117 == (methodLabel()))) { + jumpTarget117 = ((AbstractInstruction *) ((jumpTarget117->address))); + } + assert(jumpTarget117 != 0); + jumpTarget27 = jumpTarget117; + offset115 = (((int) jumpTarget27)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 3); + ((self_in_dispatchConcretize->machineCode))[2] = (offset115 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset115) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset115) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset115) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l124: /* end concretizeConditionalJump: */; + return; + + case JumpLess: + /* begin concretizeConditionalJump: */ + jumpTarget110 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget110); + if ((addressIsInInstructions(jumpTarget110)) + || (jumpTarget110 == (methodLabel()))) { + jumpTarget110 = ((AbstractInstruction *) ((jumpTarget110->address))); + } + assert(jumpTarget110 != 0); + jumpTarget20 = jumpTarget110; + offset26 = (((int) jumpTarget20)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset26) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 12); + ((self_in_dispatchConcretize->machineCode))[1] = (offset26 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l129; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget118 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget118); + if ((addressIsInInstructions(jumpTarget118)) + || (jumpTarget118 == (methodLabel()))) { + jumpTarget118 = ((AbstractInstruction *) ((jumpTarget118->address))); + } + assert(jumpTarget118 != 0); + jumpTarget28 = jumpTarget118; + offset116 = (((int) jumpTarget28)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 12); + ((self_in_dispatchConcretize->machineCode))[2] = (offset116 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset116) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset116) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset116) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l129: /* end concretizeConditionalJump: */; + return; + + case JumpGreaterOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget119 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget119); + if ((addressIsInInstructions(jumpTarget119)) + || (jumpTarget119 == (methodLabel()))) { + jumpTarget119 = ((AbstractInstruction *) ((jumpTarget119->address))); + } + assert(jumpTarget119 != 0); + jumpTarget29 = jumpTarget119; + offset27 = (((int) jumpTarget29)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset27) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 13); + ((self_in_dispatchConcretize->machineCode))[1] = (offset27 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l134; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1110 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1110); + if ((addressIsInInstructions(jumpTarget1110)) + || (jumpTarget1110 == (methodLabel()))) { + jumpTarget1110 = ((AbstractInstruction *) ((jumpTarget1110->address))); + } + assert(jumpTarget1110 != 0); + jumpTarget210 = jumpTarget1110; + offset117 = (((int) jumpTarget210)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 13); + ((self_in_dispatchConcretize->machineCode))[2] = (offset117 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset117) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset117) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset117) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l134: /* end concretizeConditionalJump: */; + return; + + case JumpGreater: + /* begin concretizeConditionalJump: */ + jumpTarget120 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget120); + if ((addressIsInInstructions(jumpTarget120)) + || (jumpTarget120 == (methodLabel()))) { + jumpTarget120 = ((AbstractInstruction *) ((jumpTarget120->address))); + } + assert(jumpTarget120 != 0); + jumpTarget30 = jumpTarget120; + offset28 = (((int) jumpTarget30)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset28) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 15); + ((self_in_dispatchConcretize->machineCode))[1] = (offset28 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l139; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1111 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1111); + if ((addressIsInInstructions(jumpTarget1111)) + || (jumpTarget1111 == (methodLabel()))) { + jumpTarget1111 = ((AbstractInstruction *) ((jumpTarget1111->address))); + } + assert(jumpTarget1111 != 0); + jumpTarget211 = jumpTarget1111; + offset118 = (((int) jumpTarget211)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 15); + ((self_in_dispatchConcretize->machineCode))[2] = (offset118 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset118) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset118) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset118) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l139: /* end concretizeConditionalJump: */; + return; + + case JumpLessOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget121 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget121); + if ((addressIsInInstructions(jumpTarget121)) + || (jumpTarget121 == (methodLabel()))) { + jumpTarget121 = ((AbstractInstruction *) ((jumpTarget121->address))); + } + assert(jumpTarget121 != 0); + jumpTarget31 = jumpTarget121; + offset29 = (((int) jumpTarget31)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset29) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 14); + ((self_in_dispatchConcretize->machineCode))[1] = (offset29 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l144; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1112 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1112); + if ((addressIsInInstructions(jumpTarget1112)) + || (jumpTarget1112 == (methodLabel()))) { + jumpTarget1112 = ((AbstractInstruction *) ((jumpTarget1112->address))); + } + assert(jumpTarget1112 != 0); + jumpTarget212 = jumpTarget1112; + offset119 = (((int) jumpTarget212)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 14); + ((self_in_dispatchConcretize->machineCode))[2] = (offset119 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset119) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset119) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset119) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l144: /* end concretizeConditionalJump: */; + return; + + case JumpAbove: + case JumpFPGreater: + /* begin concretizeConditionalJump: */ + jumpTarget122 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget122); + if ((addressIsInInstructions(jumpTarget122)) + || (jumpTarget122 == (methodLabel()))) { + jumpTarget122 = ((AbstractInstruction *) ((jumpTarget122->address))); + } + assert(jumpTarget122 != 0); + jumpTarget32 = jumpTarget122; + offset30 = (((int) jumpTarget32)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset30) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 7); + ((self_in_dispatchConcretize->machineCode))[1] = (offset30 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l149; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1113 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1113); + if ((addressIsInInstructions(jumpTarget1113)) + || (jumpTarget1113 == (methodLabel()))) { + jumpTarget1113 = ((AbstractInstruction *) ((jumpTarget1113->address))); + } + assert(jumpTarget1113 != 0); + jumpTarget213 = jumpTarget1113; + offset120 = (((int) jumpTarget213)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 7); + ((self_in_dispatchConcretize->machineCode))[2] = (offset120 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset120) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset120) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset120) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l149: /* end concretizeConditionalJump: */; + return; + + case JumpBelowOrEqual: + case JumpFPLessOrEqual: + /* begin concretizeConditionalJump: */ + jumpTarget123 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget123); + if ((addressIsInInstructions(jumpTarget123)) + || (jumpTarget123 == (methodLabel()))) { + jumpTarget123 = ((AbstractInstruction *) ((jumpTarget123->address))); + } + assert(jumpTarget123 != 0); + jumpTarget33 = jumpTarget123; + offset31 = (((int) jumpTarget33)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset31) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 6); + ((self_in_dispatchConcretize->machineCode))[1] = (offset31 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l154; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1114 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1114); + if ((addressIsInInstructions(jumpTarget1114)) + || (jumpTarget1114 == (methodLabel()))) { + jumpTarget1114 = ((AbstractInstruction *) ((jumpTarget1114->address))); + } + assert(jumpTarget1114 != 0); + jumpTarget214 = jumpTarget1114; + offset121 = (((int) jumpTarget214)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 6); + ((self_in_dispatchConcretize->machineCode))[2] = (offset121 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset121) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset121) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset121) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l154: /* end concretizeConditionalJump: */; + return; + + case JumpFPOrdered: + /* begin concretizeConditionalJump: */ + jumpTarget124 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget124); + if ((addressIsInInstructions(jumpTarget124)) + || (jumpTarget124 == (methodLabel()))) { + jumpTarget124 = ((AbstractInstruction *) ((jumpTarget124->address))); + } + assert(jumpTarget124 != 0); + jumpTarget34 = jumpTarget124; + offset32 = (((int) jumpTarget34)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset32) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 11); + ((self_in_dispatchConcretize->machineCode))[1] = (offset32 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l159; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1115 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1115); + if ((addressIsInInstructions(jumpTarget1115)) + || (jumpTarget1115 == (methodLabel()))) { + jumpTarget1115 = ((AbstractInstruction *) ((jumpTarget1115->address))); + } + assert(jumpTarget1115 != 0); + jumpTarget215 = jumpTarget1115; + offset122 = (((int) jumpTarget215)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 11); + ((self_in_dispatchConcretize->machineCode))[2] = (offset122 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset122) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset122) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset122) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l159: /* end concretizeConditionalJump: */; + return; + + case JumpFPUnordered: + /* begin concretizeConditionalJump: */ + jumpTarget125 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget125); + if ((addressIsInInstructions(jumpTarget125)) + || (jumpTarget125 == (methodLabel()))) { + jumpTarget125 = ((AbstractInstruction *) ((jumpTarget125->address))); + } + assert(jumpTarget125 != 0); + jumpTarget35 = jumpTarget125; + offset33 = (((int) jumpTarget35)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); + if ((((self_in_dispatchConcretize->machineCodeSize)) == 0 + ? isQuick(self_in_dispatchConcretize, offset33) + : ((self_in_dispatchConcretize->machineCodeSize)) == 2)) { + ((self_in_dispatchConcretize->machineCode))[0] = (112 + 10); + ((self_in_dispatchConcretize->machineCode))[1] = (offset33 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l164; + } + /* begin concretizeConditionalJumpLong: */ + jumpTarget1116 = ((AbstractInstruction *) (((self_in_dispatchConcretize->operands))[0])); + assertSaneJumpTarget(jumpTarget1116); + if ((addressIsInInstructions(jumpTarget1116)) + || (jumpTarget1116 == (methodLabel()))) { + jumpTarget1116 = ((AbstractInstruction *) ((jumpTarget1116->address))); + } + assert(jumpTarget1116 != 0); + jumpTarget216 = jumpTarget1116; + offset123 = (((int) jumpTarget216)) - (((int) (((self_in_dispatchConcretize->address)) + 6))); + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = (128 + 10); + ((self_in_dispatchConcretize->machineCode))[2] = (offset123 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset123) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset123) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset123) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l164: /* end concretizeConditionalJump: */; + return; + + case RetN: + /* begin concretizeRetN */ + offset3 = ((self_in_dispatchConcretize->operands))[0]; + if (offset3 == 0) { + ((self_in_dispatchConcretize->machineCode))[0] = 195; + (self_in_dispatchConcretize->machineCodeSize) = 1; + goto l10; + } + ((self_in_dispatchConcretize->machineCode))[0] = 194; + ((self_in_dispatchConcretize->machineCode))[1] = (offset3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = (((usqInt) offset3) >> 8); + (self_in_dispatchConcretize->machineCodeSize) = 3; + l10: /* end concretizeRetN */; + return; + + case Stop: + /* begin concretizeStop */ + ((self_in_dispatchConcretize->machineCode))[0] = 204; + (self_in_dispatchConcretize->machineCodeSize) = 1; + return; + + case AddCqR: + /* begin concretizeAddCqR */ + value = ((self_in_dispatchConcretize->operands))[0]; + reg2 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, value)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg2, 0)); + ((self_in_dispatchConcretize->machineCode))[2] = (value & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l12; + } + if (reg2 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 5; + ((self_in_dispatchConcretize->machineCode))[1] = (value & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l12; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg2, 0)); + ((self_in_dispatchConcretize->machineCode))[2] = (value & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l12: /* end concretizeAddCqR */; + return; + + case AddCwR: + /* begin concretizeAddCwR */ + value1 = ((self_in_dispatchConcretize->operands))[0]; + reg3 = ((self_in_dispatchConcretize->operands))[1]; + if (reg3 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 5; + ((self_in_dispatchConcretize->machineCode))[1] = (value1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l13; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg3, 0)); + ((self_in_dispatchConcretize->machineCode))[2] = (value1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l13: /* end concretizeAddCwR */; + return; + + case AddRR: + concretizeOpRR(self_in_dispatchConcretize, 3); + return; + + case AddcRR: + /* begin concretizeAddcRR */ + regLHS = ((self_in_dispatchConcretize->operands))[0]; + regRHS = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 19; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, regLHS, regRHS)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case AddcCqR: + /* begin concretizeAddcCqR */ + value2 = ((self_in_dispatchConcretize->operands))[0]; + reg4 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, value2)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg4, 2)); + ((self_in_dispatchConcretize->machineCode))[2] = (value2 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l15; + } + if (reg4 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 21; + ((self_in_dispatchConcretize->machineCode))[1] = (value2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l15; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg4, 2)); + ((self_in_dispatchConcretize->machineCode))[2] = (value2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l15: /* end concretizeAddcCqR */; + return; + + case AddRdRd: + /* begin concretizeSEE2OpRdRd: */ + regRHS1 = ((self_in_dispatchConcretize->operands))[0]; + regLHS1 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 88; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS1, regLHS1)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case AddRsRs: + /* begin concretizeSEEOpRsRs: */ + regRHS2 = ((self_in_dispatchConcretize->operands))[0]; + regLHS2 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 88; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS2, regLHS2)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case AndCqR: + /* begin concretizeAndCqR */ + mask = ((self_in_dispatchConcretize->operands))[0]; + reg5 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, mask)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg5, 4)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l18; + } + if (reg5 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 37; + ((self_in_dispatchConcretize->machineCode))[1] = (mask & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) mask) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l18; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg5, 4)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l18: /* end concretizeAndCqR */; + return; + + case AndCwR: + /* begin concretizeAndCwR */ + value3 = ((self_in_dispatchConcretize->operands))[0]; + reg6 = ((self_in_dispatchConcretize->operands))[1]; + if (reg6 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 37; + ((self_in_dispatchConcretize->machineCode))[1] = (value3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value3) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l19; + } + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg6, 4)); + ((self_in_dispatchConcretize->machineCode))[2] = (value3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value3) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l19: /* end concretizeAndCwR */; + return; + + case AndRR: + concretizeOpRR(self_in_dispatchConcretize, 35); + return; + + case TstCqR: + /* begin concretizeTstCqR */ + mask1 = ((self_in_dispatchConcretize->operands))[0]; + reg7 = ((self_in_dispatchConcretize->operands))[1]; + if ((isQuick(self_in_dispatchConcretize, mask1)) + && (reg7 < 4)) { + ((self_in_dispatchConcretize->machineCode))[0] = 246; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg7, 0)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask1 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l20; + } + if (reg7 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 169; + ((self_in_dispatchConcretize->machineCode))[1] = (mask1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) mask1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l20; + } + ((self_in_dispatchConcretize->machineCode))[0] = 247; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg7, 0)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l20: /* end concretizeTstCqR */; + return; + + case CmpCqR: + /* begin concretizeCmpCqR */ + value4 = ((self_in_dispatchConcretize->operands))[0]; + reg8 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, value4)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg8, 7)); + ((self_in_dispatchConcretize->machineCode))[2] = (value4 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l21; + } + if (reg8 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 61; + ((self_in_dispatchConcretize->machineCode))[1] = (value4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value4) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l21; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg8, 7)); + ((self_in_dispatchConcretize->machineCode))[2] = (value4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value4) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l21: /* end concretizeCmpCqR */; + return; + + case CmpCwR: + /* begin concretizeCmpCwR */ + value5 = ((self_in_dispatchConcretize->operands))[0]; + reg9 = ((self_in_dispatchConcretize->operands))[1]; + if (reg9 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 61; + ((self_in_dispatchConcretize->machineCode))[1] = (value5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value5) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l22; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg9, 7)); + ((self_in_dispatchConcretize->machineCode))[2] = (value5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value5) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l22: /* end concretizeCmpCwR */; + return; + + case CmpRR: + concretizeReverseOpRR(self_in_dispatchConcretize, 57); + return; + + case CmpRdRd: + /* begin concretizeCmpRdRd */ + regRHS3 = ((self_in_dispatchConcretize->operands))[0]; + regLHS3 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 102; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 46; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS3, regLHS3)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case CmpRsRs: + /* begin concretizeCmpRsRs */ + regRHS4 = ((self_in_dispatchConcretize->operands))[0]; + regLHS4 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 46; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS4, regLHS4)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case DivRdRd: + /* begin concretizeSEE2OpRdRd: */ + regRHS5 = ((self_in_dispatchConcretize->operands))[0]; + regLHS5 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 94; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS5, regLHS5)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case DivRsRs: + /* begin concretizeSEEOpRsRs: */ + regRHS6 = ((self_in_dispatchConcretize->operands))[0]; + regLHS6 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 94; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS6, regLHS6)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MulRdRd: + /* begin concretizeSEE2OpRdRd: */ + regRHS7 = ((self_in_dispatchConcretize->operands))[0]; + regLHS7 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 89; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS7, regLHS7)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MulRsRs: + /* begin concretizeSEEOpRsRs: */ + regRHS8 = ((self_in_dispatchConcretize->operands))[0]; + regLHS8 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 89; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS8, regLHS8)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case OrCqR: + /* begin concretizeOrCqR */ + mask2 = ((self_in_dispatchConcretize->operands))[0]; + reg10 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, mask2)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg10, 1)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask2 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l29; + } + if (reg10 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 13; + ((self_in_dispatchConcretize->machineCode))[1] = (mask2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) mask2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l29; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg10, 1)); + ((self_in_dispatchConcretize->machineCode))[2] = (mask2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) mask2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) mask2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) mask2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l29: /* end concretizeOrCqR */; + return; + + case OrCwR: + /* begin concretizeOrCwR */ + value6 = ((self_in_dispatchConcretize->operands))[0]; + reg11 = ((self_in_dispatchConcretize->operands))[1]; + if (reg11 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 13; + ((self_in_dispatchConcretize->machineCode))[1] = (value6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value6) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l30; + } + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg11, 1)); + ((self_in_dispatchConcretize->machineCode))[2] = (value6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value6) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l30: /* end concretizeOrCwR */; + return; + + case OrRR: + concretizeOpRR(self_in_dispatchConcretize, 11); + return; + + case SubCqR: + /* begin concretizeSubCqR */ + value7 = ((self_in_dispatchConcretize->operands))[0]; + reg12 = ((self_in_dispatchConcretize->operands))[1]; + if (isQuick(self_in_dispatchConcretize, value7)) { + ((self_in_dispatchConcretize->machineCode))[0] = 131; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg12, 5)); + ((self_in_dispatchConcretize->machineCode))[2] = (value7 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l31; + } + if (reg12 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 45; + ((self_in_dispatchConcretize->machineCode))[1] = (value7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value7) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l31; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg12, 5)); + ((self_in_dispatchConcretize->machineCode))[2] = (value7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value7) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l31: /* end concretizeSubCqR */; + return; + + case SubCwR: + /* begin concretizeSubCwR */ + value8 = ((self_in_dispatchConcretize->operands))[0]; + reg13 = ((self_in_dispatchConcretize->operands))[1]; + if (reg13 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 45; + ((self_in_dispatchConcretize->machineCode))[1] = (value8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value8) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l32; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg13, 5)); + ((self_in_dispatchConcretize->machineCode))[2] = (value8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value8) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l32: /* end concretizeSubCwR */; + return; + + case SubRR: + concretizeOpRR(self_in_dispatchConcretize, 43); + return; + + case SubbRR: + /* begin concretizeSubbRR */ + regLHS9 = ((self_in_dispatchConcretize->operands))[0]; + regRHS9 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 27; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, regLHS9, regRHS9)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case SubRdRd: + /* begin concretizeSEE2OpRdRd: */ + regRHS10 = ((self_in_dispatchConcretize->operands))[0]; + regLHS10 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 92; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS10, regLHS10)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SubRsRs: + /* begin concretizeSEEOpRsRs: */ + regRHS11 = ((self_in_dispatchConcretize->operands))[0]; + regLHS11 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 92; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS11, regLHS11)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SqrtRd: + /* begin concretizeSqrtRd */ + reg14 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 81; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, reg14, reg14)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SqrtRs: + /* begin concretizeSqrtRs */ + reg15 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 81; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, reg15, reg15)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case XorCwR: + /* begin concretizeXorCwR */ + value9 = ((self_in_dispatchConcretize->operands))[0]; + reg16 = ((self_in_dispatchConcretize->operands))[1]; + if (reg16 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 53; + ((self_in_dispatchConcretize->machineCode))[1] = (value9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value9) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l38; + } + ((self_in_dispatchConcretize->machineCode))[0] = 129; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg16, 6)); + ((self_in_dispatchConcretize->machineCode))[2] = (value9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) value9) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l38: /* end concretizeXorCwR */; + return; + + case XorRR: + concretizeOpRR(self_in_dispatchConcretize, 51); + return; + + case XorRdRd: + /* begin concretizeXorRdRd */ + regRHS12 = ((self_in_dispatchConcretize->operands))[0]; + regLHS12 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 102; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 87; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS12, regLHS12)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case XorRsRs: + /* begin concretizeXorRsRs */ + regRHS13 = ((self_in_dispatchConcretize->operands))[0]; + regLHS13 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 87; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regRHS13, regLHS13)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case NegateR: + /* begin concretizeNegateR */ + reg17 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 247; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg17, 3)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case NotR: + /* begin concretizeNotR */ + reg18 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 247; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg18, 2)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + return; + + case LoadEffectiveAddressMwrR: + /* begin concretizeLoadEffectiveAddressMwrR */ + offset4 = ((self_in_dispatchConcretize->operands))[0]; + srcReg = ((self_in_dispatchConcretize->operands))[1]; + destReg = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg != ESP) { + if (isQuick(self_in_dispatchConcretize, offset4)) { + ((self_in_dispatchConcretize->machineCode))[0] = 141; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg, destReg)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l43; + } + ((self_in_dispatchConcretize->machineCode))[0] = 141; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg, destReg)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l43; + } + if (isQuick(self_in_dispatchConcretize, offset4)) { + ((self_in_dispatchConcretize->machineCode))[0] = 141; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg, destReg)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset4 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l43; + } + ((self_in_dispatchConcretize->machineCode))[0] = 141; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg, destReg)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset4) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + l43: /* end concretizeLoadEffectiveAddressMwrR */; + return; + + case ArithmeticShiftRightCqR: + /* begin concretizeArithmeticShiftRightCqR */ + shiftCount = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + reg19 = ((self_in_dispatchConcretize->operands))[1]; + if (shiftCount == 1) { + ((self_in_dispatchConcretize->machineCode))[0] = 209; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg19, 7)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l44; + } + ((self_in_dispatchConcretize->machineCode))[0] = 193; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg19, 7)); + ((self_in_dispatchConcretize->machineCode))[2] = shiftCount; + (self_in_dispatchConcretize->machineCodeSize) = 3; + l44: /* end concretizeArithmeticShiftRightCqR */; + return; + + case LogicalShiftRightCqR: + /* begin concretizeLogicalShiftRightCqR */ + distance = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + reg20 = ((self_in_dispatchConcretize->operands))[1]; + if (distance == 1) { + ((self_in_dispatchConcretize->machineCode))[0] = 209; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg20, 5)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l45; + } + ((self_in_dispatchConcretize->machineCode))[0] = 193; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg20, 5)); + ((self_in_dispatchConcretize->machineCode))[2] = distance; + (self_in_dispatchConcretize->machineCodeSize) = 3; + l45: /* end concretizeLogicalShiftRightCqR */; + return; + + case LogicalShiftLeftCqR: + /* begin concretizeLogicalShiftLeftCqR */ + distance1 = (((((self_in_dispatchConcretize->operands))[0]) < 0x1F) ? (((self_in_dispatchConcretize->operands))[0]) : 0x1F); + reg21 = ((self_in_dispatchConcretize->operands))[1]; + if (distance1 == 1) { + ((self_in_dispatchConcretize->machineCode))[0] = 209; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg21, 4)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l46; + } + ((self_in_dispatchConcretize->machineCode))[0] = 193; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg21, 4)); + ((self_in_dispatchConcretize->machineCode))[2] = distance1; + (self_in_dispatchConcretize->machineCodeSize) = 3; + l46: /* end concretizeLogicalShiftLeftCqR */; + return; + + case ArithmeticShiftRightRR: + /* begin concretizeArithmeticShiftRightRR */ + shiftCountReg = ((self_in_dispatchConcretize->operands))[0]; + destReg1 = ((self_in_dispatchConcretize->operands))[1]; + if (shiftCountReg == ECX) { + ((self_in_dispatchConcretize->machineCode))[0] = 211; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg1, 7)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l47; + } + regToShift = (destReg1 == shiftCountReg + ? ECX + : (destReg1 == ECX + ? shiftCountReg + : destReg1)); + if (shiftCountReg == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = (144 + ECX); + ((self_in_dispatchConcretize->machineCode))[1] = 211; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift, 7)); + ((self_in_dispatchConcretize->machineCode))[3] = (144 + ECX); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l47; + } + ((self_in_dispatchConcretize->machineCode))[0] = 135; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg)); + ((self_in_dispatchConcretize->machineCode))[2] = 211; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift, 7)); + ((self_in_dispatchConcretize->machineCode))[4] = 135; + ((self_in_dispatchConcretize->machineCode))[5] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg)); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l47: /* end concretizeArithmeticShiftRightRR */; + return; + + case LogicalShiftLeftRR: + /* begin concretizeLogicalShiftLeftRR */ + shiftCountReg1 = ((self_in_dispatchConcretize->operands))[0]; + destReg2 = ((self_in_dispatchConcretize->operands))[1]; + if (shiftCountReg1 == ECX) { + ((self_in_dispatchConcretize->machineCode))[0] = 211; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg2, 4)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l48; + } + regToShift1 = (destReg2 == shiftCountReg1 + ? ECX + : (destReg2 == ECX + ? shiftCountReg1 + : destReg2)); + if (shiftCountReg1 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = (144 + ECX); + ((self_in_dispatchConcretize->machineCode))[1] = 211; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift1, 4)); + ((self_in_dispatchConcretize->machineCode))[3] = (144 + ECX); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l48; + } + ((self_in_dispatchConcretize->machineCode))[0] = 135; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg1)); + ((self_in_dispatchConcretize->machineCode))[2] = 211; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, regToShift1, 4)); + ((self_in_dispatchConcretize->machineCode))[4] = 135; + ((self_in_dispatchConcretize->machineCode))[5] = (modRMRO(self_in_dispatchConcretize, ModReg, ECX, shiftCountReg1)); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l48: /* end concretizeLogicalShiftLeftRR */; + return; + + case MoveCqR: + /* begin concretizeMoveCqR */ + if ((((self_in_dispatchConcretize->operands))[0]) != 0) { + /* begin concretizeMoveCwR */ + value13 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = (184 + (((self_in_dispatchConcretize->operands))[1])); + ((self_in_dispatchConcretize->machineCode))[1] = (value13 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value13) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value13) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value13) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l165; + } + reg26 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 49; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModReg, reg26, reg26)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + l165: /* end concretizeMoveCqR */; + return; + + case MoveCwR: + /* begin concretizeMoveCwR */ + value10 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = (184 + (((self_in_dispatchConcretize->operands))[1])); + ((self_in_dispatchConcretize->machineCode))[1] = (value10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value10) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value10) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value10) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + return; + + case MoveRR: + concretizeReverseOpRR(self_in_dispatchConcretize, 137); + return; + + case MoveRdRd: + /* begin concretizeMoveRdRd */ + srcReg1 = ((self_in_dispatchConcretize->operands))[0]; + destReg3 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg3, srcReg1)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveRsRs: + /* begin concretizeMoveRsRs */ + srcReg2 = ((self_in_dispatchConcretize->operands))[0]; + destReg4 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, destReg4, srcReg2)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case MoveAwR: + /* begin concretizeMoveAwR */ + addressOperand = ((self_in_dispatchConcretize->operands))[0]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand))) + || ((((AbstractInstruction *) addressOperand)) == (methodLabel()))) { + addressOperand = ((((AbstractInstruction *) addressOperand))->address); + } + reg22 = ((self_in_dispatchConcretize->operands))[1]; + if (reg22 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 161; + ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l52; + } + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg22)); + ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l52: /* end concretizeMoveAwR */; + return; + + case MoveRAw: + /* begin concretizeMoveRAw */ + reg23 = ((self_in_dispatchConcretize->operands))[0]; + addressOperand1 = ((self_in_dispatchConcretize->operands))[1]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand1))) + || ((((AbstractInstruction *) addressOperand1)) == (methodLabel()))) { + addressOperand1 = ((((AbstractInstruction *) addressOperand1))->address); + } + if (reg23 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 163; + ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l53; + } + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg23)); + ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand1 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand1) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand1) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand1) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l53: /* end concretizeMoveRAw */; + return; + + case MoveAbR: + /* begin concretizeMoveAbR */ + addressOperand2 = ((self_in_dispatchConcretize->operands))[0]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand2))) + || ((((AbstractInstruction *) addressOperand2)) == (methodLabel()))) { + addressOperand2 = ((((AbstractInstruction *) addressOperand2))->address); + } + reg24 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg24)); + ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand2 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand2) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand2) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand2) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + return; + + case MoveRAb: + /* begin concretizeMoveRAb */ + reg25 = ((self_in_dispatchConcretize->operands))[0]; + addressOperand3 = ((self_in_dispatchConcretize->operands))[1]; + if ((addressIsInInstructions(((AbstractInstruction *) addressOperand3))) + || ((((AbstractInstruction *) addressOperand3)) == (methodLabel()))) { + addressOperand3 = ((((AbstractInstruction *) addressOperand3))->address); + } + if (reg25 == EAX) { + ((self_in_dispatchConcretize->machineCode))[0] = 162; + ((self_in_dispatchConcretize->machineCode))[1] = (addressOperand3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) addressOperand3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand3) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l55; + } + ((self_in_dispatchConcretize->machineCode))[0] = 136; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 5, reg25)); + ((self_in_dispatchConcretize->machineCode))[2] = (addressOperand3 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) addressOperand3) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand3) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand3) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + l55: /* end concretizeMoveRAb */; + return; + + case MoveMbrR: + /* begin concretizeMoveMbrR */ + offset5 = ((self_in_dispatchConcretize->operands))[0]; + srcReg3 = ((self_in_dispatchConcretize->operands))[1]; + destReg5 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg3 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset5)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg3, destReg5)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l56; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg3, destReg5)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + goto l56; + } + if (isQuick(self_in_dispatchConcretize, offset5)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg3, destReg5)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg3)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l56; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg3, destReg5)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg3)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset5 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset5) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset5) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset5) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + l56: /* end concretizeMoveMbrR */; + return; + + case MoveRMbr: + case MoveRM8r: + /* begin concretizeMoveRMbr */ + offset6 = ((self_in_dispatchConcretize->operands))[1]; + srcReg4 = ((self_in_dispatchConcretize->operands))[0]; + destReg6 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg4 >= 4) { + error("invalid register"); + } + if (destReg6 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset6)) { + ((self_in_dispatchConcretize->machineCode))[0] = 136; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg6, srcReg4)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset6 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l57; + } + ((self_in_dispatchConcretize->machineCode))[0] = 136; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg6, srcReg4)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l57; + } + ((self_in_dispatchConcretize->machineCode))[0] = 136; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg6, srcReg4)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg6)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset6 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset6) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset6) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset6) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + l57: /* end concretizeMoveRMbr */; + return; + + case MoveM8rR: + /* begin concretizeMoveM8rR */ + offset7 = ((self_in_dispatchConcretize->operands))[0]; + srcReg5 = ((self_in_dispatchConcretize->operands))[1]; + destReg7 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg5 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset7)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg5, destReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l58; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg5, destReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + goto l58; + } + if (isQuick(self_in_dispatchConcretize, offset7)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg5, destReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg5)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset7 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l58; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg5, destReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg5)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset7 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset7) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset7) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset7) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + l58: /* end concretizeMoveM8rR */; + return; + + case MoveM16rR: + /* begin concretizeMoveM16rR */ + offset8 = ((self_in_dispatchConcretize->operands))[0]; + srcReg6 = ((self_in_dispatchConcretize->operands))[1]; + destReg8 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg6 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset8)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 183; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg6, destReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l59; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 183; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg6, destReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset8) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + goto l59; + } + if (isQuick(self_in_dispatchConcretize, offset8)) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 183; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg6, destReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg6)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset8 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l59; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 183; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg6, destReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg6)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset8 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset8) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset8) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset8) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + l59: /* end concretizeMoveM16rR */; + return; + + case MoveRM16r: + /* begin concretizeMoveRM16r */ + offset9 = ((self_in_dispatchConcretize->operands))[1]; + srcReg7 = ((self_in_dispatchConcretize->operands))[0]; + destReg9 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg9 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset9)) { + ((self_in_dispatchConcretize->machineCode))[0] = 102; + ((self_in_dispatchConcretize->machineCode))[1] = 137; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg9, srcReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l60; + } + ((self_in_dispatchConcretize->machineCode))[0] = 102; + ((self_in_dispatchConcretize->machineCode))[1] = 137; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg9, srcReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset9) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + goto l60; + } + ((self_in_dispatchConcretize->machineCode))[0] = 102; + ((self_in_dispatchConcretize->machineCode))[1] = 137; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg9, srcReg7)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg9)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset9 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset9) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset9) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset9) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + l60: /* end concretizeMoveRM16r */; + return; + + case MoveM32rR: + case MoveMwrR: + /* begin concretizeMoveMwrR */ + offset10 = ((self_in_dispatchConcretize->operands))[0]; + srcReg8 = ((self_in_dispatchConcretize->operands))[1]; + destReg10 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg8 != ESP) { + if ((offset10 == 0) + && (srcReg8 != EBP)) { + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, srcReg8, destReg10)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l61; + } + if (isQuick(self_in_dispatchConcretize, offset10)) { + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg8, destReg10)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset10 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l61; + } + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg8, destReg10)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset10) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset10) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset10) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l61; + } + if (offset10 == 0) { + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, srcReg8, destReg10)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l61; + } + if (isQuick(self_in_dispatchConcretize, offset10)) { + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg8, destReg10)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset10 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l61; + } + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg8, destReg10)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg8)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset10 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset10) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset10) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset10) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + l61: /* end concretizeMoveMwrR */; + return; + + case MoveRM32r: + case MoveRMwr: + /* begin concretizeMoveRMwr */ + srcReg9 = ((self_in_dispatchConcretize->operands))[0]; + offset11 = ((self_in_dispatchConcretize->operands))[1]; + destReg11 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg11 != ESP) { + if ((offset11 == 0) + && (destReg11 != EBP)) { + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, destReg11, srcReg9)); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l62; + } + if (isQuick(self_in_dispatchConcretize, offset11)) { + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg11, srcReg9)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset11 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l62; + } + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg11, srcReg9)); + ((self_in_dispatchConcretize->machineCode))[2] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset11) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset11) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset11) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l62; + } + if (offset11 == 0) { + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, destReg11, srcReg9)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l62; + } + if (isQuick(self_in_dispatchConcretize, offset11)) { + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg11, srcReg9)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset11 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l62; + } + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg11, srcReg9)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg11)); + ((self_in_dispatchConcretize->machineCode))[3] = (offset11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset11) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset11) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset11) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 7; + l62: /* end concretizeMoveRMwr */; + return; + + case MoveM32rRs: + /* begin concretizeMoveM32rRs */ + offset12 = ((self_in_dispatchConcretize->operands))[0]; + srcReg10 = ((self_in_dispatchConcretize->operands))[1]; + destReg12 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg10 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset12)) { + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg10, destReg12)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l63; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg10, destReg12)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset12) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l63; + } + if (isQuick(self_in_dispatchConcretize, offset12)) { + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg10, destReg12)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg10)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l63; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg10, destReg12)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg10)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset12) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset12) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset12) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 9; + l63: /* end concretizeMoveM32rRs */; + return; + + case MoveRsM32r: + /* begin concretizeMoveRsM32r */ + srcReg11 = ((self_in_dispatchConcretize->operands))[0]; + offset13 = ((self_in_dispatchConcretize->operands))[1]; + destReg13 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg13 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset13)) { + + /* MOVSD destReg, srcReg */ + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset13 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l64; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset13 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset13) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset13) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset13) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l64; + } + if (isQuick(self_in_dispatchConcretize, offset13)) { + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg13)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset13 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l64; + } + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg13, srcReg11)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg13)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset13 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset13) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset13) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset13) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 9; + l64: /* end concretizeMoveRsM32r */; + return; + + case MoveM64rRd: + /* begin concretizeMoveM64rRd */ + offset14 = ((self_in_dispatchConcretize->operands))[0]; + srcReg12 = ((self_in_dispatchConcretize->operands))[1]; + destReg14 = ((self_in_dispatchConcretize->operands))[2]; + if (srcReg12 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset14)) { + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset14 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l65; + } + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset14 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset14) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset14) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset14) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l65; + } + if (isQuick(self_in_dispatchConcretize, offset14)) { + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg12)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset14 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l65; + } + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 16; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, srcReg12, destReg14)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, srcReg12)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset14 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset14) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset14) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset14) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 9; + l65: /* end concretizeMoveM64rRd */; + return; + + case MoveXbrRR: + /* begin concretizeMoveXbrRR */ + index = ((self_in_dispatchConcretize->operands))[0]; + base = ((self_in_dispatchConcretize->operands))[1]; + dest = ((self_in_dispatchConcretize->operands))[2]; + if (base != EBP) { + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, dest)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, index, base)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + goto l66; + } + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, dest)); + ((self_in_dispatchConcretize->machineCode))[3] = (sib(self_in_dispatchConcretize, SIB1, index, base)); + ((self_in_dispatchConcretize->machineCode))[4] = 0; + (self_in_dispatchConcretize->machineCodeSize) = 5; + l66: /* end concretizeMoveXbrRR */; + return; + + case MoveRXbrR: + /* begin concretizeMoveRXbrR */ + src = ((self_in_dispatchConcretize->operands))[0]; + index1 = ((self_in_dispatchConcretize->operands))[1]; + base1 = ((self_in_dispatchConcretize->operands))[2]; + mcIdx = 0; + swapreg = NoReg; + if (src >= 4) { + + /* x86 allows movb %rl, mem only with %al, %bl, %cl, %dl, so swap with the first one that isn't used. */ + swapreg = src; + if (index1 == EAX) { + index1 = swapreg; + } + if (base1 == EAX) { + base1 = swapreg; + } + src = EAX; + mcIdx = 1; + ((self_in_dispatchConcretize->machineCode))[0] = (144 + swapreg); + } + if (base1 != EBP) { + ((self_in_dispatchConcretize->machineCode))[mcIdx] = 136; + ((self_in_dispatchConcretize->machineCode))[mcIdx + 1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, src)); + ((self_in_dispatchConcretize->machineCode))[mcIdx + 2] = (sib(self_in_dispatchConcretize, SIB1, index1, base1)); + if (swapreg != NoReg) { + ((self_in_dispatchConcretize->machineCode))[mcIdx + 3] = (144 + swapreg); + } + (self_in_dispatchConcretize->machineCodeSize) = 3 + (2 * mcIdx); + goto l67; + } + ((self_in_dispatchConcretize->machineCode))[mcIdx] = 136; + ((self_in_dispatchConcretize->machineCode))[mcIdx + 1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, src)); + ((self_in_dispatchConcretize->machineCode))[mcIdx + 2] = (sib(self_in_dispatchConcretize, SIB1, index1, base1)); + ((self_in_dispatchConcretize->machineCode))[mcIdx + 3] = 0; + if (swapreg != NoReg) { + ((self_in_dispatchConcretize->machineCode))[mcIdx + 4] = (144 + swapreg); + } + (self_in_dispatchConcretize->machineCodeSize) = 4 + (2 * mcIdx); + l67: /* end concretizeMoveRXbrR */; + return; + + case MoveXwrRR: + /* begin concretizeMoveXwrRR */ + index2 = ((self_in_dispatchConcretize->operands))[0]; + base2 = ((self_in_dispatchConcretize->operands))[1]; + dest1 = ((self_in_dispatchConcretize->operands))[2]; + if (base2 != EBP) { + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, dest1)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index2, base2)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l68; + } + ((self_in_dispatchConcretize->machineCode))[0] = 139; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, dest1)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index2, base2)); + ((self_in_dispatchConcretize->machineCode))[3] = 0; + (self_in_dispatchConcretize->machineCodeSize) = 4; + l68: /* end concretizeMoveXwrRR */; + return; + + case MoveRXwrR: + /* begin concretizeMoveRXwrR */ + src1 = ((self_in_dispatchConcretize->operands))[0]; + index3 = ((self_in_dispatchConcretize->operands))[1]; + base3 = ((self_in_dispatchConcretize->operands))[2]; + if (base3 != EBP) { + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegInd, 4, src1)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index3, base3)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + goto l69; + } + ((self_in_dispatchConcretize->machineCode))[0] = 137; + ((self_in_dispatchConcretize->machineCode))[1] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, 4, src1)); + ((self_in_dispatchConcretize->machineCode))[2] = (sib(self_in_dispatchConcretize, SIB4, index3, base3)); + ((self_in_dispatchConcretize->machineCode))[3] = 0; + (self_in_dispatchConcretize->machineCodeSize) = 4; + l69: /* end concretizeMoveRXwrR */; + return; + + case MoveRdM64r: + /* begin concretizeMoveRdM64r */ + srcReg13 = ((self_in_dispatchConcretize->operands))[0]; + offset15 = ((self_in_dispatchConcretize->operands))[1]; + destReg15 = ((self_in_dispatchConcretize->operands))[2]; + if (destReg15 != ESP) { + if (isQuick(self_in_dispatchConcretize, offset15)) { + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset15 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + goto l70; + } + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (offset15 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset15) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset15) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset15) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 8; + goto l70; + } + if (isQuick(self_in_dispatchConcretize, offset15)) { + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp8, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg15)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset15 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 6; + goto l70; + } + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 17; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModRegRegDisp32, destReg15, srcReg13)); + ((self_in_dispatchConcretize->machineCode))[4] = (sib(self_in_dispatchConcretize, SIB1, 4, destReg15)); + ((self_in_dispatchConcretize->machineCode))[5] = (offset15 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) offset15) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[7] = ((((usqInt) offset15) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[8] = ((((usqInt) offset15) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 9; + l70: /* end concretizeMoveRdM64r */; + return; + + case PopR: + /* begin concretizePopR */ + ((self_in_dispatchConcretize->machineCode))[0] = (88 + (((self_in_dispatchConcretize->operands))[0])); + (self_in_dispatchConcretize->machineCodeSize) = 1; + return; + + case PushR: + /* begin concretizePushR */ + ((self_in_dispatchConcretize->machineCode))[0] = (80 + (((self_in_dispatchConcretize->operands))[0])); + (self_in_dispatchConcretize->machineCodeSize) = 1; + return; + + case PushCq: + /* begin concretizePushCq */ + value11 = ((self_in_dispatchConcretize->operands))[0]; + if (isQuick(self_in_dispatchConcretize, value11)) { + ((self_in_dispatchConcretize->machineCode))[0] = 106; + ((self_in_dispatchConcretize->machineCode))[1] = (value11 & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 2; + goto l73; + } + ((self_in_dispatchConcretize->machineCode))[0] = 104; + ((self_in_dispatchConcretize->machineCode))[1] = (value11 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value11) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value11) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value11) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + l73: /* end concretizePushCq */; + return; + + case PushCw: + /* begin concretizePushCw */ + value12 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 104; + ((self_in_dispatchConcretize->machineCode))[1] = (value12 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[2] = ((((usqInt) value12) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) value12) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) value12) >> 24) & 0xFF); + (self_in_dispatchConcretize->machineCodeSize) = 5; + return; + + case PrefetchAw: + /* begin concretizePrefetchAw */ + if (((self_in_dispatchConcretize->maxSize)) > 0) { + addressOperand4 = ((self_in_dispatchConcretize->operands))[0]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 24; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, 0, 5, 1)); + ((self_in_dispatchConcretize->machineCode))[3] = (addressOperand4 & 0xFF); + ((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) addressOperand4) >> 8) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) addressOperand4) >> 16) & 0xFF); + ((self_in_dispatchConcretize->machineCode))[6] = ((((usqInt) addressOperand4) >> 24) & 0xFF); + } + (self_in_dispatchConcretize->machineCodeSize) = (self_in_dispatchConcretize->maxSize); + return; + + case ConvertRRd: + /* begin concretizeConvertRRd */ + srcReg14 = ((self_in_dispatchConcretize->operands))[0]; + destReg16 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 42; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg14, destReg16)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRdR: + /* begin concretizeConvertRdR */ + srcReg15 = ((self_in_dispatchConcretize->operands))[0]; + destReg17 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 45; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg15, destReg17)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRsRd: + /* begin concretizeConvertRsRd */ + srcReg16 = ((self_in_dispatchConcretize->operands))[0]; + destReg18 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 90; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg16, destReg18)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRdRs: + /* begin concretizeConvertRdRs */ + srcReg17 = ((self_in_dispatchConcretize->operands))[0]; + destReg19 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 242; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 90; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg17, destReg19)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRsR: + /* begin concretizeConvertRsR */ + srcReg18 = ((self_in_dispatchConcretize->operands))[0]; + destReg20 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 45; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg18, destReg20)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case ConvertRRs: + /* begin concretizeConvertRRs */ + srcReg19 = ((self_in_dispatchConcretize->operands))[0]; + destReg21 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 243; + ((self_in_dispatchConcretize->machineCode))[1] = 15; + ((self_in_dispatchConcretize->machineCode))[2] = 42; + ((self_in_dispatchConcretize->machineCode))[3] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg19, destReg21)); + (self_in_dispatchConcretize->machineCodeSize) = 4; + return; + + case SignExtend8RR: + /* begin concretizeSignExtend8RR */ + srcReg20 = ((self_in_dispatchConcretize->operands))[0]; + destReg22 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 190; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg20, destReg22)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case SignExtend16RR: + /* begin concretizeSignExtend16RR */ + srcReg21 = ((self_in_dispatchConcretize->operands))[0]; + destReg23 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 191; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg21, destReg23)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case ZeroExtend8RR: + /* begin concretizeZeroExtend8RR */ + srcReg22 = ((self_in_dispatchConcretize->operands))[0]; + destReg24 = ((self_in_dispatchConcretize->operands))[1]; + ((self_in_dispatchConcretize->machineCode))[0] = 15; + ((self_in_dispatchConcretize->machineCode))[1] = 182; + ((self_in_dispatchConcretize->machineCode))[2] = (modRMRO(self_in_dispatchConcretize, ModReg, srcReg22, destReg24)); + (self_in_dispatchConcretize->machineCodeSize) = 3; + return; + + case ZeroExtend16RR: + concretizeZeroExtend16RR(self_in_dispatchConcretize); + return; + + default: + error("Case not found and no otherwise clause"); + } + return; +} + + +/* Attempt to generate concrete machine code for the instruction at address. + This is part of the inner dispatch of concretizeAt: actualAddress which + exists only + to get around the number of literals limits in the SqueakV3 (blue book + derived) bytecode set. */ + + /* CogIA32Compiler>>#dispatchConcretizeProcessorSpecific */ +static void NoDbgRegParms +dispatchConcretizeProcessorSpecific(AbstractInstruction * self_in_dispatchConcretizeProcessorSpecific) +{ + usqIntptr_t addressOperand; + usqIntptr_t addressOperand1; + usqIntptr_t destReg; + usqIntptr_t destReg1; + usqIntptr_t destReg2; + usqIntptr_t destReg3; + usqIntptr_t offset; + usqIntptr_t offset1; + usqIntptr_t offset2; + usqIntptr_t offset3; + usqIntptr_t reg; + usqIntptr_t reg1; + usqIntptr_t reg11; + usqIntptr_t reg2; + usqIntptr_t reg21; + usqIntptr_t reg3; + usqIntptr_t regDivisor; + usqIntptr_t srcReg; + usqIntptr_t srcReg1; + sqInt srcReg2; + sqInt srcReg3; + + + switch ((self_in_dispatchConcretizeProcessorSpecific->opcode)) { + case CDQ: + /* begin concretizeCDQ */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 153; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + case IDIVR: + /* begin concretizeIDIVR */ + regDivisor = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 247; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, regDivisor, 7)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 2; + return; + + case IMULRR: + /* begin concretizeMulRR */ + reg1 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + reg2 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 175; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, reg1, reg2)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + return; + + case CPUID: + /* begin concretizeCPUID */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 162; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 2; + return; + + case CMPXCHGAwR: + /* begin concretizeCMPXCHGAwR */ + addressOperand = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + reg = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 177; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegInd, 5, reg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (addressOperand & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) addressOperand) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) addressOperand) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) addressOperand) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 7; + return; + + case CMPXCHGMwrR: + /* begin concretizeCMPXCHGMwrR */ + offset = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + srcReg = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + destReg = ((self_in_dispatchConcretizeProcessorSpecific->operands))[2]; + if (srcReg != ESP) { + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 177; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, srcReg, destReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 4; + goto l6; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 177; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, srcReg, destReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) offset) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 7; + goto l6; + } + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 177; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, srcReg, destReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, srcReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = (offset & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 5; + goto l6; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 177; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, srcReg, destReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, srcReg)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = (offset & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) offset) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[7] = ((((usqInt) offset) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 8; + l6: /* end concretizeCMPXCHGMwrR */; + return; + + case LFENCE: + /* begin concretizeFENCE: */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 174; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, 0, 5)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + return; + + case MFENCE: + /* begin concretizeFENCE: */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 174; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, 0, 6)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + return; + + case SFENCE: + /* begin concretizeFENCE: */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 15; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = 174; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, 0, 7)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + return; + + case LOCK: + /* begin concretizeLOCK */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 240; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + case XCHGAwR: + /* begin concretizeXCHGAwR */ + addressOperand1 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + reg3 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegInd, 5, reg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (addressOperand1 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = ((((usqInt) addressOperand1) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) addressOperand1) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) addressOperand1) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 6; + return; + + case XCHGMwrR: + /* begin concretizeXCHGMwrR */ + offset1 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + srcReg1 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + destReg1 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[2]; + if (srcReg1 != ESP) { + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset1)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, srcReg1, destReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset1 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + goto l12; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, srcReg1, destReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset1 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = ((((usqInt) offset1) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset1) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset1) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 6; + goto l12; + } + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset1)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, srcReg1, destReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, srcReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset1 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 4; + goto l12; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, srcReg1, destReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, srcReg1)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset1 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset1) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset1) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) offset1) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 7; + l12: /* end concretizeXCHGMwrR */; + return; + + case XCHGRR: + /* begin concretizeXCHGRR */ + reg11 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + reg21 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + if (reg21 == EAX) { + reg21 = reg11; + reg11 = EAX; + } + if (reg11 == EAX) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = (144 + reg21); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + goto l13; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 135; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModReg, reg11, reg21)); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 2; + l13: /* end concretizeXCHGRR */; + return; + + case FSTPS: + /* begin concretizeFSTPS */ + srcReg2 = 3; + offset2 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + destReg2 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + if (destReg2 != ESP) { + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset2)) { + + /* FSTP dest */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 217; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, destReg2, srcReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset2 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + goto l14; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 217; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, destReg2, srcReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset2 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = ((((usqInt) offset2) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset2) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset2) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 6; + goto l14; + } + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset2)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 217; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, destReg2, srcReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, destReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset2 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 4; + goto l14; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 217; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, destReg2, srcReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, destReg2)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset2 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset2) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset2) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) offset2) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 7; + l14: /* end concretizeFSTPS */; + return; + + case FSTPD: + /* begin concretizeFSTPD */ + srcReg3 = 3; + offset3 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[0]; + destReg3 = ((self_in_dispatchConcretizeProcessorSpecific->operands))[1]; + if (destReg3 != ESP) { + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset3)) { + + /* FSTP dest */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 221; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, destReg3, srcReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset3 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 3; + goto l15; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 221; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, destReg3, srcReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (offset3 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = ((((usqInt) offset3) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset3) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset3) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 6; + goto l15; + } + if (isQuick(self_in_dispatchConcretizeProcessorSpecific, offset3)) { + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 221; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp8, destReg3, srcReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, destReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset3 & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 4; + goto l15; + } + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 221; + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[1] = (modRMRO(self_in_dispatchConcretizeProcessorSpecific, ModRegRegDisp32, destReg3, srcReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[2] = (sib(self_in_dispatchConcretizeProcessorSpecific, SIB1, 4, destReg3)); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[3] = (offset3 & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[4] = ((((usqInt) offset3) >> 8) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[5] = ((((usqInt) offset3) >> 16) & 0xFF); + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[6] = ((((usqInt) offset3) >> 24) & 0xFF); + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 7; + l15: /* end concretizeFSTPD */; + return; + + case REP: + /* begin concretizeREP */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 243; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + case CLD: + /* begin concretizeCLD */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 0xFC; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + case MOVSB: + /* begin concretizeMOVSB */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 164; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + case MOVSD: + /* begin concretizeMOVSD */ + ((self_in_dispatchConcretizeProcessorSpecific->machineCode))[0] = 165; + (self_in_dispatchConcretizeProcessorSpecific->machineCodeSize) = 1; + return; + + default: + error("Case not found and no otherwise clause"); + } + return; +} + + +/* Answer if CallFull and/or JumpFull are relative and hence need relocating + on method + compation. If so, they are annotated with IsRelativeCall in methods and + relocated in + relocateIfCallOrMethodReference:mcpc:delta: */ + + /* CogIA32Compiler>>#fullCallsAreRelative */ +static sqInt NoDbgRegParms +fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative) +{ + return 1; +} + + /* CogIA32Compiler>>#genDivR:R:Quo:Rem: */ +static AbstractInstruction * NoDbgRegParms +genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder) +{ + sqInt rDividend; + sqInt rDivisor; + sqInt reg; + sqInt rQuotient; + sqInt rRemainder; + sqInt rUnused; + sqInt saveRestoreEAX; + sqInt saveRestoreEDX; + sqInt saveRestoreExchanged; + + assert(abstractRegDividend != abstractRegDivisor); + assert(abstractRegQuotient != abstractRegRemainder); + rDividend = abstractRegDividend; + rDivisor = abstractRegDivisor; + rQuotient = abstractRegQuotient; + + /* IDIV r does a signed divide of EDX:EAX by r, EAX := Quotient, EDX := Remainder. + Since we must sign extend the dividend into EDX we must substitute another register if EDX is an input */ + rRemainder = abstractRegRemainder; + if ((rDividend == EDX) + || (rDivisor == EDX)) { + + /* Slang, sigh... */ + rUnused = EAX; + while (rUnused <= EDI) { + if ((rUnused != ESP) + && ((rUnused != EBP) + && ((rUnused != EDX) + && ((rUnused != rDividend) + && ((rUnused != rDivisor) + && ((rUnused != rQuotient) + && (rUnused != rRemainder))))))) { + /* begin PushR: */ + genoperand(PushR, rUnused); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EDX, rUnused); + if (rDividend == EDX) { + genDivRRQuoRem(self_in_genDivRRQuoRem, rDivisor, rUnused, rQuotient, rRemainder); + } + else { + genDivRRQuoRem(self_in_genDivRRQuoRem, rUnused, rDividend, rQuotient, rRemainder); + } + /* begin PopR: */ + genoperand(PopR, rUnused); + return self_in_genDivRRQuoRem; + } + rUnused += 1; + } + error("couldn't find unused register in genDivR:R:Quo:Rem:"); + } + if ((saveRestoreEAX = (rQuotient != EAX) + && (rRemainder != EAX))) { + /* begin PushR: */ + genoperand(PushR, EAX); + } + if ((saveRestoreEDX = (rQuotient != EDX) + && (rRemainder != EDX))) { + /* begin PushR: */ + genoperand(PushR, EDX); + } + saveRestoreExchanged = -1; + if (rDividend != EAX) { + if (rDivisor == EAX) { + if (((rDividend != rQuotient) + && (rDividend != rRemainder)) + && ((rDividend != EDX) + || (!saveRestoreEDX))) { + /* begin PushR: */ + reg = (saveRestoreExchanged = rDividend); + genoperand(PushR, reg); + } + genoperandoperand(XCHGRR, rDivisor, rDividend); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, rDividend, EAX); + } + } + gen(CDQ); + genoperand(IDIVR, (rDivisor == EAX + ? rDividend + : rDivisor)); + if ((rQuotient == EDX) + && (rRemainder == EAX)) { + genoperandoperand(XCHGRR, rQuotient, rRemainder); + } + else { + if (rQuotient == EDX) { + if (rRemainder != EDX) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EDX, rRemainder); + } + if (rQuotient != EAX) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EAX, rQuotient); + } + } + else { + if (rQuotient != EAX) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EAX, rQuotient); + } + if (rRemainder != EDX) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EDX, rRemainder); + } + } + } + if (saveRestoreExchanged >= 0) { + /* begin PopR: */ + genoperand(PopR, saveRestoreExchanged); + } + if (saveRestoreEDX) { + /* begin PopR: */ + genoperand(PopR, EDX); + } + if (saveRestoreEAX) { + /* begin PopR: */ + genoperand(PopR, EAX); + } + return self_in_genDivRRQuoRem; +} + + /* CogIA32Compiler>>#generateCheckFeatures */ +static AbstractInstruction * NoDbgRegParms +generateCheckFeatures(AbstractInstruction * self_in_generateCheckFeatures) +{ + AbstractInstruction *anInstruction; + + /* begin PushR: */ + genoperand(PushR, EDX); + /* begin PushR: */ + genoperand(PushR, ECX); + /* begin PushR: */ + genoperand(PushR, EBX); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, EAX); + gen(CPUID); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, EDX, EAX); + /* begin PopR: */ + genoperand(PopR, EBX); + /* begin PopR: */ + genoperand(PopR, ECX); + /* begin PopR: */ + genoperand(PopR, EDX); + /* begin RetN: */ + genoperand(RetN, 0); + return self_in_generateCheckFeatures; +} + + +/* Generate a function that attempts to lock the vmOwnerLock and answers + true if it succeeded. */ + + /* CogIA32Compiler>>#generateLowLevelTryLock: */ +static AbstractInstruction * NoDbgRegParms +generateLowLevelTryLock(AbstractInstruction * self_in_generateLowLevelTryLock, sqInt vmOwnerLockAddress) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + + if (vmOwnerLockAddress == 0) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, EAX); + /* begin RetN: */ + genoperand(RetN, 0); + return self_in_generateLowLevelTryLock; + } + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 1, EAX); + gen(MFENCE); + genoperandoperand(XCHGAwR, vmOwnerLockAddress, EAX); + gen(SFENCE); + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, 1, EAX); + /* begin RetN: */ + genoperand(RetN, 0); + return self_in_generateLowLevelTryLock; +} + + /* CogIA32Compiler>>#generateLowLevelUnlock: */ +static AbstractInstruction * NoDbgRegParms +generateLowLevelUnlock(AbstractInstruction * self_in_generateLowLevelUnlock, sqInt vmOwnerLockAddress) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + if (vmOwnerLockAddress != 0) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, EAX); + /* begin MoveR:Aw: */ + anInstruction1 = genoperandoperand(MoveRAw, EAX, vmOwnerLockAddress); + gen(SFENCE); + } + /* begin RetN: */ + genoperand(RetN, 0); + return self_in_generateLowLevelUnlock; +} + + +/* Load the stack pointer register with that of the C stack, effecting + a switch to the C stack. Used when machine code calls into the + CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogIA32Compiler>>#genLoadCStackPointer */ +static sqInt NoDbgRegParms +genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer) +{ + sqInt address; + AbstractInstruction *anInstruction; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + return 0; +} + + +/* Load the frame and stack pointer registers with those of the C stack, + effecting a switch to the C stack. Used when machine code calls into + the CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogIA32Compiler>>#genLoadCStackPointers */ +static sqInt NoDbgRegParms +genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + /* begin MoveAw:R: */ + address1 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, FPReg); + return 0; +} + + +/* Switch back to the Smalltalk stack. Assign SPReg first + because typically it is used immediately afterwards. */ + + /* CogIA32Compiler>>#genLoadStackPointers */ +static sqInt NoDbgRegParms +genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveAw:R: */ + address = stackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + /* begin MoveAw:R: */ + address1 = framePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, FPReg); + return 0; +} + + +/* Get the abstract registers for ECX, EDI and ESI */ + + /* CogIA32Compiler>>#genMemCopy:to:constantSize: */ +static AbstractInstruction * NoDbgRegParms +genMemCopytoconstantSize(AbstractInstruction * self_in_genMemCopytoconstantSize, sqInt originalSourceReg, sqInt originalDestReg, sqInt size) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt countReg; + sqInt destReg; + AbstractInstruction * inst; + sqInt numbytes; + sqInt numwords; + sqInt sourceReg; + + sourceReg = ESI; + destReg = EDI; + + /* Put the source in ESI and the dest in EDI */ + countReg = ECX; + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (originalSourceReg != sourceReg) { + if (originalDestReg == sourceReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalDestReg, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalSourceReg, sourceReg); + } + if (originalDestReg != destReg) { + if (originalDestReg == sourceReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, destReg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalDestReg, destReg); + } + } + gen(CLD); + numbytes = size & 3; + if (numbytes > 0) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numbytes, countReg); + gen(REP); + gen(MOVSB); + } + numwords = size / 4; + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, numwords, countReg); + gen(REP); + gen(MOVSD); + return self_in_genMemCopytoconstantSize; +} + + +/* Get the abstract registers for ECX, EDI and ESI */ + + /* CogIA32Compiler>>#genMemCopy:to:size: */ +static AbstractInstruction * NoDbgRegParms +genMemCopytosize(AbstractInstruction * self_in_genMemCopytosize, sqInt originalSourceReg, sqInt originalDestReg, sqInt originalSize) +{ + AbstractInstruction *anInstruction; + sqInt countReg; + sqInt destReg; + AbstractInstruction * inst; + sqInt size; + sqInt sourceReg; + sqInt spilledSize; + + sourceReg = ESI; + destReg = EDI; + + /* TODO: Avoid spilling */ + countReg = ECX; + spilledSize = 0; + if ((originalSize == sourceReg) + || (originalSize == destReg)) { + /* begin PushR: */ + genoperand(PushR, originalSize); + spilledSize = 1; + } + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (originalSourceReg != sourceReg) { + if (originalDestReg == sourceReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalDestReg, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalSourceReg, sourceReg); + } + if (originalDestReg != destReg) { + if (originalDestReg == sourceReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, destReg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalDestReg, destReg); + } + } + if (spilledSize) { + /* begin PopR: */ + genoperand(PopR, TempReg); + size = TempReg; + } + else { + if (originalSize == countReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, originalSize, TempReg); + size = TempReg; + } + else { + size = originalSize; + } + } + gen(CLD); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, size, countReg); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 3, countReg); + gen(REP); + gen(MOVSB); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, size, countReg); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 2, countReg); + gen(REP); + gen(MOVSD); + return self_in_genMemCopytosize; +} + + /* CogIA32Compiler>>#genMulR:R: */ +static AbstractInstruction * NoDbgRegParms +genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest) +{ + return genoperandoperand(IMULRR, regSource, regDest); +} + + /* CogIA32Compiler>>#genPushC64: */ +static AbstractInstruction * NoDbgRegParms +genPushC64(AbstractInstruction * self_in_genPushC64, sqLong constant64Bits) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt highPart; + AbstractInstruction * inst; + + if (BytesPerWord == 4) { + highPart = (constant64Bits >> 32ll); + /* begin PushCw: */ + anInstruction = genoperand(PushCw, highPart); + inst = anInstruction; + /* begin PushCw: */ + anInstruction1 = genoperand(PushCw, ((sqInt) (constant64Bits & 0xFFFFFFFFU))); + return inst; + } + else { + /* begin PushCw: */ + anInstruction2 = genoperand(PushCw, constant64Bits); + return anInstruction2; + } +} + + +/* Ensure that the register args are pushed before the outer and + inner retpcs at an entry miss for arity <= self numRegArgs. The + outer retpc is that of a call at a send site. The inner is the call + from a method or PIC abort/miss to the trampoline. */ +/* This won't be as clumsy on a RISC. But putting the receiver and + args above the return address means the CoInterpreter has a + single machine-code frame format which saves us a lot of work. */ +/* Iff there are register args convert + base -> outerRetpc (send site retpc) + sp -> innerRetpc (PIC abort/miss retpc) + to + base -> receiver + (arg0) + (arg1) + outerRetpc + sp -> innerRetpc (PIC abort/miss retpc) */ + + /* CogIA32Compiler>>#genPushRegisterArgsForAbortMissNumArgs: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + if (numArgs == 0) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, SPReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 2 * BytesPerWord, SPReg); + return self_in_genPushRegisterArgsForAbortMissNumArgs; + } + if (numArgs == 1) { + /* begin MoveMw:r:R: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin MoveMw:r:R: */ + anInstruction5 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 3 * BytesPerWord, SPReg); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, Arg0Reg, 2 * BytesPerWord, SPReg); + return self_in_genPushRegisterArgsForAbortMissNumArgs; + } + if (numArgs == 2) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + /* begin MoveMw:r:R: */ + anInstruction8 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin MoveMw:r:R: */ + anInstruction9 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 4 * BytesPerWord, SPReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, Arg0Reg, 3 * BytesPerWord, SPReg); + return self_in_genPushRegisterArgsForAbortMissNumArgs; + } + } + return self_in_genPushRegisterArgsForAbortMissNumArgs; +} + + +/* Ensure that the register args are pushed before the retpc for arity <= + self numRegArgs. This + isn't as clumsy on a RISC. But putting the receiver and args above the + return address + means the CoInterpreter has a single machine-code frame format which saves + us a lot of work. + N.B. Take great care to /not/ smash TempReg, which is used in directed + send marshalling. + We could use XCHG to swap the ReceiverResultReg and top-of-stack return + address, pushing the + the ret pc (now in ReceiverResultReg) later, but XCHG is very slow. We can + use SendNumArgsReg + because it is only live in sends of arity >= (NumSendTrampolines - 1). */ + + /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) +{ + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + + assert((numRegArgs()) < (NumSendTrampolines - 1)); + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + + /* a.k.a. + cogit gen: XCHGMwrR operand: 0 operand: SPReg operand: ReceiverResultReg. + but XCHG is slow. */ + /* begin MoveMw:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, SPReg, scratchReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); + if (numArgs > 0) { + /* begin PushR: */ + genoperand(PushR, Arg0Reg); + if (numArgs > 1) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + } + } + /* begin PushR: */ + genoperand(PushR, scratchReg); + + } + return self_in_genPushRegisterArgsForNumArgsscratchReg; +} + + /* CogIA32Compiler>>#genRemoveNArgsFromStack: */ +static sqInt NoDbgRegParms +genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) +{ + AbstractInstruction *anInstruction; + + if (!(n == 0)) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, n * 4, ESP); + } + return 0; +} + + /* CogIA32Compiler>>#genRemoveNFloatArgsFromStack: */ +static sqInt NoDbgRegParms +genRemoveNFloatArgsFromStack(AbstractInstruction * self_in_genRemoveNFloatArgsFromStack, sqInt n) +{ + AbstractInstruction *anInstruction; + + if (n > 0) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, n * 8, ESP); + } + return 0; +} + + /* CogIA32Compiler>>#genRestoreRegsExcept: */ +static sqInt NoDbgRegParms +genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt preservedReg) +{ + AbstractInstruction *anInstruction; + sqInt reg; + + assert(((EDI - EAX) + 1) == 6); + for (reg = EAX; reg <= EDI; reg += 1) { + if (!(((reg >= ESP) && (reg <= EBP)))) { + if (preservedReg == reg) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 4, ESP); + } + else { + /* begin PopR: */ + genoperand(PopR, reg); + } + } + } + return 0; +} + + +/* Restore the registers in regMask as saved by genSaveRegs:. */ + + /* CogIA32Compiler>>#genRestoreRegs: */ +static sqInt NoDbgRegParms +genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs, sqInt regMask) +{ + sqInt reg; + + assert(!((regMask & (registerMaskForand(ESP, EBP))))); + for (reg = EAX; reg <= EDI; reg += 1) { + if (regMask & (1U << reg)) { + /* begin PopR: */ + genoperand(PopR, reg); + } + } + return 0; +} + + +/* Save the registers in regMask for a call into the C run-time from a + trampoline. + */ + + /* CogIA32Compiler>>#genSaveRegs: */ +static sqInt NoDbgRegParms +genSaveRegs(AbstractInstruction * self_in_genSaveRegs, sqInt regMask) +{ + sqInt reg; + + assert(((EDI - EAX) + 1) == 8); + assert(!((regMask & (registerMaskForand(ESP, EBP))))); + for (reg = EDI; reg >= EAX; reg += -1) { + if (regMask & (1U << reg)) { + /* begin PushR: */ + genoperand(PushR, reg); + } + } + return 0; +} + + +/* Save the frame and stack pointer registers to the framePointer + and stackPointer variables. Used to save the machine code frame + for use by the run-time when calling into the CoInterpreter run-time. */ + + /* CogIA32Compiler>>#genSaveStackPointers */ +static sqInt NoDbgRegParms +genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveR:Aw: */ + address = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, FPReg, address); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, SPReg, address1); + return 0; +} + + /* CogIA32Compiler>>#genSubstituteReturnAddress: */ +static AbstractInstruction * NoDbgRegParms +genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc) +{ + AbstractInstruction *anInstruction; + + /* begin PushCw: */ + anInstruction = genoperand(PushCw, retpc); + return anInstruction; +} + + +/* Answer if we support SSE2 */ + + /* CogIA32Compiler>>#hasSSE2Instructions */ +static sqInt NoDbgRegParms +hasSSE2Instructions(AbstractInstruction * self_in_hasSSE2Instructions) +{ + return ((ceCheckFeatures()) & (1U << 26)) != 0; +} + + +/* Answer if we support SSE */ + + /* CogIA32Compiler>>#hasSSEInstructions */ +static sqInt NoDbgRegParms +hasSSEInstructions(AbstractInstruction * self_in_hasSSEInstructions) +{ + return ((ceCheckFeatures()) & (1U << 25)) != 0; +} + + +/* Answer the inline cache tag for the return address of a send. */ + + /* CogIA32Compiler>>#inlineCacheTagAt: */ +static sqInt NoDbgRegParms +inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress) +{ + return literalBeforeFollowingAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 5); +} + + +/* Answer the instruction size at pc. This is very far from a full decode. + It only has to cope with the instructions generated in a block dispatch. */ + + /* CogIA32Compiler>>#instructionSizeAt: */ +static sqInt NoDbgRegParms +instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc) +{ + sqInt op; + + op = byteAt(pc); + + switch (op) { + case 15: + return twoByteInstructionSizeAt(self_in_instructionSizeAt, pc); + + case 61: + case 233: + return 5; + + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 0x7C: + case 125: + case 0x7E: + case 0x7F: + case 137: + case 235: + return 2; + + case 131: + return sizeImmediateGroup1at(self_in_instructionSizeAt, op, pc); + + case 139: + return sizeHasModrmat(self_in_instructionSizeAt, op, pc); + + case 144: + case 204: + return 1; + + default: + error("Case not found and no otherwise clause"); + return -1; + } +} + + +/* Assuming mcpc is a send return pc answer if the instruction before it is a + call (not a CallFull). + */ + + /* CogIA32Compiler>>#isCallPrecedingReturnPC: */ +static sqInt NoDbgRegParms +isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc) +{ + return (byteAt(mcpc - 5)) == 232; +} + + /* CogIA32Compiler>>#isJumpAt: */ +static sqInt NoDbgRegParms +isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc) +{ + sqInt op; + + op = byteAt(pc); + return (((op >= 112) && (op <= 0x7F))) + || ((op == 233) + || ((op == 235) + || ((op == 15) + && ((((byteAt(pc + 1)) >= 128) && ((byteAt(pc + 1)) <= 143)))))); +} + + +/* Answer if the receiver is a pc-dependent instruction. */ + + /* CogIA32Compiler>>#isPCDependent */ +static sqInt NoDbgRegParms +isPCDependent(AbstractInstruction * self_in_isPCDependent) +{ + return (isJump(self_in_isPCDependent)) + || (((self_in_isPCDependent->opcode)) == AlignmentNops); +} + + /* CogIA32Compiler>>#isQuick: */ +static sqInt NoDbgRegParms +isQuick(AbstractInstruction * self_in_isQuick, usqIntptr_t operand) +{ + return (((((int) operand)) >= -128) && ((((int) operand)) <= 0x7F)); +} + + +/* Set the target of a jump instruction. These all have the target in the + first operand. */ +/* Set the target of a jump instruction. These all have the target in the + first operand. + Override to cope with JumpFPNotEqual where because of IEEE NaN conformance + and the behaviour of COMISD/UCOMISD we generate two jumps to the same + target. */ + + /* CogIA32Compiler>>#jmpTarget: */ +static AbstractInstruction * NoDbgRegParms +jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction) +{ + AbstractInstruction *aDependent; + + aDependent = (self_in_jmpTarget->dependent); + while (aDependent != null) { + jmpTarget(aDependent, anAbstractInstruction); + aDependent = (aDependent->dependent); + } + ((self_in_jmpTarget->operands))[0] = (((usqInt)anAbstractInstruction)); + return anAbstractInstruction; +} + + +/* Branch/Call ranges. Jump[Cond] can be generated as short as possible. + Call/Jump[Cond]Long must be generated + in the same number of bytes irrespective of displacement since their + targets may be updated, but they need only + span 16Mb, the maximum size of the code zone. This allows e.g. ARM to use + single-word call and jump instructions + for most calls and jumps. CallFull/JumpFull must also be generated in the + same number of bytes irrespective of + displacement for the same reason, but they must be able to span the full + (32-bit or 64-bit) address space because + they are used to call code in the C runtime, which may be distant from the + code zone + */ + + /* CogIA32Compiler>>#jumpLongByteSize */ +static sqInt NoDbgRegParms +jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize) +{ + return 5; +} + + /* CogIA32Compiler>>#jumpLongConditionalByteSize */ +static sqInt NoDbgRegParms +jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize) +{ + return 6; +} + + +/* Answer the target address for the long jump immediately preceding mcpc */ + + /* CogIA32Compiler>>#jumpLongTargetBeforeFollowingAddress: */ +static sqInt NoDbgRegParms +jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc) +{ + return callTargetFromReturnAddress(self_in_jumpLongTargetBeforeFollowingAddress, mcpc); +} + + /* CogIA32Compiler>>#jumpShortByteSize */ +static sqInt NoDbgRegParms +jumpShortByteSize(AbstractInstruction * self_in_jumpShortByteSize) +{ + return 2; +} + + /* CogIA32Compiler>>#jumpTargetPCAt: */ +static usqInt NoDbgRegParms +jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc) +{ + sqInt byte; + sqInt offset; + sqInt size; + + size = instructionSizeAt(self_in_jumpTargetPCAt, pc); + if (size == 2) { + byte = byteAt(pc + 1); + offset = ((byte & 128) == 0 + ? byte + : byte - 256); + } + else { + byte = byteAt((pc + size) - 1); + offset = ((byte & 128) == 0 + ? byte + : byte - 256); + offset = (((sqInt)((usqInt)(offset) << 8))) + (byteAt((pc + size) - 2)); + offset = (((sqInt)((usqInt)(offset) << 8))) + (byteAt((pc + size) - 3)); + offset = (((sqInt)((usqInt)(offset) << 8))) + (byteAt((pc + size) - 4)); + } + return (pc + size) + offset; +} + + +/* Answer the delta from the stack pointer after a call to the stack pointer + immediately prior to the call. This is used to compute the stack pointer + immediately prior to call from within a leaf routine, which in turn is + used to capture the c stack pointer to use in trampolines back into the C + run-time. */ + + /* CogIA32Compiler>>#leafCallStackPointerDelta */ +static sqInt NoDbgRegParms +leafCallStackPointerDelta(AbstractInstruction * self_in_leafCallStackPointerDelta) +{ + return 4; +} + + +/* Answer the literal embedded in the instruction immediately preceding + followingAddress. + */ + + /* CogIA32Compiler>>#literalBeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress) +{ + return (((((sqInt)((usqInt)((byteAt(followingAddress - 1))) << 24))) + (((sqInt)((usqInt)((byteAt(followingAddress - 2))) << 16)))) + (((sqInt)((usqInt)((byteAt(followingAddress - 3))) << 8)))) + (byteAt(followingAddress - 4)); +} + + +/* Answer a literal loaded before the inline cache tag load for the return + address of a send. + */ + + /* CogIA32Compiler>>#literalBeforeInlineCacheTagAt: */ +static sqInt NoDbgRegParms +literalBeforeInlineCacheTagAt(AbstractInstruction * self_in_literalBeforeInlineCacheTagAt, sqInt callSiteReturnAddress) +{ + return literalBeforeFollowingAddress(self_in_literalBeforeInlineCacheTagAt, callSiteReturnAddress - 10); +} + + +/* Answer the byte size of a MoveCwR opcode's corresponding machine code */ + + /* CogIA32Compiler>>#loadLiteralByteSize */ +static sqInt NoDbgRegParms +loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize) +{ + return 5; +} + + +/* Answer the byte size of a MoveCwR opcode's corresponding machine code + when the argument is a PIC. This is for the self-reference at the end of a + closed PIC. */ + + /* CogIA32Compiler>>#loadPICLiteralByteSize */ +static sqInt NoDbgRegParms +loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize) +{ + return loadLiteralByteSize(self_in_loadPICLiteralByteSize); +} + + /* CogIA32Compiler>>#machineCodeAt: */ +static usqInt NoDbgRegParms +machineCodeAt(AbstractInstruction * self_in_machineCodeAt, sqInt anOffset) +{ + return ((self_in_machineCodeAt->machineCode))[anOffset]; +} + + +/* Answer the maximum number of bytes of machine code generated for any + abstract instruction. + e.g. lock movsd 0x400(%esp),%xmm4 => f0 f2 0f 10 a4 24 00 04 00 00 */ + + /* CogIA32Compiler>>#machineCodeBytes */ +static sqInt NoDbgRegParms +machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes) +{ + return 10; +} + + +/* See ModR/M byte & opcode syntax + In addition to the notation shown above in 'Mnemonic Syntax' on page 43, + the following notation indicates the size and type of operands in the + syntax of an instruction opcode: + /digit Indicates that the ModRM byte specifies only one register or memory + (r/m) operand. + The digit is specified by the ModRM reg field and is used as an + instruction-opcode extension. + Valid digit values range from 0 to 7. + /r Indicates that the ModRM byte specifies both a register operand and a + reg/mem (register or memory) operand. */ + + /* CogIA32Compiler>>#mod:RM:RO: */ +static sqInt NoDbgRegParms +modRMRO(AbstractInstruction * self_in_modRMRO, sqInt mod, sqInt regMode, sqInt regOpcode) +{ + return ((((sqInt)((usqInt)(mod) << 6))) + (((sqInt)((usqInt)(regOpcode) << 3)))) + regMode; +} + + +/* Answer the number of opcodes required to compile the CPUID call to extract + the extended features information. + */ + + /* CogIA32Compiler>>#numCheckFeaturesOpcodes */ +static sqInt NoDbgRegParms +numCheckFeaturesOpcodes(AbstractInstruction * self_in_numCheckFeaturesOpcodes) +{ + return 11; +} + + /* CogIA32Compiler>>#numIntRegArgs */ +static sqInt NoDbgRegParms +numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs) +{ + return 0; +} + + +/* push $ebx + movl #0, %eax + movl 1, $ebx + mfence + lock cmpxchg %eax, &vmOwnerLock; # N.B. 2 instructions + pop $ebx + jnz locked + sfence + movl 1, $eax + ret + locked: ; N.B. Requires an instruction + movl 0, $eax + ret */ + + /* CogIA32Compiler>>#numLowLevelLockOpcodes */ +static sqInt NoDbgRegParms +numLowLevelLockOpcodes(AbstractInstruction * self_in_numLowLevelLockOpcodes) +{ + return 14; +} + + /* CogIA32Compiler>>#padIfPossibleWithStopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr) +{ + stopsFromto(self_in_padIfPossibleWithStopsFromto, startAddr, endAddr); + return self_in_padIfPossibleWithStopsFromto; +} + + /* CogIA32Compiler>>#relocateCallBeforeReturnPC:by: */ +static AbstractInstruction * NoDbgRegParms +relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta) +{ + sqInt distance; + + if (delta != 0) { + distance = (((((sqInt)((usqInt)((byteAt(retpc - 1))) << 24))) + (((sqInt)((usqInt)((byteAt(retpc - 2))) << 16)))) + (((sqInt)((usqInt)((byteAt(retpc - 3))) << 8)))) + (byteAt(retpc - 4)); + distance += delta; + byteAtput(retpc - 1, (((usqInt) distance) >> 24) & 0xFF); + byteAtput(retpc - 2, (((usqInt) distance) >> 16) & 0xFF); + byteAtput(retpc - 3, (((usqInt) distance) >> 8) & 0xFF); + byteAtput(retpc - 4, distance & 0xFF); + } + return self_in_relocateCallBeforeReturnPCby; +} + + /* CogIA32Compiler>>#relocateMethodReferenceBeforeAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta) +{ + relocateCallBeforeReturnPCby(self_in_relocateMethodReferenceBeforeAddressby, pc, delta); + return self_in_relocateMethodReferenceBeforeAddressby; +} + + +/* Rewrite a call instruction to call a different target. This variant is + used to link PICs + in ceSendMiss et al, and to rewrite cached primitive calls. Answer the + extent of + the code change which is used to compute the range of the icache to flush. */ +/* self cCode: '' + inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: + callSiteReturnAddress - 1]. */ + + /* CogIA32Compiler>>#rewriteCallAt:target: */ +static sqInt NoDbgRegParms +rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + usqInt callDistance; + + if (!(callTargetAddress >= (minCallAddress()))) { + error("linking callsite to invalid address"); + } + + callDistance = ((usqInt) (callTargetAddress - callSiteReturnAddress)); + byteAtput(callSiteReturnAddress - 1, (((usqInt) callDistance) >> 24) & 0xFF); + byteAtput(callSiteReturnAddress - 2, (((usqInt) callDistance) >> 16) & 0xFF); + byteAtput(callSiteReturnAddress - 3, (((usqInt) callDistance) >> 8) & 0xFF); + byteAtput(callSiteReturnAddress - 4, callDistance & 0xFF); + assert((callTargetFromReturnAddress(self_in_rewriteCallAttarget, callSiteReturnAddress)) == callTargetAddress); + return 5; +} + + +/* Rewrite the short jump instruction to jump to a new cpic case target. */ +/* prevent type inference for avoiding warning on abs */ + + /* CogIA32Compiler>>#rewriteCPICJumpAt:target: */ +static sqInt NoDbgRegParms +rewriteCPICJumpAttarget(AbstractInstruction * self_in_rewriteCPICJumpAttarget, usqInt addressFollowingJump, usqInt jumpTargetAddress) +{ + sqInt callDistance; + + callDistance = jumpTargetAddress - addressFollowingJump; + assert((SQABS(callDistance)) < 128); + byteAtput(addressFollowingJump - 1, callDistance & 0xFF); + return 2; +} + + +/* Rewrite an inline cache to call a different target for a new tag. This + variant is used + to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of + the code + change which is used to compute the range of the icache to flush. */ +/* self cCode: '' + inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: + callSiteReturnAddress - 1]. */ + + /* CogIA32Compiler>>#rewriteInlineCacheAt:tag:target: */ +static sqInt NoDbgRegParms +rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress) +{ + usqInt callDistance; + + if (!(callTargetAddress >= (minCallAddress()))) { + error("linking callsite to invalid address"); + } + + callDistance = ((usqInt) (callTargetAddress - callSiteReturnAddress)); + byteAtput(callSiteReturnAddress - 1, (((usqInt) callDistance) >> 24) & 0xFF); + byteAtput(callSiteReturnAddress - 2, (((usqInt) callDistance) >> 16) & 0xFF); + byteAtput(callSiteReturnAddress - 3, (((usqInt) callDistance) >> 8) & 0xFF); + byteAtput(callSiteReturnAddress - 4, callDistance & 0xFF); + byteAtput(callSiteReturnAddress - 6, (((usqInt) cacheTag) >> 24) & 0xFF); + byteAtput(callSiteReturnAddress - 7, (((usqInt) cacheTag) >> 16) & 0xFF); + byteAtput(callSiteReturnAddress - 8, (((usqInt) cacheTag) >> 8) & 0xFF); + byteAtput(callSiteReturnAddress - 9, cacheTag & 0xFF); + assert((callTargetFromReturnAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress)) == callTargetAddress); + return 10; +} + + +/* Rewrite an inline cache with a new tag. This variant is used + by the garbage collector. */ + + /* CogIA32Compiler>>#rewriteInlineCacheTag:at: */ +static AbstractInstruction * NoDbgRegParms +rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, sqInt callSiteReturnAddress) +{ + byteAtput(callSiteReturnAddress - 6, (((usqInt) cacheTag) >> 24) & 0xFF); + byteAtput(callSiteReturnAddress - 7, (((usqInt) cacheTag) >> 16) & 0xFF); + byteAtput(callSiteReturnAddress - 8, (((usqInt) cacheTag) >> 8) & 0xFF); + byteAtput(callSiteReturnAddress - 9, cacheTag & 0xFF); + return self_in_rewriteInlineCacheTagat; +} + + +/* Rewrite a long jump instruction to jump to a different target. This + variant is used to rewrite cached primitive calls. Answer the extent of + the code change which is used to compute the range of the icache to flush. */ + + /* CogIA32Compiler>>#rewriteJumpLongAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteCallAttarget(self_in_rewriteJumpLongAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* to save Slang from having to be a real compiler (it can't inline switches + that return) + */ +/* Answer if the receiver's opcode sets the condition codes correctly for the + given conditional jump opcode. + */ + + /* CogIA32Compiler>>#setsConditionCodesFor: */ +static sqInt NoDbgRegParms +setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode) +{ + + switch ((self_in_setsConditionCodesFor->opcode)) { + case ArithmeticShiftRightCqR: + case ArithmeticShiftRightRR: + case LogicalShiftLeftCqR: + case LogicalShiftLeftRR: + return ((aConditionalJumpOpcode >= JumpZero) && (aConditionalJumpOpcode <= JumpNonNegative)); + + case XorRR: + return 1; + + default: + haltmsg("unhandled opcode in setsConditionCodesFor:"); + return 0; + + } +} + + /* CogIA32Compiler>>#sizeHasModrm:at: */ +static sqInt NoDbgRegParms +sizeHasModrmat(AbstractInstruction * self_in_sizeHasModrmat, sqInt op, sqInt pc) +{ + sqInt mod; + sqInt modrm; + sqInt rm; + sqInt ro; + + modrm = byteAt(pc + 1); + mod = ((usqInt) modrm) >> 6; + ro = (((usqInt) modrm) >> 3) & 7; + rm = modrm & 7; + if (mod == 3) { + return 2; + } + if (rm != 4) { + + /* no SIB byte */ + + switch (mod) { + case 0: + return (rm == 5 + ? 6 + : 3); + + case 1: + return 3; + + case 2: + return 6; + + default: + error("Case not found and no otherwise clause"); + return -1; + } + } + haltmsg("fall through in sizeHasModrm:at:"); + return 0; +} + + +/* see [1] p A-7, p A-13 */ + + /* CogIA32Compiler>>#sizeImmediateGroup1:at: */ +static sqInt NoDbgRegParms +sizeImmediateGroup1at(AbstractInstruction * self_in_sizeImmediateGroup1at, sqInt op, sqInt pc) +{ + sqInt mod; + sqInt modrm; + sqInt rm; + sqInt ro; + + modrm = byteAt(pc + 1); + mod = ((usqInt) modrm) >> 6; + ro = (((usqInt) modrm) >> 3) & 7; + rm = modrm & 7; + + switch (ro) { + case 7: + return (op == 129 + ? 6 + : 3); + + default: + error("Case not found and no otherwise clause"); + return -1; + } +} + + +/* Size a jump and set its address. The target may be another instruction + or an absolute address. On entry the address inst var holds our virtual + address. On exit address is set to eventualAbsoluteAddress, which is + where this instruction will be output. The span of a jump to a following + instruction is therefore between that instruction's address and this + instruction's address ((which are both still their virtual addresses), but + the span of a jump to a preceding instruction or to an absolute address is + between that instruction's address (which by now is its eventual absolute + address) or absolute address and eventualAbsoluteAddress. */ + + /* CogIA32Compiler>>#sizePCDependentInstructionAt: */ +static usqInt NoDbgRegParms +sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress) +{ + AbstractInstruction *abstractInstruction; + usqIntptr_t alignment; + usqIntptr_t maximumSpan; + usqIntptr_t target; + + if (((self_in_sizePCDependentInstructionAt->opcode)) == AlignmentNops) { + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + alignment = ((self_in_sizePCDependentInstructionAt->operands))[0]; + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = ((eventualAbsoluteAddress + (alignment - 1)) & (-alignment)) - eventualAbsoluteAddress); + } + assert(isJump(self_in_sizePCDependentInstructionAt)); + target = ((self_in_sizePCDependentInstructionAt->operands))[0]; + abstractInstruction = ((AbstractInstruction *) target); + if ((addressIsInInstructions(abstractInstruction)) + || (abstractInstruction == (methodLabel()))) { + maximumSpan = ((abstractInstruction->address)) - (((abstractInstructionfollows(self_in_sizePCDependentInstructionAt, abstractInstruction) + ? eventualAbsoluteAddress + : (self_in_sizePCDependentInstructionAt->address))) + 2); + } + else { + maximumSpan = target - (eventualAbsoluteAddress + 2); + } + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = (((self_in_sizePCDependentInstructionAt->opcode)) >= FirstShortJump + ? (isQuick(self_in_sizePCDependentInstructionAt, maximumSpan) + ? 2 + : (((self_in_sizePCDependentInstructionAt->opcode)) == Jump + ? 5 + : 6)) + : ((((self_in_sizePCDependentInstructionAt->opcode)) == JumpLong) + || (((self_in_sizePCDependentInstructionAt->opcode)) == JumpFull) + ? 5 + : 6))); +} + + /* CogIA32Compiler>>#stackBytesForNumArgs: */ +static sqInt NoDbgRegParms +stackBytesForNumArgs(AbstractInstruction * self_in_stackBytesForNumArgs, sqInt numArgs) +{ + return numArgs * 4; +} + + +/* Return a minimum amount of headroom for each stack page (in bytes). In a + JIT the stack has to have room for interrupt handlers which will run on + the stack. + See [1] pp 6-13 to 6-14. On an interrupt or exception the maximum state + that an IA32 CPU will push is SS, ESP, EFLAGS, CS, EIP and an error code. + It may then + call an interrupt procedure. Leave some room above the minimum state. */ + + /* CogIA32Compiler>>#stackPageInterruptHeadroomBytes */ +static sqInt NoDbgRegParms +stackPageInterruptHeadroomBytes(AbstractInstruction * self_in_stackPageInterruptHeadroomBytes) +{ + return 256; +} + + /* CogIA32Compiler>>#stopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr) +{ + sqInt addr; + + for (addr = startAddr; addr <= endAddr; addr += 1) { + byteAtput(addr, 204); + } + return self_in_stopsFromto; +} + + +/* Rewrite the literal in the instruction immediately preceding + followingAddress. + */ + + /* CogIA32Compiler>>#storeLiteral:beforeFollowingAddress: */ +static AbstractInstruction * NoDbgRegParms +storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress) +{ + byteAtput(followingAddress - 1, (((usqInt) literal) >> 24) & 0xFF); + byteAtput(followingAddress - 2, (((usqInt) literal) >> 16) & 0xFF); + byteAtput(followingAddress - 3, (((usqInt) literal) >> 8) & 0xFF); + byteAtput(followingAddress - 4, literal & 0xFF); + return self_in_storeLiteralbeforeFollowingAddress; +} + + /* CogIA32Compiler>>#s:i:b: */ +static sqInt NoDbgRegParms +sib(AbstractInstruction * self_in_sib, sqInt scale, sqInt indexReg, sqInt baseReg) +{ + return ((((sqInt)((usqInt)(scale) << 6))) + (((sqInt)((usqInt)(indexReg) << 3)))) + baseReg; +} + + /* CogIA32Compiler>>#twoByteInstructionSizeAt: */ +static sqInt NoDbgRegParms +twoByteInstructionSizeAt(AbstractInstruction * self_in_twoByteInstructionSizeAt, sqInt pc) +{ + sqInt op; + + op = byteAt(pc + 1); + + switch (op & 240) { + case 128: + + /* long conditional jumps */ + return 6; + + default: + error("Case not found and no otherwise clause"); + return -1; + } +} + + /* CogIA32Compiler>>#unsignedShortAt: */ +static sqInt NoDbgRegParms +unsignedShortAt(AbstractInstruction * self_in_unsignedShortAt, sqInt byteAddress) +{ + return (byteAt(byteAddress)) + (((usqInt) (byteAt(byteAddress + 1)) << 8)); +} + + +/* Answer if Call and JumpLong are relative and hence need to take the + caller's relocation delta into account during code compaction, rather than + just the + callee's delta. */ + + /* CogIA32Compiler>>#zoneCallsAreRelative */ +static sqInt NoDbgRegParms +zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative) +{ + return 1; +} + + /* Cogit>>#AddCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAddCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#AndCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#AndCq:R:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *first; + + if (srcReg == destReg) { + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return anInstruction1; + } + first = genoperandoperand(MoveRR, srcReg, destReg); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + return first; +} + + /* Cogit>>#ArithmeticShiftRightR:R: */ +static AbstractInstruction * NoDbgRegParms +gArithmeticShiftRightRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(ArithmeticShiftRightRR, reg1, reg2); +} + + /* Cogit>>#abortOffset */ +sqInt +abortOffset(void) +{ + return missOffset; +} + + /* Cogit>>#abstractInstruction:follows: */ +static sqInt NoDbgRegParms +abstractInstructionfollows(AbstractInstruction *theAbstractInstruction, AbstractInstruction *anAbstractInstruction) +{ + return theAbstractInstruction > anAbstractInstruction; +} + + /* Cogit>>#addCleanBlockStarts */ +static void +addCleanBlockStarts(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt startPCOrNil; + + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + maxLitIndex = ((maxLitIndex < i) ? i : maxLitIndex); + addBlockStartAtnumArgsnumCopiedspan(startPCOrNil - 1, argumentCountOfClosure(lit), copiedValueCountOfClosure(lit), spanForCleanBlockStartingAt(startPCOrNil - 1)); + } + } +} + + +/* Perform an integrity/leak check using the heapMap. + Set a bit at each cog method's header. */ + + /* Cogit>>#addCogMethodsToHeapMap */ +void +addCogMethodsToHeapMap(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + heapMapAtWordPut(cogMethod, 1); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* Cogit>>#addressIsInFixups: */ +static sqInt NoDbgRegParms +addressIsInFixups(AbstractInstruction *address) +{ + return address >= (AbstractInstruction *)&fixups[0] && address < (AbstractInstruction *)&fixups[numAbstractOpcodes]; +} + + /* Cogit>>#addressIsInInstructions: */ +static sqInt NoDbgRegParms +addressIsInInstructions(AbstractInstruction *address) +{ + return !((usqInt)(address) & BytesPerWord-1) \ + && (address) >= &abstractOpcodes[0] \ + && (address) < &abstractOpcodes[opcodeIndex]; +} + + +/* calculate the end of the n'th case statement - which is complicated + because we have case 1 right at the top of our CPIC and then build up from + the last one. Yes I know this sounds strange, but trust me - I'm an + Engineer, we do things backwards all the emit + */ + + /* Cogit>>#addressOfEndOfCase:inCPIC: */ +static sqInt NoDbgRegParms +addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC) +{ + assert((n >= 1) + && (n <= MaxCPICCases)); + return (n == 1 + ? (((sqInt)cPIC)) + firstCPICCaseOffset + : ((((sqInt)cPIC)) + firstCPICCaseOffset) + (((MaxCPICCases + 1) - n) * cPICCaseSize)); +} + + /* Cogit>>#alignUptoRoutineBoundary: */ +static sqInt NoDbgRegParms +alignUptoRoutineBoundary(sqInt anAddress) +{ + return (((anAddress + 7) | 7) - 7); +} + + +/* Check that all methods have valid selectors, and that all linked sends are + to valid targets and have valid cache tags + */ + + /* Cogit>>#allMachineCodeObjectReferencesValid */ +static sqInt +allMachineCodeObjectReferencesValid(void) +{ + CogMethod *cogMethod; + sqInt ok; + + ok = 1; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (!(asserta(checkValidOopReference((cogMethod->selector))))) { + ok = 0; + } + if (!(asserta((cogMethodDoesntLookKosher(cogMethod)) == 0))) { + ok = 0; + } + } + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, ((sqInt)cogMethod))) == 0))) { + ok = 0; + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(asserta(noTargetsFreeInClosedPIC(cogMethod)))) { + ok = 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#allMethodsHaveCorrectHeader */ +static sqInt +allMethodsHaveCorrectHeader(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (!(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod()))) { + return 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + /* Cogit>>#annotateAbsolutePCRef: */ +static AbstractInstruction * NoDbgRegParms +annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = IsAbsPCReference); + return abstractInstruction; +} + + /* Cogit>>#annotateBytecode: */ +static AbstractInstruction * NoDbgRegParms +annotateBytecode(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = HasBytecodePC); + return abstractInstruction; +} + + /* Cogit>>#annotate:objRef: */ +static AbstractInstruction * NoDbgRegParms +annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) +{ + if (shouldAnnotateObjectReference(anOop)) { + if (isYoungObject(anOop)) { + hasYoungReferent = 1; + } + (abstractInstruction->annotation = IsObjectReference); + } + return abstractInstruction; +} + + /* Cogit>>#assertSaneJumpTarget: */ +static void NoDbgRegParms +assertSaneJumpTarget(AbstractInstruction *jumpTarget) +{ + assert((closedPICSize == null) + || ((openPICSize == null) + || ((addressIsInInstructions(jumpTarget)) + || ((((((usqInt)jumpTarget)) >= codeBase) && ((((usqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); +} + + /* Cogit>>#blockCreationBytecodeSizeForHeader: */ +static sqInt NoDbgRegParms +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) +{ + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? AltBlockCreationBytecodeSize + : BlockCreationBytecodeSize); +} + + +/* Evaluate binaryFunction with the block start mcpc and supplied arg for + each entry in the block dispatch. If the function answers non-zero answer + the value + it answered. Used to update back-references to the home method in + compaction. */ + + /* Cogit>>#blockDispatchTargetsFor:perform:arg: */ +static sqInt NoDbgRegParms +blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) +{ + sqInt blockEntry; + usqInt end; + sqInt pc; + sqInt result; + usqInt targetpc; + + if (((cogMethod->blockEntryOffset)) == 0) { + return null; + } + blockEntry = ((cogMethod->blockEntryOffset)) + (((sqInt)cogMethod)); + pc = blockEntry; + end = (mapEndFor(cogMethod)) - 1; + while (pc < end) { + if (isJumpAt(backEnd, pc)) { + targetpc = jumpTargetPCAt(backEnd, pc); + if (targetpc < blockEntry) { + result = binaryFunction(targetpc, arg); + if (result != 0) { + return result; + } + } + } + pc += instructionSizeAt(backEnd, pc); + } + return 0; +} + + +/* Answer the zero-relative bytecode pc matching the machine code pc argument + in cogMethod, given the start of the bytecodes for cogMethod's block or + method object. */ + + /* Cogit>>#bytecodePCFor:startBcpc:in: */ +sqInt +bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc1; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc1 = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc1)), startbcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc1 += (mapByte & DisplacementMask); + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + return 0; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + return 0; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc1)), bcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + return 0; +} + + /* Cogit>>#CallRT:registersToBeSavedMask: */ +static AbstractInstruction * NoDbgRegParms +CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved) +{ + AbstractInstruction *abstractInstruction; + sqInt callerSavedRegsToBeSaved; + AbstractInstruction *lastInst; + sqInt reg; + sqInt registersToBePushed; + + reg = 0; + callerSavedRegsToBeSaved = CallerSavedRegisterMask & registersToBeSaved; + registersToBePushed = callerSavedRegsToBeSaved; + reg = 0; + while (registersToBePushed != 0) { + if (registersToBePushed & 1) { + /* begin PushR: */ + genoperand(PushR, reg); + } + reg += 1; + registersToBePushed = ((sqInt) registersToBePushed) >> 1; + } + + /* begin CallRT: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + lastInst = abstractInstruction; + while (reg >= 0) { + if (callerSavedRegsToBeSaved & (1U << reg)) { + /* begin PopR: */ + lastInst = genoperand(PopR, reg); + } + reg -= 1; + } + return lastInst; + +} + + /* Cogit>>#Call: */ +static AbstractInstruction * NoDbgRegParms +gCall(sqInt callTarget) +{ + return genoperand(Call, callTarget); +} + + /* Cogit>>#CmpCq:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#CmpCw:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(CmpCwR, wordConstant, reg); + return anInstruction; +} + + /* Cogit>>#CmpR:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(CmpRR, reg1, reg2); +} + + +/* This is a static version of ceCallCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiver */ +void +callCogCodePopReceiver(void) +{ + realCECallCogCodePopReceiverReg(); + error("what??"); + +} + + +/* This is a static version of ceCallCogCodePopReceiverAndClassRegs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiverAndClassRegs */ +void +callCogCodePopReceiverAndClassRegs(void) +{ + realCECallCogCodePopReceiverAndClassRegs(); +} + + +/* Code entry closed PIC miss. A send has fallen + through a closed (finite) polymorphic inline cache. + Either extend it or patch the send site to an open PIC. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#ceCPICMiss:receiver: */ +sqInt +ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver) +{ + sqInt cacheTag; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + sqInt outerReturn; + sqInt result; + sqInt selector; + + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(cPIC); + } + outerReturn = stackTop(); + assert(!(((inlineCacheTagAt(backEnd, outerReturn)) == (picAbortDiscriminatorValue())))); + if (((cPIC->cPICNumCases)) < MaxCPICCases) { + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (cPIC->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + + l1: /* end lookup:for:methodAndErrorSelectorInto: */; + } + else { + newTargetMethodOrNil = (errorSelectorOrNil = null); + } + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if ((((cPIC->cPICNumCases)) >= MaxCPICCases) + || (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((cPIC->selector), (cPIC->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(cPIC); + } + cogExtendPICCaseNMethodtagisMNUCase(cPIC, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + executeCogPICfromLinkedSendWithReceiverandCacheTag(cPIC, receiver, inlineCacheTagAt(backEnd, outerReturn)); + return null; +} + + /* Cogit>>#ceFree: */ +void +ceFree(void*pointer) +{ + free(pointer); +} + + /* Cogit>>#ceMalloc: */ +void* +ceMalloc(size_t size) +{ + return malloc(size); +} + + +/* An in-line cache check in a method has failed. The failing entry check has + jumped to the ceMethodAbort abort call at the start of the method which + has called this routine. + If possible allocate a closed PIC for the current and existing classes. + The stack looks like: + receiver + args + sender return address + sp=> ceMethodAbort call return address + So we can find the method that did the failing entry check at + ceMethodAbort call return address - missOffset + and we can find the send site from the outer return address. */ + + /* Cogit>>#ceSICMiss: */ +sqInt +ceSICMiss(sqInt receiver) +{ + sqInt cacheTag; + sqInt entryPoint; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt extent; + usqInt innerReturn; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + usqInt outerReturn; + CogMethod *pic; + sqInt result; + sqInt selector; + CogMethod *targetMethod; + + + /* Whether we can relink to a PIC or not we need to pop off the inner return and identify the target method. */ + innerReturn = ((usqInt)(popStack())); + targetMethod = ((CogMethod *) (innerReturn - missOffset)); + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(targetMethod); + } + outerReturn = ((usqInt)(stackTop())); + assert(((outerReturn >= methodZoneBase) && (outerReturn <= (freeStart())))); + entryPoint = callTargetFromReturnAddress(backEnd, outerReturn); + assert(((targetMethod->selector)) != (nilObject())); + assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint); + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (targetMethod->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + +l1: /* end lookup:for:methodAndErrorSelectorInto: */; + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || (((inlineCacheTagAt(backEnd, outerReturn)) == 0) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((targetMethod->selector), (targetMethod->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(targetMethod); + } + pic = openPICWithSelector((targetMethod->selector)); + if ((pic == null) + || (!1)) { + + /* otherwise attempt to create a closed PIC for the two cases. */ + pic = cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase((targetMethod->selector), (targetMethod->cmNumArgs), targetMethod, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + if ((((((sqInt)pic)) >= MaxNegativeErrorCode) && ((((sqInt)pic)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. + Continue as if this is an unlinked send. */ + if ((((sqInt)pic)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return ceSendFromInLineCacheMiss(targetMethod); + } + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + } + extent = (((pic->cmType)) == CMOpenPIC + ? rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat((targetMethod->selector), mframeHomeMethodExport(), outerReturn), (((sqInt)pic)) + cmEntryOffset) + : rewriteCallAttarget(backEnd, outerReturn, (((sqInt)pic)) + cmEntryOffset)); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + executeCogPICfromLinkedSendWithReceiverandCacheTag(pic, receiver, inlineCacheTagAt(backEnd, outerReturn)); + return null; +} + + /* Cogit>>#checkAssertsEnabledInCogit */ +void +checkAssertsEnabledInCogit(void) +{ + sqInt assertsAreEnabledInCogit; + + assertsAreEnabledInCogit = 0; + assert(assertsAreEnabledInCogit); +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRefAndTarget:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt offset; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObject; + sqInt targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (!(asserta(checkValidOopReference(literal)))) { + return 1; + } + if ((couldBeObject(literal)) + && (isReallyYoungObject(literal))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 2; + } + } + } + if (annotation >= IsSendCall) { + if (!(asserta((((((CogMethod *) cogMethod))->cmType)) == CMMethod))) { + return 3; + } + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj) { + if (couldBeObject(cacheTag1)) { + if (!(asserta(checkValidOopReference(cacheTag1)))) { + return 4; + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 5; + } + } + if ((couldBeObject(cacheTag1)) + && (isReallyYoungObject(cacheTag1))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 6; + } + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 7; + } + } + + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send; find which kind. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(asserta((((targetMethod1->cmType)) == CMMethod) + || ((((targetMethod1->cmType)) == CMClosedPIC) + || (((targetMethod1->cmType)) == CMOpenPIC))))) { + return 8; + } + + } + } + return 0; +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRef:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt entryPoint; + sqInt literal; + sqInt off; + sqInt offset; + sqInt offset1; + sqInt selectorOrCacheTag; + sqInt *sendTable; + sqInt table; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (!(checkValidOopReference(literal))) { + print("object ref leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + offset = entryPoint; + } + else { + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable = superSendTrampolines; + + + } + } + offset = offset1; + + } + selectorOrCacheTag = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + if ((entryPoint > methodZoneBase) + && ((offset != cmNoCheckEntryOffset) + && ((((((CogMethod *) (entryPoint - offset)))->cmType)) != CMOpenPIC))) { + + /* linked non-super send, cacheTag is a cacheTag */ + if (!(validInlineCacheTag(selectorOrCacheTag))) { + print("cache tag leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + else { + + /* unlinked send or super send; cacheTag is a selector unless 64-bit, in which case it is an index. */ + if (!(checkValidOopReference(selectorOrCacheTag))) { + print("selector leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + } + return 0; +} + + +/* Answer if all references to objects in machine-code are valid. */ + + /* Cogit>>#checkIntegrityOfObjectReferencesInCode: */ +sqInt +checkIntegrityOfObjectReferencesInCode(sqInt gcModes) +{ + CogMethod *cogMethod; + sqInt count; + sqInt ok; + + cogMethod = ((CogMethod *) methodZoneBase); + ok = 1; + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if ((cogMethod->cmRefersToYoung)) { + if (((count = occurrencesInYoungReferrers(cogMethod))) != 1) { + print("young referrer CM "); + printHex(((sqInt)cogMethod)); + if (count == 0) { + print(" is not in youngReferrers"); + cr(); + } + else { + print(" is in youngReferrers "); + printNum(count); + print(" times!"); + cr(); + } + ok = 0; + } + } + if (!(checkValidOopReference((cogMethod->selector)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" selector"); + cr(); + ok = 0; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + if (!(checkValidObjectReference((cogMethod->methodObject)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if (!(isOopCompiledMethod((cogMethod->methodObject)))) { + print("non-method in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + if (((isYoungObject((cogMethod->methodObject))) + || (isYoung((cogMethod->selector)))) + && (!((cogMethod->cmRefersToYoung)))) { + print("CM "); + printHex(((sqInt)cogMethod)); + print(" refers to young but not marked as such"); + cr(); + ok = 0; + } + + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(checkValidObjectReferencesInClosedPIC(cogMethod))) { + ok = 0; + } + } + else { + if (((cogMethod->cmType)) == CMOpenPIC) { + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#checkMaybeObjRefInClosedPIC: */ +static sqInt NoDbgRegParms +checkMaybeObjRefInClosedPIC(sqInt maybeObject) +{ + if (maybeObject == 0) { + return 1; + } + if (!(couldBeObject(maybeObject))) { + return 1; + } + return checkValidObjectReference(maybeObject); +} + + /* Cogit>>#checkValidObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt ok; + sqInt pc; + + ok = 1; + + /* first we check the obj ref at the beginning of the CPIC */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongByteSize(backEnd))); + cr(); + ok = 0; + } + + /* For each case we check any object reference at the end address - sizeof(conditional instruction) and then increment the end address by case size */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongConditionalByteSize(backEnd))); + cr(); + ok = 0; + } + pc += cPICCaseSize; + } + return ok; +} + + +/* Answer if the ClosedPIC refers to any unmarked objects or freed/freeable + target methods, + applying markAndTraceOrFreeCogMethod:firstVisit: to those targets to + determine if freed/freeable. + */ + + /* Cogit>>#closedPICRefersToUnmarkedObject: */ +static sqInt NoDbgRegParms +closedPICRefersToUnmarkedObject(CogMethod *cPIC) +{ + sqInt i; + sqInt object; + sqInt pc; + + if (!((isImmediate((cPIC->selector))) + || (isMarked((cPIC->selector))))) { + return 1; + } + pc = addressOfEndOfCaseinCPIC(1, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + } + return 0; +} + + /* Cogit>>#codeEntryFor: */ +char * +codeEntryFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i + 1]; + } + } + return null; +} + + /* Cogit>>#codeEntryNameFor: */ +char * +codeEntryNameFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i]; + } + } + return null; +} + + /* Cogit>>#cogCodeBase */ +sqInt +cogCodeBase(void) +{ + return codeBase; +} + + +/* Answer the contents of the code zone as an array of pair-wise element, + address in ascending address order. + Answer a string for a runtime routine or abstract label (beginning, end, + etc), a CompiledMethod for a CMMethod, + or a selector (presumably a Symbol) for a PIC. */ + + /* Cogit>>#cogCodeConstituents */ +sqInt +cogCodeConstituents(void) +{ + CogMethod *cogMethod; + sqInt constituents; + sqInt count; + sqInt i; + sqInt label; + sqInt value; + + + /* + 3 for start, freeStart and end */ + count = (trampolineTableIndex / 2) + 3; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + count += 1; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + constituents = instantiateClassindexableSize(classArray(), count * 2); + if (!(constituents)) { + return constituents; + } + pushRemappableOop(constituents); + if ((((label = stringForCString("CogCode"))) == null) + || (((value = positive32BitIntegerFor(codeBase))) == null)) { + return null; + } + storePointerUncheckedofObjectwithValue(0, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(1, topRemappableOop(), value); + for (i = 0; i < trampolineTableIndex; i += 2) { + if ((((label = stringForCString(trampolineAddresses[i]))) == null) + || (((value = positive32BitIntegerFor(((usqInt)(trampolineAddresses[i + 1]))))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(2 + i, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(3 + i, topRemappableOop(), value); + } + count = trampolineTableIndex + 2; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), (((cogMethod->cmType)) == CMMethod + ? (cogMethod->methodObject) + : (cogMethod->selector))); + if (!((value = positive32BitIntegerFor(((usqInt)cogMethod))))) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + count += 2; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if ((((label = stringForCString("CCFree"))) == null) + || (((value = positive32BitIntegerFor(mzFreeStart))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + if ((((label = stringForCString("CCEnd"))) == null) + || (((value = positive32BitIntegerFor(limitAddress))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 2, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 3, topRemappableOop(), value); + constituents = popRemappableOop(); + beRootIfOld(constituents); + return constituents; +} + + +/* Extend the cPIC with the supplied case. If caseNMethod is cogged dispatch + direct to + its unchecked entry-point. If caseNMethod is not cogged, jump to the fast + interpreter dispatch, and if isMNUCase then dispatch to fast MNU + invocation and mark the cPIC as + having the MNU case for cache flushing. */ + + /* Cogit>>#cogExtendPIC:CaseNMethod:tag:isMNUCase: */ +static sqInt NoDbgRegParms +cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase) +{ + sqInt address; + sqInt operand; + usqIntptr_t target; + + compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase); + assert(!(inlineCacheTagIsYoung(caseNTag))); + assert((caseNMethod != null) + && (!(isYoung(caseNMethod)))); + if ((!isMNUCase) + && (methodHasCogMethod(caseNMethod))) { + + /* this isn't an MNU and we have an already cogged method to jump to */ + operand = 0; + target = (((sqInt)(cogMethodOf(caseNMethod)))) + cmNoCheckEntryOffset; + } + else { + operand = caseNMethod; + if (isMNUCase) { + + /* this is an MNU so tag the CPIC header and setup a jump to the MNUAbort */ + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) cPIC))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + target = (((sqInt)cPIC)) + (sizeof(CogMethod)); + } + else { + + /* setup a jump to the interpretAborth so we can cog the target method */ + target = (((sqInt)cPIC)) + (picInterpretAbortOffset()); + } + } + address = addressOfEndOfCaseinCPIC(((cPIC->cPICNumCases)) + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(address, caseNTag, operand, target); + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), address - cPICCaseSize); + flushICacheFromto(processor, ((usqInt)cPIC), (((usqInt)cPIC)) + closedPICSize); + (cPIC->cPICNumCases = ((cPIC->cPICNumCases)) + 1); + return 0; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cogFullBlockMethod:numCopied: */ +CogMethod * +cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied) +{ + CogMethod *cogMethod; + + + /* inline exclude: */ + assert(!((methodHasCogMethod(aMethodObj)))); + assert(isOopCompiledMethod(ultimateLiteralOf(aMethodObj))); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogFullBlockMethod(numCopied); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#cogitPostGCAction: */ +void +cogitPostGCAction(sqInt gcMode) +{ + +# if SPURVM + if (gcMode == GCModeBecome) { + followForwardedLiteralsInOpenPICList(); + } + +# endif /* SPURVM */ + + assert(allMethodsHaveCorrectHeader()); + assert(((gcMode & (GCModeFull + GCModeNewSpace)) == 0) + || (kosherYoungReferrers())); +} + + +/* Check that the header fields onf a non-free method are consistent with + the type. Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#cogMethodDoesntLookKosher: */ +sqInt +cogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + if (((((cogMethod->blockSize)) & (BytesPerWord - 1)) != 0) + || ((((cogMethod->blockSize)) < (sizeof(CogMethod))) + || (((cogMethod->blockSize)) >= 32768))) { + return 1; + } + if (((cogMethod->cmType)) == CMFree) { + return 2; + } + if (((cogMethod->cmType)) == CMMethod) { + if (!((((cogMethod->methodHeader)) & 1))) { + return 11; + } + if (!(couldBeObject((cogMethod->methodObject)))) { + return 12; + } + if ((((cogMethod->stackCheckOffset)) > 0) + && (((cogMethod->stackCheckOffset)) < cmNoCheckEntryOffset)) { + return 13; + } + return 0; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (((cogMethod->blockSize)) != openPICSize) { + return 21; + } + if (((cogMethod->methodHeader)) != 0) { + return 22; + } + if (((cogMethod->objectHeader)) >= 0) { + if ((((cogMethod->methodObject)) != 0) + && ((((cogMethod->methodObject)) < methodZoneBase) + || ((((cogMethod->methodObject)) > ((freeStart()) - openPICSize)) + || (((((cogMethod->methodObject)) & (BytesPerWord - 1)) != 0) + || ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) != CMOpenPIC))))) { + return 23; + } + } + if (((cogMethod->stackCheckOffset)) != 0) { + return 24; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (((cogMethod->blockSize)) != closedPICSize) { + return 0x1F; + } + if (!(((((cogMethod->cPICNumCases)) >= 1) && (((cogMethod->cPICNumCases)) <= MaxCPICCases)))) { + return 32; + } + if (((cogMethod->methodHeader)) != 0) { + return 33; + } + if (((cogMethod->methodObject)) != 0) { + return 34; + } + return 0; + } + return 9; +} + + +/* Attempt to create a one-case PIC for an MNU. + The tag for the case is at the send site and so doesn't need to be + generated. + */ + + /* Cogit>>#cogMNUPICSelector:receiver:methodOperand:numArgs: */ +CogMethod * +cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs) +{ + CogMethod *pic; + sqInt startAddress; + + if ((isYoung(selector)) + || ((inlineCacheTagForInstance(rcvr)) == 0)) { + return 0; + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 1); + assert(endCPICCase0 != null); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + callForCogCompiledCodeCompaction(); + return 0; + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + (pic->cPICNumCases = 1); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 1); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Create an Open PIC. Temporarily create a direct call of + ceSendFromOpenPIC:. Should become a probe of the first-level method lookup + cache followed by a + call of ceSendFromOpenPIC: if the probe fails. */ + + /* Cogit>>#cogOpenPICSelector:numArgs: */ +static CogMethod * NoDbgRegParms +cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs) +{ + sqInt codeSize; + sqInt end; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + CogMethod *pic; + sqInt startAddress; + + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 0); + startAddress = allocate(openPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + (methodLabel->address = startAddress); + (methodLabel->dependent = null); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + compileOpenPICnumArgs(selector, numArgs); + computeMaximumSizes(); + concretizeAt(methodLabel, startAddress); + codeSize = generateInstructionsAt(startAddress + (sizeof(CogMethod))); + mapSize = generateMapAtstart((startAddress + openPICSize) - 1, startAddress + cmNoCheckEntryOffset); + assert((((entry->address)) - startAddress) == cmEntryOffset); + assert(((roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize))) <= openPICSize); + end = outputInstructionsAt(startAddress + (sizeof(CogMethod))); + /* begin fillInOPICHeader:numArgs:selector: */ + pic = ((CogMethod *) startAddress); + (pic->cmType = CMOpenPIC); + (pic->objectHeader = 0); + (pic->blockSize = openPICSize); + addToOpenPICList(pic); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + if ((pic->cmRefersToYoung = isYoung(selector))) { + addToYoungReferrers(pic); + } + (pic->cmUsageCount = initialOpenPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (pic->cPICNumCases = 0); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMOpenPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(openPICSize == (roundUpLength(openPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + openPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to create a two-case PIC for case0CogMethod and + case1Method,case1Tag. The tag for case0CogMethod is at the send site and + so doesn't need to be generated. + case1Method may be any of + - a Cog method; link to its unchecked entry-point + - a CompiledMethod; link to ceInterpretMethodFromPIC: + - a CompiledMethod; link to ceMNUFromPICMNUMethod:receiver: */ + + /* Cogit>>#cogPICSelector:numArgs:Case0Method:Case1Method:tag:isMNUCase: */ +static CogMethod * NoDbgRegParms +cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase) +{ + CogMethod *pic; + sqInt startAddress; + + if (isYoung(selector)) { + return ((CogMethod *) YoungSelectorInPIC); + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), isMNUCase); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = isMNUCase; + (pic->cPICNumCases = 2); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 2); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cog:selector: */ +CogMethod * +cogselector(sqInt aMethodObj, sqInt aSelectorOop) +{ + CogMethod *cogMethod; + + + /* inline exclude:selector: */ + assert(!((methodHasCogMethod(aMethodObj)))); + + assert(!((isOopCompiledMethod(ultimateLiteralOf(aMethodObj))))); + compilationBreakpointisMNUCase(aSelectorOop, lengthOf(aSelectorOop), 0); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogMethod(aSelectorOop); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#compactCogCompiledCode */ +void +compactCogCompiledCode(void) +{ + assert(noCogMethodsMaximallyMarked()); + markActiveMethodsAndReferents(); + freeOlderMethodsForCompaction(); + compactPICsWithFreedTargets(); + planCompaction(); + updateStackZoneReferencesToCompiledCodePreCompaction(); + relocateMethodsPreCompaction(); + compactCompiledCode(); + assert(allMethodsHaveCorrectHeader()); + assert(kosherYoungReferrers()); + stopsFromto(backEnd, freeStart(), (youngReferrers()) - 1); + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(youngReferrers()))); +} + + /* Cogit>>#compactPICsWithFreedTargets */ +static void +compactPICsWithFreedTargets(void) +{ + CogMethod *cogMethod; + sqInt count; + + cogMethod = ((CogMethod *) methodZoneBase); + count = 0; + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICCompactAndIsNowEmpty(cogMethod))) { + (cogMethod->cmType = CMFree); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + count += 1; + } + assert(count == (numMethods())); +} + + +/* The start of a CogMethod has a call to a run-time abort routine that + either handles an in-line cache failure or a stack overflow. The routine + selects the + path depending on ReceiverResultReg; if zero it takes the stack overflow + path; if nonzero the in-line cache miss path. Neither of these paths + returns. The abort routine must be called; In the callee the method is + located by + adding the relevant offset to the return address of the call. + + N.B. This code must match that in compilePICAbort: so that the offset of + the return address of the call is the same in methods and closed PICs. */ + + /* Cogit>>#compileAbort */ +static AbstractInstruction * +compileAbort(void) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + stackOverflowCall = anInstruction; + return (sendMiss = gCall(methodAbortTrampolineFor(methodOrBlockNumArgs))); + +} + + /* Cogit>>#compileBlockDispatchFrom:to: */ +static sqInt NoDbgRegParms +compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex) +{ + AbstractInstruction *anInstruction; + BlockStart *blockStart; + sqInt halfWay; + AbstractInstruction *jmp; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + sqInt quickConstant; + + if (lowBlockStartIndex == highBlockStartIndex) { + blockStart = blockStartAt(lowBlockStartIndex); + /* begin Jump: */ + jumpTarget = (blockStart->entryLabel); + genoperand(Jump, ((sqInt)jumpTarget)); + return null; + } + halfWay = (highBlockStartIndex + lowBlockStartIndex) / 2; + assert(((halfWay >= lowBlockStartIndex) && (halfWay <= highBlockStartIndex))); + + /* N.B. FLAGS := TempReg - startpc */ + blockStart = blockStartAt(halfWay); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)(((blockStart->startpc)) + 1) << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (lowBlockStartIndex == halfWay) { + /* begin JumpLessOrEqual: */ + jumpTarget1 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)jumpTarget1)); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + return null; + } + if ((halfWay + 1) == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + /* begin JumpGreater: */ + jumpTarget2 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpGreater, ((sqInt)jumpTarget2)); + return compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + } + /* begin JumpGreater: */ + jmp = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + if (halfWay == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + jmpTarget(jmp, (blockStart->entryLabel)); + } + else { + jmpTarget(jmp, gLabel()); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + } + return 0; +} + + +/* Compile a block's entry. This looks like a dummy CogBlockMethod header + (for frame parsing) + followed by either a frame build, if a frame is required, or nothing. The + CogMethodHeader's objectHeader field is a back pointer to the method, but + this can't be filled in until code generation. */ + + /* Cogit>>#compileBlockEntry: */ +static void NoDbgRegParms +compileBlockEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt alignment; + + /* begin AlignmentNops: */ + alignment = blockAlignment(); + genoperand(AlignmentNops, alignment); + (blockStart->fakeHeader = gLabel()); + + switch (sizeof(CogBlockMethod)) { + case 8: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 12: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 16: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + default: + error("Case not found and no otherwise clause"); + } + (blockStart->entryLabel = gLabel()); + if (needsFrame) { + compileBlockFrameBuild(blockStart); + if (recordBlockTrace()) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceBlockActivationTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + } + else { + compileBlockFramelessEntry(blockStart); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:floatResultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && (0 >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (numArgs > 1) { + if (numArgs > 2) { + if (numArgs > 3) { + if (regOrConst3 < NoReg) { + /* begin PushCq: */ + anInstruction4 = genoperand(PushCq, -2 - regOrConst3); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst3); + } + } + if (regOrConst2 < NoReg) { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, -2 - regOrConst2); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst2); + } + } + if (regOrConst1 < NoReg) { + /* begin PushCq: */ + anInstruction2 = genoperand(PushCq, -2 - regOrConst1); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst1); + } + } + if (regOrConst0 < NoReg) { + /* begin PushCq: */ + anInstruction3 = genoperand(PushCq, -2 - regOrConst0); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst0); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin annotateCall: */ + anInstruction5 = genoperand(CallFull, callTarget); + abstractInstruction = anInstruction5; + (abstractInstruction->annotation = IsRelativeCall); + + if (resultRegOrNone != NoReg) { + cFloatResultToRd(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && (0 >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (numArgs > 1) { + if (numArgs > 2) { + if (numArgs > 3) { + if (regOrConst3 < NoReg) { + /* begin PushCq: */ + anInstruction4 = genoperand(PushCq, -2 - regOrConst3); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst3); + } + } + if (regOrConst2 < NoReg) { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, -2 - regOrConst2); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst2); + } + } + if (regOrConst1 < NoReg) { + /* begin PushCq: */ + anInstruction2 = genoperand(PushCq, -2 - regOrConst1); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst1); + } + } + if (regOrConst0 < NoReg) { + /* begin PushCq: */ + anInstruction3 = genoperand(PushCq, -2 - regOrConst0); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst0); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin annotateCall: */ + anInstruction5 = genoperand(CallFull, callTarget); + abstractInstruction = anInstruction5; + (abstractInstruction->annotation = IsRelativeCall); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && (0 >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (numArgs > 1) { + if (numArgs > 2) { + if (numArgs > 3) { + if (regOrConst3 < NoReg) { + /* begin PushCq: */ + anInstruction4 = genoperand(PushCq, -2 - regOrConst3); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst3); + } + } + if (regOrConst2 < NoReg) { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, -2 - regOrConst2); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst2); + } + } + if (regOrConst1 < NoReg) { + /* begin PushCq: */ + anInstruction2 = genoperand(PushCq, -2 - regOrConst1); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst1); + } + } + if (regOrConst0 < NoReg) { + /* begin PushCq: */ + anInstruction3 = genoperand(PushCq, -2 - regOrConst0); + } + else { + /* begin PushR: */ + genoperand(PushR, regOrConst0); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin annotateCall: */ + anInstruction5 = genoperand(CallFull, callTarget); + abstractInstruction = anInstruction5; + (abstractInstruction->annotation = IsRelativeCall); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + if (resultReg2OrNone != NoReg) { + genWriteCSecondResultIntoReg(backEnd, resultReg2OrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:floatArg:floatArg:floatArg:floatArg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqInt callTarget; + sqInt delta; + AbstractInstruction * inst; + AbstractInstruction * inst1; + AbstractInstruction * inst2; + AbstractInstruction * inst3; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && (0 >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:floatArg:floatArg:floatArg:floatArg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l19; + } + if (numArgs > 1) { + if (numArgs > 2) { + if (numArgs > 3) { + if (regOrConst3 < NoReg) { + /* begin PushC64: */ + genPushC64(backEnd, -2 - regOrConst3); + } + else { + /* begin PushRd: */ + anInstruction5 = genoperandoperandoperand(MoveRdM64r, regOrConst3, -8, SPReg); + inst = anInstruction5; + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 8, SPReg); + } + } + if (regOrConst2 < NoReg) { + /* begin PushC64: */ + genPushC64(backEnd, -2 - regOrConst2); + } + else { + /* begin PushRd: */ + anInstruction2 = genoperandoperandoperand(MoveRdM64r, regOrConst2, -8, SPReg); + inst1 = anInstruction2; + /* begin SubCq:R: */ + anInstruction11 = genoperandoperand(SubCqR, 8, SPReg); + } + } + if (regOrConst1 < NoReg) { + /* begin PushC64: */ + genPushC64(backEnd, -2 - regOrConst1); + } + else { + /* begin PushRd: */ + anInstruction3 = genoperandoperandoperand(MoveRdM64r, regOrConst1, -8, SPReg); + inst2 = anInstruction3; + /* begin SubCq:R: */ + anInstruction12 = genoperandoperand(SubCqR, 8, SPReg); + } + } + if (regOrConst0 < NoReg) { + /* begin PushC64: */ + genPushC64(backEnd, -2 - regOrConst0); + } + else { + /* begin PushRd: */ + anInstruction4 = genoperandoperandoperand(MoveRdM64r, regOrConst0, -8, SPReg); + inst3 = anInstruction4; + /* begin SubCq:R: */ + anInstruction13 = genoperandoperand(SubCqR, 8, SPReg); + } + ((AbstractInstruction *) backEnd); +l19: /* end genMarshallNArgs:floatArg:floatArg:floatArg:floatArg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin annotateCall: */ + anInstruction6 = genoperand(CallFull, callTarget); + abstractInstruction = anInstruction6; + (abstractInstruction->annotation = IsRelativeCall); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNFloatArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Compile the cache tag computation and the first comparison. Answer the + address of that comparison. */ + + /* Cogit>>#compileCPICEntry */ +static AbstractInstruction * +compileCPICEntry(void) +{ + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + +/* Compile the abstract instructions for the entire full block method. */ + + /* Cogit>>#compileEntireFullBlockMethod: */ +static sqInt NoDbgRegParms +compileEntireFullBlockMethod(sqInt numCopied) +{ + sqInt result; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileFullBlockEntry(); + compileFullBlockMethodFrameBuild(numCopied); + if (((result = compileMethodBody())) < 0) { + return result; + } + assert(blockCount == 0); + return 0; +} + + +/* The entry code to a method checks that the class of the current receiver + matches that in the inline cache. Other non-obvious elements are that its + alignment must be + different from the alignment of the noCheckEntry so that the method map + machinery can distinguish normal and super sends (super sends bind to the + noCheckEntry). */ + + /* Cogit>>#compileEntry */ +static void +compileEntry(void) +{ + AbstractInstruction *abstractInstruction; + + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)sendMiss)); + /* begin Label */ + noCheckEntry = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (compileSendTrace()) { + /* begin saveAndRestoreLinkRegAround: */ + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceLinkedSendTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + } +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Abort for stack overflow on full block activation (no inline cache miss + possible). The flag is SendNumArgsReg. */ + + /* Cogit>>#compileFullBlockEntry */ +static sqInt +compileFullBlockEntry(void) +{ + sqInt alignment; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt callTarget; + AbstractInstruction * jumpNoContextSwitch; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + stackOverflowCall = anInstruction; + /* begin Call: */ + callTarget = methodAbortTrampolineFor(methodOrBlockNumArgs); + genoperand(Call, callTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + fullBlockNoContextSwitchEntry = anInstruction1; + /* begin Jump: */ + jumpNoContextSwitch = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + alignment = ((BytesPerWord < 8) ? 8 : BytesPerWord); + genoperand(AlignmentNops, alignment); + /* begin MoveR:R: */ + fullBlockEntry = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpNoContextSwitch, gLabel()); + return 0; +} + + +/* Compile the top-level method body. */ + + /* Cogit>>#compileMethodBody */ +static sqInt +compileMethodBody(void) +{ + if (endPC < initialPC) { + return 0; + } + return compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +} + + +/* The start of a PIC has a call to a run-time abort routine that either + handles a dispatch to an + interpreted method or a dispatch of an MNU case. The routine selects the + path by testing + ClassReg, which holds the inline cache tag; if equal to the + picAbortDiscriminatorValue (zero) + it takes the MNU path; if nonzero the dispatch to interpreter path. + Neither of these paths + returns. The abort routine must be called; In the callee the PIC is + located by adding the + relevant offset to the return address of the call. + + N.B. This code must match that in compileAbort so that the offset of the + return address of + the call is the same in methods and closed PICs. */ + + /* Cogit>>#compilePICAbort: */ +static sqInt NoDbgRegParms +compilePICAbort(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + sqInt callTarget1; + AbstractInstruction * picMNUAbort; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ClassReg); + picMNUAbort = anInstruction; + /* begin Call: */ + callTarget1 = picAbortTrampolineFor(numArgs); + picInterpretAbort = genoperand(Call, callTarget1); + + return 0; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargfloatResultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + /* begin RetN: */ + genoperand(RetN, 0); + +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + /* begin RetN: */ + genoperand(RetN, 0); + +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, resultReg2OrNone, regMask); + genLoadStackPointers(backEnd); + /* begin RetN: */ + genoperand(RetN, 0); + +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + /* begin RetN: */ + genoperand(RetN, 0); + +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeEntryOffsets */ +static void +computeEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + AbstractInstruction *sendMissCall; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + sendMissCall = compileAbort(); + compileEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cmEntryOffset = ((entry->address)) - methodZoneBase; + cmNoCheckEntryOffset = ((noCheckEntry->address)) - methodZoneBase; + missOffset = (((sendMissCall->address)) + ((sendMissCall->machineCodeSize))) - methodZoneBase; + entryPointMask = BytesPerWord - 1; + while ((cmEntryOffset & entryPointMask) == (cmNoCheckEntryOffset & entryPointMask)) { + entryPointMask = (entryPointMask + entryPointMask) + 1; + } + if (entryPointMask >= (roundUpLength(1))) { + error("cannot differentiate checked and unchecked entry-points with current cog method alignment"); + } + checkedEntryAlignment = cmEntryOffset & entryPointMask; + uncheckedEntryAlignment = cmNoCheckEntryOffset & entryPointMask; + assert(checkedEntryAlignment != uncheckedEntryAlignment); +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeFullBlockEntryOffsets */ +static void +computeFullBlockEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + compileFullBlockEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cbEntryOffset = ((fullBlockEntry->address)) - methodZoneBase; + cbNoSwitchEntryOffset = ((fullBlockNoContextSwitchEntry->address)) - methodZoneBase; + +} + + +/* This pass assigns maximum sizes to all abstract instructions and + eliminates jump fixups. + It hence assigns the maximum address an instruction will occur at which + allows the next + pass to conservatively size jumps. */ + + /* Cogit>>#computeMaximumSizes */ +static void +computeMaximumSizes(void) +{ + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt relativeAddress; + + relativeAddress = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + (abstractInstruction->address = relativeAddress); + (abstractInstruction->maxSize = computeMaximumSize(abstractInstruction)); + relativeAddress += (abstractInstruction->maxSize); + } +} + + +/* Configure a copy of the prototype CPIC for a two-case PIC for + case0CogMethod and + case1Method + case1Tag. + The tag for case0CogMethod is at the send site and so doesn't need to be + generated. case1Method may be any of + - a Cog method; jump to its unchecked entry-point + - a CompiledMethod; jump to the ceInterpretFromPIC trampoline + - nil; call ceMNUFromPIC + addDelta is the address change from the prototype to the new CPIC + location, needed + because the loading of the CPIC label at the end may use a literal instead + of a pc relative load. */ +/* self disassembleFrom: cPIC asInteger + (self sizeof: CogMethod) to: cPIC + asInteger + closedPICSize + */ + + /* Cogit>>#configureCPIC:Case0:Case1Method:tag:isMNUCase:numArgs:delta: */ +static sqInt NoDbgRegParms +configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta) +{ + sqInt caseEndAddress; + sqInt operand; + sqInt pc; + usqIntptr_t targetEntry; + + assert(case1Method != null); + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + assert(!(inlineCacheTagIsYoung(case1Tag))); + if ((!isMNUCase) + && (methodHasCogMethod(case1Method))) { + operand = 0; + targetEntry = (((sqInt)(cogMethodOf(case1Method)))) + cmNoCheckEntryOffset; + } + else { + + /* We do not scavenge PICs, hence we cannot cache the MNU method if it is in new space. */ + operand = ((case1Method == null) + || (isYoungObject(case1Method)) + ? 0 + : case1Method); + targetEntry = (case1Method == null + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : (((sqInt)cPIC)) + (picInterpretAbortOffset())); + } + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)case0CogMethod)) + cmNoCheckEntryOffset); + + /* update the cpic case */ + caseEndAddress = addressOfEndOfCaseinCPIC(2, cPIC); + rewriteCPICCaseAttagobjReftarget(caseEndAddress, case1Tag, operand, ((sqInt)((isMNUCase + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : targetEntry)))); + /* begin relocateMethodReferenceBeforeAddress:by: */ + pc = ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)); + relocateCallBeforeReturnPCby(((AbstractInstruction *) backEnd), pc, addrDelta); + ((AbstractInstruction *) backEnd); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + return 0; +} + + +/* Configure a copy of the prototype CPIC for a one-case MNU CPIC that calls + ceMNUFromPIC for + case0Tag The tag for case0 is at the send site and so doesn't need to be + generated. addDelta is the address change from the prototype to the new + CPIC location, needed + because the loading of the CPIC label at the end may be a literal instead + of a pc-relative load. */ +/* adjust the jump at missOffset, the ceAbortXArgs */ + + /* Cogit>>#configureMNUCPIC:methodOperand:numArgs:delta: */ +static sqInt NoDbgRegParms +configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta) +{ + int operand; + sqInt pc; + sqInt target; + + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + + /* set the jump to the case0 method */ + operand = ((methodOperand == null) + || (isYoungObject(methodOperand)) + ? 0 + : methodOperand); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)cPIC)) + (sizeof(CogMethod))); + storeLiteralbeforeFollowingAddress(backEnd, operand, ((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + /* begin relocateMethodReferenceBeforeAddress:by: */ + pc = ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)); + relocateCallBeforeReturnPCby(((AbstractInstruction *) backEnd), pc, addrDelta); + ((AbstractInstruction *) backEnd); + /* begin rewriteCPIC:caseJumpTo: */ + target = addressOfEndOfCaseinCPIC(2, cPIC); + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), target); + return 0; +} + + +/* Scan the CPIC for target methods that have been freed and eliminate them. + Since the first entry cannot be eliminated, answer that the PIC should be + freed if the first entry is to a free target. Answer if the PIC is now + empty or should be freed. */ + + /* Cogit>>#cPICCompactAndIsNowEmpty: */ +static sqInt NoDbgRegParms +cPICCompactAndIsNowEmpty(CogMethod *cPIC) +{ + sqInt entryPoint; + sqInt followingAddress; + sqInt i; + sqInt methods[MaxCPICCases]; + sqInt pc; + int tags[MaxCPICCases]; + CogMethod *targetMethod; + sqInt targets[MaxCPICCases]; + sqInt used; + sqInt valid; + + used = 0; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + + /* Collect all target triples except for triples whose entry-point is a freed method */ + valid = 1; + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + if (i == 1) { + return 1; + } + valid = 0; + } + } + if (valid) { + tags[used] = ((i > 1 + ? (/* begin literal32BeforeFollowingAddress: */ + (followingAddress = pc - (jumpLongConditionalByteSize(backEnd))), + literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), followingAddress)) + : 0)); + targets[used] = entryPoint; + methods[used] = (literalBeforeFollowingAddress(backEnd, pc - ((i == 1 + ? jumpLongByteSize(backEnd) + : (jumpLongConditionalByteSize(backEnd)) + (cmpC32RTempByteSize(backEnd)))))); + used += 1; + } + } + if (used == ((cPIC->cPICNumCases))) { + return 0; + } + if (used == 0) { + return 1; + } + (cPIC->cPICNumCases = used); + if (used == 1) { + pc = addressOfEndOfCaseinCPIC(2, cPIC); + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), pc); + return 0; + } + for (i = 1; i < used; i += 1) { + pc = addressOfEndOfCaseinCPIC(i + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(pc, tags[i], methods[i], targets[i]); + } + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), pc - cPICCaseSize); + return 0; +} + + +/* The first case in a CPIC doesn't have a class reference so we need only + step over actually usd subsequent cases. + */ + + /* Cogit>>#cPICHasForwardedClass: */ +static sqInt NoDbgRegParms +cPICHasForwardedClass(CogMethod *cPIC) +{ + sqInt classIndex; + sqInt i; + sqInt pc; + + + /* start by finding the address of the topmost case, the cPICNumCases'th one */ + pc = (addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC)) - (jumpLongConditionalByteSize(backEnd)); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + /* begin literal32BeforeFollowingAddress: */ + classIndex = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (isForwardedClassIndex(classIndex)) { + return 1; + } + pc += cPICCaseSize; + } + return 0; +} + + +/* scan the CPIC for target methods that have been freed. */ + + /* Cogit>>#cPICHasFreedTargets: */ +static sqInt NoDbgRegParms +cPICHasFreedTargets(CogMethod *cPIC) +{ + sqInt entryPoint; + sqInt i; + sqInt pc; + CogMethod *targetMethod; + + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + return 1; + } + } + } + return 0; +} + + +/* Whimsey; we want 16rCA5E10 + cPICPrototypeCaseOffset to be somewhere in + the middle of the zone. + */ + + /* Cogit>>#cPICPrototypeCaseOffset */ +static usqInt +cPICPrototypeCaseOffset(void) +{ + return ((methodZoneBase + (youngReferrers())) / 2) - 13262352; +} + + +/* Are any of the jumps from this CPIC to targetMethod? */ + + /* Cogit>>#cPIC:HasTarget: */ +static sqInt NoDbgRegParms +cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) +{ + sqInt i; + sqInt pc; + usqInt target; + + target = (((usqInt)targetMethod)) + cmNoCheckEntryOffset; + + /* Since this is a fast test doing simple compares we don't need to care that some + cases have nonsense addresses in there. Just zip on through. */ + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (target == (jumpLongTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + for (i = 2; i <= MaxCPICCases; i += 1) { + pc += cPICCaseSize; + if (target == (jumpLongTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + } + return 0; +} + + +/* Division is a little weird on some processors. Defer to the backEnd + to allow it to generate any special code it may need to. */ + + /* Cogit>>#DivR:R:Quo:Rem: */ +static AbstractInstruction * NoDbgRegParms +gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) +{ + genDivRRQuoRem(backEnd, rDivisor, rDividend, rQuotient, rRemainder); + return abstractInstructionAt(opcodeIndex - 1); +} + + +/* Return the default number of bytes to allocate for native code at startup. + The actual value can be set via vmParameterAt: and/or a preference in the + ini file. */ + + /* Cogit>>#defaultCogCodeSize */ +sqInt +defaultCogCodeSize(void) +{ + /* begin getDefaultCogCodeSize */ + return 1024 * 1024; +} + + +/* Answer the number of bytecodes to skip to get to the first bytecode + past the primitive call and any store of the error code. */ + + /* Cogit>>#deltaToSkipPrimAndErrorStoreIn:header: */ +static sqInt NoDbgRegParms +deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader) +{ + return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0) + && ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj))) + ? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader)) + : 0); +} + + /* Cogit>>#endPCOf: */ +static sqInt NoDbgRegParms +endPCOf(sqInt aMethod) +{ + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt end; + sqInt latestContinuation; + sqInt nExts; + sqInt pc; + sqInt prim; + sqInt targetPC; + + pc = (latestContinuation = startPCOfMethod(aMethod)); + if (((prim = primitiveIndexOf(aMethod))) > 0) { + if (isQuickPrimitiveIndex(prim)) { + return pc - 1; + } + } + /* begin bytecodeSetOffsetFor: */ + bsOffset = (methodUsesAlternateBytecodeSet(aMethod) + ? 256 + : 0); + nExts = 0; + end = numBytesOf(aMethod); + while (pc <= end) { + byte = fetchByteofObject(pc, aMethod); + descriptor = generatorAt(byte + bsOffset); + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + end = pc; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, aMethod); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + if ((descriptor->isBlockCreation)) { + pc += distance; + } + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + pc += (descriptor->numBytes); + } + return end; +} + + +/* This is a static version of ceEnterCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#enterCogCodePopReceiver */ +void +enterCogCodePopReceiver(void) +{ + realCEEnterCogCodePopReceiverReg(); + error("what??"); + +} + + +/* Use asserts to check if the ClosedPICPrototype is as expected from + compileClosedPICPrototype, and can be updated as required via + rewriteCPICCaseAt:tag:objRef:target:. If all asserts pass, answer + 0, otherwise answer a bit mask identifying all the errors. */ +/* self disassembleFrom: methodZoneBase + (self sizeof: CogMethod) to: + methodZoneBase + closedPICSize + */ + + /* Cogit>>#expectedClosedPICPrototype: */ +static sqInt NoDbgRegParms +expectedClosedPICPrototype(CogMethod *cPIC) +{ + sqInt classTag; + usqInt classTagPC; + sqInt entryPoint; + sqInt errors; + sqInt i; + usqInt methodObjPC; + sqInt object; + usqInt pc; + + errors = 0; + + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((usqInt)cPIC)) + firstCPICCaseOffset; + object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd))); + if (!(asserta(object == (firstPrototypeMethodOop())))) { + errors = 1; + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + if (!(asserta(entryPoint == ((cPICPrototypeCaseOffset()) + 13262352)))) { + errors += 2; + } + for (i = 1; i < MaxCPICCases; i += 1) { + + /* verify information in case is as expected. */ + pc += cPICCaseSize; + methodObjPC = (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == ((subsequentPrototypeMethodOop()) + i)))) { + errors = errors | 4; + } + classTagPC = pc - (jumpLongConditionalByteSize(backEnd)); + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == (3133021973U + i)))) { + errors = errors | 8; + } + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (!(asserta(entryPoint == (((cPICPrototypeCaseOffset()) + 13262352) + (i * 16))))) { + errors = errors | 16; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == (((subsequentPrototypeMethodOop()) + i) ^ 2779096485U)))) { + errors = errors | 32; + } + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == ((3133021973U + i) ^ 1515870810)))) { + errors = errors | 64; + } + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (!(asserta(entryPoint == ((((cPICPrototypeCaseOffset()) + 13262352) + (i * 16)) ^ 5614160)))) { + errors = errors | 128; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, (pc + cPICEndSize)); + if (!(asserta(entryPoint == (cPICMissTrampolineFor(0))))) { + errors += 256; + } + return errors; +} + + +/* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A) */ + + /* Cogit>>#extABytecode */ +static sqInt +extABytecode(void) +{ + extA = (((usqInt) extA << 8)) + byte1; + return 0; +} + + +/* 225 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B) */ + + /* Cogit>>#extBBytecode */ +static sqInt +extBBytecode(void) +{ + extB = ((numExtB == 0) + && (byte1 > 0x7F) + ? byte1 - 256 + : (((usqInt) extB << 8)) + byte1); + numExtB += 1; + return 0; +} + + +/* Fill in the block headers now we know the exact layout of the code. */ + + /* Cogit>>#fillInBlockHeadersAt: */ +static sqInt NoDbgRegParms +fillInBlockHeadersAt(sqInt startAddress) +{ + CogBlockMethod *blockHeader; + BlockStart *blockStart; + sqInt i; + + if (!(needsFrame + && (blockCount > 0))) { + return null; + } + if (blockNoContextSwitchOffset == null) { + blockNoContextSwitchOffset = ((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)); + } + else { + assert(blockNoContextSwitchOffset == (((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)))); + } + for (i = 0; i < blockCount; i += 1) { + blockStart = blockStartAt(i); + blockHeader = ((CogBlockMethod *) ((((blockStart->fakeHeader))->address))); + (blockHeader->homeOffset = ((((blockStart->fakeHeader))->address)) - startAddress); + (blockHeader->startpc = (blockStart->startpc)); + (blockHeader->cmType = CMBlock); + (blockHeader->cmNumArgs = (blockStart->numArgs)); + (blockHeader->cbUsesInstVars = (blockStart->hasInstVarRef)); + (blockHeader->stackCheckOffset = (((blockStart->stackCheckLabel)) == null + ? 0 + : ((((blockStart->stackCheckLabel))->address)) - ((((blockStart->fakeHeader))->address)))); + } + return 0; +} + + /* Cogit>>#fillInMethodHeader:size:selector: */ +static CogMethod * NoDbgRegParms +fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) +{ + CogMethod *originalMethod; + sqInt rawHeader; + + (method->cmType = CMMethod); + (method->objectHeader = nullHeaderForMachineCodeMethod()); + (method->blockSize = size); + (method->methodObject = methodObj); + + /* If the method has already been cogged (e.g. Newspeak accessors) then + leave the original method attached to its cog method, but get the right header. */ + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); + assert(((originalMethod->blockSize)) == size); + assert(methodHeader == ((originalMethod->methodHeader))); + } + else { + rawHeaderOfput(methodObj, ((sqInt)method)); + } + (method->methodHeader = methodHeader); + (method->selector = selector); + (method->cmNumArgs = argumentCountOfMethodHeader(methodHeader)); + if ((method->cmRefersToYoung = hasYoungReferent)) { + addToYoungReferrers(method); + } + (method->cmUsageCount = initialMethodUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) method))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (method->cmUsesPenultimateLit = maxLitIndex >= ((literalCountOfMethodHeader(methodHeader)) - 2)); + (method->blockEntryOffset = (blockEntryLabel != null + ? ((blockEntryLabel->address)) - (((sqInt)method)) + : 0)); + if (needsFrame) { + if (!((((stackCheckLabel->address)) - (((sqInt)method))) <= MaxStackCheckOffset)) { + error("too much code for stack check offset"); + } + } + (method->stackCheckOffset = (needsFrame + ? ((stackCheckLabel->address)) - (((sqInt)method)) + : 0)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)method)) + missOffset)) == (methodAbortTrampolineFor((method->cmNumArgs)))); + assert(size == (roundUpLength(size))); + flushICacheFromto(processor, ((usqInt)method), (((usqInt)method)) + size); + /* begin maybeEnableSingleStep */ + return method; +} + + /* Cogit>>#findBackwardBranch:IsBackwardBranch:Mcpc:Bcpc:MatchingBcpc: */ +static sqInt NoDbgRegParms +findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc) +{ + return ((isBackwardBranchAndAnnotation & 1) + && ((((sqInt)targetBcpc)) == bcpc) + ? ((sqInt)mcpc) + : 0); +} + + /* Cogit>>#findBlockMethodWithEntry:startBcpc: */ +static usqInt NoDbgRegParms +findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc) +{ + CogBlockMethod *cogBlockMethod; + + cogBlockMethod = ((CogBlockMethod *) (blockEntryMcpc - (sizeof(CogBlockMethod)))); + if (((cogBlockMethod->startpc)) == startBcpc) { + return ((usqInt)cogBlockMethod); + } + return 0; +} + + /* Cogit>>#findMapLocationForMcpc:inMethod: */ +static sqInt NoDbgRegParms +findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + if (mcpc == targetMcpc) { + return map; + } + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation != IsAnnotationExtension) { + mcpc += 1 * ((annotation == IsDisplacementX2N + ? ((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + if (mcpc >= targetMcpc) { + assert(mcpc == targetMcpc); + if (annotation == IsDisplacementX2N) { + map -= 1; + mapByte = byteAt(map); + annotation = ((usqInt) mapByte) >> AnnotationShift; + assert(annotation > IsAnnotationExtension); + } + return map; + } + map -= 1; + } + return 0; +} + + +/* Find the CMMethod or CMBlock that has zero-relative startbcpc as its first + bytecode pc. + As this is for cannot resume processing and/or conversion to machine-code + on backward + branch, it doesn't have to be fast. Enumerate block returns and map to + bytecode pcs. */ + + /* Cogit>>#findMethodForStartBcpc:inHomeMethod: */ +CogBlockMethod * +findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) == CMMethod); + if (startbcpc == (startPCOfMethodHeader((cogMethod->methodHeader)))) { + return ((CogBlockMethod *) cogMethod); + } + assert(((cogMethod->blockEntryOffset)) != 0); + return ((CogBlockMethod *) (blockDispatchTargetsForperformarg(cogMethod, findBlockMethodWithEntrystartBcpc, startbcpc))); +} + + +/* Machine code addresses map to the following bytecode for all bytecodes + except backward branches, where they map to the backward branch itself. + This is so that loops continue, rather than terminate prematurely. */ + + /* Cogit>>#find:IsBackwardBranch:Mcpc:Bcpc:MatchingMcpc: */ +static sqInt NoDbgRegParms +findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc) +{ + return (targetMcpc == mcpc + ? ((descriptor == null) + || (isBackwardBranchAndAnnotation & 1) + ? bcpc + : bcpc + ((descriptor->numBytes))) + : 0); +} + + /* Cogit>>#firstMappedPCFor: */ +static usqInt NoDbgRegParms +firstMappedPCFor(CogMethod *cogMethod) +{ + return ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); +} + + +/* Answer a fake value for the first method oop in the PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. */ + + /* Cogit>>#firstPrototypeMethodOop */ +static sqInt +firstPrototypeMethodOop(void) +{ + return (((((usqInt)99282957)) >= ((methodLabel->address))) + && ((((usqInt)99282957)) < (youngReferrers())) + ? 212332557 + : 99282957); +} + + /* Cogit>>#followForwardedLiteralsIn: */ +void +followForwardedLiteralsIn(CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((cogMethod->cmType)) != CMMethod) + || (!(isForwarded((cogMethod->methodObject))))); + if (shouldRemapOop((cogMethod->selector))) { + (cogMethod->selector = remapObj((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + ensureInYoungReferrers(cogMethod); + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#followForwardedMethods */ +void +followForwardedMethods(void) +{ + CogMethod *cogMethod; + sqInt freedPIC; + + freedPIC = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (isForwarded((cogMethod->methodObject))) { + (cogMethod->methodObject = followForwarded((cogMethod->methodObject))); + if (isYoungObject((cogMethod->methodObject))) { + ensureInYoungReferrers(cogMethod); + } + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (followMethodReferencesInClosedPIC(cogMethod)) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } +} + + +/* Follow a potential object reference from a closed PIC. + This may be a method reference or null. + Answer if the followed literal is young. + 'mcpc' refers to the jump/branch instruction at the end of + each cpic case */ + + /* Cogit>>#followMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +followMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + if (!(isForwarded(object))) { + return isYoungObject(object); + } + subject = followForwarded(object); + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + return isYoungObject(subject); +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#followMethodReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +followMethodReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = followMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (followMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Free machine-code methods whose compiled methods are unmarked + and open PICs whose selectors are not marked, and closed PICs that + refer to unmarked objects. */ + + /* Cogit>>#freeUnmarkedMachineCode */ +void +freeUnmarkedMachineCode(void) +{ + CogMethod *cogMethod; + sqInt freedMethod; + + freedMethod = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (!(isMarked((cogMethod->methodObject))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((!(isImmediate((cogMethod->selector)))) + && (!(isMarked((cogMethod->selector)))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMClosedPIC) + && (closedPICRefersToUnmarkedObject(cogMethod))) { + freedMethod = 1; + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedMethod) { + unlinkSendsToFree(); + } +} + + /* Cogit>>#genCallMustBeBooleanFor: */ +static AbstractInstruction * NoDbgRegParms +genCallMustBeBooleanFor(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt callTarget; + + /* begin CallRT: */ + callTarget = (boolean == (falseObject()) + ? ceSendMustBeBooleanAddFalseTrampoline + : ceSendMustBeBooleanAddTrueTrampoline); + /* begin annotateCall: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + return abstractInstruction; +} + + /* Cogit>>#genCheckForInterruptsTrampoline */ +static sqInt +genCheckForInterruptsTrampoline(void) +{ + sqInt address1; + AbstractInstruction *anInstruction1; + + zeroOpcodeIndex(); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Aw: */ + address1 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, TempReg, address1); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCheckForInterrupts, "ceCheckForInterruptsTrampoline", 0, null, null, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genConditionalBranch:operand: */ +static AbstractInstruction * NoDbgRegParms +genConditionalBranchoperand(sqInt opcode, sqInt operandOne) +{ + AbstractInstruction *branch; + AbstractInstruction * self_in_noteFollowingConditionalBranch; + + /* begin noteFollowingConditionalBranch: */ + self_in_noteFollowingConditionalBranch = previousInstruction(); + branch = genoperand(opcode, operandOne); + return branch; +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. The desired arguments and entry-point are pushed on a stackPage's + stack. The enilopmart pops off the values to be loaded into registers and + then executes a return instruction to pop off the entry-point and jump to + it. + BEFORE AFTER (stacks grow down) + whatever stackPointer -> whatever + target address => reg1 = reg1val, etc + reg1val pc = target address + reg2val + stackPointer -> reg3val */ + + /* Cogit>>#genEnilopmartFor:and:and:forCall:called: */ +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) + +{ + sqInt endAddress; + sqInt enilopmart; + sqInt size; + + zeroOpcodeIndex(); + genLoadStackPointers(backEnd); + if (regArg3OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg3OrNone); + } + if (regArg2OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg2OrNone); + } + /* begin PopR: */ + genoperand(PopR, regArg1); + genEnilopmartReturn(forCall); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineName, enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. At the point the enilopmart enters machine code via a return + instruction, any argument registers have been loaded with their values and + the stack, if + for call, looks like + ret pc + stackPointer -> target address + + and if not for call, looks like + whatever + stackPointer -> target address + + If forCall and running on a CISC, ret pc must be left on the stack. If + forCall and + running on a RISC, ret pc must be popped into LinkReg. In either case, + target address must be removed from the stack and jumped/returned to. */ + + /* Cogit>>#genEnilopmartReturn: */ +static void NoDbgRegParms +genEnilopmartReturn(sqInt forCall) +{ + /* begin RetN: */ + genoperand(RetN, 0); + +} + + +/* Generate the routine that writes the current values of the C frame and + stack pointers into + variables. These are used to establish the C stack in trampolines back + into the C run-time. + + This is a presumptuous quick hack for x86. It is presumptuous for two + reasons. Firstly + the system's frame and stack pointers may differ from those we use in + generated code, + e.g. on register-rich RISCs. Secondly the ABI may not support a simple + frameless call + as written here (for example 128-bit stack alignment on Mac OS X). */ + + /* Cogit>>#generateCaptureCStackPointers: */ +static void NoDbgRegParms +generateCaptureCStackPointers(sqInt captureFramePointer) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt quickConstant1; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 32; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + + /* Must happen first; value may be used in accessing any of the following addresses */ + startAddress = methodZoneBase; + if (captureFramePointer) { + /* begin MoveR:Aw: */ + address = cFramePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, FPReg, address); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, TempReg); + /* begin AddCq:R: */ + quickConstant1 = leafCallStackPointerDelta(backEnd); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant1, TempReg); + /* begin MoveR:Aw: */ + address1 = cStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, TempReg, address1); + + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + flushICacheFromto(processor, ((usqInt)startAddress), ((usqInt)methodZoneBase)); + recordGeneratedRunTimeaddress("ceCaptureCStackPointers", startAddress); + ceCaptureCStackPointers = ((void (*)(void)) startAddress); +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ + + /* Cogit>>#generateClosedPICPrototype */ +static void +generateClosedPICPrototype(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + CogMethod *cPIC; + AbstractInstruction * cPICEndOfCodeLabel; + sqInt endAddress; + AbstractInstruction * endCPICCase1; + usqIntptr_t fixupSize; + sqInt h; + AbstractInstruction *jumpNext; + sqInt jumpTarget; + sqInt jumpTarget1; + sqInt jumpTarget2; + sqInt numArgs; + sqInt opcode; + usqIntptr_t opcodeSize; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + + + /* stack allocate the various collections so that they + are effectively garbage collected on return. */ + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = MaxCPICCases * 9; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + /* begin compileClosedPICPrototype */ + compilePICAbort((numArgs = 0)); + + /* At the end of the entry code we need to jump to the first case code, which is actually the last chunk. + On each entension we must update this jump to move back one case. */ + jumpNext = compileCPICEntry(); + /* begin MoveUniqueCw:R: */ + wordConstant2 = firstPrototypeMethodOop(); + /* begin gen:uniqueLiteral:operand: */ + anInstruction2 = genoperandoperand(MoveCwR, wordConstant2, SendNumArgsReg); + /* begin JumpLong: */ + jumpTarget1 = (cPICPrototypeCaseOffset()) + 13262352; + genoperand(JumpLong, jumpTarget1); + /* begin Label */ + endCPICCase0 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + for (h = 1; h < MaxCPICCases; h += 1) { + if (h == (MaxCPICCases - 1)) { + jmpTarget(jumpNext, gLabel()); + } + /* begin MoveUniqueCw:R: */ + wordConstant = (subsequentPrototypeMethodOop()) + h; + /* begin gen:uniqueLiteral:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg); + /* begin CmpC32:R: */ + wordConstant1 = 3133021973U + h; + /* begin gen:literal:operand: */ + opcode = CmpCwR; + /* begin checkLiteral:forInstruction: */ + anInstruction1 = genoperandoperand(opcode, wordConstant1, TempReg); + /* begin JumpLongZero: */ + jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16); + genConditionalBranchoperand(JumpLongZero, ((sqInt)jumpTarget)); + if (h == 1) { + /* begin Label */ + endCPICCase1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + /* begin MoveCw:R: */ + wordConstant3 = (methodLabel->address); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveCwR, wordConstant3, ClassReg); + /* begin JumpLong: */ + jumpTarget2 = cPICMissTrampolineFor(numArgs); + genoperand(JumpLong, jumpTarget2); + /* begin Label */ + cPICEndOfCodeLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + computeMaximumSizes(); + cPIC = ((CogMethod *) methodZoneBase); + closedPICSize = (sizeof(CogMethod)) + (generateInstructionsAt(methodZoneBase + (sizeof(CogMethod)))); + endAddress = outputInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + assert((methodZoneBase + closedPICSize) == endAddress); + firstCPICCaseOffset = ((endCPICCase0->address)) - methodZoneBase; + cPICEndOfCodeOffset = ((cPICEndOfCodeLabel->address)) - methodZoneBase; + cPICCaseSize = ((endCPICCase1->address)) - ((endCPICCase0->address)); + cPICEndSize = closedPICSize - (((MaxCPICCases - 1) * cPICCaseSize) + firstCPICCaseOffset); + closedPICSize = roundUpLength(closedPICSize); + assert(((picInterpretAbort->address)) == (((methodLabel->address)) + (picInterpretAbortOffset()))); + assert((expectedClosedPICPrototype(cPIC)) == 0); + storeLiteralbeforeFollowingAddress(backEnd, 0, ((endCPICCase0->address)) - (jumpLongByteSize(backEnd))); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + cPICPrototype = cPIC; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogFullBlock */ +static CogMethod * +generateCogFullBlock(void) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cbNoSwitchEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cbEntryOffset) == ((fullBlockEntry->address))); + assert((startAddress + cbNoSwitchEntryOffset) == ((fullBlockNoContextSwitchEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cbNoSwitchEntryOffset); + flag("TOCHECK"); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, nilObject()); + (method->cpicHasMNUCaseOrCMIsFullBlock = 1); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogMethod: */ +static CogMethod * NoDbgRegParms +generateCogMethod(sqInt selector) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cmNoCheckEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cmEntryOffset) == ((entry->address))); + assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); + fillInBlockHeadersAt(startAddress); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* Size pc-dependent instructions and assign eventual addresses to all + instructions. Answer the size of the code. + Compute forward branches based on virtual address (abstract code starts at + 0), assuming that any branches branched over are long. + Compute backward branches based on actual address. + Reuse the fixups array to record the pc-dependent instructions that need + to have + their code generation postponed until after the others. */ + + /* Cogit>>#generateInstructionsAt: */ +static sqInt NoDbgRegParms +generateInstructionsAt(sqInt eventualAbsoluteAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + BytecodeFixup *fixup; + sqInt i; + sqInt j; + sqInt pcDependentIndex; + + absoluteAddress = eventualAbsoluteAddress; + pcDependentIndex = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + if (isPCDependent(abstractInstruction)) { + sizePCDependentInstructionAt(abstractInstruction, absoluteAddress); + fixup = fixupAt(pcDependentIndex); + pcDependentIndex += 1; + (fixup->instructionIndex = i); + absoluteAddress += (abstractInstruction->machineCodeSize); + } + else { + absoluteAddress = concretizeAt(abstractInstruction, absoluteAddress); + } + } + for (j = 0; j < pcDependentIndex; j += 1) { + fixup = fixupAt(j); + abstractInstruction = abstractInstructionAt((fixup->instructionIndex)); + concretizeAt(abstractInstruction, (abstractInstruction->address)); + } + return absoluteAddress - eventualAbsoluteAddress; +} + + +/* Generate the method map at addressrNull (or compute it if addressOrNull is + null). Answer the length of the map in byes. Each entry in the map is in + two parts. In the + least signficant bits are a displacement of how far from the start or + previous entry, + unless it is an IsAnnotationExtension byte, in which case those bits are + the extension. + In the most signficant bits are the type of annotation at the point + reached. A null + byte ends the map. */ + + /* Cogit>>#generateMapAt:start: */ +static sqInt NoDbgRegParms +generateMapAtstart(sqInt addressOrNull, sqInt startAddress) +{ + unsigned char annotation; + sqInt delta; + sqInt i; + AbstractInstruction *instruction; + sqInt length; + sqInt location; + sqInt mapEntry; + sqInt maxDelta; + usqIntptr_t mcpc; + + length = 0; + location = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + annotation = (instruction->annotation); + if (!(annotation == null)) { + /* begin mapEntryAddress */ + mcpc = ((instruction->address)) + ((instruction->machineCodeSize)); + while (((delta = (mcpc - location) / 1)) > DisplacementMask) { + maxDelta = (((((delta < MaxX2NDisplacement) ? delta : MaxX2NDisplacement)) | DisplacementMask) - DisplacementMask); + assert((((usqInt) maxDelta) >> AnnotationShift) <= DisplacementMask); + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, (((usqInt) maxDelta) >> AnnotationShift) + DisplacementX2N); + } + location += maxDelta; + length += 1; + } + if (!(addressOrNull == null)) { + mapEntry = delta + (((sqInt)((usqInt)((((annotation < IsSendCall) ? annotation : IsSendCall))) << AnnotationShift))); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + location += delta; + length += 1; + if (annotation > IsSendCall) { + + /* Add the necessary IsAnnotationExtension */ + if (!(addressOrNull == null)) { + mapEntry = (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift))) + (annotation - IsSendCall); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + length += 1; + } + } + } + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, MapEnd); + } + return length + 1; +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#generateOpenPICPrototype */ +static void +generateOpenPICPrototype(void) +{ + sqInt codeSize; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + compileOpenPICnumArgs(specialSelector(0), 2); + computeMaximumSizes(); + concretizeAt(methodLabel, methodZoneBase); + codeSize = generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + mapSize = generateMapAtstart(null, methodZoneBase + cmNoCheckEntryOffset); + openPICSize = (roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize)); +} + + +/* Generate the run-time entries at the base of the native code zone and + update the base. + */ + + /* Cogit>>#generateRunTimeTrampolines */ +static void +generateRunTimeTrampolines(void) +{ + ceSendMustBeBooleanAddFalseTrampoline = genMustBeBooleanTrampolineForcalled(falseObject(), "ceSendMustBeBooleanAddFalseTrampoline"); + ceSendMustBeBooleanAddTrueTrampoline = genMustBeBooleanTrampolineForcalled(trueObject(), "ceSendMustBeBooleanAddTrueTrampoline"); + ceNonLocalReturnTrampoline = genNonLocalReturnTrampoline(); + + /* Neither of the context inst var access trampolines save registers. Their operation could cause + arbitrary update of stack frames, so the assumption is that callers flush the stack before calling + the context inst var access trampolines, and that everything except the result is dead afterwards. */ + ceCheckForInterruptTrampoline = genCheckForInterruptsTrampoline(); + ceFetchContextInstVarTrampoline = genTrampolineForcalledargargresult(ceContextinstVar, "ceFetchContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, SendNumArgsReg); + ceStoreContextInstVarTrampoline = genTrampolineForcalledargargargresult(ceContextinstVarvalue, "ceStoreContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, ClassReg, ReceiverResultReg); + + /* These two are unusual; they are reached by return instructions. */ + ceCannotResumeTrampoline = genTrampolineForcalled(ceCannotResume, "ceCannotResumeTrampoline"); + ceBaseFrameReturnTrampoline = genReturnTrampolineForcalledarg(ceBaseFrameReturn, "ceBaseFrameReturnTrampoline", ReceiverResultReg); + ceReturnToInterpreterTrampoline = genReturnTrampolineForcalledarg(ceReturnToInterpreter, "ceReturnToInterpreterTrampoline", ReceiverResultReg); + ceMallocTrampoline = genTrampolineForcalledargresult(ceMalloc, "ceMallocTrampoline", ReceiverResultReg, TempReg); + ceFreeTrampoline = genTrampolineForcalledarg(ceFree, "ceFreeTrampoline", ReceiverResultReg); + ceFFICalloutTrampoline = genFFICalloutTrampoline(); + +} + + +/* Generate a routine ceCaptureCStackPointers that will capture the C stack + pointer, and, if it is in use, the C frame pointer. These are used in + trampolines to call + run-time routines in the interpreter from machine-code. */ + + /* Cogit>>#generateStackPointerCapture */ +static void +generateStackPointerCapture(void) +{ + sqInt oldMethodZoneBase; + sqInt oldTrampolineTableIndex; + + + /* For the benefit of the following assert, assume the minimum at first. */ + cFramePointerInUse = 0; + assertCStackWellAligned(); + oldMethodZoneBase = methodZoneBase; + oldTrampolineTableIndex = trampolineTableIndex; + generateCaptureCStackPointers(1); + ceCaptureCStackPointers(); + if (!((cFramePointerInUse = isCFramePointerInUse()))) { + methodZoneBase = oldMethodZoneBase; + trampolineTableIndex = oldTrampolineTableIndex; + generateCaptureCStackPointers(0); + } + assertCStackWellAligned(); +} + + +/* Generate the run-time entries and exits at the base of the native code + zone and update the base. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* Cogit>>#generateTrampolines */ +static void +generateTrampolines(void) +{ + usqIntptr_t fixupSize; + sqInt methodZoneStart; + usqIntptr_t opcodeSize; + + methodZoneStart = methodZoneBase; + (methodLabel->address = methodZoneStart); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 80; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + hasYoungReferent = 0; + generateSendTrampolines(); + generateMissAbortTrampolines(); + generateObjectRepresentationTrampolines(); + generateRunTimeTrampolines(); + generateEnilopmarts(); + generateTracingTrampolines(); + recordGeneratedRunTimeaddress("methodZoneBase", methodZoneBase); + flushICacheFromto(processor, ((usqInt)methodZoneStart), ((usqInt)methodZoneBase)); +} + + /* Cogit>>#genFFICalloutTrampoline */ +static sqInt +genFFICalloutTrampoline(void) +{ + sqInt address1; + sqInt address3; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction3; + sqInt startAddress; + + opcodeIndex = 0; + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin MoveR:Aw: */ + address1 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, ClassReg, address1); + + /* begin CallR: */ + genoperand(CallR, TempReg); + /* begin MoveAw:R: */ + address3 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address3, ClassReg); + /* begin PushR: */ + genoperand(PushR, ClassReg); + + /* begin RetN: */ + genoperand(RetN, 0); + startAddress = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceFFICalloutTrampoline", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a routine that answers the stack pointer immedately + after a leaf call, used for checking stack pointer alignment. */ + + /* Cogit>>#genGetLeafCallStackPointer */ +static void +genGetLeafCallStackPointer(void) +{ + AbstractInstruction *anInstruction; + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt quickConstant; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 4; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + startAddress = methodZoneBase; + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, EAX); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetFP", startAddress); + ceGetFP = ((usqIntptr_t (*)(void)) startAddress); + startAddress = methodZoneBase; + zeroOpcodeIndex(); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, EAX); + /* begin AddCq:R: */ + quickConstant = leafCallStackPointerDelta(backEnd); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, EAX); + + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetSP", startAddress); + ceGetSP = ((usqIntptr_t (*)(void)) startAddress); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target + or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch + in a closed PIC. It distinguishes the two by testing ClassReg. If the + register is zero then this is an MNU. + + This poses a problem in 32-bit Spur, where zero is the cache tag for + immediate characters (tag pattern 2r10) because SmallIntegers have tag + patterns 2r11 + and 2r01, so anding with 1 reduces these to 0 & 1. We solve the ambiguity + by patching send sites with a 0 cache tag to open PICs instead of closed + PICs. */ + + /* Cogit>>#genInnerPICAbortTrampoline: */ +static sqInt NoDbgRegParms +genInnerPICAbortTrampoline(char *name) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpMNUCase; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceInterpretMethodFromPICreceiver, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg); + jmpTarget(jumpMNUCase, gLabel()); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceMNUFromPICMNUMethodreceiver, name, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genLoadCStackPointersForPrimCall */ +static sqInt +genLoadCStackPointersForPrimCall(void) +{ + sqInt address; + sqInt address1; + sqInt address2; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + + if (debugPrimCallStackOffset == 0) { + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + } + else { + /* begin MoveAw:R: */ + address1 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, debugPrimCallStackOffset, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SPReg); + } + if (cFramePointerInUse) { + /* begin MoveAw:R: */ + address2 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address2, FPReg); + } + return 0; +} + + +/* The in-line cache for a send is implemented as a constant load into + ClassReg. We always use a 32-bit load, even in 64-bits. + + In the initial (unlinked) state the in-line cache is notionally loaded + with the selector. + But since in 64-bits an arbitrary selector oop won't fit in a 32-bit + constant load, we + instead load the cache with the selector's index, either into the literal + frame of the + current method, or into the special selector array. Negative values are + 1-relative indices into the special selector array. + + When a send is linked, the load of the selector, or selector index, is + overwritten with a + load of the receiver's class, or class tag. Hence, the 64-bit VM is + currently constrained + to use class indices as cache tags. If out-of-line literals are used, + distinct caches /must + not/ share acche locations, for if they do, send cacheing will be confused + by the sharing. + Hence we use the MoveUniqueC32:R: instruction that will not share literal + locations. */ + + /* Cogit>>#genLoadInlineCacheWithSelector: */ +static void NoDbgRegParms +genLoadInlineCacheWithSelector(sqInt selectorIndex) +{ + AbstractInstruction *anInstruction; + sqInt cacheValue; + sqInt opcode; + sqInt selector; + + assert((selectorIndex < 0 + ? (((-selectorIndex) >= 1) && ((-selectorIndex) <= (numSpecialSelectors()))) + : ((selectorIndex >= 0) && (selectorIndex <= ((literalCountOf(methodObj)) - 1))))); + selector = (selectorIndex < 0 + ? specialSelector(-1 - selectorIndex) + : getLiteral(selectorIndex)); + assert(addressCouldBeOop(selector)); + if (isYoung(selector)) { + hasYoungReferent = 1; + } + cacheValue = selector; + + /* begin MoveUniqueC32:R: */ + opcode = MoveCwR; + /* begin uniqueLiteral:forInstruction: */ + anInstruction = genoperandoperand(opcode, cacheValue, ClassReg); +} + + /* Cogit>>#genNonLocalReturnTrampoline */ +static sqInt +genNonLocalReturnTrampoline(void) +{ + sqInt address1; + AbstractInstruction *anInstruction1; + + zeroOpcodeIndex(); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Aw: */ + address1 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, TempReg, address1); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceNonLocalReturn, "ceNonLocalReturnTrampoline", 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate a trampoline for a routine used as a return address, that has one + argument. Hack: a negative value indicates an abstract register, a + non-negative value indicates a constant. */ + + /* Cogit>>#genReturnTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 0, NoReg, 0); +} + + +/* If the client requires, then on an ARM-like RISC processor, the return + address needs to + be pushed to the stack so that the interpreter sees the same stack layout + as on CISC. + */ + + /* Cogit>>#genSmalltalkToCStackSwitch: */ +static sqInt NoDbgRegParms +genSmalltalkToCStackSwitch(sqInt pushLinkReg) +{ + genSaveStackPointers(backEnd); + if (cFramePointerInUse) { + genLoadCStackPointers(backEnd); + } + else { + genLoadCStackPointer(backEnd); + } + return 0; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called: */ +static sqInt NoDbgRegParms +genTrampolineForcalled(void *aRoutine, char *aString) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with two arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:floatResult: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, resultReg2, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:floatArg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone, resultReg2OrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, regMask, 1, NoReg, 0); +} + + +/* */ + + /* Cogit>>#gen: */ +static AbstractInstruction * NoDbgRegParms +gen(sqInt opcode) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + return abstractInstruction; +} + + +/* */ +/* */ + + /* Cogit>>#gen:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperand(sqInt opcode, sqInt operand) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operand; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + ((abstractInstruction->operands))[2] = operandThree; + return abstractInstruction; +} + + /* Cogit>>#getLiteral: */ +static sqInt NoDbgRegParms +getLiteral(sqInt litIndex) +{ + if (maxLitIndex < litIndex) { + maxLitIndex = litIndex; + } + return literalofMethod(litIndex, methodObj); +} + + /* Cogit>>#incrementUsageOfTargetIfLinkedSend:mcpc:ignored: */ +static sqInt NoDbgRegParms +incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + + if (annotation >= IsSendCall) { + assert(annotation != IsNSSendCall); + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmUsageCount)) < (CMMaxUsageCount / 2)) { + (targetMethod1->cmUsageCount = ((targetMethod1->cmUsageCount)) + 1); + } + + } + } + return 0; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#indexForSelector:in:at: */ +static sqInt NoDbgRegParms +indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc) +{ + sqInt i; + sqInt iLimiT; + sqInt methodOop; + + assert(((((usqInt)mcpc)) > (((usqInt)cogMethod))) + && (mcpc < ((((usqInt)cogMethod)) + ((cogMethod->blockSize))))); + for (i = 0; i < NumSpecialSelectors; i += 1) { + if (selector == (specialSelector(i))) { + return -1 - i; + } + } + + /* Then search the method's literal frame... open code fetchPointer:ofObject: for speed... */ + methodOop = (cogMethod->methodObject); + for (i = LiteralStart, iLimiT = (literalCountOfMethodHeader((cogMethod->methodHeader))); i <= iLimiT; i += 1) { + if ((longAt(((i * BytesPerOop) + BaseHeaderSize) + methodOop)) == selector) { + assert(selector == (literalofMethod(i - 1, methodOop))); + return i - 1; + } + } + error("could not find selector in method when unlinking send site"); + return 0; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialClosedPICUsageCount */ +static sqInt +initialClosedPICUsageCount(void) +{ + return CMMaxUsageCount / 2; +} + + /* Cogit>>#initializeBackend */ +static void +initializeBackend(void) +{ + (methodLabel->machineCodeSize = 0); + (methodLabel->opcode = Label); + ((methodLabel->operands))[0] = 0; + ((methodLabel->operands))[1] = 0; + } + + /* Cogit>>#initializeCodeZoneFrom:upTo: */ +void +initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress) +{ + usqIntptr_t fixupSize; + usqIntptr_t fixupSize1; + sqInt numberOfAbstractOpcodes; + sqInt numberOfAbstractOpcodes1; + usqIntptr_t opcodeSize; + usqIntptr_t opcodeSize1; + sqInt startAddress1; + sqInt startAddress2; + + initializeBackend(); + stopsFromto(backEnd, startAddress, endAddress - 1); + sqMakeMemoryExecutableFromTo(startAddress, endAddress); + codeBase = (methodZoneBase = startAddress); + minValidCallAddress = (((((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) < (primitiveFailAddress())) ? (((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) : (primitiveFailAddress())); + manageFromto(methodZoneBase, endAddress); + /* begin maybeGenerateCheckFeatures */ + /* begin allocateOpcodes:bytecodes: */ + numberOfAbstractOpcodes1 = numCheckFeaturesOpcodes(backEnd); + numAbstractOpcodes = numberOfAbstractOpcodes1; + opcodeSize1 = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize1 = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize1 + fixupSize1); + bzero(abstractOpcodes, opcodeSize1 + fixupSize1); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize1)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + startAddress2 = methodZoneBase; + generateCheckFeatures(backEnd); + outputInstructionsForGeneratedRuntimeAt(startAddress2); + recordGeneratedRunTimeaddress("ceCheckFeaturesFunction", startAddress2); + ceCheckFeaturesFunction = ((usqIntptr_t (*)(void)) startAddress2); + + /* begin maybeGenerateICacheFlush */ + /* begin generateVMOwnerLockFunctions */ + +# if COGMTVM + /* begin allocateOpcodes:bytecodes: */ + numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd); + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + zeroOpcodeIndex(); + startAddress1 = methodZoneBase; + generateLowLevelTryLock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress1); + ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress1); + zeroOpcodeIndex(); + initialPC = 0; + endPC = numAbstractOpcodes - 1; + startAddress1 = methodZoneBase; + generateLowLevelUnlock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress1); + ceUnlockVMOwner = ((void (*)(void)) startAddress1); + +# endif /* COGMTVM */ + + genGetLeafCallStackPointer(); + generateStackPointerCapture(); + generateTrampolines(); + computeEntryOffsets(); + computeFullBlockEntryOffsets(); + generateClosedPICPrototype(); + manageFromto(methodZoneBase, endAddress); + generateOpenPICPrototype(); +} + + +/* Answer a usage count that reflects likely long-term usage. + Answer 1 for non-primitives or quick primitives (inst var accessors), + 2 for methods with interpreter primitives, and 3 for compiled primitives. */ + + /* Cogit>>#initialMethodUsageCount */ +static sqInt +initialMethodUsageCount(void) +{ + if ((primitiveIndex == 1) + || (isQuickPrimitiveIndex(primitiveIndex))) { + return 1; + } + if (!(primitiveGeneratorOrNil())) { + return 2; + } + return 3; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialOpenPICUsageCount */ +static sqInt +initialOpenPICUsageCount(void) +{ + return CMMaxUsageCount - 1; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#inlineCacheValueForSelector:in:at: */ +static sqInt NoDbgRegParms +inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc) +{ + return selector; +} + + /* Cogit>>#inverseBranchFor: */ +static sqInt NoDbgRegParms +inverseBranchFor(sqInt opcode) +{ + + switch (opcode) { + case JumpLongZero: + return JumpLongNonZero; + + case JumpLongNonZero: + return JumpLongZero; + + case JumpZero: + return JumpNonZero; + + case JumpNonZero: + return JumpZero; + + case JumpNegative: + return JumpNonNegative; + + case JumpNonNegative: + return JumpNegative; + + case JumpOverflow: + return JumpNoOverflow; + + case JumpNoOverflow: + return JumpOverflow; + + case JumpCarry: + return JumpNoCarry; + + case JumpNoCarry: + return JumpCarry; + + case JumpLess: + return JumpGreaterOrEqual; + + case JumpGreaterOrEqual: + return JumpLess; + + case JumpGreater: + return JumpLessOrEqual; + + case JumpLessOrEqual: + return JumpGreater; + + case JumpBelow: + return JumpAboveOrEqual; + + case JumpAboveOrEqual: + return JumpBelow; + + case JumpAbove: + return JumpBelowOrEqual; + + case JumpBelowOrEqual: + return JumpAbove; + + default: + error("Case not found and no otherwise clause"); + } + error("invalid opcode for inverse"); + return 0; +} + + +/* See Cogit class>>initializeAnnotationConstants */ + + /* Cogit>>#isPCMappedAnnotation: */ +static sqInt NoDbgRegParms +isPCMappedAnnotation(sqInt annotation) +{ + return annotation >= HasBytecodePC; +} + + /* Cogit>>#isPCWithinMethodZone: */ +sqInt +isPCWithinMethodZone(void *address) +{ + return (((((usqInt)address)) >= methodZoneBase) && ((((usqInt)address)) <= (freeStart()))); +} + + +/* Answer if the instruction preceding retpc is a call instruction. */ + + /* Cogit>>#isSendReturnPC: */ +sqInt +isSendReturnPC(sqInt retpc) +{ + sqInt target; + + if (!(isCallPrecedingReturnPC(backEnd, retpc))) { + return 0; + } + target = callTargetFromReturnAddress(backEnd, retpc); + return (((target >= firstSend) && (target <= lastSend))) + || (((target >= methodZoneBase) && (target <= (freeStart())))); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPEqual(void *jumpTarget) +{ + AbstractInstruction *jumpToTarget; + AbstractInstruction *jumpUnordered; + + /* begin genJumpFPEqual: */ + jumpUnordered = gen(JumpFPUnordered); + jumpToTarget = genoperand(JumpFPEqual, ((sqInt)jumpTarget)); + jmpTarget(jumpUnordered, gLabel()); + return jumpToTarget; +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreaterOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreaterOrEqual(void *jumpTarget) +{ + /* begin genJumpFPGreaterOrEqual: */ + return genoperand(JumpFPGreaterOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreater: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreater(void *jumpTarget) +{ + /* begin genJumpFPGreater: */ + return genoperand(JumpFPGreater, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLessOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLessOrEqual(void *jumpTarget) +{ + /* begin genJumpFPLessOrEqual: */ + return genoperand(JumpFPLessOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLess: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLess(void *jumpTarget) +{ + /* begin genJumpFPLess: */ + return genoperand(JumpFPLess, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPNotEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPNotEqual(void *jumpTarget) +{ + AbstractInstruction *jumpToTarget; + AbstractInstruction *jumpUnordered; + + /* begin genJumpFPNotEqual: */ + jumpToTarget = genoperand(JumpFPNotEqual, ((sqInt)jumpTarget)); + jumpUnordered = genoperand(JumpFPUnordered, ((sqInt)jumpTarget)); + addDependent(jumpToTarget, jumpUnordered); + return jumpToTarget; +} + + /* Cogit>>#Label */ +static AbstractInstruction * +gLabel(void) +{ + return genoperandoperand(Label, (labelCounter += 1), bytecodePC); +} + + /* Cogit>>#LogicalShiftLeftCq:R: */ +static AbstractInstruction * NoDbgRegParms +gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg) +{ + return genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); +} + + /* Cogit>>#lastOpcode */ +static AbstractInstruction * +lastOpcode(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#linkSendAt:in:to:offset:receiver: */ +void +linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver) +{ + sqInt address; + sqInt extent; + sqInt inlineCacheTag; + + assert((theEntryOffset == cmEntryOffset) + || (theEntryOffset == cmNoCheckEntryOffset)); + assert(((callSiteReturnAddress >= methodZoneBase) && (callSiteReturnAddress <= (freeStart())))); + inlineCacheTag = (theEntryOffset == cmNoCheckEntryOffset + ? (targetMethod->selector) + : inlineCacheTagForInstance(receiver)); + address = (((sqInt)targetMethod)) + theEntryOffset; + extent = rewriteInlineCacheAttagtarget(backEnd, callSiteReturnAddress, inlineCacheTag, address); + flushICacheFromto(processor, (((usqInt)callSiteReturnAddress)) - extent, ((usqInt)callSiteReturnAddress)); +} + + /* Cogit>>#loadBytesAndGetDescriptor */ +static BytecodeDescriptor * +loadBytesAndGetDescriptor(void) +{ + BytecodeDescriptor *descriptor; + + byte0 = (fetchByteofObject(bytecodePC, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor, bytecodePC); + return descriptor; +} + + /* Cogit>>#loadSubsequentBytesForDescriptor:at: */ +static void NoDbgRegParms +loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc) +{ + if (((descriptor->numBytes)) > 1) { + byte1 = fetchByteofObject(pc + 1, methodObj); + if (((descriptor->numBytes)) > 2) { + byte2 = fetchByteofObject(pc + 2, methodObj); + if (((descriptor->numBytes)) > 3) { + byte3 = fetchByteofObject(pc + 3, methodObj); + if (((descriptor->numBytes)) > 4) { + notYetImplemented(); + } + } + } + } +} + + /* Cogit>>#MoveAw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveAwR(sqInt address, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, reg); + return anInstruction; +} + + /* Cogit>>#MoveCq:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#MoveCw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, reg); + return anInstruction; +} + + /* Cogit>>#MoveMw:r:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, destReg); + return anInstruction; +} + + /* Cogit>>#MoveR:Mw:r: */ +static AbstractInstruction * NoDbgRegParms +gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, baseReg); + return anInstruction; +} + + /* Cogit>>#MoveR:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(MoveRR, reg1, reg2); +} + + +/* Answer the address of the null byte at the end of the method map. */ + + /* Cogit>>#mapEndFor: */ +static usqInt NoDbgRegParms +mapEndFor(CogMethod *cogMethod) +{ + usqInt end; + + end = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while ((byteAt(end)) != MapEnd) { + end -= 1; + assert(end > (firstMappedPCFor(cogMethod))); + } + return end; +} + + +/* Unlinking/GC/Disassembly support */ + + /* Cogit>>#mapFor:performUntil:arg: */ +static sqInt NoDbgRegParms +mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = functionSymbol(annotation, (((char *) mcpc)), arg); + if (result != 0) { + return result; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + return 0; +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#mapObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +mapObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = remapMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential class ref in the compare instruction, and the potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (remapMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Update all references to objects in the generated runtime. */ + + /* Cogit>>#mapObjectReferencesInGeneratedRuntime */ +static void +mapObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + sqInt mappedLiteral; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = literalBeforeFollowingAddress(backEnd, mcpc); + mappedLiteral = remapObject(literal); + if (mappedLiteral != literal) { + /* begin storeLiteral:atAnnotatedAddress:using: */ + storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), mappedLiteral, mcpc); + codeModified = 1; + } + } +} + + +/* Update all references to objects in machine code for a become. + Unlike incrementalGC or fullGC a method that does not refer to young may + refer to young as a result of the become operation. Unlike incrementalGC + or fullGC the reference from a Cog method to its methodObject *must not* + change since the two are two halves of the same object. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForBecome */ +static void +mapObjectReferencesInMachineCodeForBecome(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt remappedMethod; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = (freedPIC = 0); + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + assert(!hasYoungObj); + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + if ((isYoung((cogMethod->selector))) + || (mapObjectReferencesInClosedPIC(cogMethod))) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + else { + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + remappedMethod = remapOop((cogMethod->methodObject)); + if (remappedMethod != ((cogMethod->methodObject))) { + if (methodHasCogMethod(remappedMethod)) { + error("attempt to become two cogged methods"); + } + if (!(withoutForwardingOnandwithsendToCogit((cogMethod->methodObject), remappedMethod, (cogMethod->cmUsesPenultimateLit), methodhasSameCodeAscheckPenultimate))) { + error("attempt to become cogged method into different method"); + } + if ((rawHeaderOf((cogMethod->methodObject))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + rawHeaderOfput(remappedMethod, ((sqInt)cogMethod)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + } + } + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + ensureInYoungReferrers(cogMethod); + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (freedPIC) { + unlinkSendsToFree(); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for a full gc. Since + the current (New)ObjectMemory GC makes everything old in a full GC + a method not referring to young will not refer to young afterwards */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForFullGC */ +static void +mapObjectReferencesInMachineCodeForFullGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + codeModified = 0; + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(!((cogMethod->cmRefersToYoung))); + mapObjectReferencesInClosedPIC(cogMethod); + } + else { + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for either a Spur + scavenging gc + or a Squeak V3 incremental GC. Avoid scanning all code by using the + youngReferrers list. In a young gc a method referring to young may no + longer refer to young, but a + method not referring to young cannot and will not refer to young + afterwards. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForYoungGC */ +static void +mapObjectReferencesInMachineCodeForYoungGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + usqInt pointer; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = 0; + pointer = youngReferrers(); + while (pointer < limitAddress) { + assert(!hasYoungObj); + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) == CMFree) { + assert(!((cogMethod->cmRefersToYoung))); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if ((cogMethod->cmRefersToYoung)) { + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + pointer += BytesPerWord; + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code. */ + + /* Cogit>>#mapObjectReferencesInMachineCode: */ +void +mapObjectReferencesInMachineCode(sqInt gcMode) +{ + + switch (gcMode) { + case GCModeNewSpace: + mapObjectReferencesInMachineCodeForYoungGC(); + break; + case GCModeFull: + mapObjectReferencesInMachineCodeForFullGC(); + break; + case GCModeBecome: + mapObjectReferencesInMachineCodeForBecome(); + break; + default: + error("Case not found and no otherwise clause"); + } + if (!(asserta((freeStart()) <= (youngReferrers())))) { + error("youngReferrers list overflowed"); + } +} + + +/* Mark objects in machine-code of marked methods (or open PICs with marked + selectors). + */ + + /* Cogit>>#markAndTraceMachineCodeOfMarkedMethods */ +void +markAndTraceMachineCodeOfMarkedMethods(void) +{ + sqInt annotation; + sqInt annotation1; + CogMethod *cogMethod; + usqInt map; + usqInt map1; + sqInt mapByte; + sqInt mapByte1; + usqInt mcpc; + usqInt mcpc1; + sqInt result; + sqInt result1; + sqInt val; + sqInt val1; + + val = 0; + val1 = 0; + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + codeModified = 0; + markAndTraceObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector))))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc1 = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map1 = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte1 = byteAt(map1))) != MapEnd) { + if (mapByte1 >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc1 += (mapByte1 & DisplacementMask); + if ((((annotation1 = ((usqInt) mapByte1) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte1 = byteAt(map1 - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation1 += mapByte1 & DisplacementMask; + map1 -= 1; + } + result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); + if (result1 != 0) { + goto l4; + } + } + else { + if (mapByte1 < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte1 - DisplacementX2N)) << AnnotationShift))); + } + } + map1 -= 1; + } + l4: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Mark and trace any object references in the generated run-time. */ + + /* Cogit>>#markAndTraceObjectReferencesInGeneratedRuntime */ +static void +markAndTraceObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = literalBeforeFollowingAddress(backEnd, mcpc); + markAndTraceLiteralinatpc(literal, ((CogMethod *) null), ((usqInt)mcpc)); + } +} + + +/* Mark and trace objects in the argument and free if it is appropriate. + Answer if the method has been freed. firstVisit is a hint used to avoid + scanning methods we've already seen. False positives are fine. + For a CMMethod this + frees if the bytecode method isnt marked, + marks and traces object literals and selectors, + unlinks sends to targets that should be freed. + For a CMClosedPIC this + frees if it refers to anything that should be freed or isn't marked. + For a CMOpenPIC this + frees if the selector isn't marked. */ +/* this recurses at most one level down */ + + /* Cogit>>#markAndTraceOrFreeCogMethod:firstVisit: */ +static sqInt NoDbgRegParms +markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + sqInt val; + + val = 0; + if (((cogMethod->cmType)) == CMFree) { + return 1; + } + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if (((cogMethod->cmType)) == CMMethod) { + if (!(isMarked((cogMethod->methodObject)))) { + freeMethod(cogMethod); + return 1; + } + if (firstVisit) { + /* begin markLiteralsAndUnlinkUnmarkedSendsIn: */ + assert(((cogMethod->cmType)) == CMMethod); + assert(isMarked((cogMethod->methodObject))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(closedPICRefersToUnmarkedObject(cogMethod))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (isMarked((cogMethod->selector))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + assert((((cogMethod->cmType)) == CMMethod) + || ((((cogMethod->cmType)) == CMClosedPIC) + || (((cogMethod->cmType)) == CMOpenPIC))); + return 0; +} + + +/* If entryPoint is that of some method, then mark and trace objects in it + and free if it is appropriate. + Answer if the method has been freed. */ + + /* Cogit>>#markAndTraceOrFreePICTarget:in: */ +static sqInt NoDbgRegParms +markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC) +{ + CogMethod *targetMethod; + + assert((entryPoint > methodZoneBase) + && (entryPoint < (freeStart()))); + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + return 0; + } + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + return markAndTraceOrFreeCogMethodfirstVisit(targetMethod, (((usqInt)targetMethod)) > (((usqInt)cPIC))); +} + + +/* Mark and trace literals. Unlink sends that have unmarked cache tags or + targets. + */ + + /* Cogit>>#markLiteralsAndUnlinkIfUnmarkedSend:pc:method: */ +static sqInt NoDbgRegParms +markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt cacheTagMarked; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + sqInt val; + + literal = 0; + val = 0; + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + cacheTagMarked = tagCouldBeObj1 + && (cacheTagIsMarked(cacheTag1)); + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((!cacheTagMarked) + || (markAndTraceOrFreeCogMethodfirstVisit(targetMethod1, (((usqInt)targetMethod1)) > (((usqInt)mcpc))))) { + + /* Either the cacheTag is unmarked (e.g. new class) or the target + has been freed (because it is unmarked), so unlink the send. */ + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + markAndTraceLiteralinat((targetMethod1->selector), targetMethod1, (&((targetMethod1->selector)))); + } + + } + else { + + /* cacheTag is selector */ + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + + } + return 0; +} + + +/* Mark and trace literals. + Additionally in Newspeak, void push implicits that have unmarked classes. */ + + /* Cogit>>#markLiterals:pc:method: */ +static sqInt NoDbgRegParms +markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt entryPoint; + sqInt entryPoint1; + sqInt literal; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + + literal = 0; + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1) { + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + + /* cacheTag is selector */ + codeModified = 1; + } + } + + } + return 0; +} + + /* Cogit>>#markMethodAndReferents: */ +void +markMethodAndReferents(CogBlockMethod *aCogMethod) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((aCogMethod->cmType)) == CMMethod) + || (((aCogMethod->cmType)) == CMBlock)); + cogMethod = (((aCogMethod->cmType)) == CMMethod + ? ((CogMethod *) aCogMethod) + : cmHomeMethod(aCogMethod)); + (cogMethod->cmUsageCount = CMMaxUsageCount); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#maxCogMethodAddress */ +usqInt +maxCogMethodAddress(void) +{ + return ((usqInt)(limitZony())); +} + + +/* If this is the Newspeak VM and the objectRepresentation supports pinning + then allocate space for the implicit receiver caches on the heap. */ + + /* Cogit>>#maybeAllocAndInitIRCs */ +static sqInt +maybeAllocAndInitIRCs(void) +{ + return 1; + +} + + +/* Check that the header fields are consistent with the type. + Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#maybeFreeCogMethodDoesntLookKosher: */ +static sqInt NoDbgRegParms +maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + sqInt result; + + result = cogMethodDoesntLookKosher(cogMethod); + return (result == 2 + ? 0 + : result); +} + + +/* In SIsta Spur counters are held on the heap in pinned objects which must + be marked + to avoid them being garbage collected. This is the hook through which that + happens. + */ + + /* Cogit>>#maybeMarkCountersIn: */ +static void NoDbgRegParms +maybeMarkCountersIn(CogMethod *cogMethod) +{ +} + + /* Cogit>>#mclassIsSmallInteger */ +static sqInt +mclassIsSmallInteger(void) +{ + return (methodClassOf(methodObj)) == (classSmallInteger()); +} + + +/* Answer the absolute machine code pc matching the zero-relative + bytecode pc of a backward branch in cogMethod, given the start + of the bytecodes for cogMethod's block or method object. */ + + /* Cogit>>#mcPCForBackwardBranch:startBcpc:in: */ +usqInt +mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc1; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = (((0 + (((int)((usqInt)(HasBytecodePC) << 1)))) & 1) + && ((((sqInt)(((void *)bcpc)))) == startbcpc) + ? ((sqInt)(((char *) mcpc))) + : 0); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc1 = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc1 += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc1 == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, -1, aMethodObj)) + : 0)); + bcpc1 = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask); + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc1 >= endbcpc) { + return ((sqInt) 0); + } + } + else { + if (((descriptor->isReturn)) + && (bcpc1 >= latestContinuation)) { + return ((sqInt) 0); + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj); + targetPC = (bcpc1 + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) < 0)); + result = findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc1, (((void *)bcpc))); + if (result != 0) { + return result; + } + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + return ((sqInt) 0); +} + + +/* For the purposes of become: see if the two methods are similar, i.e. can + be safely becommed. + This is pretty strict. All literals and bytecodes must be identical. Only + trailer bytes and header + flags can differ. */ + + /* Cogit>>#method:hasSameCodeAs:checkPenultimate: */ +static sqInt NoDbgRegParms +methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) +{ + sqInt bi; + sqInt endPCA; + sqInt headerA; + sqInt headerB; + sqInt li; + sqInt numLitsA; + + headerA = methodHeaderOf(methodA); + headerB = methodHeaderOf(methodB); + numLitsA = literalCountOfMethodHeader(headerA); + endPCA = endPCOf(methodA); + if (((argumentCountOfMethodHeader(headerA)) != (argumentCountOfMethodHeader(headerB))) + || (((temporaryCountOfMethodHeader(headerA)) != (temporaryCountOfMethodHeader(headerB))) + || (((primitiveIndexOfMethodheader(methodA, headerA)) != (primitiveIndexOfMethodheader(methodB, headerB))) + || ((numLitsA != (literalCountOfMethodHeader(headerB))) + || (endPCA > (numBytesOf(methodB))))))) { + return 0; + } + for (li = 1; li < numLitsA; li += 1) { + if ((fetchPointerofObject(li, methodA)) != (fetchPointerofObject(li, methodB))) { + if ((li < (numLitsA - 1)) + || (comparePenultimateLiteral)) { + return 0; + } + } + } + for (bi = (startPCOfMethod(methodA)); bi <= endPCA; bi += 1) { + if ((fetchByteofObject(bi, methodA)) != (fetchByteofObject(bi, methodB))) { + return 0; + } + } + return 1; +} + + /* Cogit>>#minCogMethodAddress */ +sqInt +minCogMethodAddress(void) +{ + return methodZoneBase; +} + + /* Cogit>>#mnuOffset */ +sqInt +mnuOffset(void) +{ + return missOffset; +} + + /* Cogit>>#NegateR: */ +static AbstractInstruction * NoDbgRegParms +gNegateR(sqInt reg) +{ + return genoperand(NegateR, reg); +} + + /* Cogit>>#needsFrameIfImmutability: */ +static sqInt NoDbgRegParms +needsFrameIfImmutability(sqInt stackDelta) +{ + return IMMUTABILITY; +} + + /* Cogit>>#needsFrameIfInBlock: */ +static sqInt NoDbgRegParms +needsFrameIfInBlock(sqInt stackDelta) +{ + return inBlock > 0; +} + + /* Cogit>>#needsFrameNever: */ +static sqInt NoDbgRegParms +needsFrameNever(sqInt stackDelta) +{ + return 0; +} + + /* Cogit>>#noAssertMethodClassAssociationOf: */ +static sqInt NoDbgRegParms +noAssertMethodClassAssociationOf(sqInt methodPointer) +{ + return literalofMethod((literalCountOfMethodHeader(noAssertHeaderOf(methodPointer))) - 1, methodPointer); +} + + +/* Check that no method is maximally marked. A maximal mark is an indication + the method has been scanned to increase the usage count of its referent + methods. */ + + /* Cogit>>#noCogMethodsMaximallyMarked */ +static sqInt +noCogMethodsMaximallyMarked(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == CMMaxUsageCount)) { + return 0; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + +/* Answer if all targets in the PIC are in-use methods. */ + + /* Cogit>>#noTargetsFreeInClosedPIC: */ +static sqInt NoDbgRegParms +noTargetsFreeInClosedPIC(CogMethod *cPIC) +{ + return !(cPICHasFreedTargets(cPIC)); +} + + +/* Store the generated machine code, answering the last address */ + + /* Cogit>>#outputInstructionsAt: */ +static sqInt NoDbgRegParms +outputInstructionsAt(sqInt startAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt j; + + absoluteAddress = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + assert(((abstractInstruction->address)) == absoluteAddress); + /* begin outputMachineCodeAt: */ + for (j = 0; j < ((abstractInstruction->machineCodeSize)); j += 1) { + byteAtput(absoluteAddress + j, ((abstractInstruction->machineCode))[j]); + } + absoluteAddress += (abstractInstruction->machineCodeSize); + } + return absoluteAddress; +} + + +/* Output instructions generated for one of the generated run-time routines, + a trampoline, etc + */ + + /* Cogit>>#outputInstructionsForGeneratedRuntimeAt: */ +static sqInt NoDbgRegParms +outputInstructionsForGeneratedRuntimeAt(sqInt startAddress) +{ + sqInt endAddress; + sqInt size; + + computeMaximumSizes(); + (methodLabel->address = startAddress); + size = generateInstructionsAt(startAddress); + endAddress = outputInstructionsAt(startAddress); + assert((startAddress + size) == endAddress); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + return startAddress; +} + + /* Cogit>>#PopR: */ +static AbstractInstruction * NoDbgRegParms +gPopR(sqInt reg) +{ + return genoperand(PopR, reg); +} + + /* Cogit>>#PushCw: */ +static AbstractInstruction * NoDbgRegParms +gPushCw(sqInt wordConstant) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal: */ + anInstruction = genoperand(PushCw, wordConstant); + return anInstruction; +} + + +/* Code entry closed PIC full or miss to an instance of a young class or to a + young target method. + Attempt to patch the send site to an open PIC. Answer if the attempt + succeeded; in fact it will + only return if the attempt failed. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#patchToOpenPICFor:numArgs:receiver: */ +sqInt +patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver) +{ + sqInt extent; + CogMethod *oPIC; + sqInt outerReturn; + + + /* See if an Open PIC is already available. */ + outerReturn = stackTop(); + oPIC = openPICWithSelector(selector); + if (!(oPIC)) { + + /* otherwise attempt to create an Open PIC. */ + oPIC = cogOpenPICSelectornumArgs(selector, numArgs); + if ((((((sqInt)oPIC)) >= MaxNegativeErrorCode) && ((((sqInt)oPIC)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. */ + if ((((sqInt)oPIC)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return 0; + } + } + extent = rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat(selector, mframeHomeMethodExport(), outerReturn), (((sqInt)oPIC)) + cmEntryOffset); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + flushICacheFromto(processor, ((usqInt)oPIC), (((usqInt)oPIC)) + openPICSize); + executeCogMethodfromLinkedSendWithReceiver(oPIC, receiver); + return 1; +} + + +/* This value is used to decide between MNU processing + or interpretation in the closed PIC aborts. */ + + /* Cogit>>#picAbortDiscriminatorValue */ +static sqInt +picAbortDiscriminatorValue(void) +{ + return 0; +} + + +/* Answer the start of the abort sequence for invoking the interpreter in a + closed PIC. + */ + + /* Cogit>>#picInterpretAbortOffset */ +static sqInt +picInterpretAbortOffset(void) +{ + return (interpretOffset()) - (callInstructionByteSize(backEnd)); +} + + /* Cogit>>#previousInstruction */ +static AbstractInstruction * +previousInstruction(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#printCogMethodFor: */ +void +printCogMethodFor(void *address) +{ + CogMethod *cogMethod; + + cogMethod = methodFor(address); + if (cogMethod == 0) { + if ((codeEntryFor(address)) == null) { + print("not a method"); + cr(); + } + else { + print("trampoline "); + print(codeEntryNameFor(address)); + cr(); + } + } + else { + printCogMethod(cogMethod); + } +} + + /* Cogit>>#printPCMapPairsFor: */ +void +printPCMapPairsFor(CogMethod *cogMethod) +{ + unsigned char annotation; + usqInt map; + unsigned char mapByte; + usqInt mcpc; + sqInt value; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + /* begin mapStartFor: */ + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation == IsAnnotationExtension) { + value = (mapByte & DisplacementMask) + IsSendCall; + } + else { + value = annotation; + mcpc += 1 * ((annotation == IsDisplacementX2N + ? ((int)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + printHexnp(map); + print(": "); + printf("%02x", mapByte); + printChar(' '); + printNum(annotation); + print(" ("); + + switch (value) { + case IsDisplacementX2N: + print("IsDisplacementX2N"); + break; + case IsAnnotationExtension: + print("IsAnnotationExtension"); + break; + case IsObjectReference: + print("IsObjectReference"); + break; + case IsAbsPCReference: + print("IsAbsPCReference"); + break; + case HasBytecodePC: + print("HasBytecodePC"); + break; + case IsRelativeCall: + print("IsRelativeCall"); + break; + case IsSendCall: + print("IsSendCall"); + break; + case IsSuperSend: + print("IsSuperSend"); + break; + case IsDirectedSuperSend: + print("IsDirectedSuperSend"); + break; + default: + print("??? "); + printHexnp(value); + + } + + print(") "); + printHexnp(mapByte & DisplacementMask); + printChar(' '); + putchar('@'); + printHex(mcpc); + cr(); + flush(); + map -= 1; + } +} + + /* Cogit>>#printTrampolineTable */ +void +printTrampolineTable(void) +{ + sqInt i; + + for (i = 0; i < trampolineTableIndex; i += 2) { + printHex(((sqInt)(trampolineAddresses[i + 1]))); + print(": "); + print(((char *) (trampolineAddresses[i]))); + cr(); + } +} + + /* Cogit>>#processorHasDivQuoRemAndMClassIsSmallInteger */ +static sqInt +processorHasDivQuoRemAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#processorHasDoublePrecisionFloatingPointSupport */ +static sqInt +processorHasDoublePrecisionFloatingPointSupport(void) +{ + /* begin hasDoublePrecisionFloatingPointSupport */ + return hasSSE2Instructions(((AbstractInstruction *) backEnd)); +} + + /* Cogit>>#processorHasMultiplyAndMClassIsSmallInteger */ +static sqInt +processorHasMultiplyAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#recordGeneratedRunTime:address: */ +static void NoDbgRegParms +recordGeneratedRunTimeaddress(char *aString, sqInt address) +{ + trampolineAddresses[trampolineTableIndex] = aString; + trampolineAddresses[trampolineTableIndex + 1] = (((char *) address)); + trampolineTableIndex += 2; +} + + +/* This one for C support code. */ + + /* Cogit>>#recordPrimTraceFunc */ +sqInt +recordPrimTraceFunc(void) +{ + return recordPrimTrace(); +} + + /* Cogit>>#recordRunTimeObjectReferences */ +static void +recordRunTimeObjectReferences(void) +{ + sqInt i; + AbstractInstruction *instruction; + + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + if (((instruction->annotation)) == IsObjectReference) { + assert(runtimeObjectRefIndex < NumObjRefsInRuntime); + assert(!hasYoungReferent); + if (hasYoungReferent) { + error("attempt to generate run-time routine containing young object reference. Cannot initialize Cogit run-time."); + } + objectReferencesInRuntime[runtimeObjectRefIndex] = (((usqInt)(((instruction->address)) + ((instruction->machineCodeSize))))); + runtimeObjectRefIndex += 1; + } + } +} + + /* Cogit>>#registerMaskFor: */ +static sqInt NoDbgRegParms +registerMaskFor(sqInt reg) +{ + return 1U << reg; +} + + /* Cogit>>#registerMaskFor:and: */ +static sqInt NoDbgRegParms +registerMaskForand(sqInt reg1, sqInt reg2) +{ + return (1U << reg1) | (1U << reg2); +} + + /* Cogit>>#relocateCallsAndSelfReferencesInMethod: */ +static void NoDbgRegParms +relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) +{ + sqInt annotation; + sqLong callDelta; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqLong refDelta; + sqInt result; + + refDelta = (cogMethod->objectHeader); + callDelta = refDelta; + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cogMethod)) + missOffset)) == ((((cogMethod->cmType)) == CMMethod + ? methodAbortTrampolineFor((cogMethod->cmNumArgs)) + : picAbortTrampolineFor((cogMethod->cmNumArgs))))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cogMethod)) + missOffset, -callDelta); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#relocateCallsInClosedPIC: */ +static void NoDbgRegParms +relocateCallsInClosedPIC(CogMethod *cPIC) +{ + sqLong callDelta; + sqInt entryPoint; + sqInt i; + sqInt pc; + sqInt pc1; + sqLong refDelta; + CogMethod *targetMethod; + + refDelta = (cPIC->objectHeader); + callDelta = refDelta; + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cPIC)) + missOffset)) == (picAbortTrampolineFor((cPIC->cmNumArgs)))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cPIC)) + missOffset, -callDelta); + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (i == 1) { + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + } + else { + /* begin jumpLongConditionalTargetBeforeFollowingAddress: */ + entryPoint = jumpLongTargetBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + } + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + + /* Interpret/MNU */ + } + else { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert(((targetMethod->cmType)) == CMMethod); + if (i == 1) { + relocateJumpLongBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + else { + relocateJumpLongConditionalBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + } + } + assert(((cPIC->cPICNumCases)) > 0); + /* begin relocateMethodReferenceBeforeAddress:by: */ + pc1 = (addressOfEndOfCaseinCPIC(2, cPIC)) + (loadLiteralByteSize(backEnd)); + relocateCallBeforeReturnPCby(((AbstractInstruction *) backEnd), pc1, refDelta); + ((AbstractInstruction *) backEnd); + relocateJumpLongBeforeFollowingAddressby(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, -callDelta); +} + + /* Cogit>>#relocateIfCallOrMethodReference:mcpc:delta: */ +static sqInt NoDbgRegParms +relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta) +{ + sqInt callDelta; + sqInt entryPoint; + sqInt offset; + sqInt offset1; + sqInt sendTable; + sqInt *sendTable1; + CogMethod *targetMethod; + sqInt unlinkedRoutine; + + callDelta = refDelta; + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + + /* send is not linked; just relocate */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable1 = superSendTrampolines; + + + } + } + targetMethod = ((CogMethod *) (entryPoint - offset1)); + if (((targetMethod->cmType)) != CMFree) { + + /* send target not freed; just relocate. */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -(callDelta - ((targetMethod->objectHeader)))); + + /* See comment in planCompaction */ + restorePICUsageCount(targetMethod); + + return 0; + } + unlinkedRoutine = sendTable1[((((targetMethod->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod->cmNumArgs)) : (NumSendTrampolines - 1))]; + unlinkedRoutine -= callDelta; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + return 0; + + } + if (annotation == IsRelativeCall) { + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + if (annotation == IsAbsPCReference) { + /* begin relocateMethodReferenceBeforeAddress:by: */ + relocateCallBeforeReturnPCby(((AbstractInstruction *) backEnd), ((sqInt)mcpc), refDelta); + ((AbstractInstruction *) backEnd); + } + return 0; +} + + /* Cogit>>#remapIfObjectRef:pc:hasYoung: */ +static sqInt NoDbgRegParms +remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr) +{ + sqInt cacheTag; + sqInt cacheTag1; + sqInt entryPoint; + sqInt entryPoint1; + sqInt ignored; + sqInt literal; + sqInt mappedCacheTag; + sqInt mappedLiteral; + sqInt *sendTable; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod *targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (couldBeObject(literal)) { + mappedLiteral = remapObject(literal); + if (literal != mappedLiteral) { + /* begin storeLiteral:atAnnotatedAddress:using: */ + storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), mappedLiteral, ((usqInt)mcpc)); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedLiteral))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1 + && (couldBeObject(cacheTag1))) { + mappedCacheTag = remapObject(cacheTag1); + if (cacheTag1 != mappedCacheTag) { + rewriteInlineCacheTagat(backEnd, mappedCacheTag, ((usqInt)mcpc)); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedCacheTag))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + if (hasYoungPtr != 0) { + + /* Since the unlinking routines may rewrite the cacheTag to the send's selector, and + since they don't have the cogMethod to hand and can't add it to youngReferrers, + the method must remain in youngReferrers if the targetMethod's selector is young. */ + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = superSendTrampolines; + + + } + } + if (isYoung((targetMethod1->selector))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + + } + } + + } + return 0; +} + + +/* Remap a potential object reference from a closed PIC. + This may be an object reference, an inline cache tag or null. + Answer if the updated literal is young. + mcpc is the address of the next instruction following either + the load of the method literal or the compare of the class tag. */ + + /* Cogit>>#remapMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +remapMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + subject = remapOop(object); + if (object != subject) { + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + } + return isYoungObject(subject); +} + + +/* Rewrite the three values involved in a CPIC case. Used by the initialize & + extend CPICs. + c.f. expectedClosedPICPrototype: */ +/* write the obj ref/operand via the second ldr */ + + /* Cogit>>#rewriteCPICCaseAt:tag:objRef:target: */ +static void NoDbgRegParms +rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget) +{ + sqInt classTagPC; + sqInt methodObjPC; + + methodObjPC = (followingAddress - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + storeLiteralbeforeFollowingAddress(backEnd, newObjRef, methodObjPC); + + /* rewite the tag via the first ldr */ + classTagPC = followingAddress - (jumpLongConditionalByteSize(backEnd)); + /* begin storeLiteral32:beforeFollowingAddress: */ + storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), newTag, classTagPC); + + ((AbstractInstruction *) backEnd); + rewriteConditionalJumpLongAttarget(backEnd, followingAddress, newTarget); +} + + /* Cogit>>#SubCw:R: */ +static AbstractInstruction * NoDbgRegParms +gSubCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(SubCwR, wordConstant, reg); + return anInstruction; +} + + +/* Answer the number of clean blocks found in the literal frame */ + + /* Cogit>>#scanForCleanBlocks */ +static sqInt +scanForCleanBlocks(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt numCleanBlocks; + sqInt startPCOrNil; + + numCleanBlocks = 0; + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + numCleanBlocks += 1; + } + } + return numCleanBlocks; +} + + /* Cogit>>#setBreakMethod: */ +void +setBreakMethod(sqInt anObj) +{ + breakMethod = anObj; +} + + /* Cogit>>#setPostCompileHook: */ +void +setPostCompileHook(void (*aFunction)(CogMethod *)) +{ + postCompileHook = aFunction; +} + + +/* If a method is compiled to machine code via a block entry it won't have a + selector. A subsequent send can find the method and hence fill in the + selector. + */ +/* self disassembleMethod: cogMethod */ + + /* Cogit>>#setSelectorOf:to: */ +void +setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop) +{ + compilationBreakpointisMNUCase(aSelectorOop, numBytesOf(aSelectorOop), 0); + assert(((cogMethod->cmType)) == CMMethod); + (cogMethod->selector = aSelectorOop); + if (isYoung(aSelectorOop)) { + ensureInYoungReferrers(cogMethod); + } +} + + /* Cogit>>#spanForCleanBlockStartingAt: */ +static sqInt NoDbgRegParms +spanForCleanBlockStartingAt(sqInt startPC) +{ + BytecodeDescriptor *descriptor; + usqInt end; + sqInt pc; + + pc = startPC; + end = numBytesOf(methodObj); + while (pc <= end) { + descriptor = generatorAt((fetchByteofObject(pc, methodObj)) + bytecodeSetOffset); + pc += (descriptor->numBytes); + if ((descriptor->isReturn)) { + return pc - startPC; + } + } + error("couldn't locate end of clean block"); + return 0; +} + + +/* Answer a fake value for the method oop in other than the first case in the + PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. + */ + + /* Cogit>>#subsequentPrototypeMethodOop */ +static sqInt +subsequentPrototypeMethodOop(void) +{ + return (((((usqInt)195929424)) >= ((methodLabel->address))) + && ((((usqInt)195929424)) < (youngReferrers())) + ? 233496237 + : 195929424); +} + + /* Cogit>>#traceLinkedSendOffset */ +sqInt +traceLinkedSendOffset(void) +{ + return (cmNoCheckEntryOffset + (callInstructionByteSize(backEnd))) + (0); +} + + +/* Encode true and false and 0 to N such that they can't be confused for + register numbers (including NoReg) + and can be tested for by isTrampolineArgConstant: and decoded by + trampolineArgValue: + */ + + /* Cogit>>#trampolineArgConstant: */ +static sqInt NoDbgRegParms +trampolineArgConstant(sqInt booleanOrInteger) +{ + assert(booleanOrInteger >= 0); + return -2 - booleanOrInteger; +} + + /* Cogit>>#trampolineName:numArgs: */ +static char * NoDbgRegParms +trampolineNamenumArgs(char *routinePrefix, sqInt numArgs) +{ + char *theString; + + /* begin trampolineName:numArgs:limit: */ + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= (NumSendTrampolines - 2) + ? '0' + numArgs + : 'N')); + return theString; +} + + +/* Malloc a string with the contents for the trampoline table */ + + /* Cogit>>#trampolineName:numArgs:limit: */ +static char * NoDbgRegParms +trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit) +{ + char *theString; + + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#trampolineName:numRegArgs: */ +static char * NoDbgRegParms +trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs) +{ + sqInt argsLimit; + char *theString; + + /* begin trampolineName:numArgs:limit: */ + argsLimit = 2; + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#unknownBytecode */ +static sqInt +unknownBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* Unlink all sends in cog methods. */ + + /* Cogit>>#unlinkAllSends */ +void +unlinkAllSends(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) != CMFree) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); +} + + /* Cogit>>#unlinkIfFreeOrLinkedSend:pc:of: */ +static sqInt NoDbgRegParms +unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((targetMethod1->cmType)) == CMFree) + || (((targetMethod1->selector)) == theSelector)) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfInvalidClassSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send, but maybe a super send or linked to an OpenPIC, in which case the cache tag will be a selector.... */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) + || (((targetMethod1->cmType)) == CMOpenPIC))) { + if (!(isValidClassTag(inlineCacheTagAt(backEnd, ((sqInt)mcpc))))) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSendToFree:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmType)) == CMFree) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:to: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((sqInt)targetMethod1)) == theCogMethod) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + +/* Unlink all sends in cog methods whose class tag is that of a forwarded + class. + */ + + /* Cogit>>#unlinkSendsLinkedForInvalidClasses */ +void +unlinkSendsLinkedForInvalidClasses(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + codeModified = (freedPIC = 0); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasForwardedClass(cogMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + +/* Unlink all sends in cog methods. Free all Closed PICs with the selector, + or with an MNU case if isMNUSelector. First check if any method actually + has the selector; if not there can't be any linked send to it. This + routine (including descendents) is performance critical. It contributes + perhaps 30% of entire execution time in Compiler recompileAll. */ + + /* Cogit>>#unlinkSendsOf:isMNUSelector: */ +void +unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt mustScanAndUnlink; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + mustScanAndUnlink = 0; + if (isMNUSelector) { + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) + && (((cogMethod->cmType)) == CMClosedPIC)) { + assert(((cogMethod->cmType)) == CMClosedPIC); + freeMethod(cogMethod); + mustScanAndUnlink = 1; + } + else { + if (((cogMethod->selector)) == selector) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + else { + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selector)) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + if (!mustScanAndUnlink) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to free methods and/or pics. */ + + /* Cogit>>#unlinkSendsToFree */ +void +unlinkSendsToFree(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(noTargetsFreeInClosedPIC(cogMethod)); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to a particular target method. + If targetMethodObject isn't actually a method (perhaps being + used via invokeAsMethod) then there's nothing to do. */ + + /* Cogit>>#unlinkSendsTo:andFreeIf: */ +void +unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + CogMethod *targetMethod; + + if (!((isOopCompiledMethod(targetMethodObject)) + && (methodHasCogMethod(targetMethodObject)))) { + return; + } + targetMethod = cogMethodOf(targetMethodObject); + if (!(methodZoneBase)) { + return; + } + codeModified = (freedPIC = 0); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask); + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasTarget(cogMethod, targetMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freeIfTrue) { + freeMethod(targetMethod); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + /* Cogit>>#XorCw:R: */ +static AbstractInstruction * NoDbgRegParms +gXorCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(XorCwR, wordConstant, reg); + return anInstruction; +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ +/* Eliminate stale dependent info. */ + + /* Cogit>>#zeroOpcodeIndex */ +static void +zeroOpcodeIndex(void) +{ + sqInt i; + + for (i = 0; i < opcodeIndex; i += 1) { + ((abstractOpcodes[i]).dependent = null); + } + zeroOpcodeIndexForNewOpcodes(); +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ + + /* Cogit>>#zeroOpcodeIndexForNewOpcodes */ +static void +zeroOpcodeIndexForNewOpcodes(void) +{ + opcodeIndex = 0; +} + + /* CogMethodZone>>#addAllToYoungReferrers */ +void +addAllToYoungReferrers(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + ensureInYoungReferrers(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#addToOpenPICList: */ +static void NoDbgRegParms +addToOpenPICList(CogMethod *anOpenPIC) +{ + assert(((anOpenPIC->cmType)) == CMOpenPIC); + assert((openPICList == null) + || (((openPICList->cmType)) == CMOpenPIC)); + (anOpenPIC->nextOpenPIC = ((usqInt)openPICList)); + openPICList = anOpenPIC; +} + + /* CogMethodZone>>#addToYoungReferrers: */ +static void NoDbgRegParms +addToYoungReferrers(CogMethod *cogMethod) +{ + assert(youngReferrers <= limitAddress); + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + assert((cogMethod->cmRefersToYoung)); + assert((youngReferrers <= limitAddress) + && (youngReferrers >= (limitAddress - (methodCount * BytesPerWord)))); + if (!(asserta((limitAddress - (methodCount * BytesPerWord)) >= mzFreeStart))) { + error("no room on youngReferrers list"); + } + youngReferrers -= BytesPerWord; + longAtput(youngReferrers, ((usqInt)cogMethod)); +} + + /* CogMethodZone>>#allocate: */ +static sqInt NoDbgRegParms +allocate(sqInt numBytes) +{ + usqInt allocation; + sqInt roundedBytes; + + roundedBytes = (numBytes + 7) & -8; + if ((mzFreeStart + roundedBytes) >= (limitAddress - (methodCount * BytesPerWord))) { + return 0; + } + allocation = mzFreeStart; + mzFreeStart += roundedBytes; + methodCount += 1; + return allocation; +} + + +/* Free all methods */ + + /* CogMethodZone>>#clearCogCompiledCode */ +static void +clearCogCompiledCode(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMMethod) { + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + manageFromto(baseAddress, limitAddress); +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#clearSavedPICUsageCount: */ +static void NoDbgRegParms +clearSavedPICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = 0); + } +} + + /* CogMethodZone>>#compactCompiledCode */ +static void +compactCompiledCode(void) +{ + unsigned short bytes; + CogMethod *dest; + sqLong objectHeaderValue; + CogMethod *source; + + objectHeaderValue = nullHeaderForMachineCodeMethod(); + source = ((CogMethod *) baseAddress); + openPICList = null; + methodCount = 0; + while ((source < (limitZony())) + && (((source->cmType)) != CMFree)) { + assert((cogMethodDoesntLookKosher(source)) == 0); + (source->objectHeader = objectHeaderValue); + if (((source->cmUsageCount)) > 0) { + (source->cmUsageCount = ((source->cmUsageCount)) / 2); + } + clearSavedPICUsageCount(source); + + if (((source->cmType)) == CMOpenPIC) { + (source->nextOpenPIC = ((usqInt)openPICList)); + openPICList = source; + } + methodCount += 1; + source = ((CogMethod *) (roundUpLength((((sqInt)source)) + ((source->blockSize))))); + } + if (source >= (limitZony())) { + haltmsg("no free methods; cannot compact."); + return; + } + dest = source; + while (source < (limitZony())) { + assert((maybeFreeCogMethodDoesntLookKosher(source)) == 0); + bytes = (source->blockSize); + if (((source->cmType)) != CMFree) { + methodCount += 1; + memmove(dest, source, bytes); + (dest->objectHeader = objectHeaderValue); + if (((dest->cmType)) == CMMethod) { + + /* For non-Newspeak there should be a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only update the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((dest->methodObject))))) == (((sqInt)source))) { + rawHeaderOfput((dest->methodObject), ((sqInt)dest)); + } + else { + assert((noAssertMethodClassAssociationOf((dest->methodObject))) == (nilObject())); + } + } + else { + clearSavedPICUsageCount(dest); + + if (((dest->cmType)) == CMOpenPIC) { + (dest->nextOpenPIC = ((usqInt)openPICList)); + openPICList = dest; + } + } + if (((dest->cmUsageCount)) > 0) { + (dest->cmUsageCount = ((dest->cmUsageCount)) / 2); + } + dest = ((CogMethod *) ((((usqInt)dest)) + bytes)); + } + source = ((CogMethod *) ((((usqInt)source)) + bytes)); + } + mzFreeStart = ((usqInt)dest); + methodBytesFreedSinceLastCompaction = 0; +} + + /* CogMethodZone>>#ensureInYoungReferrers: */ +static void NoDbgRegParms +ensureInYoungReferrers(CogMethod *cogMethod) +{ + if (!((cogMethod->cmRefersToYoung))) { + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + (cogMethod->cmRefersToYoung = 1); + addToYoungReferrers(cogMethod); + } +} + + /* CogMethodZone>>#followForwardedLiteralsInOpenPICList */ +static void +followForwardedLiteralsInOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (openPIC != null) { + followForwardedLiteralsIn(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#freeMethod: */ +void +freeMethod(CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) != CMFree); + assert(((cogMethodDoesntLookKosher(cogMethod)) == 0) + || (((cogMethodDoesntLookKosher(cogMethod)) == 23) + && ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) == CMFree))); + if (((cogMethod->cmType)) == CMMethod) { + + /* For non-Newspeak there should ne a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only reset the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((cogMethod->methodObject))))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + } + } + if (((cogMethod->cmType)) == CMOpenPIC) { + removeFromOpenPICList(cogMethod); + } + (cogMethod->cmRefersToYoung = 0); + (cogMethod->cmType = CMFree); + methodBytesFreedSinceLastCompaction += (cogMethod->blockSize); +} + + +/* Free methods, preferring older methods for compaction, up to some + fraction, currently a quarter. + */ + + /* CogMethodZone>>#freeOlderMethodsForCompaction */ +static void +freeOlderMethodsForCompaction(void) +{ + usqInt amountToFree; + CogMethod *cogMethod; + sqInt freeableUsage; + usqInt freedSoFar; + usqInt initialFreeSpace; + usqInt zoneSize; + + zoneSize = limitAddress - baseAddress; + initialFreeSpace = (limitAddress - mzFreeStart) + methodBytesFreedSinceLastCompaction; + freedSoFar = initialFreeSpace; + + /* 4 needs to be e.g. a start-up parameter */ + amountToFree = zoneSize / 4; + freeableUsage = 0; + do { + cogMethod = ((CogMethod *) baseAddress); + while (((((usqInt)cogMethod)) < mzFreeStart) + && (freedSoFar < amountToFree)) { + if ((((cogMethod->cmType)) == CMMethod + ? ((cogMethod->cmUsageCount)) <= freeableUsage + : (((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == 0))) { + freeMethod(cogMethod); + freedSoFar += (cogMethod->blockSize); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } while((freedSoFar < amountToFree) + && (((freeableUsage += 1)) < CMMaxUsageCount)); +} + + +/* Answer that all entries in youngReferrers are in-use and have the + cmRefersToYoung flag set. + Used to check that the youngreferrers pruning routines work correctly. */ + + /* CogMethodZone>>#kosherYoungReferrers */ +static sqInt +kosherYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + if ((youngReferrers > limitAddress) + || (youngReferrers < mzFreeStart)) { + return 0; + } + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung)))) { + return 0; + } + pointer += BytesPerWord; + } + return 1; +} + + /* CogMethodZone>>#manageFrom:to: */ +static void NoDbgRegParms +manageFromto(sqInt theStartAddress, sqInt theLimitAddress) +{ + mzFreeStart = (baseAddress = theStartAddress); + youngReferrers = (limitAddress = theLimitAddress); + openPICList = null; + methodBytesFreedSinceLastCompaction = 0; + methodCount = 0; +} + + /* CogMethodZone>>#methodFor: */ +CogMethod * +methodFor(void *address) +{ + CogMethod *cogMethod; + CogMethod *nextMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((cogMethod < (limitZony())) + && ((((usqInt)cogMethod)) <= (((usqInt)address)))) { + /* begin methodAfter: */ + nextMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + if (nextMethod == cogMethod) { + return 0; + } + if (((((usqInt)address)) >= (((usqInt)cogMethod))) + && ((((usqInt)address)) < (((usqInt)nextMethod)))) { + return cogMethod; + } + cogMethod = nextMethod; + } + return 0; +} + + /* CogMethodZone>>#methodsCompiledToMachineCodeInto: */ +sqInt +methodsCompiledToMachineCodeInto(sqInt arrayObj) +{ + CogMethod *cogMethod; + sqInt methodIndex; + + methodIndex = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + storePointerUncheckedofObjectwithValue(methodIndex, arrayObj, (cogMethod->methodObject)); + methodIndex += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return methodIndex; +} + + /* CogMethodZone>>#numMethods */ +sqInt +numMethods(void) +{ + return methodCount; +} + + /* CogMethodZone>>#numMethodsOfType: */ +sqInt +numMethodsOfType(sqInt cogMethodType) +{ + CogMethod *cogMethod; + sqInt n; + + n = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cogMethodType) { + n += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return n; +} + + /* CogMethodZone>>#occurrencesInYoungReferrers: */ +static sqInt NoDbgRegParms +occurrencesInYoungReferrers(CogMethod *cogMethod) +{ + sqInt count; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + count = 0; + pointer = youngReferrers; + while (pointer < limitAddress) { + if ((((sqInt)cogMethod)) == (longAt(pointer))) { + count += 1; + } + pointer += BytesPerWord; + } + return count; +} + + /* CogMethodZone>>#openPICWithSelector: */ +static CogMethod * NoDbgRegParms +openPICWithSelector(sqInt aSelector) +{ + CogMethod *openPIC; + + openPIC = openPICList; + do { + if ((openPIC == null) + || (((openPIC->selector)) == aSelector)) { + return openPIC; + } + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* Some methods have been freed. Compute how much each survivor needs to + move during the ensuing compaction and record it in the objectHeader + field. + For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#planCompaction */ +static void +planCompaction(void) +{ + CogMethod *cogMethod; + sqInt delta; + + delta = 0; + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMFree) { + delta -= (cogMethod->blockSize); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->objectHeader = delta); + savePICUsageCount(cogMethod); + + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethods */ +void +printCogMethods(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + printCogMethod(cogMethod); + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsOfType: */ +void +printCogMethodsOfType(sqInt cmType) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cmType) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithMethod: */ +void +printCogMethodsWithMethod(sqInt methodOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->methodObject)) == methodOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithPrimitive: */ +void +printCogMethodsWithPrimitive(sqInt primIdx) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (primIdx == (primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader))))) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithSelector: */ +void +printCogMethodsWithSelector(sqInt selectorOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selectorOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogYoungReferrers */ +void +printCogYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((cogMethod->cmRefersToYoung))) { + print("*"); + } + if (((cogMethod->cmType)) == CMFree) { + print("!"); + } + if (!(((cogMethod->cmRefersToYoung)) + && (((cogMethod->cmType)) != CMFree))) { + print(" "); + } + printCogMethod(cogMethod); + pointer += BytesPerWord; + } +} + + /* CogMethodZone>>#printOpenPICList */ +void +printOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (!(openPIC == null)) { + printCogMethod(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#pruneYoungReferrers */ +static sqInt +pruneYoungReferrers(void) +{ + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((CogMethod *) (longAt(next))))->cmRefersToYoung)))) break; + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + if (((((CogMethod *) (longAt(source))))->cmRefersToYoung)) { + assert(source < (dest - BytesPerWord)); + longAtput((dest -= BytesPerWord), longAt(source)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + assert(kosherYoungReferrers()); + return 0; +} + + /* CogMethodZone>>#relocateAndPruneYoungReferrers */ +static sqInt +relocateAndPruneYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((cogMethod = ((CogMethod *) (longAt(next))))->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))))) break; + if (((cogMethod->objectHeader)) != 0) { + longAtput(next, (((sqInt)cogMethod)) + ((cogMethod->objectHeader))); + } + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + cogMethod = ((CogMethod *) (longAt(source))); + if ((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))) { + assert(source < (dest - BytesPerWord)); + if (((cogMethod->objectHeader)) != 0) { + cogMethod = ((CogMethod *) ((((sqInt)cogMethod)) + (((sqInt)((cogMethod->objectHeader)))))); + } + longAtput((dest -= BytesPerWord), ((sqInt)cogMethod)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + return 0; +} + + +/* All surviving methods have had the amount they are going to relocate by + stored in their objectHeader fields. Relocate all relative calls so that + after the compaction of both the method containing each call and the call + target the calls invoke the same target. */ + + /* CogMethodZone>>#relocateMethodsPreCompaction */ +static sqInt +relocateMethodsPreCompaction(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cmType)) == CMClosedPIC) { + relocateCallsInClosedPIC(cogMethod); + } + else { + relocateCallsAndSelfReferencesInMethod(cogMethod); + } + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + relocateAndPruneYoungReferrers(); + return 1; +} + + /* CogMethodZone>>#removeFromOpenPICList: */ +static sqInt NoDbgRegParms +removeFromOpenPICList(CogMethod *anOpenPIC) +{ + CogMethod *prevPIC; + + assert(((anOpenPIC->cmType)) == CMOpenPIC); + if (anOpenPIC == openPICList) { + + /* N.B. Use self rather than coInterpreter to avoid attempting to cast nil. + Conversion to CogMethod done in the nextOpenPIC accessor. */ + openPICList = ((CogMethod *) ((anOpenPIC->nextOpenPIC))); + return null; + } + prevPIC = openPICList; + do { + assert((prevPIC != null) + && (((prevPIC->cmType)) == CMOpenPIC)); + if (((prevPIC->nextOpenPIC)) == (((sqInt)anOpenPIC))) { + (prevPIC->nextOpenPIC = (anOpenPIC->nextOpenPIC)); + return null; + } + prevPIC = ((CogMethod *) ((prevPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#restorePICUsageCount: */ +static void NoDbgRegParms +restorePICUsageCount(CogMethod *cogMethod) +{ + if ((((cogMethod->cmType)) == CMClosedPIC) + && (((cogMethod->blockEntryOffset)) != 0)) { + (cogMethod->cmUsageCount = (cogMethod->blockEntryOffset)); + (cogMethod->blockEntryOffset = 0); + } +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#savePICUsageCount: */ +static void NoDbgRegParms +savePICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = (cogMethod->cmUsageCount)); + (cogMethod->cmUsageCount = 0); + } +} + + /* CogMethodZone>>#voidYoungReferrersPostTenureAll */ +static void +voidYoungReferrersPostTenureAll(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) != CMFree) { + (cogMethod->cmRefersToYoung = 0); + } + pointer += BytesPerWord; + } + youngReferrers = limitAddress; +} + + /* CogMethodZone>>#whereIsMaybeCodeThing: */ +char * +whereIsMaybeCodeThing(sqInt anOop) +{ + if (oopisGreaterThanOrEqualToandLessThan(anOop, codeBase, limitAddress)) { + if (oopisLessThan(anOop, methodZoneBase)) { + return " is in generated runtime"; + } + if (oopisLessThan(anOop, mzFreeStart)) { + return " is in generated methods"; + } + if (oopisLessThan(anOop, youngReferrers)) { + return " is in code zone"; + } + return " is in young referrers"; + } + return null; +} + + /* CogObjectRepresentation>>#checkValidObjectReference: */ +static sqInt NoDbgRegParms +checkValidObjectReference(sqInt anOop) +{ + return (!(isImmediate(anOop))) + && ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentation>>#genCmpClassFloatCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassFloatCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassFloatCompactIndex, reg); + return anInstruction; +} + + /* CogObjectRepresentation>>#genCmpClassMethodContextCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassMethodContextCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, reg); + return anInstruction; +} + + /* CogObjectRepresentation>>#genDoubleArithmetic:preOpCheck: */ +static sqInt NoDbgRegParms +genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg)) +{ + AbstractInstruction *doOp; + AbstractInstruction *jumpFailAlloc; + AbstractInstruction *jumpFailCheck; + AbstractInstruction *jumpFailClass; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpNonInt; + + if (!(processorHasDoublePrecisionFloatingPointSupport())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + jumpImmediate = genJumpImmediate(Arg0Reg); + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFailClass = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + /* begin Label */ + doOp = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (!(preOpCheckOrNil == null)) { + jumpFailCheck = preOpCheckOrNil(DPFPReg0, DPFPReg1); + } + genoperandoperand(arithmeticOperator, DPFPReg1, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImmediate, gLabel()); + maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(Arg0Reg, TempReg, DPFPReg1, doOp); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonInt = genJumpNotSmallInteger(Arg0Reg); + + genConvertSmallIntegerToIntegerInReg(ClassReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, ClassReg, DPFPReg1); + /* begin Jump: */ + genoperand(Jump, ((sqInt)doOp)); + jmpTarget(jumpFailAlloc, jmpTarget(jumpFailClass, gLabel())); + jmpTarget(jumpNonInt, getJmpTarget(jumpFailClass)); + + if (!(preOpCheckOrNil == null)) { + jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); + } + return 0; +} + + /* CogObjectRepresentation>>#genDoubleComparison:invert: */ +static sqInt NoDbgRegParms +genDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *compare; + sqInt constant; + AbstractInstruction *jumpCond; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpNonInt; + + if (!(processorHasDoublePrecisionFloatingPointSupport())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + jumpImmediate = genJumpImmediate(Arg0Reg); + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + if (invertComparison) { + + /* May need to invert for NaNs */ + /* begin CmpRd:Rd: */ + compare = genoperandoperand(CmpRdRd, DPFPReg0, DPFPReg1); + } + else { + /* begin CmpRd:Rd: */ + compare = genoperandoperand(CmpRdRd, DPFPReg1, DPFPReg0); + } + + /* FP jumps are a little weird */ + jumpCond = jumpOpcodeGenerator(0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImmediate, gLabel()); + maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(Arg0Reg, TempReg, DPFPReg1, compare); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonInt = genJumpNotSmallInteger(Arg0Reg); + + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, Arg0Reg, DPFPReg1); + /* begin Jump: */ + genoperand(Jump, ((sqInt)compare)); + jmpTarget(jumpFail, gLabel()); + jmpTarget(jumpNonInt, getJmpTarget(jumpFail)); + + return CompletePrimitive; +} + + +/* Get the method header (first word) of a CompiledMethod into headerReg. + Deal with the method possibly being cogged. */ + + /* CogObjectRepresentation>>#genGetMethodHeaderOf:into:scratch: */ +static sqInt NoDbgRegParms +genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpNotCogged; + sqInt offset; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, methodReg, headerReg); + /* begin genJumpSmallInteger:scratchReg: */ + jumpNotCogged = genJumpSmallInteger(headerReg); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodHeader); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, headerReg, headerReg); + jmpTarget(jumpNotCogged, gLabel()); + return 0; +} + + +/* TODO: Optimize this one avoiding the trampoline */ + + /* CogObjectRepresentation>>#genLcByteSizeOf:to: */ +static void NoDbgRegParms +genLcByteSizeOfto(sqInt oop, sqInt resultRegister) +{ + AbstractInstruction *abstractInstruction; + + if (oop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, oop, Arg0Reg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceByteSizeOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, resultRegister); + ssPushNativeRegister(resultRegister); +} + + /* CogObjectRepresentation>>#genLcFloat32:toOop: */ +static void NoDbgRegParms +genLcFloat32toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, value, DPFPReg0); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcFloat64:toOop: */ +static void NoDbgRegParms +genLcFloat64toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + if (value != DPFPReg0) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, DPFPReg0); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop: */ +static void NoDbgRegParms +genLcInstantiateOop(sqInt classOop) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:constantIndexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + if (classOop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, indexableSize, Arg1Reg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:indexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != Arg0Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + if (indexableSize != Arg1Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg1Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, Arg1Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInt64ToOop: */ +static void NoDbgRegParms +genLcInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOopToInt64: */ +static void NoDbgRegParms +genLcOopToInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + +/* Assume this is always correct */ + + /* CogObjectRepresentation>>#genLcOopToPointer: */ +static void NoDbgRegParms +genLcOopToPointer(sqInt object) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, object, object); + ssPushNativeRegister(object); +} + + /* CogObjectRepresentation>>#genLcOopToUInt64: */ +static void NoDbgRegParms +genLcOopToUInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat32: */ +static void NoDbgRegParms +genLcOoptoFloat32(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, DPFPReg0, value); + ssPushNativeRegisterSingleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat64: */ +static void NoDbgRegParms +genLcOoptoFloat64(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (DPFPReg0 != value) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, DPFPReg0, value); + } + ssPushNativeRegisterDoubleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcOop:toUInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcPointerToOop:class: */ +static void NoDbgRegParms +genLcPointerToOopclass(sqInt pointer, sqInt pointerClass) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin PushR: */ + genoperand(PushR, pointer); + annotateobjRef(gMoveCwR(pointerClass, Arg0Reg), pointerClass); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, BytesPerOop, Arg1Reg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin PopR: */ + genoperand(PopR, pointer); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, pointer, BaseHeaderSize, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushRegister(pointer); +} + + /* CogObjectRepresentation>>#genLcUInt64ToOop: */ +static void NoDbgRegParms +genLcUInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcUInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLoadSlot:sourceReg:destReg: */ +static sqInt NoDbgRegParms +genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, (index * BytesPerWord) + BaseHeaderSize, sourceReg, destReg); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveAdd */ +static sqInt +genPrimitiveAdd(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, ReceiverResultReg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveAsFloat */ +static sqInt +genPrimitiveAsFloat(void) +{ + AbstractInstruction *jumpFailAlloc; + + if (!(processorHasDoublePrecisionFloatingPointSupport())) { + return UnimplementedPrimitive; + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, TempReg, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFailAlloc, gLabel()); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveBitAnd */ +static sqInt +genPrimitiveBitAnd(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitOr */ +static sqInt +genPrimitiveBitOr(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + +/* rTemp := rArg0 + rClass := tTemp + rTemp := rTemp & 1 + jz nonInt + rClass >>= 1 + cmp 0,rClass + jge neg + cmp 31,rClass // numSmallIntegerBits, jge for sign + jge tooBig + rTemp := rReceiver + rTemp <<= rClass + rTemp >>= rClass (arithmetic) + cmp rTemp,rReceiver + jnz ovfl + rReceiver := rReceiver - 1 + rReceiver := rReceiver <<= rClass + rReceiver := rReceiver + 1 + ret + neg: + rClass := 0 - rClass + cmp 31,rClass // numSmallIntegerBits + jge inRange + rClass := 31 + inRange + rReceiver := rReceiver >>= rClass. + rReceiver := rReceiver | smallIntegerTags. + ret + ovfl + tooBig + nonInt: + fail + */ + + /* CogObjectRepresentation>>#genPrimitiveBitShift */ +static sqInt +genPrimitiveBitShift(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpInRange; + AbstractInstruction *jumpNegative; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + AbstractInstruction *jumpTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpNegative: */ + jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + /* begin JumpGreaterOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, TempReg); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, ClassReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, ReceiverResultReg); + /* begin JumpNonZero: */ + jumpOvfl = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, ReceiverResultReg); + genAddSmallIntegerTagsTo(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNegative, gNegateR(ClassReg)); + /* begin CmpCq:R: */ + quickConstant2 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); + /* begin JumpLessOrEqual: */ + jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + quickConstant = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); + jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); + genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, jmpTarget(jumpTooBig, jmpTarget(jumpOvfl, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitXor */ +static sqInt +genPrimitiveBitXor(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin XorR:R: */ + genoperandoperand(XorRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveClass */ +static sqInt +genPrimitiveClass(void) +{ + sqInt reg; + sqInt reg1; + + reg = ReceiverResultReg; + if (methodOrBlockNumArgs > 0) { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + reg1 = (reg = Arg0Reg); + assert(0 < (numRegArgs())); + } + if ((genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ReceiverResultReg, TempReg, reg == ReceiverResultReg)) == BadRegisterSet) { + genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ClassReg, TempReg, reg == ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDiv */ +static sqInt +genPrimitiveDiv(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, TempReg); + jmpTarget(jumpSameSign, (convert = gLabel())); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDivide */ +static sqInt +genPrimitiveDivide(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpInexact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOverflow; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpNonZero: */ + jumpInexact = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + jumpOverflow = genJumpNotSmallIntegerValuescratch(TempReg, Arg1Reg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOverflow, jmpTarget(jumpInexact, jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveEqual */ +static sqInt +genPrimitiveEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpZero, gJumpFPEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatAdd */ +static sqInt +genPrimitiveFloatAdd(void) +{ + return genDoubleArithmeticpreOpCheck(AddRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatDivide */ +static sqInt +genPrimitiveFloatDivide(void) +{ + return genDoubleArithmeticpreOpCheck(DivRdRd, genDoubleFailIfZeroArgRcvrarg); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatEqual */ +static sqInt +genPrimitiveFloatEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatGreaterOrEqual */ +static sqInt +genPrimitiveFloatGreaterOrEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPGreaterOrEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatGreaterThan */ +static sqInt +genPrimitiveFloatGreaterThan(void) +{ + return genDoubleComparisoninvert(gJumpFPGreater, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatLessOrEqual */ +static sqInt +genPrimitiveFloatLessOrEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPGreaterOrEqual, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatLessThan */ +static sqInt +genPrimitiveFloatLessThan(void) +{ + return genDoubleComparisoninvert(gJumpFPGreater, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatMultiply */ +static sqInt +genPrimitiveFloatMultiply(void) +{ + return genDoubleArithmeticpreOpCheck(MulRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatNotEqual */ +static sqInt +genPrimitiveFloatNotEqual(void) +{ + return genDoubleComparisoninvert(gJumpFPNotEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveFloatSquareRoot */ +static sqInt +genPrimitiveFloatSquareRoot(void) +{ + AbstractInstruction *jumpFailAlloc; + + if (!(processorHasDoublePrecisionFloatingPointSupport())) { + return UnimplementedPrimitive; + } + genGetDoubleValueOfinto(ReceiverResultReg, DPFPReg0); + /* begin SqrtRd: */ + genoperand(SqrtRd, DPFPReg0); + jumpFailAlloc = genAllocFloatValueintoscratchRegscratchReg(DPFPReg0, SendNumArgsReg, ClassReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFailAlloc, gLabel()); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveFloatSubtract */ +static sqInt +genPrimitiveFloatSubtract(void) +{ + return genDoubleArithmeticpreOpCheck(SubRdRd, null); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterOrEqual */ +static sqInt +genPrimitiveGreaterOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreaterOrEqual, gJumpFPGreaterOrEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterThan */ +static sqInt +genPrimitiveGreaterThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreater, gJumpFPGreater, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveIdentical */ +static sqInt +genPrimitiveIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(0); +} + + /* CogObjectRepresentation>>#genPrimitiveLessOrEqual */ +static sqInt +genPrimitiveLessOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLessOrEqual, gJumpFPGreaterOrEqual, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveLessThan */ +static sqInt +genPrimitiveLessThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLess, gJumpFPGreater, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveMod */ +static sqInt +genPrimitiveMod(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genRemoveSmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, Arg1Reg); + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ClassReg); + jmpTarget(jumpSameSign, jmpTarget(jumpExact, gLabel())); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveMultiply */ +static sqInt +genPrimitiveMultiply(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(processorHasMultiplyAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + genRemoveSmallIntegerTagsInScratchReg(Arg1Reg); + /* begin MulR:R: */ + genMulRR(backEnd, Arg1Reg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + +/* subclasses override if they can */ + + /* CogObjectRepresentation>>#genPrimitiveNewMethod */ +static sqInt +genPrimitiveNewMethod(void) +{ + return UnimplementedPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveNotEqual */ +static sqInt +genPrimitiveNotEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpNonZero, gJumpFPNotEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveNotIdentical */ +static sqInt +genPrimitiveNotIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(1); +} + + /* CogObjectRepresentation>>#genPrimitiveQuo */ +static sqInt +genPrimitiveQuo(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + convert = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveSubtract */ +static sqInt +genPrimitiveSubtract(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, TempReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genAddSmallIntegerTagsTo(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genSmallIntegerComparison: */ +static sqInt NoDbgRegParms +genSmallIntegerComparison(sqInt jumpOpcode) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpTrue; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpFail = genJumpNotSmallInteger(Arg0Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + jumpTrue = genConditionalBranchoperand(jumpOpcode, 0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFail, gLabel()); + return CompletePrimitive; +} + + +/* Stack looks like + return address */ + + /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ +static sqInt NoDbgRegParms +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpCond; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpNonInt; + sqInt r; + + r = genSmallIntegerComparison(jumpOpcode); + if (r < 0) { + return r; + } + +# if defined(DPFPReg0) + + /* Fall through on non-SmallInteger argument. Argument may be a Float : let us check or fail */ + jumpNonInt = genJumpImmediate(Arg0Reg); + + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(ReceiverResultReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, ReceiverResultReg, DPFPReg0); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + if (invertComparison) { + + /* May need to invert for NaNs */ + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg0, DPFPReg1); + } + else { + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg1, DPFPReg0); + } + + /* FP jumps are a little weird */ + jumpCond = jumpFPOpcodeGenerator(0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNonInt, jmpTarget(jumpFail, gLabel())); + + +# endif /* defined(DPFPReg0) */ + + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#isUnannotatableConstant: */ +static sqInt NoDbgRegParms +isUnannotatableConstant(CogSimStackEntry *simStackEntry) +{ + return (((simStackEntry->type)) == SSConstant) + && ((isImmediate((simStackEntry->constant))) + || (!(shouldAnnotateObjectReference((simStackEntry->constant))))); +} + + +/* If the receiver supports immediate floats then generate a test for a + smallFloat in oopReg, + converting it to the float value in dpReg and jumping to targetInst. + Otherwise do nothing. */ + + /* CogObjectRepresentation>>#maybeGenConvertIfSmallFloatIn:scratchReg:into:andJumpTo: */ +static sqInt NoDbgRegParms +maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(sqInt oopReg, sqInt scratch, sqInt dpReg, AbstractInstruction *targetInst) +{ + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#genAddSmallIntegerTagsTo: */ +static sqInt NoDbgRegParms +genAddSmallIntegerTagsTo(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, aRegister); + return 0; +} + + +/* Set the SmallInteger tag bits when the tag bits may be filled with + garbage. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genClearAndSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genClearAndSetSmallIntegerTagsIn(sqInt scratchReg) +{ + return genSetSmallIntegerTagsIn(scratchReg); +} + + +/* Convert the Character in reg to a SmallInteger, assuming + the Character's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertCharacterToSmallIntegerInReg: */ +static void NoDbgRegParms +genConvertCharacterToSmallIntegerInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertIntegerToSmallIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToSmallIntegerInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, reg); + return 0; +} + + +/* Convert the SmallInteger in reg to a Character, assuming + the SmallInteger's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToCharacterInReg: */ +static void NoDbgRegParms +genConvertSmallIntegerToCharacterInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertSmallIntegerToIntegerInReg(sqInt reg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, reg); + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#generateLowcodeObjectTrampolines */ +static void +generateLowcodeObjectTrampolines(void) +{ + ceFloatObjectOfTrampoline = genTrampolineForcalledfloatArgresult(floatObjectOf, "ceFloatObjectOfTrampoline", DPFPReg0, TempReg); + ceFloatValueOfTrampoline = genTrampolineForcalledargfloatResult(floatValueOf, "ceFloatValueOfTrampoline", ReceiverResultReg, DPFPReg0); + ceInstantiateClassIndexableSizeTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassIndexableSizeTrampoline", Arg0Reg, Arg1Reg, TempReg); + ceInstantiateClassTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassTrampoline", ReceiverResultReg, 0, TempReg); + ceByteSizeOfTrampoline = genTrampolineForcalledargresult(byteSizeOf, "ceByteSizeOfTrampoline", Arg0Reg, TempReg); + cePositive64BitIntegerTrampoline = genTrampolineForcalledargargresult(positive64BitIntegerFor, "cePositive64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + cePositive64BitValueOfTrampoline = genTrampolineForcalledargresultresult(positive64BitValueOf, "cePositive64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + ceSigned64BitIntegerTrampoline = genTrampolineForcalledargargresult(signed64BitIntegerFor, "ceSigned64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + ceSigned64BitValueOfTrampoline = genTrampolineForcalledargresultresult(signed64BitValueOf, "ceSigned64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + + cePositive32BitIntegerTrampoline = genTrampolineForcalledargresult(positive32BitIntegerFor, "cePositive32BitIntegerTrampoline", ReceiverResultReg, TempReg); + cePositive32BitValueOfTrampoline = genTrampolineForcalledargresult(positive32BitValueOf, "cePositive32BitValueOfTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitIntegerTrampoline = genTrampolineForcalledargresult(signed32BitIntegerFor, "ceSigned32BitIntegerTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitValueOfTrampoline = genTrampolineForcalledargresult(signed32BitValueOf, "ceSigned32BitValueOfTrampoline", ReceiverResultReg, TempReg); +} + + +/* indexReg contains the 1-relative index of an element in tableObj. + Since BaseHeaderSize > BytesPerOop we must adjust it to use + it as a zero-relative index from the beginning of the object. */ + + /* CogObjectRepresentationFor32BitSpur>>#genFetchIndexRegister:from:into: */ +static sqInt NoDbgRegParms +genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + assert(indexReg != destReg); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, (BaseHeaderSize / BytesPerWord) - 1, indexReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tableObj)) { + annotateobjRef(gMoveCwR(tableObj, destReg), tableObj); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tableObj, destReg); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, indexReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, encoded as a + SmallInteger. + */ +/* Get header word in scratchReg */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:asSmallIntegerInto: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + genConvertIntegerToSmallIntegerInReg(destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, unencoded. */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return 0; +} + + +/* Extract the inline cache tag for the object in sourceReg into destReg. The + inline cache tag for a given object is the value loaded in inline caches + to distinguish + objects of different classes. In Spur this is either the tags for + immediates, (with + 1 & 3 collapsed to 1 for SmallIntegers, and 2 collapsed to 0 for + Characters), or + the receiver's classIndex. + If forEntry is true answer the entry label at which control is to enter + (cmEntryOffset). If forEntry is false, control enters at the start. + If forEntry is true, generate something like this: + Limm: + andl $0x1, rDest + j Lcmp + Lentry: + movl rSource, rDest + andl $0x3, rDest + jnz Limm + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + If forEntry is false, generate something like the following. + At least on a 2.2GHz Intel Core i7 the following is slightly faster than + the above, + 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks + Lentry: + movl rSource, rDest + andl $0x3, rDest + jz LnotImm + andl $1, rDest + j Lcmp + LnotImm: + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + But we expect most SmallInteger arithmetic to be performed in-line and so + prefer the + version that is faster for non-immediates (because it branches for + immediates only). */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetInlineCacheClassTagFrom:into:forEntry: */ +static AbstractInstruction * NoDbgRegParms +genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *entryLabel; + AbstractInstruction *immLabel; + AbstractInstruction *jumpCompare; + AbstractInstruction *jumpNotImm; + sqInt quickConstant; + + if (forEntry) { + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + jmpTarget(jumpCompare, gLabel()); + } + else { + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpZero: */ + jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin AndCq:R: */ + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + flag("endianness"); + jmpTarget(jumpNotImm, gMoveMwrR(0, sourceReg, destReg)); + jmpTarget(jumpCompare, gAndCqR(classIndexMask(), destReg)); + } + return entryLabel; +} + + /* CogObjectRepresentationFor32BitSpur>>#genGetOverflowSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetOverflowSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, -BaseHeaderSize, srcReg, destReg); + return 0; +} + + +/* Generate a test for aRegister containing an integer value in the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpIsSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpIsSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpGreaterOrEqual: */ + genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerInScratchReg(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 1, aRegister); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + +/* Generate a test for aRegister containing an integer value outside the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpLess: */ + genConditionalBranchoperand(JumpLess, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcInt32ToOop: */ +static void NoDbgRegParms +genLcInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToInt32: */ +static void NoDbgRegParms +genLcOopToInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToUInt32: */ +static void NoDbgRegParms +genLcOopToUInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcUInt32ToOop: */ +static void NoDbgRegParms +genLcUInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAt */ +static sqInt +genPrimitiveAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *convertToIntAndReturn; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpIsArray; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpIsWords; + AbstractInstruction *jumpMethodOutOfBounds; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpZero: */ + jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpBelow: */ + jumpNotIndexable = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpBelowOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable, gLabel()); + /* begin Jump: */ + jumpNotIndexable = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsArray, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction7 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), nSlotsOrBytesReg)); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + methodInBounds = anInstruction9; + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + + /* begin Label */ + convertToIntAndReturn = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotSmallIntegerUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, formatReg); + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant6 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AndCqR, quickConstant6, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg1Reg); + /* begin AddCq:R: */ + anInstruction14 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + /* begin Jump: */ + jumpMethodOutOfBounds = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpFixedFieldsOutOfBounds, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpMethodOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel()))))))))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAtPut */ +static sqInt +genPrimitiveAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNonSmallIntegerValue; + AbstractInstruction *jumpNotIndexableBits; + AbstractInstruction *jumpNotIndexablePointers; + AbstractInstruction * jumpNotPointers; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant1 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpAbove: */ + jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); + /* begin CmpCq:R: */ + quickConstant2 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpBelow: */ + jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin JumpNonZero: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpHasFixedFields, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant3 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant3, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin AddCq:R: */ + anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotPointers, gLabel()); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); + /* begin CmpCq:R: */ + quickConstant4 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + /* begin JumpBelow: */ + jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + } + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction13 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR((((usqInt)0xFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), nSlotsOrBytesReg); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR((((usqInt)0xFFFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); + /* begin AndCq:R: */ + anInstruction16 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsCompiledMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + jmpTarget(jumpIsContext, jmpTarget(jumpNotIndexableBits, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexablePointers, jmpTarget(jumpNonSmallIntegerValue, jmpTarget(jumpFixedFieldsOutOfBounds, gLabel()))))))))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpIsContext)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); + return 0; +} + + +/* Arguably we should fail for immediates, but so far no one has complained, + so... + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveIdentityHash */ +static sqInt +genPrimitiveIdentityHash(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpNotSet; + AbstractInstruction *jumpSI; + AbstractInstruction * ret; + + jumpImm = genJumpImmediate(ReceiverResultReg); + genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ConstZero, TempReg); + /* begin JumpZero: */ + jumpNotSet = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + ret = genoperand(RetN, 0); + jmpTarget(jumpImm, gLabel()); + jumpSI = genJumpSmallInteger(ReceiverResultReg); + jmpTarget(jumpSI, ret); + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)ret)); + jmpTarget(jumpNotSet, gLabel()); + return 0; +} + + +/* :Assume the receiuver is never a SmallInteger. One would use ^self for + that. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveImmediateAsInteger */ +static sqInt +genPrimitiveImmediateAsInteger(void) +{ + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + +/* Implement primitiveNew for convenient cases: + - the receiver has a hash + - the receiver is fixed size (excluding ephemerons to save instructions & + miniscule time) + - single word header/num slots < numSlotsMask + - the result fits in eden (actually below scavengeThreshold) + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNew */ +static sqInt +genPrimitiveNew(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpUnhashed; + AbstractInstruction *jumpVariableOrEphemeron; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + AbstractInstruction *skip; + + if (methodOrBlockNumArgs != 0) { + return UnimplementedPrimitive; + } + + /* inst spec will hold class's instance specification, then byte size and finally end of new object. */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* get freeStart as early as possible so as not to wait later... */ + instSpecReg = (byteSizeReg = ClassReg); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, TempReg); + /* begin AndCq:R: */ + quickConstant4 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); + /* begin CmpCq:R: */ + quickConstant5 = nonIndexablePointerFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + /* begin JumpAbove: */ + jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + /* begin JumpAboveOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction13 = genoperandoperand(CmpCqR, 0, byteSizeReg); + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction14 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant7 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + /* begin MoveCq:R: */ + quickConstant2 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + /* begin AddCq:R: */ + anInstruction17 = genoperandoperand(AddCqR, 8, Arg1Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpUnhashed, jmpTarget(jumpVariableOrEphemeron, jmpTarget(jumpTooBig, jmpTarget(jumpNoSpace, gLabel())))); + return 0; +} + + +/* Implement primitiveNewWithArg for convenient cases: + - the receiver has a hash + - the receiver is variable and not compiled method + - single word header/num slots < numSlotsMask + - the result fits in eden + See superclass method for dynamic frequencies of formats. + For the moment we implement only arrayFormat, firstByteFormat & + firstLongFormat + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNewWithArg */ +static sqInt +genPrimitiveNewWithArg(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpArrayFormat; + AbstractInstruction *jumpArrayTooBig; + AbstractInstruction *jumpByteFormat; + AbstractInstruction *jumpBytePrepDone; + AbstractInstruction *jumpByteTooBig; + AbstractInstruction *jumpFailCuzFixed; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpLongPrepDone; + AbstractInstruction *jumpLongTooBig; + AbstractInstruction *jumpNElementsNonInt; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpUnhashed; + sqInt maxSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + AbstractInstruction *skip; + sqInt wordConstant; + + if (methodOrBlockNumArgs != 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + + /* inst spec will hold class's instance specification and then byte size and finally numSlots half of header */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* The max slots we'll allocate here are those for a single header */ + instSpecReg = (byteSizeReg = ClassReg); + + /* get freeStart as early as possible so as not to wait later... */ + maxSlots = (numSlotsMask()) - 1; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + + /* get class's format inst var for inst spec (format field) */ + jumpNElementsNonInt = genJumpNotSmallInteger(Arg0Reg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, TempReg); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin CmpCq:R: */ + quickConstant4 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + /* begin JumpZero: */ + jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + /* begin JumpZero: */ + jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction15 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + /* begin JumpNonZero: */ + jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = (((usqInt)maxSlots << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + /* begin JumpAbove: */ + jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, 0); + /* begin Jump: */ + jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpByteTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, instSpecReg, TempReg); + /* begin AndCq:R: */ + anInstruction17 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + /* begin LogicalShiftLeftCq:R: */ + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin AddCq:R: */ + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); + /* begin PushCq: */ + anInstruction3 = genoperand(PushCq, 0); + /* begin Jump: */ + jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpArrayTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCw: */ + wordConstant = nilObject(); + /* begin gen:literal: */ + anInstruction4 = genoperand(PushCw, wordConstant); + jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); + /* begin MoveR:Mw:r: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction19 = genoperandoperand(CmpCqR, 0, byteSizeReg); + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction20 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + anInstruction21 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant8 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction22 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + /* begin PopR: */ + genoperand(PopR, fillReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + /* begin AddCq:R: */ + anInstruction23 = genoperandoperand(AddCqR, 8, Arg1Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNoSpace, gPopR(TempReg)); + jmpTarget(jumpUnhashed, jmpTarget(jumpFailCuzFixed, jmpTarget(jumpArrayTooBig, jmpTarget(jumpByteTooBig, jmpTarget(jumpLongTooBig, jmpTarget(jumpNElementsNonInt, gLabel())))))); + return 0; +} + + +/* Implement primitiveShallowCopy/primitiveClone for convenient cases: + - the receiver is not a context + - the receiver is not a compiled method + - the result fits in eden (actually below scavengeThreshold) */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveShallowCopy */ +static sqInt +genPrimitiveShallowCopy(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *continuance; + AbstractInstruction *copyLoop; + sqInt formatReg; + AbstractInstruction * jumpEmpty; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpVariable; + sqInt ptrReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt resultReg; + sqInt slotsReg; + + jumpImmediate = genJumpImmediate(ReceiverResultReg); + resultReg = Arg0Reg; + + /* get freeStart as early as possible so as not to wait later... */ + slotsReg = Arg1Reg; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, resultReg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (ptrReg = (formatReg = SendNumArgsReg)), NoReg); + /* begin CmpCq:R: */ + quickConstant = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = indexablePointersFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpZero: */ + jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + continuance = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genGetRawSlotSizeOfNonImminto(ReceiverResultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant2 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + /* begin JumpZero: */ + jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction14 = genoperandoperand(CmpCqR, 0, slotsReg); + /* begin JumpZero: */ + jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, slotsReg, TempReg); + /* begin AndCq:R: */ + anInstruction15 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, slotsReg); + /* begin AddCq:R: */ + anInstruction16 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, resultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant3 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction17 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ptrReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, slotsReg, address1); + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + /* begin AndCq:R: */ + quickConstant4 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); + /* begin gen:quickConstant:operand: */ + anInstruction18 = genoperandoperand(AndCqR, quickConstant4, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + /* begin MoveMw:r:R: */ + anInstruction5 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + /* begin AndCq:R: */ + quickConstant5 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); + /* begin gen:quickConstant:operand: */ + anInstruction19 = genoperandoperand(AndCqR, quickConstant5, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + /* begin Label */ + copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AddCq:R: */ + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + /* begin AddCq:R: */ + anInstruction21 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + /* begin MoveMw:r:R: */ + anInstruction9 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ptrReg, slotsReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)copyLoop)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpVariable, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction22 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); + jmpTarget(jumpImmediate, jmpTarget(jumpNoSpace, jmpTarget(jumpIsMethod, jmpTarget(jumpTooBig, jmpTarget(jumpEmpty, gLabel()))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAt */ +static sqInt +genPrimitiveStringAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *done; + sqInt formatReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsDone; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpLess: */ + jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + jumpWordsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + jmpTarget(jumpWordsDone, (done = gLabel())); + genConvertIntegerToCharacterInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)done)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel())))))); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAtPut */ +static sqInt +genPrimitiveStringAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpBadArg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNotString; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant1 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpBelow: */ + jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); + /* begin AndCq:R: */ + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel())))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpNotString)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentationFor32BitSpur>>#genRemoveSmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, scratchReg); + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#genShiftAwaySmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg); + return 0; +} + + +/* Get the literal count of a CompiledMethod into headerReg, plus one if + requested. If inBytes is true, scale the count by the word size. Deal with + the possibility of + the method being cogged. */ + + /* CogObjectRepresentationFor32BitSpur>>#getLiteralCountOf:plusOne:inBytes:into:scratch: */ +static sqInt NoDbgRegParms +getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + genGetMethodHeaderOfintoscratch(methodReg, litCountReg, scratchReg); + if (inBytes) { + /* begin AndCq:R: */ + quickConstant = ((sqInt)((usqInt)((alternateHeaderNumLiteralsMask())) << 1)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, litCountReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, litCountReg); + } + else { + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, litCountReg); + /* begin AndCq:R: */ + quickConstant1 = alternateHeaderNumLiteralsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant1, litCountReg); + } + if (plusOne) { + /* begin AddCq:R: */ + quickConstant2 = (inBytes + ? BytesPerWord + : 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, litCountReg); + } + return 0; +} + + +/* Answer the relevant inline cache tag for an instance. + c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */ + + /* CogObjectRepresentationFor32BitSpur>>#inlineCacheTagForInstance: */ +static sqInt NoDbgRegParms +inlineCacheTagForInstance(sqInt oop) +{ + return (isImmediate(oop) + ? oop & 1 + : classIndexOf(oop)); +} + + /* CogObjectRepresentationFor32BitSpur>>#jumpNotSmallIntegerUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0x3FFFFFFF, reg); + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in an inline cache preceding address in + cogMethodOrNil. Answer if code was modified. */ + + /* CogObjectRepresentationFor32BitSpur>>#markAndTraceCacheTagLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + rewriteInlineCacheTagat(backEnd(), objOop, address); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + /* CogObjectRepresentationFor32BitSpur>>#numSmallIntegerBits */ +static sqInt +numSmallIntegerBits(void) +{ + return 0x1F; +} + + +/* The two valid tag patterns are 0 (Character) and 1 (SmallInteger) */ + + /* CogObjectRepresentationFor32BitSpur>>#validInlineCacheTag: */ +static sqInt NoDbgRegParms +validInlineCacheTag(usqInt classIndexOrTagPattern) +{ + return (classIndexOrTagPattern <= 1) + || ((classAtIndex(classIndexOrTagPattern)) != null); +} + + +/* Answer if the cacheTag is not unmarked, i.e. answer true for compact class + indices and immediates; only answer false for unmarked objects. In Spur + linked send cache tags are class indices so effectively they're always + marked. */ + + /* CogObjectRepresentationForSpur>>#cacheTagIsMarked: */ +static sqInt NoDbgRegParms +cacheTagIsMarked(sqInt cacheTag) +{ + return 1; +} + + /* CogObjectRepresentationForSpur>>#checkValidOopReference: */ +static sqInt NoDbgRegParms +checkValidOopReference(sqInt anOop) +{ + return (isImmediate(anOop)) + || ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentationForSpur>>#couldBeObject: */ +static sqInt NoDbgRegParms +couldBeObject(sqInt literal) +{ + return (isNonImmediate(literal)) + && (oopisGreaterThanOrEqualTo(literal, startOfMemory())); +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genActiveContextTrampolineLarge:inBlock:called: */ +static sqInt NoDbgRegParms +genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genGetActiveContextLargeinBlock(isLarge, isInBlock); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(aString, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + /* CogObjectRepresentationForSpur>>#genAllocFloatValue:into:scratchReg:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genAllocFloatValueintoscratchRegscratchReg(sqInt dpreg, sqInt resultReg, sqInt scratch1, sqInt scratch2) +{ + sqInt address; + sqInt address1; + usqIntptr_t allocSize; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *jumpFail; + usqLong newFloatHeader; + sqInt quickConstant; + sqInt quickConstant1; + + allocSize = BaseHeaderSize + (sizeof(double)); + newFloatHeader = headerForSlotsformatclassIndex((sizeof(double)) / BytesPerWord, firstLongFormat(), ClassFloatCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, resultReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction1 = genoperandoperandoperand(LoadEffectiveAddressMwrR, allocSize, resultReg, scratch1); + /* begin CmpCq:R: */ + quickConstant1 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant1, scratch1); + /* begin JumpAboveOrEqual: */ + jumpFail = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, scratch1, address1); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) newFloatHeader); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, scratch1); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, scratch1, 0, resultReg); + /* begin MoveCq:R: */ + anInstruction21 = genoperandoperand(MoveCqR, newFloatHeader >> 32, scratch1); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, scratch1, 4, resultReg); + /* begin MoveRd:M64:r: */ + anInstruction5 = genoperandoperandoperand(MoveRdM64r, dpreg, BaseHeaderSize, resultReg); + return jumpFail; +} + + +/* Check the remembered bit of the object in objReg; answer the jump taken if + the bit is already set. + Only need to fetch the byte containing it, which reduces the size of the + mask constant. + */ + + /* CogObjectRepresentationForSpur>>#genCheckRememberedBitOf:scratch: */ +static AbstractInstruction * NoDbgRegParms +genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + int mask; + sqInt rememberedBitByteOffset; + + rememberedBitByteOffset = (rememberedBitShift()) / 8; + mask = 1U << ((rememberedBitShift()) % 8); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, rememberedBitByteOffset, objReg, scratchReg); + /* begin TstCq:R: */ + anInstruction1 = genoperandoperand(TstCqR, mask, scratchReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genConvertCharacterToCodeInReg: */ +static sqInt NoDbgRegParms +genConvertCharacterToCodeInReg(sqInt reg) +{ + sqInt quickConstant; + + /* begin LogicalShiftRightCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, reg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genConvertIntegerToCharacterInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToCharacterInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin LogicalShiftLeftCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); + /* begin AddCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant1, reg); + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. If numCopied > 0 pop those values off the stack. */ + + /* CogObjectRepresentationForSpur>>#genCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *anInstruction; + sqInt i; + + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(bcpc, numArgs, numCopied, ctxtNumArgs, isLargeCtxt, isInBlock); + for (i = 1; i <= numCopied; i += 1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (((numCopied - i) + ClosureFirstCopiedValueIndex) * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + } + return 0; +} + + +/* Create a full closure with the given values. */ + + /* CogObjectRepresentationForSpur>>#genCreateFullClosure:numArgs:numCopied:ignoreContext:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + sqInt constant; + usqLong header; + sqInt numSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultReg and thence in ClassReg. */ + if (ignoreContext) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ClassReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction11 = genoperandoperand(MoveCqR, constant, ClassReg); + } + } + else { + genGetActiveContextNumArgslargeinBlock(contextNumArgs, contextIsLarge, contextIsBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + } + numSlots = FullClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + assert(ClassFullBlockClosureCompactIndex != 0); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassFullBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant2 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant2, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(compiledBlock)) { + annotateobjRef(gMoveCwR(compiledBlock, TempReg), compiledBlock); + } + else { + /* begin MoveCq:R: */ + anInstruction13 = genoperandoperand(MoveCqR, compiledBlock, TempReg); + } + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + return 0; +} + + +/* Make sure that the object in reg is not forwarded. This routine assumes + the object will + never be forwarded to an immediate, as it is used to unforward literal + variables (associations). + Use the fact that isForwardedObjectClassIndexPun is a power of two to save + an instruction. */ + + /* CogObjectRepresentationForSpur>>#genEnsureObjInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *loop; + AbstractInstruction *ok; + sqInt quickConstant; + + assert(reg != scratch); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, gLabel()); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + return genEnsureOopInRegNotForwardedscratchRegjumpBackTo(reg, scratch, gLabel()); +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:jumpBackTo: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *finished; + AbstractInstruction *imm; + AbstractInstruction *ok; + sqInt quickConstant; + + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(reg != scratch); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) instruction)))); + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + jmpTarget(imm, jmpTarget(ok, finished)); + return 0; +} + + +/* Make sure that the oop in reg is not forwarded, updating the slot in + objReg with the value. + */ + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:updatingSlot:in: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *imm; + AbstractInstruction *loop; + AbstractInstruction *ok; + sqInt quickConstant; + + + /* Open-code + self genEnsureOopInRegNotForwarded: reg + scratchReg: scratch + updatingMw: index * objectMemory wordSize + objectMemory baseHeaderSize + r: objReg. + to avoid calling the store check unless the receiver is forwarded. */ + assert((reg != scratch) + && (objReg != scratch)); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); + assert((reg == Arg0Reg) + && ((scratch == TempReg) + && (objReg == ReceiverResultReg))); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckContextReceiverTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, jmpTarget(imm, gLabel())); + return 0; +} + + +/* Do the store check. Answer the argument for the benefit of the code + generator; ReceiverResultReg may be caller-saved and hence smashed by this + call. Answering + it allows the code generator to reload ReceiverResultReg cheaply. + In Spur the only thing we leave to the run-time is adding the receiver to + the remembered set and setting its isRemembered bit. */ + + /* CogObjectRepresentationForSpur>>#generateObjectRepresentationTrampolines */ +static void +generateObjectRepresentationTrampolines(void) +{ + sqInt instVarIndex; + AbstractInstruction *jumpSC; + + +# if IMMUTABILITY + for (instVarIndex = 0; instVarIndex < NumStoreTrampolines; instVarIndex += 1) { + ceStoreTrampolines[instVarIndex] = (genStoreTrampolineCalledinstVarIndex(trampolineNamenumArgslimit("ceStoreTrampoline", instVarIndex, NumStoreTrampolines - 2), instVarIndex)); + } + +# endif /* IMMUTABILITY */ + + /* begin genStoreCheckTrampoline */ + if (CheckRememberedInTrampoline) { + zeroOpcodeIndex(); + jumpSC = genCheckRememberedBitOfscratch(ReceiverResultReg, EAX); + assert(((jumpSC->opcode)) == JumpNonZero); + (jumpSC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSC, gLabel()); + } + ceStoreCheckTrampoline = genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, "ceStoreCheckTrampoline", 1, ReceiverResultReg, null, null, null, ((CallerSavedRegisterMask | (1U << ReceiverResultReg)) - (1U << ReceiverResultReg)), 1, (CallerSavedRegisterMask & (1U << ReceiverResultReg) + ? ReceiverResultReg + : (/* begin cResultRegister */ + EAX)), CheckRememberedInTrampoline); + ceStoreCheckContextReceiverTrampoline = genStoreCheckContextReceiverTrampoline(); + ceScheduleScavengeTrampoline = genTrampolineForcalledregsToSave(ceScheduleScavenge, "ceScheduleScavengeTrampoline", CallerSavedRegisterMask); + ceSmallActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, 0, "ceSmallMethodContext"); + ceSmallActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InVanillaBlock, "ceSmallBlockContext"); + ceSmallActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InFullBlock, "ceSmallFullBlockContext"); + + ceLargeActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, 0, "ceLargeMethodContext"); + ceLargeActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InVanillaBlock, "ceLargeBlockContext"); + ceLargeActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InFullBlock, "ceLargeFullBlockContext"); + + generateLowcodeObjectTrampolines(); + +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextLarge:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction24; + AbstractInstruction *anInstruction25; + AbstractInstruction *anInstruction26; + AbstractInstruction *anInstruction27; + AbstractInstruction *anInstruction28; + AbstractInstruction *anInstruction29; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction30; + AbstractInstruction *anInstruction31; + AbstractInstruction *anInstruction32; + AbstractInstruction *anInstruction33; + AbstractInstruction *anInstruction34; + AbstractInstruction *anInstruction35; + AbstractInstruction *anInstruction36; + AbstractInstruction *anInstruction37; + AbstractInstruction *anInstruction38; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt constant; + AbstractInstruction *continuation; + AbstractInstruction *exit; + usqLong header; + AbstractInstruction *jumpNeedScavenge; + AbstractInstruction *jumpSingle; + AbstractInstruction *loopHead; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + AbstractInstruction * self_in_saveAndRestoreLinkRegAround; + sqInt slotSize; + + + /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ + /* begin MoveMw:r:R: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); + /* begin JumpZero: */ + jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSingle, gLabel()); + /* begin OrCq:R: */ + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + + switch (isInBlock) { + case InFullBlock: + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); + break; + case InVanillaBlock: + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); + /* begin MoveM16:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, ClassReg); + break; + case 0: + /* begin SubCq:R: */ + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); + break; + default: + error("Case not found and no otherwise clause"); + } + slotSize = (isLarge + ? LargeContextSlots + : SmallContextSlots); + header = headerForSlotsformatclassIndex(slotSize, indexablePointersFormat(), ClassMethodContextCompactIndex); + flag("endianness"); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction10 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant2 = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin AddCq:R: */ + quickConstant4 = smallObjectBytesForSlots(slotSize); + /* begin gen:quickConstant:operand: */ + anInstruction32 = genoperandoperand(AddCqR, quickConstant4, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction13 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant5 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction33 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + /* begin JumpAboveOrEqual: */ + jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + continuation = genoperandoperand(MoveRR, FPReg, TempReg); + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction19 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SPReg, TempReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin SubCq:R: */ + quickConstant3 = 4; + /* begin gen:quickConstant:operand: */ + anInstruction20 = genoperandoperand(SubCqR, quickConstant3, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, SendNumArgsReg, TempReg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); + if (isInBlock > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin AddCq:R: */ + anInstruction29 = genoperandoperand(AddCqR, 2, TempReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + } + else { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction30 = genoperandoperand(MoveCqR, constant, TempReg); + } + } + /* begin MoveR:Mw:r: */ + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + anInstruction24 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction25 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction26 = genoperandoperand(MoveCqR, 1, ClassReg); + /* begin CmpR:R: */ + loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); + /* begin JumpGreater: */ + exit = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, ClassReg, TempReg); + /* begin AddCq:R: */ + anInstruction34 = genoperandoperand(AddCqR, 2, TempReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + /* begin AddCq:R: */ + anInstruction35 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); + /* begin SubCq:R: */ + anInstruction27 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin MoveCq:R: */ + quickConstant1 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, ClassReg); + /* begin AddCq:R: */ + anInstruction36 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + /* begin AddCq:R: */ + anInstruction37 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); + /* begin SubCq:R: */ + anInstruction28 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + loopHead = anInstruction28; + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SPReg, ClassReg); + /* begin JumpBelowOrEqual: */ + exit = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); + /* begin AddCq:R: */ + anInstruction38 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNeedScavenge, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + self_in_saveAndRestoreLinkRegAround = ((AbstractInstruction *) (backEnd())); + CallRTregistersToBeSavedMask(ceScheduleScavengeTrampoline, ((1U << ReceiverResultReg) | (1U << SendNumArgsReg)) | (1U << ClassReg)); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuation)); + return 0; +} + + +/* Get the active context into ReceiverResultReg, creating it if necessary. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt routine; + + if (isLargeContext) { + + switch (isInBlock) { + case 0: + routine = ceLargeActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceLargeActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceLargeActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + else { + + switch (isInBlock) { + case 0: + routine = ceSmallActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceSmallActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceSmallActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, routine); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetBits:ofFormatByteOf:into: */ +static sqInt NoDbgRegParms +genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); + return 0; +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetClassIndexOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return 0; +} + + +/* Fetch the class object whose index is in instReg into destReg. + It is non-obvious, but the Cogit assumes loading a class does not involve + a runtime call, so do not call classAtIndex: */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOfClassIndex:into:scratchReg: */ +static sqInt NoDbgRegParms +genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant2; + + assert(instReg != destReg); + assert(instReg != scratchReg); + assert(destReg != scratchReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); + assert(!(shouldAnnotateObjectReference(classTableRootObj()))); + /* begin MoveMw:r:R: */ + offset = (classTableRootObj()) + BaseHeaderSize; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant2 = classTableMinorIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + /* begin AddCq:R: */ + anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's class into destReg. If the instance is not the + receiver and is forwarded, follow forwarding. */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOf:into:scratchReg:instRegIsReceiver: */ +static sqInt NoDbgRegParms +genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpIsImm; + AbstractInstruction *jumpNotForwarded; + AbstractInstruction *loop; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if ((instReg == destReg) + || ((instReg == scratchReg) + || (destReg == scratchReg))) { + return BadRegisterSet; + } + /* begin MoveR:R: */ + loop = genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant1 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + /* begin JumpNonZero: */ + jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant2 = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (!instRegIsReceiver) { + + /* if it is forwarded... */ + /* begin CmpCq:R: */ + quickConstant = isForwardedObjectClassIndexPun(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); + /* begin JumpNonZero: */ + jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(jumpNotForwarded, gLabel()); + } + jmpTarget(jumpIsImm, gMoveRR(scratchReg, destReg)); + if (scratchReg == TempReg) { + /* begin PushR: */ + genoperand(PushR, instReg); + genGetClassObjectOfClassIndexintoscratchReg(destReg, instReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, destReg); + /* begin PopR: */ + genoperand(PopR, instReg); + } + else { + genGetClassObjectOfClassIndexintoscratchReg(destReg, scratchReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, scratchReg, destReg); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1); +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetCompactClassIndexNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg) +{ + return genGetClassIndexOfNonImminto(instReg, destReg); +} + + /* CogObjectRepresentationForSpur>>#genGetDoubleValueOf:into: */ +static sqInt NoDbgRegParms +genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, BaseHeaderSize, srcReg, destFPReg); + return 0; +} + + +/* Get the format field of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into: */ +static sqInt NoDbgRegParms +genGetFormatOfinto(sqInt srcReg, sqInt destReg) +{ + return genGetBitsofFormatByteOfinto(formatMask(), srcReg, destReg); +} + + +/* Get the format of the object in sourceReg into destReg. If + scratchRegOrNone is not NoReg, load at least the least significant 32-bits + (64-bits in 64-bits) of the + header word, which contains the format, into scratchRegOrNone. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into:leastSignificantHalfOfBaseHeaderIntoScratch: */ +static sqInt NoDbgRegParms +genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, sqInt destReg, sqInt scratchRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + + if (scratchRegOrNone == NoReg) { + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, destReg, scratchRegOrNone); + /* begin LogicalShiftRightCq:R: */ + quickConstant = formatShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, destReg); + } + /* begin AndCq:R: */ + quickConstant1 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); + return 0; +} + + +/* Get the size in word-sized slots of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetNumSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetNumSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jmp; + sqInt quickConstant; + + assert(srcReg != destReg); + genGetRawSlotSizeOfNonImminto(srcReg, destReg); + /* begin CmpCq:R: */ + quickConstant = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, destReg); + /* begin JumpLess: */ + jmp = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genGetOverflowSlotsOfinto(srcReg, destReg); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* The raw numSlots field is the most significant byte of the 64-bit header + word. MoveMbrR zero-extends. */ + + /* CogObjectRepresentationForSpur>>#genGetRawSlotSizeOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetRawSlotSizeOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction1; + + /* begin MoveMb:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMbrR, 7, sourceReg, destReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genJumpImmediate: */ +static AbstractInstruction * NoDbgRegParms +genJumpImmediate(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin TstCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(TstCqR, quickConstant, aRegister); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genJumpImmutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpMutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + /* begin genJumpBaseHeaderMutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpNotCharacterInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotCharacterInScratchReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + /* begin CmpCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, reg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genLcFirstFieldPointer: */ +static void NoDbgRegParms +genLcFirstFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + ssPushNativeRegister(objectReg); +} + + +/* TODO: Retrieve the number of fixed fields. */ + + /* CogObjectRepresentationForSpur>>#genLcFirstIndexableFieldPointer: */ +static void NoDbgRegParms +genLcFirstIndexableFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + ssPushNativeRegister(objectReg); +} + + +/* Check for integer */ + + /* CogObjectRepresentationForSpur>>#genLcIsBytes:to: */ +static void NoDbgRegParms +genLcIsBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBytes; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant1 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, valueReg); + /* begin JumpLess: */ + isNotBytes = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBytes, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsFloatObject:to: */ +static void NoDbgRegParms +genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsIndexable:to: */ +static void NoDbgRegParms +genLcIsIndexableto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + ssPushNativeRegister(valueReg); +} + + +/* Check for the immediate case */ + + /* CogObjectRepresentationForSpur>>#genLcIsIntegerObject:to: */ +static void NoDbgRegParms +genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseResult; + AbstractInstruction * isImmediate; + AbstractInstruction * isLargeNegativeInteger; + AbstractInstruction * isLargePositiveInteger; + sqInt quickConstant; + AbstractInstruction * trueResult; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = smallIntegerTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetClassIndexOfNonImminto(objectReg, TempReg); + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, ClassLargePositiveInteger, TempReg); + /* begin JumpNonZero: */ + isLargePositiveInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, ClassLargeNegativeInteger, TempReg); + /* begin JumpNonZero: */ + isLargeNegativeInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, valueReg, valueReg); + /* begin Jump: */ + falseResult = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + trueResult = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isLargePositiveInteger, trueResult); + jmpTarget(isLargeNegativeInteger, trueResult); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Label */ + cont = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(falseResult, cont); + jmpTarget(isImmediate, cont); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsPointers:to: */ +static void NoDbgRegParms +genLcIsPointersto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotPointers; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + /* begin JumpGreaterOrEqual: */ + isNotPointers = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotPointers, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWordsOrBytes:to: */ +static void NoDbgRegParms +genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBits; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + /* begin JumpLess: */ + isNotBits = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, 24, valueReg); + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBits, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWords:to: */ +static void NoDbgRegParms +genLcIsWordsto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotWords; + sqInt quickConstant2; + sqInt quickConstant3; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant3 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(AndCqR, quickConstant3, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + /* begin JumpNonZero: */ + isNotWords = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotWords, falseTarget); + + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:at: */ +static void NoDbgRegParms +genLcLoadObjectat(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, fieldIndex, object, object); + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:field: */ +static void NoDbgRegParms +genLcLoadObjectfield(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 8 + (BytesPerOop * fieldIndex), object, object); + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:at: */ +static void NoDbgRegParms +genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, value, fieldIndex, object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:field: */ +static void NoDbgRegParms +genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, value, 8 + (fieldIndex * BytesPerOop), object); +} + + +/* Generate a call to code that allocates a new Array of size. + The Array should be initialized with nils iff initialized is true. + The size arg is passed in SendNumArgsReg, the result + must come back in ReceiverResultReg. */ + + /* CogObjectRepresentationForSpur>>#genNewArrayOfSize:initialized: */ +static sqInt NoDbgRegParms +genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt constant; + usqLong header; + sqInt i; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant1; + AbstractInstruction *skip; + + assert(size < (numSlotsMask())); + header = headerForSlotsformatclassIndex(size, arrayFormat(), ClassArrayCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (initialized + && (size > 0)) { + /* begin genMoveConstant:R: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction7 = genoperandoperand(MoveCqR, constant, TempReg); + } + for (i = 0; i < size; i += 1) { + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); + } + } + /* begin LoadEffectiveAddressMw:r:R: */ + offset = smallObjectBytesForSlots(size); + /* begin gen:quickConstant:operand:operand: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant1 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. Do /not/ initialize the copied values. */ + + /* CogObjectRepresentationForSpur>>#genNoPopCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + usqLong header; + sqInt numSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultRega and thence in ClassReg. */ + genGetActiveContextNumArgslargeinBlock(ctxtNumArgs, isLargeCtxt, isInBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + numSlots = ClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant3 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)bcpc << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant2 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveAsCharacter */ +static sqInt +genPrimitiveAsCharacter(void) +{ + AbstractInstruction *jumpNotInt; + AbstractInstruction *jumpOutOfRange; + sqInt reg; + + if (methodOrBlockNumArgs == 0) { + reg = ReceiverResultReg; + } + else { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + reg = Arg0Reg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotInt = genJumpNotSmallInteger(reg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + jumpOutOfRange = jumpNotCharacterUnsignedValueInRegister(TempReg); + genConvertSmallIntegerToCharacterInReg(reg); + if (reg != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOutOfRange, gLabel()); + if (reg != ReceiverResultReg) { + jmpTarget(jumpNotInt, getJmpTarget(jumpOutOfRange)); + } + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genPrimitiveIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *comp; + sqInt constant; + sqInt constant1; + AbstractInstruction *jumpCmp; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin CmpR:R: */ + comp = genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + if (orNot) { + /* begin JumpZero: */ + jumpCmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + else { + /* begin JumpNonZero: */ + jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCmp, gLabel()); + if (!orNot) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, ReceiverResultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveObjectAt */ +static sqInt +genPrimitiveObjectAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt headerReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBounds; + AbstractInstruction *jumpNotHeaderIndex; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); + /* begin CmpCq:R: */ + quickConstant1 = (((usqInt)1 << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); + /* begin JumpNonZero: */ + jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, headerReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); + /* begin SubCq:R: */ + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, headerReg, Arg0Reg); + /* begin JumpAbove: */ + jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpBounds, gAddCqR(((((usqInt)1 << 1) | 1)) - (smallIntegerTag()), Arg0Reg)); + jmpTarget(jumpBadIndex, gLabel()); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: lengthOf:baseHeader:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationForSpur>>#genPrimitiveSize */ +static sqInt +genPrimitiveSize(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt jic; + sqInt jnx; + AbstractInstruction *jump32BitLongsDone; + AbstractInstruction *jumpArrayDone; + AbstractInstruction * jumpBytesDone; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsContext1; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpNotIndexable1; + AbstractInstruction * jumpShortsDone; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + + jumpImm = genJumpImmediate(ReceiverResultReg); + /* begin genGetSizeOf:into:formatReg:scratchReg:abortJumpsInto: */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, SendNumArgsReg, TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, SendNumArgsReg); + /* begin JumpZero: */ + jumpArrayDone = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpLess: */ + jumpNotIndexable1 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, SendNumArgsReg); + /* begin JumpLessOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jump32BitLongsDone = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable1, gLabel()); + /* begin Jump: */ + jumpNotIndexable1 = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpBytesDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + anInstruction6 = genoperandoperand(AndCqR, 1, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpShortsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SendNumArgsReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + /* begin JumpZero: */ + jumpIsContext1 = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, ClassReg); + genGetClassObjectOfClassIndexintoscratchReg(SendNumArgsReg, ClassReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ClassReg, SendNumArgsReg); + genConvertSmallIntegerToIntegerInReg(SendNumArgsReg); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin AndCq:R: */ + quickConstant5 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant5, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + jmpTarget(jumpArrayDone, jmpTarget(jump32BitLongsDone, jmpTarget(jumpShortsDone, jmpTarget(jumpBytesDone, gLabel())))); + jumpNotIndexable = jumpNotIndexable1; + jumpIsContext = jumpIsContext1; + + genConvertIntegerToSmallIntegerInReg(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImm, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genSetSmallIntegerTagsIn(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, scratchReg); + return 0; +} + + +/* Create a trampoline to store-check the update of the receiver in a + closure's outerContext in compileBlockFrameBuild:. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckContextReceiverTrampoline */ +static sqInt +genStoreCheckContextReceiverTrampoline(void) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg0Reg, TempReg, 0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceStoreCheckContextReceiver", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate the code for a store check of valueReg into destReg. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckReceiverReg:valueReg:scratchReg:inFrame: */ +static sqInt NoDbgRegParms +genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, sqInt scratchReg, sqInt inFrame) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt wordConstant; + + + /* Is value stored an immediate? If so we're done */ + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(valueReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, scratchReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, valueReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + assert(destReg == ReceiverResultReg); + /* begin evaluateTrampolineCallBlock:protectLinkRegIfNot: */ + if (inFrame) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + } + else { + /* begin saveAndRestoreLinkRegAround: */ + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:destReg:scratchReg:inFrame:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + if (needsStoreCheck) { + return genStoreCheckReceiverRegvalueRegscratchReginFrame(destReg, sourceReg, scratchReg, inFrame); + } + return 0; +} + + +/* This method is used for unchecked stores in objects after their creation + (typically, inlined creation of Array, closures and some temp vectors). + Currently there is no need to do the immutability check here + */ + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:intoNewObjectInDestReg: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + return 0; +} + + +/* Convention: + - RcvrResultReg holds the object mutated. + If immutability failure: + - TempReg holds the instance variable index mutated + if instVarIndex > numDedicatedStoreTrampoline + - ClassReg holds the value to store + Registers are not lived across this trampoline as the + immutability failure may need new stack frames. */ + + /* CogObjectRepresentationForSpur>>#genStoreTrampolineCalled:instVarIndex: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex) +{ + AbstractInstruction *jumpRC; + AbstractInstruction *jumpSC; + + zeroOpcodeIndex(); + jumpSC = genJumpMutablescratchReg(ReceiverResultReg, SendNumArgsReg); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceCannotAssignTowithIndexvalueToAssign, 3, ReceiverResultReg, (instVarIndex < (NumStoreTrampolines - 1) + ? (/* begin trampolineArgConstant: */ + assert(instVarIndex >= 0), + -2 - instVarIndex) + : TempReg), ClassReg, null, 0, 1, NoReg); + jmpTarget(jumpSC, gLabel()); + if (CheckRememberedInTrampoline) { + jumpRC = genCheckRememberedBitOfscratch(ReceiverResultReg, SendNumArgsReg); + assert(((jumpRC->opcode)) == JumpNonZero); + (jumpRC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + + jmpTarget(jumpRC, gLabel()); + } + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, trampolineName, 1, ReceiverResultReg, null, null, null, 0, 1, NoReg, 1); +} +#endif /* IMMUTABILITY */ + + +/* Store check code is duplicated to use a single trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityAndStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *immutableJump; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt wordConstant; + + immutableJump = genJumpImmutablescratchReg(destReg, scratchReg); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(sourceReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveCwR, wordConstant, scratchReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, sourceReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + jmpTarget(immutableJump, gLabel()); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, index, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Gen an immutability check with no store check (e.g. assigning an immediate + literal) + */ +/* imm check has its own trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityButNoStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + mutableJump = genJumpMutablescratchReg(destReg, scratchReg); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, index, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + jmpTarget(immutabilityFailure, gLabel()); + return 0; +} +#endif /* IMMUTABILITY */ + + +/* We know there is a frame as immutability check requires a frame */ +/* needRestoreRcvr has to be true to keep RcvrResultReg live with the + receiver in it across the trampoline + */ +/* Trampoline convention... */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityCheckSourceReg:slotIndex:destReg:scratchReg:needsStoreCheck:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr) +{ + assert(destReg == ReceiverResultReg); + assert(scratchReg == TempReg); + assert(sourceReg == ClassReg); + if (needsStoreCheck) { + genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + else { + genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Make sure SendNumArgsReg and ClassReg are available in addition to + ReceiverResultReg and TempReg in + genGetActiveContextNumArgs:large:inBlock:. + */ + + /* CogObjectRepresentationForSpur>>#getActiveContextAllocatesInMachineCode */ +static sqInt +getActiveContextAllocatesInMachineCode(void) +{ + return 1; +} + + +/* Since all cache tags in Spur are class indices none of + them are young or have to be updated in a scavenge. */ + + /* CogObjectRepresentationForSpur>>#inlineCacheTagIsYoung: */ +static sqInt NoDbgRegParms +inlineCacheTagIsYoung(sqInt cacheTag) +{ + return 0; +} + + /* CogObjectRepresentationForSpur>>#jumpNotCharacterUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotCharacterUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin CmpCq:R: */ + quickConstant = (1U << (numCharacterBits())) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in a machine code instruction preceding address + in cogMethodOrNil. + Answer if code was modified. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + storeLiteralbeforeFollowingAddress(backEnd(), objOop, address); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + +/* Mark and trace a literal in a sqInt variable of cogMethod. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:at: */ +static void NoDbgRegParms +markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return; + } + objOop = followForwarded(literal); + address[0] = objOop; + markAndTraceUpdatedLiteralin(objOop, cogMethod); +} + + +/* Common code to mark a literal in cogMethod and add + the cogMethod to youngReferrers if the literal is young. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceUpdatedLiteral:in: */ +static void NoDbgRegParms +markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil) +{ + if (isNonImmediate(objOop)) { + if ((cogMethodOrNil != null) + && (isYoungObject(objOop))) { + ensureInYoungReferrers(cogMethodOrNil); + } + markAndTrace(objOop); + } +} + + +/* If primIndex has an accessorDepth and fails, or it is external and fails + with PrimErrNoMemory, + call ceCheckAndMaybeRetryPrimitive if so If ceCheck.... answers true, + retry the primitive. */ + + /* CogObjectRepresentationForSpur>>#maybeCompileRetryOnPrimitiveFail: */ +static sqInt NoDbgRegParms +maybeCompileRetryOnPrimitiveFail(sqInt primIndex) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jmp; + + if ((accessorDepthForPrimitiveIndex(primIndex)) >= 0) { + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpZero: */ + jmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + } + else { + if ((primNumberExternalCall()) != primIndex) { + return 0; + } + /* begin MoveAw:R: */ + address1 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + compileCallFornumArgsargargargargresultRegregsToSave(ceCheckAndMaybeRetryPrimitive, 1, trampolineArgConstant(primIndex), null, null, null, TempReg, 0); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* Generate a shift of the register containing the class tag in a method + cache probe. + c.f. SpurMemoryManager>>methodCacheHashOf:with: */ + + /* CogObjectRepresentationForSpur>>#maybeShiftClassTagRegisterForMethodCacheProbe: */ +static sqInt NoDbgRegParms +maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg) +{ + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 2, classTagReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#numCharacterBits */ +static sqInt +numCharacterBits(void) +{ + return 30; +} + + +/* Define how many register arguments a StackToRegisterMappingCogit can + and should use with the receiver. The value must be 0, 1 or 2. Note that a + SimpleStackBasedCogit always has 0 register args (although the receiver is + passed in a register). The Spur object representation is simple enough + that implementing at:put: is straight-forward and hence 2 register args + are worth + while. The method must be inlined in CoInterpreter, and dead code + eliminated so that the register-popping enilopmarts such as + enterRegisterArgCogMethod:- at:receiver: do not have to be implemented in + SimpleStackBasedCogit. */ + + /* CogObjectRepresentationForSpur>>#numRegArgs */ +sqInt +numRegArgs(void) +{ + return 2; +} + + /* CogObjectRepresentationForSpur>>#remapObject: */ +static sqInt NoDbgRegParms +remapObject(sqInt objOop) +{ + assert(addressCouldBeObj(objOop)); + return (shouldRemapObj(objOop) + ? remapObj(objOop) + : objOop); +} + + /* CogObjectRepresentationForSpur>>#remapOop: */ +static sqInt NoDbgRegParms +remapOop(sqInt objOop) +{ + return (shouldRemapOop(objOop) + ? remapObj(objOop) + : objOop); +} + + +/* Objects in newSpace or oldSpace except nil, true, false & + classTableRootObj need to be annotated. + */ + + /* CogObjectRepresentationForSpur>>#shouldAnnotateObjectReference: */ +static sqInt NoDbgRegParms +shouldAnnotateObjectReference(sqInt anOop) +{ + return (isNonImmediate(anOop)) + && ((oopisGreaterThan(anOop, classTableRootObj())) + || (oopisLessThan(anOop, nilObject()))); +} + + /* CogObjectRepresentationForSpur>>#slotOffsetOfInstVarIndex: */ +static sqInt NoDbgRegParms +slotOffsetOfInstVarIndex(sqInt index) +{ + return (index * BytesPerWord) + BaseHeaderSize; +} + + /* CogSimStackEntry>>#ensureSpilledAt:from: */ +static SimStackEntry * NoDbgRegParms +ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg; + + if ((self_in_ensureSpilledAtfrom->spilled)) { + if (((self_in_ensureSpilledAtfrom->type)) == SSSpill) { + assert((((self_in_ensureSpilledAtfrom->offset)) == baseOffset) + && (((self_in_ensureSpilledAtfrom->registerr)) == baseRegister)); + return self_in_ensureSpilledAtfrom; + } + } + assert(((self_in_ensureSpilledAtfrom->type)) != SSSpill); + traceSpill(self_in_ensureSpilledAtfrom); + if (((self_in_ensureSpilledAtfrom->type)) == SSConstant) { + /* begin genPushConstant: */ + constant = (self_in_ensureSpilledAtfrom->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gPushCw(constant), constant); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant); + inst = anInstruction1; + } + } + else { + if (((self_in_ensureSpilledAtfrom->type)) == SSBaseOffset) { + /* begin MoveMw:r:R: */ + offset = (self_in_ensureSpilledAtfrom->offset); + baseReg = (self_in_ensureSpilledAtfrom->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + /* begin PushR: */ + inst = genoperand(PushR, TempReg); + } + else { + assert(((self_in_ensureSpilledAtfrom->type)) == SSRegister); + /* begin PushR: */ + reg = (self_in_ensureSpilledAtfrom->registerr); + inst = genoperand(PushR, reg); + } + (self_in_ensureSpilledAtfrom->type) = SSSpill; + (self_in_ensureSpilledAtfrom->offset) = baseOffset; + (self_in_ensureSpilledAtfrom->registerr) = baseRegister; + } + (self_in_ensureSpilledAtfrom->spilled) = 1; + return self_in_ensureSpilledAtfrom; +} + + /* CogSimStackEntry>>#popToReg: */ +static SimStackEntry * NoDbgRegParms +popToReg(SimStackEntry * self_in_popToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + if ((self_in_popToReg->spilled)) { + /* begin PopR: */ + inst = genoperand(PopR, reg); + } + else { + + switch ((self_in_popToReg->type)) { + case SSBaseOffset: + /* begin MoveMw:r:R: */ + offset = (self_in_popToReg->offset); + baseReg = (self_in_popToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_popToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_popToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_popToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_popToReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackEntry>>#registerMask */ +static sqInt NoDbgRegParms +registerMask(SimStackEntry * self_in_registerMask) +{ + sqInt reg; + + return ((((self_in_registerMask->type)) == SSBaseOffset) + || (((self_in_registerMask->type)) == SSRegister) + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerMaskOrNone */ +static sqInt NoDbgRegParms +registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone) +{ + sqInt reg; + + return (((self_in_registerMaskOrNone->type)) == SSRegister + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMaskOrNone->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerOrNone */ +static sqInt NoDbgRegParms +registerOrNone(SimStackEntry * self_in_registerOrNone) +{ + return (((self_in_registerOrNone->type)) == SSRegister + ? (self_in_registerOrNone->registerr) + : NoReg); +} + + /* CogSimStackEntry>>#storeToReg: */ +static SimStackEntry * NoDbgRegParms +storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + + switch ((self_in_storeToReg->type)) { + case SSBaseOffset: + case SSSpill: + /* begin MoveMw:r:R: */ + offset = (self_in_storeToReg->offset); + baseReg = (self_in_storeToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_storeToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_storeToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_storeToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_storeToReg; +} + + /* CogSimStackNativeEntry>>#ensureIsMarkedAsSpilled */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled) +{ + if (!((self_in_ensureIsMarkedAsSpilled->spilled))) { + + switch ((self_in_ensureIsMarkedAsSpilled->type)) { + case SSNativeRegister: + case SSConstantInt32: + case SSConstantNativePointer: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + case SSConstantFloat32: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + case SSConstantFloat64: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat64; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureIsMarkedAsSpilled->spilled) = 1; + return self_in_ensureIsMarkedAsSpilled; +} + + /* CogSimStackNativeEntry>>#ensureSpilledSP:scratchRegister: */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt offset4; + sqInt offset5; + sqInt offset6; + sqInt offset7; + sqInt offset8; + sqInt quickConstant; + sqInt sourceDPReg; + sqInt sourceDPReg1; + sqInt sourceReg; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + sqInt wordConstant4; + + if (!((self_in_ensureSpilledSPscratchRegister->spilled))) { + + switch ((self_in_ensureSpilledSPscratchRegister->type)) { + case SSNativeRegister: + /* begin MoveR:Mw:r: */ + sourceReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + /* begin MoveRs:M32:r: */ + sourceDPReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset1 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRsM32r, sourceDPReg, offset1, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + /* begin MoveRd:M64:r: */ + sourceDPReg1 = (self_in_ensureSpilledSPscratchRegister->registerr); + offset2 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRdM64r, sourceDPReg1, offset2, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantFloat32: + /* begin MoveCw:R: */ + wordConstant = asIEEE32BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveCwR, wordConstant, scratchRegister); + /* begin MoveR:M32:r: */ + offset3 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset3, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSConstantFloat64: + if (BytesPerWord == 4) { + /* begin MoveCw:R: */ + wordConstant1 = (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) & 0xFFFFFFFFU; + /* begin gen:literal:operand: */ + anInstruction5 = genoperandoperand(MoveCwR, wordConstant1, scratchRegister); + /* begin MoveR:M32:r: */ + offset4 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction6 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset4, spRegister); + /* begin MoveCw:R: */ + wordConstant2 = (((((sqLong) -32)) < 0) ? ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) >> -(((sqLong) -32))) : ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) << (((sqLong) -32)))); + /* begin gen:literal:operand: */ + anInstruction7 = genoperandoperand(MoveCwR, wordConstant2, scratchRegister); + /* begin MoveR:M32:r: */ + offset5 = ((-((self_in_ensureSpilledSPscratchRegister->offset))) - 1) + 4; + /* begin gen:operand:quickConstant:operand: */ + anInstruction8 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset5, spRegister); + } + else { + /* begin MoveCw:R: */ + wordConstant3 = asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + anInstruction9 = genoperandoperand(MoveCwR, wordConstant3, scratchRegister); + /* begin MoveR:Mw:r: */ + offset6 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset6, spRegister); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_ensureSpilledSPscratchRegister->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(MoveCqR, quickConstant, scratchRegister); + /* begin MoveR:Mw:r: */ + offset7 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset7, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant4 = (self_in_ensureSpilledSPscratchRegister->constantNativePointer); + /* begin gen:literal:operand: */ + anInstruction13 = genoperandoperand(MoveCwR, wordConstant4, scratchRegister); + /* begin MoveR:Mw:r: */ + offset8 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction14 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset8, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureSpilledSPscratchRegister->spilled) = 1; + return self_in_ensureSpilledSPscratchRegister; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeFloatRegisterMask */ +static sqInt NoDbgRegParms +nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask) +{ + sqInt reg; + + return ((((self_in_nativeFloatRegisterMask->type)) == SSRegisterSingleFloat) + || (((self_in_nativeFloatRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeFloatRegisterMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackNativeEntry>>#nativePopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqLong constant64Bits; + float constantFloat32; + double constantFloat64; + sqInt dpreg1; + sqInt dpreg11; + AbstractInstruction * inst; + AbstractInstruction * inst1; + AbstractInstruction * inst11; + AbstractInstruction * inst2; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt quickConstant; + sqInt reg1; + sqInt wordConstant; + sqInt wordConstant1; + + if ((self_in_nativePopToReg->spilled)) { + loadNativeFramePointerInto(TempReg); + + switch ((self_in_nativePopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, TempReg, reg); + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, TempReg, reg); + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, TempReg, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + } + else { + + switch ((self_in_nativePopToReg->type)) { + case SSNativeRegister: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRR, reg1, reg); + } + break; + case SSRegisterSingleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRs:Rs: */ + dpreg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRsRs, dpreg1, reg); + } + break; + case SSRegisterDoubleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRd:Rd: */ + dpreg11 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRdRd, dpreg11, reg); + } + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_nativePopToReg->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(MoveCqR, quickConstant, reg); + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant = (self_in_nativePopToReg->constantNativePointer); + /* begin gen:literal:operand: */ + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, reg); + break; + case SSConstantFloat32: + /* begin MoveCf32:Rs: */ + constantFloat32 = (self_in_nativePopToReg->constantFloat32); + /* begin genMoveCf32:Rs: */ + wordConstant1 = asIEEE32BitWord(constantFloat32); + /* begin gen:literal: */ + anInstruction5 = genoperand(PushCw, wordConstant1); + inst = anInstruction5; + /* begin PopRs: */ + anInstruction21 = genoperandoperandoperand(MoveM32rRs, 0, SPReg, reg); + inst1 = anInstruction21; + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, 4, SPReg); + break; + case SSConstantFloat64: + /* begin MoveCf64:Rd: */ + constantFloat64 = (self_in_nativePopToReg->constantFloat64); + /* begin genMoveCf64:Rd: */ + constant64Bits = asIEEE64BitWord(constantFloat64); + inst2 = genPushC64(backEnd, constant64Bits); + /* begin PopRd: */ + anInstruction6 = genoperandoperandoperand(MoveM64rRd, 0, SPReg, reg); + inst11 = anInstruction6; + /* begin AddCq:R: */ + anInstruction12 = genoperandoperand(AddCqR, 8, SPReg); + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToReg; +} + + /* CogSimStackNativeEntry>>#nativePopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + sqInt reg1; + sqInt reg11; + sqInt reg12; + + assert(BytesPerWord == 4); + if ((self_in_nativePopToRegsecondReg->spilled)) { + /* begin PopR: */ + genoperand(PopR, reg); + /* begin PopR: */ + genoperand(PopR, secondReg); + } + else { + + switch ((self_in_nativePopToRegsecondReg->type)) { + case SSConstantInt64: + /* begin MoveCq:R: */ + quickConstant = ((sqInt) (((self_in_nativePopToRegsecondReg->constantInt64)) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + /* begin MoveCq:R: */ + quickConstant1 = ((sqInt) ((((usqInt) ((self_in_nativePopToRegsecondReg->constantInt64))) >> 32) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, secondReg); + break; + case SSRegisterPair: + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (reg != ((self_in_nativePopToRegsecondReg->registerr))) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg1, TempReg); + } + /* begin MoveR:R: */ + reg11 = (self_in_nativePopToRegsecondReg->registerr); + genoperandoperand(MoveRR, reg11, reg); + } + if (((self_in_nativePopToRegsecondReg->registerSecond)) != secondReg) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, secondReg); + } + else { + /* begin MoveR:R: */ + reg12 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg12, secondReg); + } + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToRegsecondReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeRegisterMask */ +static sqInt NoDbgRegParms +nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask) +{ + sqInt reg; + + return ((((((self_in_nativeRegisterMask->type)) == SSBaseOffset) + || (((self_in_nativeRegisterMask->type)) == SSNativeRegister)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterSingleFloat)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeRegisterMask->registerr)), + 1U << reg) + : (((self_in_nativeRegisterMask->type)) == SSRegisterPair + ? (registerMaskFor((self_in_nativeRegisterMask->registerr))) | (registerMaskFor((self_in_nativeRegisterMask->registerSecond))) + : 0)); +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + sqInt offset1; + sqInt offset2; + + assert((self_in_nativeStackPopToReg->spilled)); + + switch ((self_in_nativeStackPopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, FPReg, reg); + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, FPReg, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToReg; +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + sqInt offset1; + + assert((self_in_nativeStackPopToRegsecondReg->spilled)); + + switch ((self_in_nativeStackPopToRegsecondReg->type)) { + case SSSpillInt64: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativeStackPopToRegsecondReg->offset))) + 4; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin MoveMw:r:R: */ + offset1 = -((self_in_nativeStackPopToRegsecondReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset1, FPReg, secondReg); + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToRegsecondReg; +} + + /* CogSimStackNativeEntry>>#spillingNeedsScratchRegister */ +static sqInt NoDbgRegParms +spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister) +{ + if (!((self_in_spillingNeedsScratchRegister->spilled))) { + + switch ((self_in_spillingNeedsScratchRegister->type)) { + case SSConstantInt32: + case SSConstantInt64: + case SSConstantFloat32: + case SSConstantFloat64: + case SSConstantNativePointer: + return 1; + + default: + return 0; + + } + } + return 0; +} + + /* CogSimStackNativeEntry>>#stackSpillSize */ +static sqInt NoDbgRegParms +stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize) +{ + + switch ((self_in_stackSpillSize->type)) { + case SSConstantInt64: + case SSConstantFloat64: + case SSRegisterDoubleFloat: + case SSRegisterPair: + case SSSpillFloat64: + case SSSpillInt64: + return 8; + + default: + return BytesPerOop; + + } + return 0; +} + + /* CogSSBytecodeFixup>>#isMergeFixup */ +static sqInt NoDbgRegParms +isMergeFixup(BytecodeFixup * self_in_isMergeFixup) +{ + return (((usqInt)((self_in_isMergeFixup->targetInstruction)))) == NeedsMergeFixupFlag; +} + + +/* Compile the jump instruction(s) at the end of the method that dispatch to + each block body. + */ + + /* SimpleStackBasedCogit>>#compileBlockDispatch */ +static sqInt +compileBlockDispatch(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpSkip; + + assert(blockCount > 0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + blockEntryNoContextSwitch = anInstruction; + /* begin Jump: */ + jumpSkip = genoperand(Jump, ((sqInt)0)); + /* begin MoveR:R: */ + blockEntryLabel = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpSkip, gLabel()); + if (blockCount > 1) { + genLoadSlotsourceRegdestReg(ClosureStartPCIndex, ReceiverResultReg, TempReg); + } + compileBlockDispatchFromto(0, blockCount - 1); + return 0; +} + + +/* After pushing the temporaries but before the stack limit check a primitive + method needs to fetch the error code, if any, and replace the last temp + with it. */ + + /* SimpleStackBasedCogit>>#compileGetErrorCode */ +static void +compileGetErrorCode(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jmpGotError; + AbstractInstruction *jmpIntError; + AbstractInstruction *jmpNoError; + sqInt primErrorTable; + sqInt primErrorTableSize; + + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpZero: */ + jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + primErrorTable = primErrTable(); + primErrorTableSize = lengthOf(primErrorTable); + flag("use CmpCqR if pc mapping means stable contexts never contain native pcs"); + /* begin CmpCw:R: */ + anInstruction4 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); + /* begin JumpAboveOrEqual: */ + jmpIntError = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + genFetchIndexRegisterfrominto(TempReg, primErrorTable, ClassReg); + /* begin Jump: */ + jmpGotError = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpIntError, gLabel()); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ClassReg); + jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address1); + jmpTarget(jmpNoError, gLabel()); +} + + +/* Compile a call to an interpreter primitive. Call the C routine with the + usual stack-switching dance, test the primFailCode and then either + return on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compileInterpreterPrimitive: */ +static sqInt NoDbgRegParms +compileInterpreterPrimitive(void (*primitiveRoutine)(void)) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + sqInt address; + sqInt address1; + sqInt address10; + sqInt address11; + sqInt address12; + sqInt address13; + sqInt address3; + sqInt address4; + sqInt address5; + sqInt address6; + sqInt address8; + sqInt address9; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction25; + AbstractInstruction *anInstruction26; + AbstractInstruction *anInstruction27; + AbstractInstruction *anInstruction28; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt callTarget; + sqInt callTarget1; + AbstractInstruction *continuePostSampleNonPrim; + AbstractInstruction *continuePostSamplePrim; + sqInt flags; + AbstractInstruction *jmp; + AbstractInstruction *jmpSampleNonPrim; + AbstractInstruction *jmpSamplePrim; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt reg; + sqInt retpc; + + + /* Save processor fp, sp and return pc in the interpreter's frame stack and instruction pointers */ + genExternalizePointersForPrimitiveCall(); + genLoadCStackPointersForPrimCall(); + flags = primitivePropertyFlags(primitiveIndex); + if (flags & PrimCallDoNotJIT) { + return ShouldNotJIT; + } + if (flags & PrimCallCollectsProfileSamples) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick if so */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSampleNonPrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSampleNonPrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + if (recordPrimTrace()) { + genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); + } + /* begin MoveCq:R: */ + anInstruction17 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address11 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction18 = genoperandoperand(MoveRAw, TempReg, address11); + if (methodOrBlockNumArgs != 0) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + } + /* begin MoveR:Aw: */ + address12 = argumentCountAddress(); + /* begin gen:operand:literal: */ + anInstruction19 = genoperandoperand(MoveRAw, TempReg, address12); + if (flags & PrimCallNeedsPrimitiveFunction) { + /* begin MoveCw:R: */ + anInstruction4 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); + /* begin MoveR:Aw: */ + address3 = primitiveFunctionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction5 = genoperandoperand(MoveRAw, TempReg, address3); + primSetFunctionLabel = anInstruction5; + } + if (flags & (PrimCallNeedsNewMethod + PrimCallMayCallBack)) { + + /* The ceActivateFailingPrimitiveMethod: machinery can't handle framelessness. */ + if (flags & PrimCallMayCallBack) { + needsFrame = 1; + } + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), ClassReg))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + /* begin MoveR:Aw: */ + address4 = newMethodAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address4); + } + /* begin PrefetchAw: */ + address13 = primFailCodeAddress(); + /* begin gen:literal: */ + anInstruction20 = genoperand(PrefetchAw, address13); + if (flags & PrimCallMayCallBack) { + + /* Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode. */ + /* On Spur ceActivateFailingPrimitiveMethod: would like to retry if forwarders + are found. So insist on PrimCallNeedsPrimitiveFunction being set too. */ + assert(flags & PrimCallNeedsPrimitiveFunction); + /* begin genSubstituteReturnAddress: */ + retpc = (flags & PrimCallCollectsProfileSamples + ? cePrimReturnEnterCogCodeProfiling + : cePrimReturnEnterCogCode); + /* begin PushCw: */ + anInstruction22 = genoperand(PushCw, retpc); + /* begin JumpFullRT: */ + /* begin annotateCall: */ + anInstruction23 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); + abstractInstruction = anInstruction23; + (abstractInstruction->annotation = IsRelativeCall); + primInvokeInstruction = abstractInstruction; + + jmp = (jmpSamplePrim = (continuePostSamplePrim = null)); + } + else { + + /* Call the C primitive routine. */ + /* begin CallFullRT: */ + /* begin annotateCall: */ + anInstruction26 = genoperand(CallFull, ((sqInt)primitiveRoutine)); + abstractInstruction1 = anInstruction26; + (abstractInstruction1->annotation = IsRelativeCall); + primInvokeInstruction = abstractInstruction1; + + if (flags & PrimCallCollectsProfileSamples) { + assert(flags & PrimCallNeedsNewMethod); + /* begin MoveAw:R: */ + address5 = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction8 = genoperandoperand(MoveAwR, address5, TempReg); + /* begin MoveAw:R: */ + address6 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction9 = genoperandoperand(MoveAwR, address6, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSamplePrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSamplePrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileRetryOnPrimitiveFail(primitiveIndex); + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = ClassReg; + /* begin gen:literal:operand: */ + anInstruction11 = genoperandoperand(MoveAwR, address8, reg); + genLoadStackPointers(backEnd); + /* begin MoveAw:R: */ + address9 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction12 = genoperandoperand(MoveAwR, address9, TempReg); + /* begin PushR: */ + genoperand(PushR, ClassReg); + + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction25 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset1 = BytesPerWord; + /* begin gen:quickConstant:operand:operand: */ + anInstruction13 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + } + if (flags & PrimCallCollectsProfileSamples) { + + /* The sample is collected by cePrimReturnEnterCogCode for external calls */ + if (!(jmpSamplePrim == null)) { + + /* Call ceCheckProfileTick: to record sample and then continue. */ + jmpTarget(jmpSamplePrim, gLabel()); + assert(flags & PrimCallNeedsNewMethod); + /* begin CallFullRT: */ + callTarget = ((usqIntptr_t)ceCheckProfileTick); + /* begin annotateCall: */ + anInstruction27 = genoperand(CallFull, callTarget); + abstractInstruction2 = anInstruction27; + (abstractInstruction2->annotation = IsRelativeCall); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSamplePrim)); + } + jmpTarget(jmpSampleNonPrim, gLabel()); + /* begin MoveCq:R: */ + anInstruction14 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address10 = newMethodAddress(); + /* begin gen:operand:literal: */ + anInstruction15 = genoperandoperand(MoveRAw, TempReg, address10); + /* begin CallFullRT: */ + callTarget1 = ((usqIntptr_t)ceCheckProfileTick); + /* begin annotateCall: */ + anInstruction28 = genoperand(CallFull, callTarget1); + abstractInstruction3 = anInstruction28; + (abstractInstruction3->annotation = IsRelativeCall); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSampleNonPrim)); + } + if (!(jmp == null)) { + + /* Jump to restore of receiver reg and proceed to frame build for failure. */ + jmpTarget(jmp, gLabel()); + /* begin MoveMw:r:R: */ + offset2 = BytesPerWord * (methodOrBlockNumArgs + (1)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction16 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + } + return 0; +} + + +/* Compile one method cache probe in an OpenPIC's lookup of selector. + Answer the jump taken if the selector probe fails. + The class tag of the receiver must be in SendNumArgsReg. ClassReg and + TempReg are used as scratch registers. + On a hit, the offset of the entry is in ClassReg. */ + + /* SimpleStackBasedCogit>>#compileOpenPICMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + annotateobjRef(gXorCwR(selector, ClassReg), selector); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + } + annotateobjRef(gCmpCwR(selector, TempReg), selector); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile the code for an open PIC. Perform a probe of the first-level + method lookup cache followed by a call of ceSendFromInLineCacheMiss: if + the probe fails. */ + + /* SimpleStackBasedCogit>>#compileOpenPIC:numArgs: */ +static void NoDbgRegParms +compileOpenPICnumArgs(sqInt selector, sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compilePICAbort(numArgs); + entry = genGetClassTagOfintoscratchReg(ReceiverResultReg, SendNumArgsReg, TempReg); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + jmpTarget(jumpBCMethod, picInterpretAbort); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + + genSmalltalkToCStackSwitch(1); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); + compileCallFornumArgsargargargargresultRegregsToSave(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, NoReg, 0); +} + + +/* Compile one method cache probe in a perform: primitive's lookup of + selector. Answer the jump taken if the selector probe fails. */ + + /* SimpleStackBasedCogit>>#compilePerformMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + /* begin XorR:R: */ + genoperandoperand(XorRR, selectorReg, ClassReg); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, selectorReg, TempReg); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile a primitive. If possible, performance-critical primtiives will + be generated by their own routines (primitiveGenerator). Otherwise, + if there is a primitive at all, we call the C routine with the usual + stack-switching dance, test the primFailCode and then either return + on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compilePrimitive */ +static sqInt +compilePrimitive(void) +{ + sqInt code; + sqInt opcodeIndexAtPrimitive; + PrimitiveDescriptor *primitiveDescriptor; + void (*primitiveRoutine)(void); + + if (primitiveIndex == 0) { + return 0; + } + + /* Note opcodeIndex so that compileFallbackToInterpreterPrimitive: + can discard arg load instructions for unimplemented primitives. */ + code = 0; + + /* If a descriptor specifies an argument count (by numArgs >= 0) then it must match + for the generated code to be correct. For example for speed many primitives use + ResultReceiverReg instead of accessing the stack, so the receiver better be at + numArgs down the stack. Use the interpreter version if not. */ + opcodeIndexAtPrimitive = opcodeIndex; + if ((((primitiveDescriptor = primitiveGeneratorOrNil())) != null) + && ((((primitiveDescriptor->primitiveGenerator)) != null) + && ((((primitiveDescriptor->primNumArgs)) < 0) + || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj)))))) { + code = ((primitiveDescriptor->primitiveGenerator))(); + } + if ((code < 0) + && (code != UnimplementedPrimitive)) { + + /* Generator failed, so no point continuing... */ + return code; + } + if (code == UnfailingPrimitive) { + return 0; + } + if ((code == CompletePrimitive) + && (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) { + return 0; + } + if (code == UnimplementedPrimitive) { + opcodeIndex = opcodeIndexAtPrimitive; + } + if ((((primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex))) == null) + || (primitiveRoutine == (functionPointerForinClass(0, null)))) { + return genFastPrimFail(); + } + minValidCallAddress = ((minValidCallAddress < (((usqInt)primitiveRoutine))) ? minValidCallAddress : (((usqInt)primitiveRoutine))); + return compileInterpreterPrimitive(primitiveRoutine); +} + + /* SimpleStackBasedCogit>>#extendedPushBytecode */ +static sqInt +extendedPushBytecode(void) +{ + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genPushReceiverVariable(variableIndex); + } + if (variableType == 1) { + return genPushTemporaryVariable(variableIndex); + } + if (variableType == 2) { + return genPushLiteralIndex(variableIndex); + } + return genPushLiteralVariable(variableIndex); +} + + /* SimpleStackBasedCogit>>#extendedStoreAndPopBytecode */ +static sqInt +extendedStoreAndPopBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(1, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#extendedStoreBytecode */ +static sqInt +extendedStoreBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(0, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFrameMark */ +static sqInt +frameOffsetOfNativeFrameMark(void) +{ + return FoxMFReceiver - BytesPerWord; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFramePointer */ +static sqInt +frameOffsetOfNativeFramePointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 3); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeStackPointer */ +static sqInt +frameOffsetOfNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 4); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfPreviousNativeStackPointer */ +static sqInt +frameOffsetOfPreviousNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 2); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfTemporary: */ +static sqInt NoDbgRegParms +frameOffsetOfTemporary(sqInt index) +{ + return (index < methodOrBlockNumArgs + ? FoxCallerSavedIP + ((methodOrBlockNumArgs - index) * BytesPerWord) + : (FoxMFReceiver - BytesPerWord) + ((methodOrBlockNumArgs - index) * BytesPerWord)); +} + + /* SimpleStackBasedCogit>>#genDoubleFailIfZeroArgRcvr:arg: */ +static AbstractInstruction * NoDbgRegParms +genDoubleFailIfZeroArgRcvrarg(int rcvrReg, int argReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, TempReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, TempReg, DPFPReg2); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg2, argReg); + return gJumpFPEqual(0); +} + + +/* Can use any of the first 32 literals for the selector and pass up to 7 + arguments. + */ + + /* SimpleStackBasedCogit>>#genExtendedSendBytecode */ +static sqInt +genExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + /* SimpleStackBasedCogit>>#genExtendedSuperBytecode */ +static sqInt +genExtendedSuperBytecode(void) +{ + return genSendSupernumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfFalse */ +static sqInt +genExtJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + +/* SistaV1: * 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ +/* Non supported in non Sista VMs */ + + /* SimpleStackBasedCogit>>#genExtJumpIfNotInstanceOfBehaviorsBytecode */ +static sqInt +genExtJumpIfNotInstanceOfBehaviorsBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfTrue */ +static sqInt +genExtJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* NewspeakV4: 221 11011101 Nop */ +/* SistaV1: 91 01011011' Nop */ + + /* SimpleStackBasedCogit>>#genExtNopBytecode */ +static sqInt +genExtNopBytecode(void) +{ + extA = (numExtB = (extB = 0)); + return 0; +} + + +/* SistaV1: 233 11101001 iiiiiiii Push Character #iiiiiiii (+ Extend B * + 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushCharacterBytecode */ +static sqInt +genExtPushCharacterBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral(characterObjectOf(value)); +} + + +/* NewsqueakV4: 229 11100101 iiiiiiii Push Integer #iiiiiiii (+ Extend B * + 256, where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + SistaV1: 232 11101000 iiiiiiii Push Integer #iiiiiiii (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtPushIntegerBytecode */ +static sqInt +genExtPushIntegerBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral((((usqInt)value << 1) | 1)); +} + + +/* 228 11100100 i i i i i i i i Push Literal #iiiiiiii (+ Extend A * 256) */ + + /* SimpleStackBasedCogit>>#genExtPushLiteralBytecode */ +static sqInt +genExtPushLiteralBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralIndex(index); +} + + +/* 227 11100011 i i i i i i i i Push Literal Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushLitVarDirSupBytecode */ +static sqInt +genExtPushLitVarDirSupBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralVariableGivenDirectedSuper(index); +} + + +/* SistaV1: * 82 01010010 Push thisContext, (then Extend B = 1 => push + thisProcess) + */ + + /* SimpleStackBasedCogit>>#genExtPushPseudoVariable */ +static sqInt +genExtPushPseudoVariable(void) +{ + sqInt ext; + + ext = extB; + extB = 0; + numExtB = 0; + + switch (ext) { + case 0: + return genPushActiveContextBytecode(); + + default: + return unknownBytecode(); + + } + return 0; +} + + +/* 226 11100010 i i i i i i i i Push Receiver Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushReceiverVariableBytecode */ +static sqInt +genExtPushReceiverVariableBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return (isReadMediatedContextInstVarIndex(index) + ? genPushMaybeContextReceiverVariable(index) + : genPushReceiverVariable(index)); +} + + +/* 238 11101110 i i i i i j j j Send Literal Selector #iiiii (+ Extend A * + 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendBytecode */ +static sqInt +genExtSendBytecode(void) +{ + sqInt litIndex; + sqInt nArgs; + + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return genSendnumArgs(litIndex, nArgs); +} + + +/* 239 11101111 i i i i i j j j Send To Superclass Literal Selector #iiiii + (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendSuperBytecode */ +static sqInt +genExtSendSuperBytecode(void) +{ + int isDirected; + sqInt litIndex; + sqInt nArgs; + + if ((isDirected = extB >= 64)) { + extB = extB & 0x3F; + } + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return (isDirected + ? genSendDirectedSupernumArgs(litIndex, nArgs) + : genSendSupernumArgs(litIndex, nArgs)); +} + + /* SimpleStackBasedCogit>>#genExtStoreAndPopRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(1); +} + + /* SimpleStackBasedCogit>>#genExtStoreRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(0); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtUnconditionalJump */ +static sqInt +genExtUnconditionalJump(void) +{ + AbstractInstruction *abstractInstruction; + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + if (distance < 0) { + return genJumpBackTo(target); + } + genJumpTo(target); + /* begin annotateBytecode: */ + abstractInstruction = lastOpcode(); + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* SimpleStackBasedCogit>>#genFastPrimFail */ +static sqInt +genFastPrimFail(void) +{ + primitiveIndex = 0; + return UnfailingPrimitive; +} + + +/* Suport for compileInterpreterPrimitive. Generate inline code so as to + record the primitive + trace as fast as possible. */ + + /* SimpleStackBasedCogit>>#genFastPrimTraceUsing:and: */ +static void NoDbgRegParms +genFastPrimTraceUsingand(sqInt r1, sqInt r2) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + sqInt offset; + sqInt wordConstant; + + /* begin MoveAb:R: */ + address = primTraceLogIndexAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAbR, address, r2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, r2, r1); + /* begin AddCq:R: */ + anInstruction5 = genoperandoperand(AddCqR, 1, r1); + /* begin MoveR:Ab: */ + address1 = primTraceLogIndexAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAb, r1, address1); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), r1))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, selector); + /* begin gen:quickConstant:operand:operand: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + /* begin MoveCw:R: */ + wordConstant = ((sqInt)(primTraceLogAddress())); + /* begin gen:literal:operand: */ + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, r1); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, r2, r1); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfFalse */ +static sqInt +genLongJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfTrue */ +static sqInt +genLongJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* 230 11100110 i i i i i i i i Push Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongPushTemporaryVariableBytecode */ +static sqInt +genLongPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte1); +} + + +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreAndPopTemporaryVariableBytecode */ +static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + + +/* 234 11101010 i i i i i i i i Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreTemporaryVariableBytecode */ +static sqInt +genLongStoreTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(0, byte1); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalBackwardJump */ +static sqInt +genLongUnconditionalBackwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance < 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpBackTo(targetpc); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalForwardJump */ +static sqInt +genLongUnconditionalForwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance >= 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpTo(targetpc); +} + + +/* Compile the code for a probe of the first-level method cache for a perform + primtiive. The selector is assumed to be in Arg0Reg. Defer to + adjustArgumentsForPerform: to + adjust the arguments before the jump to the method. */ + + /* SimpleStackBasedCogit>>#genLookupForPerformNumArgs: */ +static sqInt NoDbgRegParms +genLookupForPerformNumArgs(sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpInterpret; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + + /* N.B. Can't assume TempReg already contains the tag because a method can + of course be invoked via the unchecked entry-point, e.g. as does perform:. */ + genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, SendNumArgsReg, 0); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + + /* Adjust arguments and jump to the method's unchecked entry-point. */ + jumpInterpret = genJumpImmediate(ClassReg); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + adjustArgumentsForPerform(numArgs); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpInterpret, gLabel())); + return 0; +} + + /* SimpleStackBasedCogit>>#genMoveTrueR: */ +static AbstractInstruction * NoDbgRegParms +genMoveTrueR(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveConstant:R: */ + constant = trueObject(); + return (shouldAnnotateObjectReference(constant) + ? annotateobjRef(gMoveCwR(constant, reg), constant) + : (/* begin MoveCq:R: */ + (anInstruction = genoperandoperand(MoveCqR, constant, reg)), + anInstruction)); +} + + /* SimpleStackBasedCogit>>#genMustBeBooleanTrampolineFor:called: */ +static sqInt NoDbgRegParms +genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName) +{ + AbstractInstruction *anInstruction; + + zeroOpcodeIndex(); + assert(!(shouldAnnotateObjectReference(boolean))); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, boolean, TempReg); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSendMustBeBoolean, trampolineName, 1, TempReg, null, null, null, 0, 1, NoReg, 1); +} + + +/* Generate the substitute return code for an external or FFI primitive call. + On success simply return, extracting numArgs from newMethod. + On primitive failure call ceActivateFailingPrimitiveMethod: newMethod. */ + + /* SimpleStackBasedCogit>>#genPrimReturnEnterCogCodeEnilopmart: */ +static void NoDbgRegParms +genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + sqInt address5; + sqInt address6; + sqInt address7; + sqInt address8; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt callTarget; + AbstractInstruction *continuePostSample; + AbstractInstruction *jmpFail; + AbstractInstruction *jmpSample; + sqInt reg; + + zeroOpcodeIndex(); + if (profiling) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick: if so. + N.B. nextProfileTick is 64-bits so 32-bit systems need to test both halves. */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction2 = genoperandoperand(MoveAwR, address1, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSample = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSample = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address6 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction12 = genoperandoperand(MoveAwR, address6, TempReg); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction16 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpNonZero: */ + jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveAw:R: */ + address5 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction7 = genoperandoperand(MoveAwR, address5, ClassReg); + genLoadStackPointers(backEnd); + /* begin MoveMw:r:R: */ + anInstruction8 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, 0, SPReg); + /* begin RetN: */ + genoperand(RetN, 0); + + jmpTarget(jmpFail, gMoveAwR(newMethodAddress(), SendNumArgsReg)); + /* begin MoveAw:R: */ + address7 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction13 = genoperandoperand(MoveAwR, address7, SPReg); + compileCallFornumArgsargargargargresultRegregsToSave(ceActivateFailingPrimitiveMethod, 1, SendNumArgsReg, null, null, null, NoReg, 0); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = ClassReg; + /* begin gen:literal:operand: */ + anInstruction14 = genoperandoperand(MoveAwR, address8, reg); + genLoadStackPointers(backEnd); + /* begin MoveMw:r:R: */ + anInstruction11 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, ReceiverResultReg); + /* begin PushR: */ + genoperand(PushR, ClassReg); + + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + if (profiling) { + + /* Call ceCheckProfileTick: to record sample and then continue. newMethod + should be up-to-date. Need to save and restore the link reg around this call. */ + jmpTarget(jmpSample, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + /* begin CallFullRT: */ + callTarget = (usqIntptr_t)ceCheckProfileTick; + /* begin annotateCall: */ + anInstruction17 = genoperand(CallFull, callTarget); + abstractInstruction = anInstruction17; + (abstractInstruction->annotation = IsRelativeCall); + + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSample)); + } +} + + +/* SistaV1: 230 11100110 iiiiiiii PushNClosureTemps iiiiiiii */ + + /* SimpleStackBasedCogit>>#genPushClosureTempsBytecode */ +static sqInt +genPushClosureTempsBytecode(void) +{ + sqInt i; + + for (i = 1; i <= byte1; i += 1) { + genPushLiteral(nilObject()); + } + return 0; +} + + /* SimpleStackBasedCogit>>#genPushConstantFalseBytecode */ +static sqInt +genPushConstantFalseBytecode(void) +{ + return genPushLiteral(falseObject()); +} + + /* SimpleStackBasedCogit>>#genPushConstantNilBytecode */ +static sqInt +genPushConstantNilBytecode(void) +{ + return genPushLiteral(nilObject()); +} + + +/* 79 01001111 Push 1 */ + + /* SimpleStackBasedCogit>>#genPushConstantOneBytecode */ +static sqInt +genPushConstantOneBytecode(void) +{ + return genPushLiteral((((usqInt)1 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushConstantTrueBytecode */ +static sqInt +genPushConstantTrueBytecode(void) +{ + return genPushLiteral(trueObject()); +} + + +/* 78 01001110 Push 0 */ + + /* SimpleStackBasedCogit>>#genPushConstantZeroBytecode */ +static sqInt +genPushConstantZeroBytecode(void) +{ + return genPushLiteral((((usqInt)0 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushLiteralConstantBytecode */ +static sqInt +genPushLiteralConstantBytecode(void) +{ + return genPushLiteralIndex(byte0 & 0x1F); +} + + +/* */ + + /* SimpleStackBasedCogit>>#genPushLiteralIndex: */ +static sqInt NoDbgRegParms +genPushLiteralIndex(sqInt literalIndex) +{ + sqInt literal; + + literal = getLiteral(literalIndex); + return genPushLiteral(literal); +} + + /* SimpleStackBasedCogit>>#genPushLiteralVariableBytecode */ +static sqInt +genPushLiteralVariableBytecode(void) +{ + return genPushLiteralVariable(byte0 & 0x1F); +} + + +/* e.g. SistaV1: 16-31 0001 iiii Push Literal Variable #iiii */ + + /* SimpleStackBasedCogit>>#genPushLitVarDirSup16CasesBytecode */ +static sqInt +genPushLitVarDirSup16CasesBytecode(void) +{ + return genPushLiteralVariableGivenDirectedSuper(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushQuickIntegerConstantBytecode */ +static sqInt +genPushQuickIntegerConstantBytecode(void) +{ + return genPushLiteral((((usqInt)(byte0 - 117) << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushReceiverVariableBytecode */ +static sqInt +genPushReceiverVariableBytecode(void) +{ + return genPushReceiverVariable(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushTemporaryVariableBytecode */ +static sqInt +genPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte0 & 15); +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnConst */ +sqInt +genQuickReturnConst(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + constant = quickPrimitiveConstantFor(primitiveIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnInstVar */ +sqInt +genQuickReturnInstVar(void) +{ + sqInt index; + + index = quickPrimitiveInstVarIndexFor(primitiveIndex); + genLoadSlotsourceRegdestReg(index, ReceiverResultReg, ReceiverResultReg); + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnSelf */ +sqInt +genQuickReturnSelf(void) +{ + genUpArrowReturn(); + return UnfailingPrimitive; +} + + /* SimpleStackBasedCogit>>#genReturnFalse */ +static sqInt +genReturnFalse(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNil */ +static sqInt +genReturnNil(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNilFromBlock */ +static sqInt +genReturnNilFromBlock(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + assert(inBlock > 0); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genBlockReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnTrue */ +static sqInt +genReturnTrue(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + +/* Can use any of the first 64 literals for the selector and pass up to 3 + arguments. + */ + + /* SimpleStackBasedCogit>>#genSecondExtendedSendBytecode */ +static sqInt +genSecondExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x3F, ((usqInt) byte1) >> 6); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector0ArgsBytecode */ +static sqInt +genSendLiteralSelector0ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 0); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector1ArgBytecode */ +static sqInt +genSendLiteralSelector1ArgBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 1); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector2ArgsBytecode */ +static sqInt +genSendLiteralSelector2ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 2); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfFalse */ +static sqInt +genShortJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfTrue */ +static sqInt +genShortJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortUnconditionalJump */ +static sqInt +genShortUnconditionalJump(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpTo(target); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopLiteralVariableBytecode */ +static sqInt +genSistaExtStoreAndPopLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopReceiverVariableBytecode */ +static sqInt +genSistaExtStoreAndPopReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = 1; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreLiteralVariableBytecode */ +static sqInt +genSistaExtStoreLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreReceiverVariableBytecode */ +static sqInt +genSistaExtStoreReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = extB & 2; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorEqualsEquals */ +static sqInt +genSpecialSelectorEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(0); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorNotEqualsEquals */ +static sqInt +genSpecialSelectorNotEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(1); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorSend */ +static sqInt +genSpecialSelectorSend(void) +{ + sqInt index; + sqInt numArgs; + + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + numArgs = specialSelectorNumArgs(index); + return genSendnumArgs((-index) - 1, numArgs); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopReceiverVariableBytecode */ +static sqInt +genStoreAndPopReceiverVariableBytecode(void) +{ + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, byte0 & 7, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopRemoteTempLongBytecode */ +static sqInt +genStoreAndPopRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(1, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopTemporaryVariableBytecode */ +static sqInt +genStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte0 & 7); +} + + /* SimpleStackBasedCogit>>#genStoreRemoteTempLongBytecode */ +static sqInt +genStoreRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(0, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + +/* SistaV1: * 217 Trap */ + + /* SimpleStackBasedCogit>>#genUnconditionalTrapBytecode */ +static sqInt +genUnconditionalTrapBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#loadNativeArgumentAddress:to: */ +static void NoDbgRegParms +loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); +} + + /* SimpleStackBasedCogit>>#loadNativeFramePointerInto: */ +static void NoDbgRegParms +loadNativeFramePointerInto(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); +} + + /* SimpleStackBasedCogit>>#loadNativeLocalAddress:to: */ +static void NoDbgRegParms +loadNativeLocalAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); +} + + +/* Collect the branch and send data for cogMethod, storing it into arrayObj. */ + + /* SimpleStackBasedCogit>>#mapPCDataFor:into: */ +sqInt +mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + CogBlockMethod *cogMethod1; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + sqInt errCode; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt startbcpc; + sqInt targetPC; + + latestContinuation = 0; + introspectionDataIndex = 0; + introspectionData = arrayObj; + if (((cogMethod->stackCheckOffset)) == 0) { + assert(introspectionDataIndex == 0); + if ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + return 4; + } + /* begin mapFor:bcpc:performUntil:arg: */ + cogMethod1 = ((CogBlockMethod *) cogMethod); + startbcpc = startPCOfMethod((cogMethod->methodObject)); + assert(((cogMethod1->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); + result = pcDataForAnnotationMcpcBcpcMethod(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc)), startbcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod1->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod1->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod1); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod1->startpc))); + homeMethod = cmHomeMethod(cogMethod1); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod1)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask); + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + errCode = 0; + goto l7; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + errCode = 0; + goto l7; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = pcDataForAnnotationMcpcBcpcMethod(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))); + } + } + map -= 1; + } + errCode = 0; +l7: /* end mapFor:bcpc:performUntil:arg: */; + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + if (((cogMethod->blockEntryOffset)) != 0) { + errCode = blockDispatchTargetsForperformarg(cogMethod, pcDataForBlockEntryMethod, ((sqInt)cogMethod)); + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + } + return introspectionDataIndex; +} + + +/* If allocCheckFiller is true, words in newSpace from freeStart to + scavengeThreshold are filled with their address, and after each call of a + plugin primitive, the VM checks + that freeStart points to a word containing the value of freeStart. This is + a simple + check for primitives overwriting the ends of an object. */ + + /* SimpleStackBasedCogit>>#maybeCompileAllocFillerCheck */ +static void +maybeCompileAllocFillerCheck(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jmpOk; + + if (getCheckAllocFiller()) { + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, ClassReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpZero: */ + jmpOk = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, PrimErrWritePastObject, TempReg); + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, TempReg, address1); + jmpTarget(jmpOk, gLabel()); + } +} + + /* SimpleStackBasedCogit>>#numSpecialSelectors */ +static sqInt +numSpecialSelectors(void) +{ + return (bytecodeSetOffset == 256 + ? AltNumSpecialSelectors + : NumSpecialSelectors); +} + + +/* Collect the branch and send data for the block method starting at + blockEntryMcpc, storing it into picData. + */ + + /* SimpleStackBasedCogit>>#pcDataForBlockEntry:Method: */ +static usqInt NoDbgRegParms +pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod) +{ + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)(blockEntryMcpc - blockNoContextSwitchOffset) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)blockEntryMcpc << 1) | 1)); + introspectionDataIndex += 4; + return 0; +} + + /* SimpleStackBasedCogit>>#pcDataFor:Annotation:Mcpc:Bcpc:Method: */ +static sqInt NoDbgRegParms +pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg) +{ + sqInt actualBcpc; + usqInt actualMcpc; + + if (!(descriptor)) { + + /* this is the stackCheck offset */ + assert(introspectionDataIndex == 0); + if (((((CogMethod *) cogMethodArg))->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 4, introspectionData, (((usqInt)(bcpc + 1) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 5, introspectionData, (((((((CogMethod *) cogMethodArg))->stackCheckOffset)) << 1) | 1)); + introspectionDataIndex += 6; + return 0; + } + if ((((usqInt) isBackwardBranchAndAnnotation) >> 1) >= HasBytecodePC) { + actualBcpc = (isBackwardBranchAndAnnotation & 1 + ? bcpc + 1 + : (bcpc + ((descriptor->numBytes))) + 1); + actualMcpc = (((usqInt)mcpc)) - (((usqInt)cogMethodArg)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, (((usqInt)actualBcpc << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, ((actualMcpc << 1) | 1)); + introspectionDataIndex += 2; + } + return 0; +} + + +/* If there is a generator for the current primitive then answer it; + otherwise answer nil. */ + + /* SimpleStackBasedCogit>>#primitiveGeneratorOrNil */ +static PrimitiveDescriptor * +primitiveGeneratorOrNil(void) +{ + PrimitiveDescriptor *primitiveDescriptor; + static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = { + { 0, -1 }, + { genPrimitiveAdd, 1 }, + { genPrimitiveSubtract, 1 }, + { genPrimitiveLessThan, 1 }, + { genPrimitiveGreaterThan, 1 }, + { genPrimitiveLessOrEqual, 1 }, + { genPrimitiveGreaterOrEqual, 1 }, + { genPrimitiveEqual, 1 }, + { genPrimitiveNotEqual, 1 }, + { genPrimitiveMultiply, 1 }, + { genPrimitiveDivide, 1 }, + { genPrimitiveMod, 1 }, + { genPrimitiveDiv, 1 }, + { genPrimitiveQuo, 1 }, + { genPrimitiveBitAnd, 1 }, + { genPrimitiveBitOr, 1 }, + { genPrimitiveBitXor, 1 }, + { genPrimitiveBitShift, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveAsFloat, 0 }, + { genPrimitiveFloatAdd, 1 }, + { genPrimitiveFloatSubtract, 1 }, + { genPrimitiveFloatLessThan, 1 }, + { genPrimitiveFloatGreaterThan, 1 }, + { genPrimitiveFloatLessOrEqual, 1 }, + { genPrimitiveFloatGreaterOrEqual, 1 }, + { genPrimitiveFloatEqual, 1 }, + { genPrimitiveFloatNotEqual, 1 }, + { genPrimitiveFloatMultiply, 1 }, + { genPrimitiveFloatDivide, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveFloatSquareRoot, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveAt, 1 }, + { genPrimitiveAtPut, 2 }, + { genPrimitiveSize, 0 }, + { genPrimitiveStringAt, 1 }, + { genPrimitiveStringAtPut, 2 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genPrimitiveObjectAt, 1 }, + { 0, -1 }, + { genPrimitiveNew, 0 }, + { genPrimitiveNewWithArg, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNewMethod, 2 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitivePerform, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentical, 1 }, + { genPrimitiveClass, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveShallowCopy, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNotIdentical, 1 }, + { genPrimitiveAsCharacter, -1 }, + { genPrimitiveImmediateAsInteger, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 }, + { genPrimitiveClosureValue, 2 }, + { genPrimitiveClosureValue, 3 }, + { genPrimitiveClosureValue, 4 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 } +}; + + if (isQuickPrimitiveIndex(primitiveIndex)) { + + /* an unused one */ + primitiveDescriptor = (&(primitiveGeneratorTable[0])); + (primitiveDescriptor->primitiveGenerator = quickPrimitiveGeneratorFor(primitiveIndex)); + return primitiveDescriptor; + } + if (((primitiveIndex >= 1) && (primitiveIndex <= MaxCompiledPrimitiveIndex))) { + return (&(primitiveGeneratorTable[primitiveIndex])); + } + return null; +} + + /* SimpleStackBasedCogit>>#recordCallOffsetIn: */ +void +recordCallOffsetIn(CogMethod *cogMethod) +{ + usqIntptr_t offset; + sqInt *offsetTable; + + offset = ((primSetFunctionLabel->address)) - (((sqInt)cogMethod)); + if ((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == null) { + externalSetPrimOffsets[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == offset); + } + offsetTable = (isJump(primInvokeInstruction) + ? externalPrimJumpOffsets + : externalPrimCallOffsets); + offset = (((primInvokeInstruction->address)) + ((primInvokeInstruction->machineCodeSize))) - (((sqInt)cogMethod)); + if ((offsetTable[(cogMethod->cmNumArgs)]) == null) { + offsetTable[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((offsetTable[(cogMethod->cmNumArgs)]) == offset); + } +} + + /* SimpleStackBasedCogit>>#rewritePrimInvocationIn:to: */ +void +rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)) +{ + usqInt address; + sqInt extent; + sqInt flags; + sqInt primIndex; + + assert(((cogMethod->cmType)) == CMMethod); + primIndex = primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader)); + flags = primitivePropertyFlags(primIndex); + if (flags & PrimCallNeedsPrimitiveFunction) { + storeLiteralbeforeFollowingAddress(backEnd, ((usqInt)primFunctionPointer), (((usqInt)cogMethod)) + (externalSetPrimOffsets[(cogMethod->cmNumArgs)])); + } + if (flags & PrimCallMayCallBack) { + address = (((usqInt)cogMethod)) + (externalPrimJumpOffsets[(cogMethod->cmNumArgs)]); + extent = rewriteJumpFullAttarget(backEnd, address, ((usqInt)primFunctionPointer)); + } + else { + address = (((usqInt)cogMethod)) + (externalPrimCallOffsets[(cogMethod->cmNumArgs)]); + extent = rewriteCallFullAttarget(backEnd, address, ((usqInt)primFunctionPointer)); + } + flushICacheFromto(processor, (((usqInt)cogMethod)) + cmNoCheckEntryOffset, (((usqInt)address)) + extent); +} + + /* SimpleStackBasedCogit>>#v3:Block:Code:Size: */ +static sqInt NoDbgRegParms +v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts <= 0); + return (((sqInt)((usqInt)((fetchByteofObject(pc + 2, aMethodObj))) << 8))) + (fetchByteofObject(pc + 3, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)(((fetchByteofObject(pc, aMethodObj)) & 3)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)((((fetchByteofObject(pc, aMethodObj)) & 7) - 4)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* N.B. This serves for both BlueBook/V3 and V4 short jumps. */ + + /* SimpleStackBasedCogit>>#v3:ShortForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return ((fetchByteofObject(pc, aMethodObj)) & 7) + 1; +} + + +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* SimpleStackBasedCogit>>#v4:Block:Code:Size: */ +static sqInt NoDbgRegParms +v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt byteOne; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + + /* If nExts < 0 it isn't known and we rely on the number of extensions encoded in the eeiiikkk byte. */ + byteOne = fetchByteofObject(pc + 1, aMethodObj); + assert((nExts < 0) + || (nExts == (((usqInt) byteOne) >> 6))); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - (((usqInt) byteOne) >> 6)) - (((usqInt) byteOne) >> 6); + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend A * 256) + */ +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend A * 256) + */ + + /* SimpleStackBasedCogit>>#v4:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* ** 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#v4:Long:BranchIfNotInstanceOf:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#v4:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + /* SimpleStackBasedCogit>>#voidCogCompiledCode */ +void +voidCogCompiledCode(void) +{ + sqInt i; + + clearCogCompiledCode(); + for (i = 0; i <= MaxNumArgs; i += 1) { + externalPrimJumpOffsets[i] = null; + externalPrimCallOffsets[i] = null; + externalSetPrimOffsets[i] = null; + } +} + + +/* Add a blockStart for an embedded block. For a binary tree walk block + dispatch blocks must be compiled in pc/depth-first order but are scanned + in breadth-first + order, so do an insertion sort (which of course is really a bubble sort + because we + have to move everything higher to make room). */ + + /* StackToRegisterMappingCogit>>#addBlockStartAt:numArgs:numCopied:span: */ +static BlockStart * NoDbgRegParms +addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span) +{ + BlockStart *blockStart; + sqInt i; + sqInt j; + + + /* Transcript ensureCr; nextPutAll: 'addBlockStartAt: '; print: bytecodepc; cr; flush. */ + if (blockCount > 0) { + i = blockCount - 1; + while (1) { + + /* check for repeat addition during recompilation due to initialNil miscount. */ + blockStart = (&(blockStarts[i])); + if (((blockStart->startpc)) == bytecodepc) { + return blockStart; + } + if (!((((blockStart->startpc)) > bytecodepc) + && (i > 0))) break; + i -= 1; + } + for (j = blockCount; j >= (i + 1); j += -1) { + blockStarts[j] = (blockStarts[j - 1]); + } + blockStart = (&(blockStarts[i + 1])); + } + else { + blockStart = (&(blockStarts[blockCount])); + } + blockCount += 1; + (blockStart->startpc = bytecodepc); + (blockStart->numArgs = numArgs); + (blockStart->numCopied = numCopied); + (blockStart->numInitialNils = 0); + (blockStart->stackCheckLabel = null); + (blockStart->hasInstVarRef = 0); + (blockStart->span = span); + return blockStart; +} + + +/* e.g. Receiver Receiver or Receiver Receiver (RISC) + Selector/Arg0 => Arg1 Selector/Arg0 => Arg1 + Arg1 Arg2 Arg1 Arg2 + Arg2 Arg3 Arg2 sp-> Arg3 + Arg3 sp-> retpc sp-> Arg3 + sp-> retpc */ +/* Generate code to adjust the possibly stacked arguments immediately + before jumping to a method looked up by a perform primitive. */ + + /* StackToRegisterMappingCogit>>#adjustArgumentsForPerform: */ +static void NoDbgRegParms +adjustArgumentsForPerform(sqInt numArgs) +{ + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + sqInt index; + + assert((numRegArgs()) <= 2); + assert(numArgs >= 1); + if (numArgs <= 2) { + if (numArgs == 2) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, Arg0Reg); + } + return; + } + if ((2 + 1) == numArgs) { + /* begin MoveMw:r:R: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg1Reg); + /* begin MoveMw:r:R: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, BytesPerWord * 2, SPReg, Arg0Reg); + + /* begin AddCq:R: */ + anInstruction14 = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); + + return; + } + for (index = (numArgs - 1); index >= 1; index += -1) { + /* begin MoveMw:r:R: */ + anInstruction10 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); + } + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, SPReg); + +} + + +/* If the stack entry is already in a register not conflicting with regMask, + answers it, + else allocate a new register not conflicting with reg mask + */ + + /* StackToRegisterMappingCogit>>#allocateRegForStackEntryAt:notConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask) +{ + sqInt mask; + CogSimStackEntry *stackEntry; + + stackEntry = ssValue(index); + mask = registerMaskOrNone(stackEntry); + if ((mask != 0) + && ((mask & regMask) == 0)) { + return registerOrNone(stackEntry); + } + return allocateRegNotConflictingWith(regMask); +} + + +/* if there's a free register, use it */ + + /* StackToRegisterMappingCogit>>#allocateRegNotConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegNotConflictingWith(sqInt regMask) +{ + sqInt reg; + + reg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (reg == NoReg) { + + /* No free register, choose one that does not conflict with regMask */ + reg = freeAnyRegNotConflictingWith(regMask); + } + if (reg == ReceiverResultReg) { + + /* If we've allocated RcvrResultReg, it's not live anymore */ + voidReceiverResultRegContainsSelf(); + } + return reg; +} + + /* StackToRegisterMappingCogit>>#anyReferencesToRegister:inTopNItems: */ +static sqInt NoDbgRegParms +anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n) +{ + sqInt i; + sqInt regMask; + + /* begin registerMaskFor: */ + regMask = 1U << reg; + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((registerMask(simStackAt(i))) & regMask) { + return 1; + } + } + return 0; +} + + +/* Store the smalltalk pointers */ + + /* StackToRegisterMappingCogit>>#beginHighLevelCall: */ +static void NoDbgRegParms +beginHighLevelCall(sqInt alignment) +{ + sqInt actualAlignment; + sqInt address1; + sqInt address2; + sqInt address3; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqInt mask; + sqInt offset; + + ssFlushAll(); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, SPReg, address1); + /* begin MoveR:Aw: */ + address2 = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, FPReg, address2); + /* begin MoveAw:R: */ + address3 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address3, SPReg); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, offset, FPReg, FPReg); + /* begin SubCq:R: */ + anInstruction5 = genoperandoperand(SubCqR, 1, FPReg); + actualAlignment = ((alignment < BytesPerWord) ? BytesPerWord : alignment); + if (actualAlignment > BytesPerWord) { + mask = -actualAlignment; + /* begin AndCq:R: */ + anInstruction6 = genoperandoperand(AndCqR, mask, SPReg); + } + currentCallCleanUpSize = 0; +} + + +/* This is a static version of ceCallCogCodePopReceiverArg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg0Regs */ +void +callCogCodePopReceiverArg0Regs(void) +{ + realCECallCogCodePopReceiverArg0Regs(); +} + + +/* This is a static version of ceCallCogCodePopReceiverArg1Arg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg1Arg0Regs */ +void +callCogCodePopReceiverArg1Arg0Regs(void) +{ + realCECallCogCodePopReceiverArg1Arg0Regs(); +} + + /* StackToRegisterMappingCogit>>#callSwitchToCStack */ +static sqInt +callSwitchToCStack(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + + /* begin MoveAw:R: */ + address = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, FPReg); + return 0; +} + + +/* Restore the link register */ + + /* StackToRegisterMappingCogit>>#callSwitchToSmalltalkStack */ +static void +callSwitchToSmalltalkStack(void) +{ + genLoadStackPointers(backEnd); +} + + +/* Loop over bytecodes, dispatching to the generator for each bytecode, + handling fixups in due course. + */ + + /* StackToRegisterMappingCogit>>#compileAbstractInstructionsFrom:through: */ +static sqInt NoDbgRegParms +compileAbstractInstructionsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + BytecodeFixup *fixup; + sqInt generateBranchAround; + sqInt nExts; + sqInt nextOpcodeIndex; + sqInt result; + + traceSimStack(); + bytecodePC = start; + nExts = (result = 0); + descriptor = null; + deadCode = 0; + while (1) { + fixup = fixupAt(bytecodePC - initialPC); + mergeWithFixupIfRequired(fixup); + /* begin assertCorrectSimStackPtr */ + descriptor = loadBytesAndGetDescriptor(); + nextOpcodeIndex = opcodeIndex; + result = (deadCode + ? mapDeadDescriptorIfNeeded(descriptor) + : ((descriptor->generator))()); + /* begin assertExtsAreConsumed: */ + if (!((descriptor->isExtension))) { + assert((extA == 0) + && ((extB == 0) + && (numExtB == 0))); + } + traceDescriptor(descriptor); + traceSimStack(); + /* begin patchFixupTargetIfNeeded:nextOpcodeIndex: */ + if ((((((usqInt)((fixup->targetInstruction)))) >= NeedsNonMergeFixupFlag) && ((((usqInt)((fixup->targetInstruction)))) <= NeedsMergeFixupFlag))) { + + /* There is a fixup for this bytecode. It must point to the first generated + instruction for this bytecode. If there isn't one we need to add a label. */ + if (opcodeIndex == nextOpcodeIndex) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (fixup->targetInstruction = abstractInstructionAt(nextOpcodeIndex)); + } + /* begin maybeDumpLiterals: */ + if ((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn))) { + /* begin dumpLiterals: */ + generateBranchAround = !((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn))); + } + /* begin nextBytecodePCFor:exts: */ + bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) + : 0)); + if (!((result == 0) + && (bytecodePC <= end))) break; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + /* begin checkEnoughOpcodes */ + if (opcodeIndex > numAbstractOpcodes) { + error("Cog JIT internal error. Too many abstract opcodes. Num opcodes heuristic is too optimistic."); + } + return result; +} + + /* StackToRegisterMappingCogit>>#compileBlockBodies */ +static sqInt +compileBlockBodies(void) +{ + BlockStart *blockStart; + sqInt compiledBlocksCount; + sqInt i; + sqInt initialCounterIndex; + sqInt initialOpcodeIndex; + sqInt initialStackPtr; + sqInt result; + sqInt savedNeedsFrame; + sqInt savedNumArgs; + sqInt savedNumTemps; + + assert(blockCount > 0); + savedNeedsFrame = needsFrame; + savedNumArgs = methodOrBlockNumArgs; + savedNumTemps = methodOrBlockNumTemps; + inBlock = InVanillaBlock; + compiledBlocksCount = 0; + while (compiledBlocksCount < blockCount) { + blockPass = 1; + blockStart = blockStartAt(compiledBlocksCount); + if (((result = scanBlock(blockStart))) < 0) { + return result; + } + initialOpcodeIndex = opcodeIndex; + + /* for SistaCogit */ + initialCounterIndex = 0; + while (1) { + compileBlockEntry(blockStart); + initialStackPtr = simStackPtr; + if (((result = compileAbstractInstructionsFromthrough(((blockStart->startpc)) + (pushNilSizenumInitialNils(methodObj, (blockStart->numInitialNils))), (((blockStart->startpc)) + ((blockStart->span))) - 1))) < 0) { + return result; + } + if (initialStackPtr == simStackPtr) break; + assert(initialStackPtr > simStackPtr); + + /* for asserts :-( */ + blockPass += 1; + (blockStart->numInitialNils = (((blockStart->numInitialNils)) + simStackPtr) - initialStackPtr); + (((blockStart->fakeHeader))->dependent = null); + reinitializeFixupsFromthrough(((blockStart->startpc)) + ((blockStart->numInitialNils)), (((blockStart->startpc)) + ((blockStart->span))) - 1); + bzero(abstractOpcodes + initialOpcodeIndex, + (opcodeIndex - initialOpcodeIndex) * sizeof(AbstractInstruction)); + opcodeIndex = initialOpcodeIndex; + } + compiledBlocksCount += 1; + } + needsFrame = savedNeedsFrame; + methodOrBlockNumArgs = savedNumArgs; + methodOrBlockNumTemps = savedNumTemps; + return 0; +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any, and to correctly + initialize the explicitly nilled/pushed temp entries (they are /not/ of + type constant nil). */ + + /* StackToRegisterMappingCogit>>#compileBlockFrameBuild: */ +static void NoDbgRegParms +compileBlockFrameBuild(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction * cascade0; + sqInt constant; + sqInt constant1; + sqInt i; + sqInt ign; + + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + cascade0 = (blockStart->fakeHeader); + addDependent(cascade0, annotateAbsolutePCRef(gPushCw(((sqInt)((blockStart->fakeHeader)))))); + /* begin setLabelOffset: */ + ((cascade0->operands))[1] = MFMethodFlagIsBlockFlag; + annotateobjRef(gPushCw(nilObject()), nilObject()); + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, Arg0Reg); + genLoadSlotsourceRegdestReg(ReceiverIndex, Arg0Reg, ReceiverResultReg); + } + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < ((blockStart->numCopied)); i += 1) { + genLoadSlotsourceRegdestReg(i + ClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + (blockStart->stackCheckLabel = annotateBytecode(gLabel())); + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramefulMethod((blockStart->startpc)); + if (((blockStart->numInitialNils)) > 0) { + if (((blockStart->numInitialNils)) > 1) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); + } + for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { + /* begin PushR: */ + genoperand(PushR, TempReg); + } + } + else { + /* begin genPushConstant: */ + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant1); + } + } + } +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. We must annotate the + first instruction in vanilla blocks so that + findMethodForStartBcpc:inHomeMethod: can function. We need two annotations + because the first is a fiducial. */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileBlockFramelessEntry: */ +static void NoDbgRegParms +compileBlockFramelessEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramelessBlock((blockStart->startpc)); + if (!(((blockStart->entryLabel)) == null)) { + /* begin annotateBytecode: */ + abstractInstruction = (blockStart->entryLabel); + (abstractInstruction->annotation = HasBytecodePC); + /* begin annotateBytecode: */ + abstractInstruction1 = (blockStart->entryLabel); + (abstractInstruction1->annotation = HasBytecodePC); + } + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, TempReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, TempReg, ReceiverResultReg); + } +} + + /* StackToRegisterMappingCogit>>#compileCogFullBlockMethod: */ +static CogMethod * NoDbgRegParms +compileCogFullBlockMethod(sqInt numCopied) +{ + usqIntptr_t allocBytes; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = isYoungObject(methodObj); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = InFullBlock; + postCompileHook = null; + maxLitIndex = -1; + assert((primitiveIndexOf(methodObj)) == 0); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = numBytesOf(methodObj); + numBytecodes = (endPC - initialPC) + 1; + primitiveIndex = 0; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + 10) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + flag("TODO"); + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + assert(numBlocks == 0); + numCleanBlocks = scanForCleanBlocks(); + assert(numCleanBlocks == 0); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireFullBlockMethod(numCopied))) < 0) { + return ((CogMethod *) result); + } + return generateCogFullBlock(); +} + + /* StackToRegisterMappingCogit>>#compileCogMethod: */ +static CogMethod * NoDbgRegParms +compileCogMethod(sqInt selector) +{ + usqIntptr_t allocBytes; + int extra; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = (isYoungObject(methodObj)) + || (isYoung(selector)); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = 0; + postCompileHook = null; + maxLitIndex = -1; + extra = ((((primitiveIndex = primitiveIndexOf(methodObj))) > 0) + && (!(isQuickPrimitiveIndex(primitiveIndex))) + ? 30 + : 10); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = (isQuickPrimitiveIndex(primitiveIndex) + ? initialPC - 1 + : numBytesOf(methodObj)); + numBytecodes = (endPC - initialPC) + 1; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + extra) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + numCleanBlocks = scanForCleanBlocks(); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireMethod())) < 0) { + return ((CogMethod *) result); + } + return generateCogMethod(selector); +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Compile the abstract instructions for the entire method, including blocks. */ + + /* StackToRegisterMappingCogit>>#compileEntireMethod */ +static sqInt +compileEntireMethod(void) +{ + sqInt result; + + regArgsHaveBeenPushed = 0; + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileAbort(); + compileEntry(); + if (((result = compilePrimitive())) < 0) { + return result; + } + compileFrameBuild(); + if (((result = compileMethodBody())) < 0) { + return result; + } + if (blockCount == 0) { + return 0; + } + if (((result = compileBlockBodies())) < 0) { + return result; + } + return compileBlockDispatch(); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#compileFrameBuild */ +static void +compileFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction *jumpSkip; + + +# if IMMUTABILITY + if (useTwoPaths) { + compileTwoPathFrameBuild(); + return; + } + +# endif /* IMMUTABILITY */ + + if (!needsFrame) { + if (useTwoPaths) { + compileTwoPathFramelessInit(); + } + initSimStackForFramelessMethod(initialPC); + return; + } + assert(!(useTwoPaths)); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. */ +/* Use ReceiverResultReg for Context to agree with store check trampoline */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileFullBlockFramelessEntry: */ +static void NoDbgRegParms +compileFullBlockFramelessEntry(sqInt numCopied) +{ + initSimStackForFramelessBlock(initialPC); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + flag("TODO"); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ + + /* StackToRegisterMappingCogit>>#compileFullBlockMethodFrameBuild: */ +static void NoDbgRegParms +compileFullBlockMethodFrameBuild(sqInt numCopied) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt constant; + sqInt i; + sqInt iLimiT; + + if (useTwoPaths) { + + /* method with only inst var store, we compile only slow path for now */ + useTwoPaths = 0; + +# if IMMUTABILITY + needsFrame = 1; + +# endif /* IMMUTABILITY */ + + } + if (!needsFrame) { + assert(numCopied == 0); + compileFullBlockFramelessEntry(numCopied); + initSimStackForFramelessBlock(initialPC); + return; + } + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin setLabelOffset: */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = MFMethodFlagIsBlockFlag; + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + flag("TODO"); + genLoadSlotsourceRegdestReg(FullClosureReceiverIndex, ClassReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, FullClosureReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < numCopied; i += 1) { + genLoadSlotsourceRegdestReg(i + FullClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + for (i = ((methodOrBlockNumArgs + numCopied) + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + stackCheckLabel = abstractInstruction; + initSimStackForFramefulMethod(initialPC); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* We are in a method where the frame is needed *only* for instance variable + store, typically a setter method. + This case has 20% overhead with Immutability compared to setter without + immutability because of the stack + frame creation. We compile two path, one where the object is immutable, + one where it isn't. At the beginning + of the frame build, we take one path or the other depending on the + receiver mutability. + + Note: this specific case happens only where there are only instance + variabel stores. We could do something + similar for literal variable stores, but we don't as it's too uncommon. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFrameBuild */ +#if IMMUTABILITY +static void +compileTwoPathFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction * jumpImmutable; + AbstractInstruction * jumpOld; + AbstractInstruction *jumpSkip; + sqInt quickConstant; + + assert(useTwoPaths); + assert(blockCount == 0); + jumpImmutable = genJumpImmutablescratchReg(ReceiverResultReg, TempReg); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + assert(!needsFrame); + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l7; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l7: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + needsFrame = 1; + jmpTarget(jumpOld, jmpTarget(jumpImmutable, gLabel())); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} +#endif /* IMMUTABILITY */ + + +/* We are in a frameless method with at least two inst var stores. We compile + two paths, + one where the object is in new space, and one where it isn't. At the + beginning + of the method, we take one path or the other depending on the receiver + being in newSpace. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFramelessInit */ +static void +compileTwoPathFramelessInit(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * jumpOld; + sqInt quickConstant; + + assert(!(IMMUTABILITY)); + assert(!(needsFrame)); + assert(useTwoPaths); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l1; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l1: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + jmpTarget(jumpOld, gLabel()); +} + + /* StackToRegisterMappingCogit>>#cPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +cPICMissTrampolineFor(sqInt numArgs) +{ + return picMissTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + +/* Replaces the Blue Book double-extended send [132], in which the first byte + was wasted on 8 bits of argument count. + Here we use 3 bits for the operation sub-type (opType), and the remaining + 5 bits for argument count where needed. + The last byte give access to 256 instVars or literals. + See also secondExtendedSendBytecode + */ + + /* StackToRegisterMappingCogit>>#doubleExtendedDoAnythingBytecode */ +static sqInt +doubleExtendedDoAnythingBytecode(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + sqInt opType; + + opType = ((usqInt) byte1) >> 5; + if (opType == 0) { + return genSendnumArgs(byte2, byte1 & 0x1F); + } + if (opType == 1) { + return genSendSupernumArgs(byte2, byte1 & 0x1F); + } + + switch (opType) { + case 2: + if (isReadMediatedContextInstVarIndex(byte2)) { + genPushMaybeContextReceiverVariable(byte2); + } + else { + genPushReceiverVariable(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + break; + case 3: + genPushLiteralIndex(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction1 = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + + case 4: + genPushLiteralVariable(byte2); + break; + case 7: + genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + + break; + default: + + /* 5 & 6 */ + if (isWriteMediatedContextInstVarIndex(byte2)) { + genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + else { + genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + +; + } + assert(needsFrame); + assert(!(prevInstIsPCAnnotated())); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#duplicateTopBytecode */ +static sqInt +duplicateTopBytecode(void) +{ + SimStackEntry desc; + + desc = ssTopDescriptor(); + return ssPushDesc(desc); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithCleanup */ +static void +endHighLevelCallWithCleanup(void) +{ + AbstractInstruction *anInstruction; + + if (currentCallCleanUpSize > 0) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, currentCallCleanUpSize, SPReg); + } + callSwitchToSmalltalkStack(); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithoutCleanup */ +static void +endHighLevelCallWithoutCleanup(void) +{ + callSwitchToSmalltalkStack(); +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + traceFixup(fixup); + if ((((usqInt)((fixup->targetInstruction)))) <= NeedsNonMergeFixupFlag) { + + /* convert a non-merge into a merge */ + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + + /* this is the target of a backward branch and + so doesn't have a simStackPtr assigned yet. */ + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + assert(((fixup->simStackPtr)) == simStackPtr); + assert(((fixup->simNativeStackPtr)) == simNativeStackPtr); + assert(((fixup->simNativeStackSize)) == simNativeStackSize); + + } + } + /* begin recordBcpc: */ + return fixup; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureNonMergeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureNonMergeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + if (((fixup->targetInstruction)) == 0) { + /* begin becomeNonMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsNonMergeFixupFlag); + } + /* begin recordBcpc: */ + return fixup; +} + + /* StackToRegisterMappingCogit>>#ensureReceiverResultRegContainsSelf */ +static void +ensureReceiverResultRegContainsSelf(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + ssAllocateRequiredReg(ReceiverResultReg); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + (optStatus.isReceiverResultRegLive = 1); + } + else { + assert((((simSelf.type)) == SSRegister) + && (((simSelf.registerr)) == ReceiverResultReg)); + assert(((optStatus.isReceiverResultRegLive)) + && (((optStatus.ssEntry)) == ((&simSelf)))); + } +} + + /* StackToRegisterMappingCogit>>#evaluate:at: */ +static void NoDbgRegParms +evaluateat(BytecodeDescriptor *descriptor, sqInt pc) +{ + byte0 = fetchByteofObject(pc, methodObj); + assert(descriptor == (generatorAt(bytecodeSetOffset + byte0))); + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); +} + + +/* Spill the closest register on stack not conflicting with regMask. + Assertion Failure if regMask has already all the registers */ + + /* StackToRegisterMappingCogit>>#freeAnyRegNotConflictingWith: */ +static sqInt NoDbgRegParms +freeAnyRegNotConflictingWith(sqInt regMask) +{ + CogSimStackEntry *desc; + sqInt index; + sqInt reg; + + assert(needsFrame); + reg = NoReg; + index = ((simSpillBase < 0) ? 0 : simSpillBase); + while ((reg == NoReg) + && (index < simStackPtr)) { + desc = simStackAt(index); + if (((desc->type)) == SSRegister) { + if (!(regMask & (registerMaskFor((desc->registerr))))) { + reg = (desc->registerr); + } + } + index += 1; + } + assert(!((reg == NoReg))); + ssAllocateRequiredReg(reg); + return reg; +} + + +/* Return from block, assuming result already loaded into ReceiverResultReg. */ +/* Return from block, assuming result already loaded into ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#genBlockReturn */ +static sqInt +genBlockReturn(void) +{ + if (needsFrame) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + } + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + + /* can't fall through */ + deadCode = 1; + return 0; +} + + +/* Generate special versions of the ceCallCogCodePopReceiverAndClassRegs + enilopmart that also pop register args from the stack to undo the pushing + of register args in the abort/miss trampolines. */ + + /* StackToRegisterMappingCogit>>#genCallPICEnilopmartNumArgs: */ +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) + +{ + sqInt endAddress; + sqInt enilopmart; + sqInt reg; + sqInt size; + + zeroOpcodeIndex(); + genLoadStackPointers(backEnd); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin PopR: */ + reg = SendNumArgsReg; + genoperand(PopR, reg); + if (numArgs > 0) { + if (numArgs > 1) { + /* begin PopR: */ + genoperand(PopR, Arg1Reg); + assert((numRegArgs()) == 2); + } + /* begin PopR: */ + genoperand(PopR, Arg0Reg); + } + /* begin PopR: */ + genoperand(PopR, ReceiverResultReg); + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + + /* begin JumpR: */ + genoperand(JumpR, TempReg); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineNamenumRegArgs("ceCallPIC", numArgs), enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after + execution. See EncoderForSistaV1's class comment and + StackInterpreter>>#inlinePrimitiveBytecode: + */ + + /* StackToRegisterMappingCogit>>#genCallPrimitiveBytecode */ +static sqInt +genCallPrimitiveBytecode(void) +{ + sqInt prim; + sqInt primSet; + + if (byte2 < 128) { + return (bytecodePC == initialPC + ? 0 + : EncounteredUnknownBytecode); + } + prim = (((sqInt)((usqInt)((byte2 - 128)) << 8))) + byte1; + primSet = (((usqInt) prim) >> 13) & 3; + prim = prim & 0x1FFF; + if (primSet == 1) { + if (prim < 1000) { + return genLowcodeNullaryInlinePrimitive(prim); + } + if (prim < 2000) { + return genLowcodeUnaryInlinePrimitive(prim - 1000); + } + if (prim < 3000) { + return genLowcodeBinaryInlinePrimitive(prim - 2000); + } + if (prim < 4000) { + return genLowcodeTrinaryInlinePrimitive(prim - 3000); + } + } + + return EncounteredUnknownBytecode; +} + + +/* Override to push the register receiver and register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#genExternalizePointersForPrimitiveCall */ +static sqInt +genExternalizePointersForPrimitiveCall(void) +{ + sqInt address2; + sqInt address3; + sqInt address4; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + + genPushRegisterArgs(); + /* begin MoveR:Aw: */ + address4 = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction4 = genoperandoperand(MoveRAw, FPReg, address4); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Aw: */ + address2 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address2); + /* begin MoveR:Aw: */ + address3 = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, SPReg, address3); + + return 0; +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* StackToRegisterMappingCogit>>#genExtPushClosureBytecode */ +static sqInt +genExtPushClosureBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); + extA = (numExtB = (extB = 0)); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* Full Block creation compilation. The block's actual code will be compiled + separatedly. + */ +/* * 255 11111111 xxxxxxxx siyyyyyy push Closure Compiled block literal + index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 + ignoreOuterContext: i = 1 + */ + + /* StackToRegisterMappingCogit>>#genExtPushFullClosureBytecode */ +static sqInt +genExtPushFullClosureBytecode(void) +{ + sqInt compiledBlock; + sqInt i; + int ignoreContext; + sqInt numCopied; + int receiverIsOnStack; + sqInt reg; + + assert(needsFrame); + compiledBlock = getLiteral(byte1 + (((sqInt)((usqInt)(extA) << 8)))); + extA = 0; + numCopied = byte2 & ((1U << 6) - 1); + receiverIsOnStack = byte2 & (1U << 7); + ignoreContext = byte2 & (1U << 6); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(compiledBlock, argumentCountOf(compiledBlock), numCopied, ignoreContext, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (FullClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + if (receiverIsOnStack) { + reg = ssStorePoptoPreferredReg(1, TempReg); + } + else { + storeToReg((&simSelf), (reg = TempReg)); + } + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, FullClosureReceiverIndex, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genExtPushRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtPushRemoteTempOrInstVarLongBytecode(void) +{ + sqInt index; + sqInt maybeContext; + + return ((byte2 & (remoteIsInstVarAccess())) == 0 + ? genPushRemoteTempLongBytecode() + : (/* begin extBSpecifiesMaybeContext */ + (maybeContext = extB & 2), + (index = byte1 + (((sqInt)((usqInt)(extA) << 8)))), + (extA = 0), + (extB = 0), + (numExtB = 0), + ((isReadMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genPushMaybeContextRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess())) + : genPushRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess()))))); +} + + /* StackToRegisterMappingCogit>>#genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean: */ +static sqInt NoDbgRegParms +genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesMaybeContext */ + maybeContext = extB & 2; + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + extB = 0; + numExtB = 0; + if ((byte2 & (remoteIsInstVarAccess())) == 0) { + genStorePopRemoteTempAtneedsStoreCheck(boolean, byte1, byte2, needsStoreCheck); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + } + else { + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + if ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext)) { + genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + else { + genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + } + return 0; +} + + +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). + */ +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). Override to add version for generic and PIC-specific entry + with reg args. */ + + /* StackToRegisterMappingCogit>>#generateEnilopmarts */ +static void +generateEnilopmarts(void) +{ + +# if Debug + /* begin genEnilopmartFor:forCall:called: */ + realCEEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "realCEEnterCogCodePopReceiverReg"); + ceEnterCogCodePopReceiverReg = enterCogCodePopReceiver; + /* begin genEnilopmartFor:forCall:called: */ + realCECallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "realCEEnterCogCodePopReceiverReg"); + ceCallCogCodePopReceiverReg = callCogCodePopReceiver; + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "realCECallCogCodePopReceiverAndClassRegs"); + ceCallCogCodePopReceiverAndClassRegs = callCogCodePopReceiverAndClassRegs; + +# else /* Debug */ + /* begin genEnilopmartFor:forCall:called: */ + ceEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "ceEnterCogCodePopReceiverReg"); + /* begin genEnilopmartFor:forCall:called: */ + ceCallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "ceCallCogCodePopReceiverReg"); + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "ceCallCogCodePopReceiverAndClassRegs"); + +# endif /* Debug */ + + genPrimReturnEnterCogCodeEnilopmart(0); + cePrimReturnEnterCogCode = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCode); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCode", cePrimReturnEnterCogCode); + genPrimReturnEnterCogCodeEnilopmart(1); + cePrimReturnEnterCogCodeProfiling = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCodeProfiling); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCodeProfiling", cePrimReturnEnterCogCodeProfiling); + +# if Debug + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "realCECallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg0Regs = callCogCodePopReceiverArg0Regs; + realCECallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "realCECallCogCodePopReceiverArg1Arg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = callCogCodePopReceiverArg1Arg0Regs; + +# else /* Debug */ + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "ceCallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "ceCallCogCodePopReceiverArg1Arg0Regs"); + +# endif /* Debug */ + + ceCall0ArgsPIC = genCallPICEnilopmartNumArgs(0); + ceCall1ArgsPIC = genCallPICEnilopmartNumArgs(1); + ceCall2ArgsPIC = genCallPICEnilopmartNumArgs(2); + assert((numRegArgs()) == 2); + + +} + + +/* Generate the run-time entries for the various method and PIC entry misses + and aborts. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* StackToRegisterMappingCogit>>#generateMissAbortTrampolines */ +static void +generateMissAbortTrampolines(void) +{ + sqInt numArgs; + sqInt numArgsLimiT; + + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + methodAbortTrampolines[numArgs] = (genMethodAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picAbortTrampolines[numArgs] = (genPICAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picMissTrampolines[numArgs] = (genPICMissTrampolineFor(numArgs)); + } +} + + +/* Override to generate code to push the register arg(s) for <= numRegArg + arity sends. + */ + + /* StackToRegisterMappingCogit>>#generateSendTrampolines */ +static void +generateSendTrampolines(void) +{ + sqInt numArgs; + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + ordinarySendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSend", numArgs), ClassReg, trampolineArgConstant(0), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + directedSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + superSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSuperSend", numArgs), ClassReg, trampolineArgConstant(1), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + firstSend = ordinarySendTrampolines[0]; + lastSend = superSendTrampolines[NumSendTrampolines - 1]; +} + + +/* Generate trampolines for tracing. In the simulator we can save a lot of + time and avoid noise instructions in the lastNInstructions log by + short-cutting these + trampolines, but we need them in the real vm. */ + + /* StackToRegisterMappingCogit>>#generateTracingTrampolines */ +static void +generateTracingTrampolines(void) +{ + ceTraceLinkedSendTrampoline = genTrampolineForcalledargregsToSave(ceTraceLinkedSend, "ceTraceLinkedSendTrampoline", ReceiverResultReg, CallerSavedRegisterMask); + ceTraceBlockActivationTrampoline = genTrampolineForcalledregsToSave(ceTraceBlockActivation, "ceTraceBlockActivationTrampoline", CallerSavedRegisterMask); + ceTraceStoreTrampoline = genTrampolineForcalledargargregsToSave(ceTraceStoreOfinto, "ceTraceStoreTrampoline", TempReg, ReceiverResultReg, CallerSavedRegisterMask); +} + + /* StackToRegisterMappingCogit>>#genForwardersInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genForwardersInlinedIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt arg; + sqInt argReg; + sqInt argReg1; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt constant; + sqInt constant1; + sqInt descr; + AbstractInstruction *finished; + AbstractInstruction *finished1; + usqInt fixup; + AbstractInstruction *imm; + AbstractInstruction *imm1; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + void *jumpTarget3; + AbstractInstruction *label; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + AbstractInstruction *ok; + AbstractInstruction *ok1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + sqInt quickConstant; + sqInt quickConstant1; + sqInt rcvr; + sqInt rcvrReg; + sqInt rcvrReg1; + sqInt reg; + sqInt rNext; + sqInt rNext1; + sqInt rTop; + sqInt rTop1; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + sqInt topRegistersMask; + int unforwardArg; + int unforwardRcvr; + + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + unforwardRcvr = !(isUnannotatableConstant(ssValue(1))); + unforwardArg = !(isUnannotatableConstant(ssTop())); + /* begin allocateEqualsEqualsRegistersArgNeedsReg:rcvrNeedsReg:into: */ + assert(unforwardArg + || (unforwardRcvr)); + argReg1 = (rcvrReg1 = NoReg); + if (unforwardArg) { + if (unforwardRcvr) { + /* begin allocateRegForStackTopTwoEntriesInto: */ + topRegistersMask = 0; + rTop1 = (rNext1 = NoReg); + if ((registerOrNone(ssTop())) != NoReg) { + rTop1 = registerOrNone(ssTop()); + } + if ((registerOrNone(ssValue(1))) != NoReg) { + /* begin registerMaskFor: */ + reg = (rNext1 = registerOrNone(ssValue(1))); + topRegistersMask = 1U << reg; + } + if (rTop1 == NoReg) { + rTop1 = allocateRegNotConflictingWith(topRegistersMask); + } + if (rNext1 == NoReg) { + rNext1 = allocateRegNotConflictingWith(1U << rTop1); + } + assert(!(((rTop1 == NoReg) + || (rNext1 == NoReg)))); + argReg1 = rTop1; + rcvrReg1 = rNext1; + + popToReg(ssTop(), argReg1); + popToReg(ssValue(1), rcvrReg1); + } + else { + argReg1 = allocateRegForStackEntryAtnotConflictingWith(0, 0); + popToReg(ssTop(), argReg1); + if (((ssValue(1))->spilled)) { + /* begin AddCq:R: */ + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + } + } + } + else { + assert(unforwardRcvr); + assert(!((((ssTop())->spilled)))); + rcvrReg1 = allocateRegForStackEntryAtnotConflictingWith(1, 0); + popToReg(ssValue(1), rcvrReg1); + } + assert(!((unforwardArg + && (argReg1 == NoReg)))); + assert(!((unforwardRcvr + && (rcvrReg1 == NoReg)))); + rcvrReg = rcvrReg1; + argReg = argReg1; + + if (!(((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)))) { + return genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(!unforwardArg, !unforwardRcvr, argReg, rcvrReg, orNot); + } + ssFlushTo(simStackPtr - 2); + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrReg != NoReg)); + if (!unforwardArg) { + /* begin genCmpConstant:R: */ + constant = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gCmpCwR(constant, rcvrReg), constant); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); + } + } + else { + if (!unforwardRcvr) { + /* begin genCmpConstant:R: */ + constant1 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gCmpCwR(constant1, argReg), constant1); + } + else { + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrReg); + } + } + ssPop(2); + if ((((fixupAt(nextPC - initialPC))->targetInstruction)) == 0) { + + /* The next instruction is dead. we can skip it. */ + deadCode = 1; + ensureFixupAt(targetBytecodePC - initialPC); + ensureFixupAt(postBranchPC - initialPC); + } + else { + assert(!(deadCode)); + } + assert(unforwardArg + || (unforwardRcvr)); + if (orNot) { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget1 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget1)); + } + } + else { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget2 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget2)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget3 = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget3)); + } + } + if (!deadCode) { + ssPushConstant(trueObject()); + } + if (unforwardArg) { + if (unforwardRcvr) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + else { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(argReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(argReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, argReg, argReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished = ((AbstractInstruction *) fixup); + } + jmpTarget(imm, jmpTarget(ok, finished)); + } + } + if (unforwardRcvr) { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(rcvrReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm1 = genJumpImmediate(rcvrReg); + /* begin MoveMw:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + /* begin AndCq:R: */ + quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); + /* begin JumpNonZero: */ + ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, rcvrReg, rcvrReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished1 = ((AbstractInstruction *) fixup); + } + jmpTarget(imm1, jmpTarget(ok1, finished1)); + } + return 0; +} + + +/* Generates the machine code for #== in the case where the instruction is + not followed by a branch + */ + + /* StackToRegisterMappingCogit>>#genIdenticalNoBranchArgIsConstant:rcvrIsConstant:argReg:rcvrReg:orNotIf: */ +static sqInt NoDbgRegParms +genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt constant; + sqInt constant1; + sqInt constant11; + sqInt constant2; + sqInt constant3; + sqInt constant4; + AbstractInstruction *jumpEqual; + AbstractInstruction *jumpNotEqual; + AbstractInstruction *label; + sqInt resultReg; + + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrRegOrNone != NoReg)); + if (argIsConstant) { + /* begin genCmpConstant:R: */ + constant4 = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant4)) { + annotateobjRef(gCmpCwR(constant4, rcvrRegOrNone), constant4); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + } + } + else { + if (rcvrIsConstant) { + /* begin genCmpConstant:R: */ + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); + } + else { + /* begin CmpCq:R: */ + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrRegOrNone); + } + } + ssPop(2); + resultReg = (rcvrRegOrNone == NoReg + ? argReg + : rcvrRegOrNone); + /* begin JumpZero: */ + jumpEqual = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + if (!argIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + if (!rcvrIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(rcvrRegOrNone, TempReg, label); + } + if (orNot) { + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, resultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); + } + } + else { + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, resultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); + } + } + /* begin Jump: */ + jumpNotEqual = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpEqual, (orNot + ? (/* begin genMoveFalseR: */ + (constant2 = falseObject()), + (shouldAnnotateObjectReference(constant2) + ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) + : (/* begin MoveCq:R: */ + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + anInstruction2))) + : (/* begin genMoveTrueR: */ + (constant3 = trueObject()), + (shouldAnnotateObjectReference(constant3) + ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) + : (/* begin MoveCq:R: */ + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + anInstruction3))))); + jmpTarget(jumpNotEqual, gLabel()); + ssPushRegister(resultReg); + return 0; +} + + +/* Decompose code generation for #== into a common constant-folding version, + followed by a double dispatch throguh the objectRepresentation to a + version that doesn't deal with forwarders and a version that does. */ + + /* StackToRegisterMappingCogit>>#genInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genInlinedIdenticalOrNotIf(sqInt orNot) +{ + BytecodeDescriptor *primDescriptor; + sqInt result; + + primDescriptor = generatorAt(byte0); + if ((isUnannotatableConstant(ssTop())) + && (isUnannotatableConstant(ssValue(1)))) { + assert(!((primDescriptor->isMapped))); + result = ((orNot + ? (((ssTop())->constant)) != (((ssValue(1))->constant)) + : (((ssTop())->constant)) == (((ssValue(1))->constant))) + ? trueObject() + : falseObject()); + ssPop(2); + return ssPushConstant(result); + } + /* begin genInlinedIdenticalOrNotIfGuts: */ + return genForwardersInlinedIdenticalOrNotIf(orNot); +} + + /* StackToRegisterMappingCogit>>#genJumpBackTo: */ +static sqInt NoDbgRegParms +genJumpBackTo(sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt address; + AbstractInstruction *anInstruction; + void *jumpTarget; + void *jumpTarget1; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpAboveOrEqual: */ + jumpTarget = fixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)jumpTarget)); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceCheckForInterruptTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + jumpTarget1 = fixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget1)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpIf:to: */ +static sqInt NoDbgRegParms +genJumpIfto(sqInt boolean, sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + CogSimStackEntry *desc; + BytecodeFixup *fixup; + void *jumpTarget; + AbstractInstruction *ok; + sqInt quickConstant; + + ssFlushTo(simStackPtr - 1); + desc = ssTop(); + ssPop(1); + if ((((desc->type)) == SSConstant) + && ((((desc->constant)) == (trueObject())) + || (((desc->constant)) == (falseObject())))) { + + /* Must arrange there's a fixup at the target whether it is jumped to or + not so that the simStackPtr can be kept correct. */ + + /* Must annotate the bytecode for correct pc mapping. */ + fixup = ensureFixupAt(targetBytecodePC - initialPC); + /* begin annotateBytecode: */ + if (((desc->constant)) == boolean) { + /* begin Jump: */ + abstractInstruction = genoperand(Jump, ((sqInt)fixup)); + } + else { + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + (abstractInstruction->annotation = HasBytecodePC); + extA = 0; + return 0; + } + popToReg(desc, TempReg); + assert((objectAfter(falseObject())) == (trueObject())); + /* begin genSubConstant:R: */ + if (shouldAnnotateObjectReference(boolean)) { + annotateobjRef(gSubCwR(boolean, TempReg), TempReg); + } + else { + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); + } + /* begin JumpZero: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + if (extA & 1) { + extA = 0; + /* begin annotateBytecode: */ + abstractInstruction1 = lastOpcode(); + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + } + extA = 0; + /* begin CmpCq:R: */ + quickConstant = (boolean == (falseObject()) + ? (trueObject()) - (falseObject()) + : (falseObject()) - (trueObject())); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpZero: */ + ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genCallMustBeBooleanFor(boolean); + jmpTarget(ok, annotateBytecode(gLabel())); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpTo: */ +static sqInt NoDbgRegParms +genJumpTo(sqInt targetBytecodePC) +{ + void *jumpTarget; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin Jump: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genLoadTemp:in: */ +static void NoDbgRegParms +genLoadTempin(sqInt objectIndex, sqInt destReg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (destReg == ReceiverResultReg) { + voidReceiverResultRegContainsSelf(); + } + ssAllocateRequiredReg(destReg); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(objectIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, destReg); +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd32 */ +static sqInt +genLowcodeAdd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd64 */ +static sqInt +genLowcodeAdd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, secondLow, firstLow); + /* begin AddcR:R: */ + genoperandoperand(AddcRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca32 */ +static sqInt +genLowcodeAlloca32(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (size == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, size, TempReg); + /* begin AndCq:R: */ + anInstruction2 = genoperandoperand(AndCqR, -16, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, size); + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, size, address1); + ssPushNativeRegister(size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca64 */ +static sqInt +genLowcodeAlloca64(void) +{ + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if ((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, sizeLow, SPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, sizeLow); + ssPushNativeRegister(sizeLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd32 */ +static sqInt +genLowcodeAnd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd64 */ +static sqInt +genLowcodeAnd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondLow, firstLow); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift32 */ +static sqInt +genLowcodeArithmeticRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift64 */ +static sqInt +genLowcodeArithmeticRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBeginCall */ +static sqInt +genLowcodeBeginCall(void) +{ + sqInt alignment; + + alignment = extA; + beginHighLevelCall(alignment); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeBinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeBinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeByteSizeOf(); + + case 1: + return genLowcodeFirstFieldPointer(); + + case 2: + return genLowcodeFirstIndexableFieldPointer(); + + case 3: + return genLowcodeIsBytes(); + + case 4: + return genLowcodeIsFloatObject(); + + case 5: + return genLowcodeIsIndexable(); + + case 6: + return genLowcodeIsIntegerObject(); + + case 7: + return genLowcodeIsPointers(); + + case 8: + return genLowcodeIsWords(); + + case 9: + return genLowcodeIsWordsOrBytes(); + + case 10: + return genLowcodeOopSmallIntegerToInt32(); + + case 11: + return genLowcodeOopSmallIntegerToInt64(); + + case 12: + return genLowcodeOopToBoolean32(); + + case 13: + return genLowcodeOopToBoolean64(); + + case 14: + return genLowcodeOopToFloat32(); + + case 15: + return genLowcodeOopToFloat64(); + + case 16: + return genLowcodeOopToInt32(); + + case 17: + return genLowcodeOopToInt64(); + + case 18: + return genLowcodeOopToPointer(); + + case 19: + return genLowcodeOopToPointerReinterpret(); + + case 20: + return genLowcodeOopToUInt32(); + + case 21: + return genLowcodeOopToUInt64(); + + case 22: + return genLowcodePin(); + + case 23: + return genLowcodeUnpin(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean32ToOop */ +static sqInt +genLowcodeBoolean32ToOop(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt value; + sqInt wordConstant; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, value); + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), value), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, value); + inst = anInstruction; + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean64ToOop */ +static sqInt +genLowcodeBoolean64ToOop(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt valueHigh; + sqInt valueLow; + sqInt wordConstant; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, valueLow, valueHigh); + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), valueLow), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, valueLow); + inst = anInstruction; + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeByteSizeOf */ +static sqInt +genLowcodeByteSizeOf(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcByteSizeOfto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat32 */ +static sqInt +genLowcodeCallArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, DPFPReg0, -BytesPerWord, SPReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, BytesPerWord, SPReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat64 */ +static sqInt +genLowcodeCallArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, DPFPReg0, -8, SPReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 8, SPReg); + currentCallCleanUpSize += 8; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt32 */ +static sqInt +genLowcodeCallArgumentInt32(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt64 */ +static sqInt +genLowcodeCallArgumentInt64(void) +{ + nativeStackPopToRegsecondReg(ssNativeTop(), TempReg, ReceiverResultReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + currentCallCleanUpSize += 8; + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentPointer */ +static sqInt +genLowcodeCallArgumentPointer(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ +/* Allocate space */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentSpace */ +static sqInt +genLowcodeCallArgumentSpace(void) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + currentCallCleanUpSize += extA; + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Fetch the pointer */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentStructure */ +static sqInt +genLowcodeCallArgumentStructure(void) +{ + AbstractInstruction *anInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + + /* Copy the structure */ + currentCallCleanUpSize += extA; + genMemCopytoconstantSize(backEnd, TempReg, SPReg, extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallInstruction */ +static sqInt +genLowcodeCallInstruction(void) +{ + AbstractInstruction *abstractInstruction; + sqInt function; + + function = extA; + /* begin CallRT: */ + abstractInstruction = genoperand(Call, function); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallPhysical */ +static sqInt +genLowcodeCallPhysical(void) +{ + sqInt registerID; + + registerID = extA; + /* begin CallR: */ + genoperand(CallR, registerID); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCheckSessionIdentifier */ +static sqInt +genLowcodeCheckSessionIdentifier(void) +{ + sqInt expectedSession; + + expectedSession = extA; + ssPushNativeConstantInt32((expectedSession == (getThisSessionID()) + ? 1 + : 0)); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCompareAndSwap32 */ +static sqInt +genLowcodeCompareAndSwap32(void) +{ + sqInt check; + sqInt newValue; + sqInt oldValue; + sqInt value; + + if (((newValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((newValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((oldValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << newValue)))) == NoReg) { + ssAllocateRequiredReg((oldValue = Arg1Reg)); + } + if (((check = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << newValue)) | (1U << oldValue)))) == NoReg) { + ssAllocateRequiredReg((check = SendNumArgsReg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << newValue)) | (1U << oldValue)) | (1U << check)))) == NoReg) { + ssAllocateRequiredReg((value = ClassReg)); + } + if ((((newValue == ReceiverResultReg) + || (oldValue == ReceiverResultReg)) + || (check == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), newValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), oldValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), check); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv32 */ +static sqInt +genLowcodeDiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv64 */ +static sqInt +genLowcodeDiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat32 */ +static sqInt +genLowcodeDuplicateFloat32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRs:Rs: */ + genoperandoperand(MoveRsRs, value, dup2); + ssPushNativeRegisterSingleFloat(value); + ssPushNativeRegisterSingleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat64 */ +static sqInt +genLowcodeDuplicateFloat64(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, dup2); + ssPushNativeRegisterDoubleFloat(value); + ssPushNativeRegisterDoubleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt32 */ +static sqInt +genLowcodeDuplicateInt32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, dup2); + ssPushNativeRegister(value); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt64 */ +static sqInt +genLowcodeDuplicateInt64(void) +{ + sqInt dup2High; + sqInt dup2Low; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((dup2Low = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((dup2Low = SendNumArgsReg)); + } + if (((dup2High = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << dup2Low)))) == NoReg) { + ssAllocateRequiredReg((dup2High = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (dup2Low == ReceiverResultReg)) + || (dup2High == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, dup2Low); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, dup2High); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + ssPushNativeRegistersecondRegister(dup2Low, dup2High); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicatePointer */ +static sqInt +genLowcodeDuplicatePointer(void) +{ + sqInt dup2; + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointerValue)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((pointerValue == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointerValue, dup2); + ssPushNativeRegister(pointerValue); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress32 */ +static sqInt +genLowcodeEffectiveAddress32(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if ((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, scale, index); + /* begin AddR:R: */ + genoperandoperand(AddRR, index, base); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress64 */ +static sqInt +genLowcodeEffectiveAddress64(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt result; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)) | (1U << base)))) == NoReg) { + ssAllocateRequiredReg((result = ReceiverResultReg)); + } + if (((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCall */ +static sqInt +genLowcodeEndCall(void) +{ + endHighLevelCallWithCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCallNoCleanup */ +static sqInt +genLowcodeEndCallNoCleanup(void) +{ + endHighLevelCallWithoutCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstFieldPointer */ +static sqInt +genLowcodeFirstFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstIndexableFieldPointer */ +static sqInt +genLowcodeFirstIndexableFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstIndexableFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Add */ +static sqInt +genLowcodeFloat32Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRs:Rs: */ + genoperandoperand(AddRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Div */ +static sqInt +genLowcodeFloat32Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRs:Rs: */ + genoperandoperand(DivRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Equal */ +static sqInt +genLowcodeFloat32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Great */ +static sqInt +genLowcodeFloat32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32GreatEqual */ +static sqInt +genLowcodeFloat32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Less */ +static sqInt +genLowcodeFloat32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32LessEqual */ +static sqInt +genLowcodeFloat32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Mul */ +static sqInt +genLowcodeFloat32Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRs:Rs: */ + genoperandoperand(MulRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Neg */ +static sqInt +genLowcodeFloat32Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRs:Rs: */ + genoperandoperand(XorRsRs, result, result); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32NotEqual */ +static sqInt +genLowcodeFloat32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sqrt */ +static sqInt +genLowcodeFloat32Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRs: */ + genoperand(SqrtRs, value); + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sub */ +static sqInt +genLowcodeFloat32Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToFloat64 */ +static sqInt +genLowcodeFloat32ToFloat64(void) +{ + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, singleFloatValue, singleFloatValue); + ssPushNativeRegisterDoubleFloat(singleFloatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt32 */ +static sqInt +genLowcodeFloat32ToInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt64 */ +static sqInt +genLowcodeFloat32ToInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToOop */ +static sqInt +genLowcodeFloat32ToOop(void) +{ + sqInt object; + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat32toOop(singleFloatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt32 */ +static sqInt +genLowcodeFloat32ToUInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt64 */ +static sqInt +genLowcodeFloat32ToUInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Add */ +static sqInt +genLowcodeFloat64Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRd:Rd: */ + genoperandoperand(AddRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Div */ +static sqInt +genLowcodeFloat64Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRd:Rd: */ + genoperandoperand(DivRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Equal */ +static sqInt +genLowcodeFloat64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Great */ +static sqInt +genLowcodeFloat64Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64GreatEqual */ +static sqInt +genLowcodeFloat64GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Less */ +static sqInt +genLowcodeFloat64Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64LessEqual */ +static sqInt +genLowcodeFloat64LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Mul */ +static sqInt +genLowcodeFloat64Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRd:Rd: */ + genoperandoperand(MulRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Neg */ +static sqInt +genLowcodeFloat64Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRd:Rd: */ + genoperandoperand(XorRdRd, result, result); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64NotEqual */ +static sqInt +genLowcodeFloat64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sqrt */ +static sqInt +genLowcodeFloat64Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRd: */ + genoperand(SqrtRd, value); + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sub */ +static sqInt +genLowcodeFloat64Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToFloat32 */ +static sqInt +genLowcodeFloat64ToFloat32(void) +{ + sqInt floatValue; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, floatValue, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt32 */ +static sqInt +genLowcodeFloat64ToInt32(void) +{ + sqInt floatValue; + sqInt int32Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int32Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int32Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int32Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int32Result); + ssPushNativeRegister(int32Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt64 */ +static sqInt +genLowcodeFloat64ToInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToOop */ +static sqInt +genLowcodeFloat64ToOop(void) +{ + sqInt floatValue; + sqInt object; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat64toOop(floatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt32 */ +static sqInt +genLowcodeFloat64ToUInt32(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int64Result); + ssPushNativeRegister(int64Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt64 */ +static sqInt +genLowcodeFloat64ToUInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFree */ +static sqInt +genLowcodeFree(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + if (pointer != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFreeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexable32Oop */ +static sqInt +genLowcodeInstantiateIndexable32Oop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + if (((indexableSize = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((indexableSize = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((classOop = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << indexableSize)))) == NoReg) { + ssAllocateRequiredReg((classOop = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << indexableSize)) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((indexableSize == ReceiverResultReg) + || (classOop == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), indexableSize); + ssNativePop(1); + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopindexableSize(classOop, indexableSize); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexableOop */ +static sqInt +genLowcodeInstantiateIndexableOop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + indexableSize = extA; + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((classOop == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopconstantIndexableSize(classOop, indexableSize); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateOop */ +static sqInt +genLowcodeInstantiateOop(void) +{ + sqInt classOop; + + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (classOop == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOop(classOop); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Equal */ +static sqInt +genLowcodeInt32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Great */ +static sqInt +genLowcodeInt32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLessOrEqual: */ + falseJump = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32GreatEqual */ +static sqInt +genLowcodeInt32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLess: */ + falseJump = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Less */ +static sqInt +genLowcodeInt32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreaterOrEqual: */ + falseJump = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32LessEqual */ +static sqInt +genLowcodeInt32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreater: */ + falseJump = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32NotEqual */ +static sqInt +genLowcodeInt32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat32 */ +static sqInt +genLowcodeInt32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat64 */ +static sqInt +genLowcodeInt32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToOop */ +static sqInt +genLowcodeInt32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToPointer */ +static sqInt +genLowcodeInt32ToPointer(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Equal */ +static sqInt +genLowcodeInt64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, firstLow); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, firstLow); + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Great */ +static sqInt +genLowcodeInt64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64GreatEqual */ +static sqInt +genLowcodeInt64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Less */ +static sqInt +genLowcodeInt64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64LessEqual */ +static sqInt +genLowcodeInt64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64NotEqual */ +static sqInt +genLowcodeInt64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, firstLow); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 1, firstLow); + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat32 */ +static sqInt +genLowcodeInt64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat64 */ +static sqInt +genLowcodeInt64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToOop */ +static sqInt +genLowcodeInt64ToOop(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToPointer */ +static sqInt +genLowcodeInt64ToPointer(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsBytes */ +static sqInt +genLowcodeIsBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsFloatObject */ +static sqInt +genLowcodeIsFloatObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsFloatObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIndexable */ +static sqInt +genLowcodeIsIndexable(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIndexableto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIntegerObject */ +static sqInt +genLowcodeIsIntegerObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIntegerObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsPointers */ +static sqInt +genLowcodeIsPointers(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsPointersto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWords */ +static sqInt +genLowcodeIsWords(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWordsOrBytes */ +static sqInt +genLowcodeIsWordsOrBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsOrBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift32 */ +static sqInt +genLowcodeLeftShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift64 */ +static sqInt +genLowcodeLeftShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentAddress */ +static sqInt +genLowcodeLoadArgumentAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat32 */ +static sqInt +genLowcodeLoadArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat64 */ +static sqInt +genLowcodeLoadArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt16 */ +static sqInt +genLowcodeLoadArgumentInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt32 */ +static sqInt +genLowcodeLoadArgumentInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt64 */ +static sqInt +genLowcodeLoadArgumentInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt8 */ +static sqInt +genLowcodeLoadArgumentInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentPointer */ +static sqInt +genLowcodeLoadArgumentPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt16 */ +static sqInt +genLowcodeLoadArgumentUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt32 */ +static sqInt +genLowcodeLoadArgumentUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt64 */ +static sqInt +genLowcodeLoadArgumentUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt8 */ +static sqInt +genLowcodeLoadArgumentUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat32FromMemory */ +static sqInt +genLowcodeLoadFloat32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, pointer, value); + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat64FromMemory */ +static sqInt +genLowcodeLoadFloat64FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, pointer, value); + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt16FromMemory */ +static sqInt +genLowcodeLoadInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt32FromMemory */ +static sqInt +genLowcodeLoadInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt64FromMemory */ +static sqInt +genLowcodeLoadInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt8FromMemory */ +static sqInt +genLowcodeLoadInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalAddress */ +static sqInt +genLowcodeLoadLocalAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat32 */ +static sqInt +genLowcodeLoadLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat64 */ +static sqInt +genLowcodeLoadLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt16 */ +static sqInt +genLowcodeLoadLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt32 */ +static sqInt +genLowcodeLoadLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt64 */ +static sqInt +genLowcodeLoadLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt8 */ +static sqInt +genLowcodeLoadLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalPointer */ +static sqInt +genLowcodeLoadLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt16 */ +static sqInt +genLowcodeLoadLocalUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt32 */ +static sqInt +genLowcodeLoadLocalUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt64 */ +static sqInt +genLowcodeLoadLocalUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt8 */ +static sqInt +genLowcodeLoadLocalUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectAt */ +static sqInt +genLowcodeLoadObjectAt(void) +{ + sqInt fieldIndex; + sqInt object; + + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((fieldIndex == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectat(object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectField */ +static sqInt +genLowcodeLoadObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + + fieldIndex = extA; + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectfield(object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadPointerFromMemory */ +static sqInt +genLowcodeLoadPointerFromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt pointerResult; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerResult = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((pointerResult = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (pointerResult == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, pointer, pointerResult); + ssPushNativeRegister(pointerResult); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt16FromMemory */ +static sqInt +genLowcodeLoadUInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt32FromMemory */ +static sqInt +genLowcodeLoadUInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt64FromMemory */ +static sqInt +genLowcodeLoadUInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt8FromMemory */ +static sqInt +genLowcodeLoadUInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLocalFrameSize */ +static sqInt +genLowcodeLocalFrameSize(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt quickConstant; + sqInt size; + + size = extA; + assert(needsFrame); + + /* Mark the stack frame */ + hasNativeFrame = 1; + annotateobjRef(gMoveCwR(splObj(LowcodeContextMark), TempReg), splObj(LowcodeContextMark)); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfNativeFrameMark(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, FPReg); + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, 1, TempReg); + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + /* begin SubCq:R: */ + anInstruction3 = genoperandoperand(SubCqR, size, TempReg); + /* begin MoveR:Mw:r: */ + offset2 = frameOffsetOfNativeFramePointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, FPReg); + /* begin MoveR:Mw:r: */ + offset3 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, FPReg); + /* begin SubCq:R: */ + quickConstant = 1 + (defaultNativeStackFrameSize()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(SubCqR, quickConstant, TempReg); + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address1); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockRegisters */ +static sqInt +genLowcodeLockRegisters(void) +{ + ssFlushAll(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockVM */ +static sqInt +genLowcodeLockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc32 */ +static sqInt +genLowcodeMalloc32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((size == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + ssFlushAll(); + if (size != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, size, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc64 */ +static sqInt +genLowcodeMalloc64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << sizeLow)) | (1U << sizeHigh)))) == NoReg) { + ssAllocateRequiredReg((pointer = SendNumArgsReg)); + } + if (((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + ssFlushAll(); + if (sizeLow != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, sizeLow, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy32 */ +static sqInt +genLowcodeMemcpy32(void) +{ + sqInt dest; + sqInt size; + sqInt source; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy64 */ +static sqInt +genLowcodeMemcpy64(void) +{ + sqInt dest; + sqInt size; + sqInt sizeLow; + sqInt source; + + sizeLow = 0; + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, sizeLow); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpyFixed */ +static sqInt +genLowcodeMemcpyFixed(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt dest; + sqInt size; + sqInt source; + + size = extA; + if (((source = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((source = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dest = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = Arg1Reg)); + } + if ((source == ReceiverResultReg) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + if (size == BytesPerWord) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, source, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, dest); + } + else { + ssFlushAll(); + genMemCopytoconstantSize(backEnd, source, dest, size); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat32ToPhysical */ +static sqInt +genLowcodeMoveFloat32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat64ToPhysical */ +static sqInt +genLowcodeMoveFloat64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt32ToPhysical */ +static sqInt +genLowcodeMoveInt32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt64ToPhysical */ +static sqInt +genLowcodeMoveInt64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMovePointerToPhysical */ +static sqInt +genLowcodeMovePointerToPhysical(void) +{ + sqInt pointerValue; + sqInt registerID; + + registerID = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul32 */ +static sqInt +genLowcodeMul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul64 */ +static sqInt +genLowcodeMul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg32 */ +static sqInt +genLowcodeNeg32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NegateR: */ + genoperand(NegateR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg64 */ +static sqInt +genLowcodeNeg64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, valueLow); + /* begin AddcCq:R: */ + anInstruction1 = genoperandoperand(AddcCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot32 */ +static sqInt +genLowcodeNot32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot64 */ +static sqInt +genLowcodeNot64(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeNullaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeNullaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeBoolean32ToOop(); + + case 1: + return genLowcodeBoolean64ToOop(); + + case 2: + return genLowcodeFloat32ToOop(); + + case 3: + return genLowcodeFloat64ToOop(); + + case 4: + return genLowcodeInt32ToOop(); + + case 5: + return genLowcodeInt64ToOop(); + + case 6: + return genLowcodePointerToOop(); + + case 7: + return genLowcodePointerToOopReinterprer(); + + case 8: + return genLowcodeSmallInt32ToOop(); + + case 9: + return genLowcodeUint32ToOop(); + + case 10: + return genLowcodeUint64ToOop(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopEqual */ +static sqInt +genLowcodeOopEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopNotEqual */ +static sqInt +genLowcodeOopNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt32 */ +static sqInt +genLowcodeOopSmallIntegerToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt64 */ +static sqInt +genLowcodeOopSmallIntegerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean32 */ +static sqInt +genLowcodeOopToBoolean32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean64 */ +static sqInt +genLowcodeOopToBoolean64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat32 */ +static sqInt +genLowcodeOopToFloat32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat32(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat64 */ +static sqInt +genLowcodeOopToFloat64(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat64(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt32 */ +static sqInt +genLowcodeOopToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt64 */ +static sqInt +genLowcodeOopToInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointer */ +static sqInt +genLowcodeOopToPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcOopToPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointerReinterpret */ +static sqInt +genLowcodeOopToPointerReinterpret(void) +{ + sqInt object; + sqInt pointer; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt32 */ +static sqInt +genLowcodeOopToUInt32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToUInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt64 */ +static sqInt +genLowcodeOopToUInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoUInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr32 */ +static sqInt +genLowcodeOr32(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr64 */ +static sqInt +genLowcodeOr64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondLow, firstLow); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat32 */ +static sqInt +genLowcodePerformCallFloat32(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat64 */ +static sqInt +genLowcodePerformCallFloat64(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat32 */ +static sqInt +genLowcodePerformCallIndirectFloat32(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat64 */ +static sqInt +genLowcodePerformCallIndirectFloat64(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt32 */ +static sqInt +genLowcodePerformCallIndirectInt32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt64 */ +static sqInt +genLowcodePerformCallIndirectInt64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + sqInt reg11; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectPointer */ +static sqInt +genLowcodePerformCallIndirectPointer(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectStructure */ +static sqInt +genLowcodePerformCallIndirectStructure(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectVoid */ +static sqInt +genLowcodePerformCallIndirectVoid(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt32 */ +static sqInt +genLowcodePerformCallInt32(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt64 */ +static sqInt +genLowcodePerformCallInt64(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + sqInt reg11; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallPointer */ +static sqInt +genLowcodePerformCallPointer(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallStructure */ +static sqInt +genLowcodePerformCallStructure(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = EAX; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallVoid */ +static sqInt +genLowcodePerformCallVoid(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePin */ +static sqInt +genLowcodePin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePlaftormCode */ +static sqInt +genLowcodePlaftormCode(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddConstantOffset */ +static sqInt +genLowcodePointerAddConstantOffset(void) +{ + AbstractInstruction *anInstruction; + sqInt base; + sqInt offset; + + offset = extB; + if (((base = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((base = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (base == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, offset, base); + ssPushNativeRegister(base); + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset32 */ +static sqInt +genLowcodePointerAddOffset32(void) +{ + sqInt base; + sqInt offset; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((base = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((base = Arg1Reg)); + } + if ((offset == ReceiverResultReg) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset64 */ +static sqInt +genLowcodePointerAddOffset64(void) +{ + sqInt base; + sqInt offsetHigh; + sqInt offsetLow; + + if (((offsetLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offsetLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((offsetHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offsetLow)))) == NoReg) { + ssAllocateRequiredReg((offsetHigh = Arg1Reg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offsetLow)) | (1U << offsetHigh)))) == NoReg) { + ssAllocateRequiredReg((base = SendNumArgsReg)); + } + if (((offsetLow == ReceiverResultReg) + || (offsetHigh == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), offsetLow, offsetHigh); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offsetLow, base); + ssPushNativeRegister(base); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerEqual */ +static sqInt +genLowcodePointerEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerNotEqual */ +static sqInt +genLowcodePointerNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt32 */ +static sqInt +genLowcodePointerToInt32(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt64 */ +static sqInt +genLowcodePointerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt resultHigh; + sqInt resultLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOop */ +static sqInt +genLowcodePointerToOop(void) +{ + sqInt pointer; + sqInt pointerClassLiteral; + + pointerClassLiteral = getLiteral(extA); + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + genLcPointerToOopclass(pointer, pointerClassLiteral); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOopReinterprer */ +static sqInt +genLowcodePointerToOopReinterprer(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat32 */ +static sqInt +genLowcodePopFloat32(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat64 */ +static sqInt +genLowcodePopFloat64(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt32 */ +static sqInt +genLowcodePopInt32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt64 */ +static sqInt +genLowcodePopInt64(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopMultipleNative */ +static sqInt +genLowcodePopMultipleNative(void) +{ + ssPopNativeSize(extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopPointer */ +static sqInt +genLowcodePopPointer(void) +{ + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt32 */ +static sqInt +genLowcodePushConstantUInt32(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt32(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt64 */ +static sqInt +genLowcodePushConstantUInt64(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt64(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushNullPointer */ +static sqInt +genLowcodePushNullPointer(void) +{ + ssPushNativeConstantPointer(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne32 */ +static sqInt +genLowcodePushOne32(void) +{ + ssPushNativeConstantInt32(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne64 */ +static sqInt +genLowcodePushOne64(void) +{ + ssPushNativeConstantInt64(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat32 */ +static sqInt +genLowcodePushOneFloat32(void) +{ + ssPushNativeConstantFloat32(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat64 */ +static sqInt +genLowcodePushOneFloat64(void) +{ + ssPushNativeConstantFloat64(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat32 */ +static sqInt +genLowcodePushPhysicalFloat32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat64 */ +static sqInt +genLowcodePushPhysicalFloat64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt32 */ +static sqInt +genLowcodePushPhysicalInt32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt64 */ +static sqInt +genLowcodePushPhysicalInt64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalPointer */ +static sqInt +genLowcodePushPhysicalPointer(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushSessionIdentifier */ +static sqInt +genLowcodePushSessionIdentifier(void) +{ + ssPushNativeConstantInt32(getThisSessionID()); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero32 */ +static sqInt +genLowcodePushZero32(void) +{ + ssPushNativeConstantInt32(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero64 */ +static sqInt +genLowcodePushZero64(void) +{ + ssPushNativeConstantInt64(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat32 */ +static sqInt +genLowcodePushZeroFloat32(void) +{ + ssPushNativeConstantFloat32(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat64 */ +static sqInt +genLowcodePushZeroFloat64(void) +{ + ssPushNativeConstantFloat64(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem32 */ +static sqInt +genLowcodeRem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem64 */ +static sqInt +genLowcodeRem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift32 */ +static sqInt +genLowcodeRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftRightR:R: */ + genoperandoperand(LogicalShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift64 */ +static sqInt +genLowcodeRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From16 */ +static sqInt +genLowcodeSignExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From8 */ +static sqInt +genLowcodeSignExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From16 */ +static sqInt +genLowcodeSignExtend64From16(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From32 */ +static sqInt +genLowcodeSignExtend64From32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, value); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, resultHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From8 */ +static sqInt +genLowcodeSignExtend64From8(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((resultLow = SendNumArgsReg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSmallInt32ToOop */ +static sqInt +genLowcodeSmallInt32ToOop(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, value); + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, value); + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat32ToMemory */ +static sqInt +genLowcodeStoreFloat32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt floatValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, floatValue, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat64ToMemory */ +static sqInt +genLowcodeStoreFloat64ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt doubleValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), doubleValue); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, doubleValue, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt16ToMemory */ +static sqInt +genLowcodeStoreInt16ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt32ToMemory */ +static sqInt +genLowcodeStoreInt32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt64ToMemory */ +static sqInt +genLowcodeStoreInt64ToMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, pointer); + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, pointer); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt8ToMemory */ +static sqInt +genLowcodeStoreInt8ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat32 */ +static sqInt +genLowcodeStoreLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat64 */ +static sqInt +genLowcodeStoreLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt16 */ +static sqInt +genLowcodeStoreLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt32 */ +static sqInt +genLowcodeStoreLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt64 */ +static sqInt +genLowcodeStoreLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, TempReg); + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, TempReg); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt8 */ +static sqInt +genLowcodeStoreLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalPointer */ +static sqInt +genLowcodeStoreLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerValue; + + baseOffset = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectField */ +static sqInt +genLowcodeStoreObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + fieldIndex = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectfield(value, object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectFieldAt */ +static sqInt +genLowcodeStoreObjectFieldAt(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (fieldIndex == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectat(value, object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStorePointerToMemory */ +static sqInt +genLowcodeStorePointerToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt memoryPointer; + sqInt pointerValue; + + if (((memoryPointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((memoryPointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << memoryPointer)))) == NoReg) { + ssAllocateRequiredReg((pointerValue = Arg1Reg)); + } + if ((memoryPointer == ReceiverResultReg) + || (pointerValue == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), memoryPointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, memoryPointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub32 */ +static sqInt +genLowcodeSub32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub64 */ +static sqInt +genLowcodeSub64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, secondLow, firstLow); + /* begin SubbR:R: */ + genoperandoperand(SubbRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeTrinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeTrinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeOopEqual(); + + case 1: + return genLowcodeOopNotEqual(); + + case 2: + return genLowcodeStoreObjectField(); + + case 3: + return genLowcodeStoreObjectFieldAt(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To16 */ +static sqInt +genLowcodeTruncate32To16(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To8 */ +static sqInt +genLowcodeTruncate32To8(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To16 */ +static sqInt +genLowcodeTruncate64To16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, valueLow); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To32 */ +static sqInt +genLowcodeTruncate64To32(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To8 */ +static sqInt +genLowcodeTruncate64To8(void) +{ + AbstractInstruction *anInstruction; + sqInt result; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, valueLow); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv32 */ +static sqInt +genLowcodeUdiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv64 */ +static sqInt +genLowcodeUdiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Great */ +static sqInt +genLowcodeUint32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelowOrEqual: */ + falseJump = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32GreatEqual */ +static sqInt +genLowcodeUint32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelow: */ + falseJump = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Less */ +static sqInt +genLowcodeUint32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAboveOrEqual: */ + falseJump = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32LessEqual */ +static sqInt +genLowcodeUint32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAbove: */ + falseJump = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat32 */ +static sqInt +genLowcodeUint32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat64 */ +static sqInt +genLowcodeUint32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToOop */ +static sqInt +genLowcodeUint32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcUInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Great */ +static sqInt +genLowcodeUint64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64GreatEqual */ +static sqInt +genLowcodeUint64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Less */ +static sqInt +genLowcodeUint64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64LessEqual */ +static sqInt +genLowcodeUint64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat32 */ +static sqInt +genLowcodeUint64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat64 */ +static sqInt +genLowcodeUint64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToOop */ +static sqInt +genLowcodeUint64ToOop(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcUInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul32 */ +static sqInt +genLowcodeUmul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul64 */ +static sqInt +genLowcodeUmul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive2: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive2(sqInt prim) +{ + + switch (prim) { + case 60: + return genLowcodeFloat64ToFloat32(); + + case 61: + return genLowcodeFloat64ToInt32(); + + case 0x3E: + return genLowcodeFloat64ToInt64(); + + case 0x3F: + return genLowcodeFloat64ToUInt32(); + + case 64: + return genLowcodeFloat64ToUInt64(); + + case 65: + return genLowcodeFree(); + + case 66: + return genLowcodeInstantiateIndexable32Oop(); + + case 67: + return genLowcodeInstantiateIndexableOop(); + + case 68: + return genLowcodeInstantiateOop(); + + case 69: + return genLowcodeInt32Equal(); + + case 70: + return genLowcodeInt32Great(); + + case 71: + return genLowcodeInt32GreatEqual(); + + case 72: + return genLowcodeInt32Less(); + + case 73: + return genLowcodeInt32LessEqual(); + + case 74: + return genLowcodeInt32NotEqual(); + + case 75: + return genLowcodeInt32ToFloat32(); + + case 76: + return genLowcodeInt32ToFloat64(); + + case 77: + return genLowcodeInt32ToPointer(); + + case 78: + return genLowcodeInt64Equal(); + + case 79: + return genLowcodeInt64Great(); + + case 80: + return genLowcodeInt64GreatEqual(); + + case 81: + return genLowcodeInt64Less(); + + case 82: + return genLowcodeInt64LessEqual(); + + case 83: + return genLowcodeInt64NotEqual(); + + case 84: + return genLowcodeInt64ToFloat32(); + + case 85: + return genLowcodeInt64ToFloat64(); + + case 86: + return genLowcodeInt64ToPointer(); + + case 87: + return genLowcodeLeftShift32(); + + case 88: + return genLowcodeLeftShift64(); + + case 89: + return genLowcodeLoadArgumentAddress(); + + case 90: + return genLowcodeLoadArgumentFloat32(); + + case 91: + return genLowcodeLoadArgumentFloat64(); + + case 92: + return genLowcodeLoadArgumentInt16(); + + case 93: + return genLowcodeLoadArgumentInt32(); + + case 94: + return genLowcodeLoadArgumentInt64(); + + case 95: + return genLowcodeLoadArgumentInt8(); + + case 96: + return genLowcodeLoadArgumentPointer(); + + case 97: + return genLowcodeLoadArgumentUInt16(); + + case 98: + return genLowcodeLoadArgumentUInt32(); + + case 99: + return genLowcodeLoadArgumentUInt64(); + + case 100: + return genLowcodeLoadArgumentUInt8(); + + case 101: + return genLowcodeLoadFloat32FromMemory(); + + case 102: + return genLowcodeLoadFloat64FromMemory(); + + case 103: + return genLowcodeLoadInt16FromMemory(); + + case 104: + return genLowcodeLoadInt32FromMemory(); + + case 105: + return genLowcodeLoadInt64FromMemory(); + + case 106: + return genLowcodeLoadInt8FromMemory(); + + case 107: + return genLowcodeLoadLocalAddress(); + + case 108: + return genLowcodeLoadLocalFloat32(); + + case 109: + return genLowcodeLoadLocalFloat64(); + + case 110: + return genLowcodeLoadLocalInt16(); + + case 111: + return genLowcodeLoadLocalInt32(); + + case 112: + return genLowcodeLoadLocalInt64(); + + case 113: + return genLowcodeLoadLocalInt8(); + + case 114: + return genLowcodeLoadLocalPointer(); + + case 115: + return genLowcodeLoadLocalUInt16(); + + case 116: + return genLowcodeLoadLocalUInt32(); + + case 117: + return genLowcodeLoadLocalUInt64(); + + case 118: + return genLowcodeLoadLocalUInt8(); + + case 119: + return genLowcodeLoadObjectAt(); + + default: + return genLowcodeUnaryInlinePrimitive3(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive3: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive3(sqInt prim) +{ + + switch (prim) { + case 120: + return genLowcodeLoadObjectField(); + + case 121: + return genLowcodeLoadPointerFromMemory(); + + case 122: + return genLowcodeLoadUInt16FromMemory(); + + case 123: + return genLowcodeLoadUInt32FromMemory(); + + case 0x7C: + return genLowcodeLoadUInt64FromMemory(); + + case 125: + return genLowcodeLoadUInt8FromMemory(); + + case 0x7E: + return genLowcodeLocalFrameSize(); + + case 0x7F: + return genLowcodeLockRegisters(); + + case 128: + return genLowcodeLockVM(); + + case 129: + return genLowcodeMalloc32(); + + case 130: + return genLowcodeMalloc64(); + + case 131: + return genLowcodeMemcpy32(); + + case 132: + return genLowcodeMemcpy64(); + + case 133: + return genLowcodeMemcpyFixed(); + + case 134: + return genLowcodeMoveFloat32ToPhysical(); + + case 135: + return genLowcodeMoveFloat64ToPhysical(); + + case 136: + return genLowcodeMoveInt32ToPhysical(); + + case 137: + return genLowcodeMoveInt64ToPhysical(); + + case 138: + return genLowcodeMovePointerToPhysical(); + + case 139: + return genLowcodeMul32(); + + case 140: + return genLowcodeMul64(); + + case 141: + return genLowcodeNeg32(); + + case 142: + return genLowcodeNeg64(); + + case 143: + return genLowcodeNot32(); + + case 144: + return genLowcodeNot64(); + + case 145: + return genLowcodeOr32(); + + case 146: + return genLowcodeOr64(); + + case 147: + return genLowcodePerformCallFloat32(); + + case 148: + return genLowcodePerformCallFloat64(); + + case 149: + return genLowcodePerformCallIndirectFloat32(); + + case 150: + return genLowcodePerformCallIndirectFloat64(); + + case 151: + return genLowcodePerformCallIndirectInt32(); + + case 152: + return genLowcodePerformCallIndirectInt64(); + + case 153: + return genLowcodePerformCallIndirectPointer(); + + case 154: + return genLowcodePerformCallIndirectStructure(); + + case 155: + return genLowcodePerformCallIndirectVoid(); + + case 156: + return genLowcodePerformCallInt32(); + + case 157: + return genLowcodePerformCallInt64(); + + case 158: + return genLowcodePerformCallPointer(); + + case 159: + return genLowcodePerformCallStructure(); + + case 160: + return genLowcodePerformCallVoid(); + + case 161: + return genLowcodePlaftormCode(); + + case 162: + return genLowcodePointerAddConstantOffset(); + + case 163: + return genLowcodePointerAddOffset32(); + + case 164: + return genLowcodePointerAddOffset64(); + + case 165: + return genLowcodePointerEqual(); + + case 166: + return genLowcodePointerNotEqual(); + + case 167: + return genLowcodePointerToInt32(); + + case 168: + return genLowcodePointerToInt64(); + + case 169: + return genLowcodePopFloat32(); + + case 170: + return genLowcodePopFloat64(); + + case 171: + return genLowcodePopInt32(); + + case 172: + return genLowcodePopInt64(); + + case 173: + return genLowcodePopMultipleNative(); + + case 174: + return genLowcodePopPointer(); + + case 175: + return genLowcodePushConstantUInt32(); + + case 176: + return genLowcodePushConstantUInt64(); + + case 177: + return genLowcodePushNullPointer(); + + case 178: + return genLowcodePushOne32(); + + case 179: + return genLowcodePushOne64(); + + default: + return genLowcodeUnaryInlinePrimitive4(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive4: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive4(sqInt prim) +{ + + switch (prim) { + case 180: + return genLowcodePushOneFloat32(); + + case 181: + return genLowcodePushOneFloat64(); + + case 182: + return genLowcodePushPhysicalFloat32(); + + case 183: + return genLowcodePushPhysicalFloat64(); + + case 184: + return genLowcodePushPhysicalInt32(); + + case 185: + return genLowcodePushPhysicalInt64(); + + case 186: + return genLowcodePushPhysicalPointer(); + + case 187: + return genLowcodePushSessionIdentifier(); + + case 188: + return genLowcodePushZero32(); + + case 189: + return genLowcodePushZero64(); + + case 190: + return genLowcodePushZeroFloat32(); + + case 191: + return genLowcodePushZeroFloat64(); + + case 192: + return genLowcodeRem32(); + + case 193: + return genLowcodeRem64(); + + case 194: + return genLowcodeRightShift32(); + + case 195: + return genLowcodeRightShift64(); + + case 196: + return genLowcodeSignExtend32From16(); + + case 197: + return genLowcodeSignExtend32From8(); + + case 198: + return genLowcodeSignExtend64From16(); + + case 199: + return genLowcodeSignExtend64From32(); + + case 200: + return genLowcodeSignExtend64From8(); + + case 201: + return genLowcodeStoreFloat32ToMemory(); + + case 202: + return genLowcodeStoreFloat64ToMemory(); + + case 203: + return genLowcodeStoreInt16ToMemory(); + + case 204: + return genLowcodeStoreInt32ToMemory(); + + case 205: + return genLowcodeStoreInt64ToMemory(); + + case 206: + return genLowcodeStoreInt8ToMemory(); + + case 207: + return genLowcodeStoreLocalFloat32(); + + case 208: + return genLowcodeStoreLocalFloat64(); + + case 209: + return genLowcodeStoreLocalInt16(); + + case 210: + return genLowcodeStoreLocalInt32(); + + case 211: + return genLowcodeStoreLocalInt64(); + + case 212: + return genLowcodeStoreLocalInt8(); + + case 213: + return genLowcodeStoreLocalPointer(); + + case 214: + return genLowcodeStorePointerToMemory(); + + case 215: + return genLowcodeSub32(); + + case 216: + return genLowcodeSub64(); + + case 217: + return genLowcodeTruncate32To16(); + + case 218: + return genLowcodeTruncate32To8(); + + case 219: + return genLowcodeTruncate64To16(); + + case 220: + return genLowcodeTruncate64To32(); + + case 221: + return genLowcodeTruncate64To8(); + + case 222: + return genLowcodeUdiv32(); + + case 223: + return genLowcodeUdiv64(); + + case 224: + return genLowcodeUint32Great(); + + case 225: + return genLowcodeUint32GreatEqual(); + + case 226: + return genLowcodeUint32Less(); + + case 227: + return genLowcodeUint32LessEqual(); + + case 228: + return genLowcodeUint32ToFloat32(); + + case 229: + return genLowcodeUint32ToFloat64(); + + case 230: + return genLowcodeUint64Great(); + + case 231: + return genLowcodeUint64GreatEqual(); + + case 232: + return genLowcodeUint64Less(); + + case 233: + return genLowcodeUint64LessEqual(); + + case 234: + return genLowcodeUint64ToFloat32(); + + case 235: + return genLowcodeUint64ToFloat64(); + + case 236: + return genLowcodeUmul32(); + + case 237: + return genLowcodeUmul64(); + + case 238: + return 0; + + case 239: + return genLowcodeUnlockVM(); + + default: + return genLowcodeUnaryInlinePrimitive5(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive5: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive5(sqInt prim) +{ + + switch (prim) { + case 240: + return genLowcodeUrem32(); + + case 241: + return genLowcodeUrem64(); + + case 242: + return genLowcodeXor32(); + + case 243: + return genLowcodeXor64(); + + case 244: + return genLowcodeZeroExtend32From16(); + + case 245: + return genLowcodeZeroExtend32From8(); + + case 246: + return genLowcodeZeroExtend64From16(); + + case 247: + return genLowcodeZeroExtend64From32(); + + case 0xF8: + return genLowcodeZeroExtend64From8(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeAdd32(); + + case 1: + return genLowcodeAdd64(); + + case 2: + return genLowcodeAlloca32(); + + case 3: + return genLowcodeAlloca64(); + + case 4: + return genLowcodeAnd32(); + + case 5: + return genLowcodeAnd64(); + + case 6: + return genLowcodeArithmeticRightShift32(); + + case 7: + return genLowcodeArithmeticRightShift64(); + + case 8: + return genLowcodeBeginCall(); + + case 9: + return genLowcodeCallArgumentFloat32(); + + case 10: + return genLowcodeCallArgumentFloat64(); + + case 11: + return genLowcodeCallArgumentInt32(); + + case 12: + return genLowcodeCallArgumentInt64(); + + case 13: + return genLowcodeCallArgumentPointer(); + + case 14: + return genLowcodeCallArgumentSpace(); + + case 15: + return genLowcodeCallArgumentStructure(); + + case 16: + return genLowcodeCallInstruction(); + + case 17: + return genLowcodeCallPhysical(); + + case 18: + return genLowcodeCheckSessionIdentifier(); + + case 19: + return genLowcodeCompareAndSwap32(); + + case 20: + return genLowcodeDiv32(); + + case 21: + return genLowcodeDiv64(); + + case 22: + return genLowcodeDuplicateFloat32(); + + case 23: + return genLowcodeDuplicateFloat64(); + + case 24: + return genLowcodeDuplicateInt32(); + + case 25: + return genLowcodeDuplicateInt64(); + + case 26: + return genLowcodeDuplicatePointer(); + + case 27: + return genLowcodeEffectiveAddress32(); + + case 28: + return genLowcodeEffectiveAddress64(); + + case 29: + return genLowcodeEndCall(); + + case 30: + return genLowcodeEndCallNoCleanup(); + + case 0x1F: + return genLowcodeFloat32Add(); + + case 32: + return genLowcodeFloat32Div(); + + case 33: + return genLowcodeFloat32Equal(); + + case 34: + return genLowcodeFloat32Great(); + + case 35: + return genLowcodeFloat32GreatEqual(); + + case 36: + return genLowcodeFloat32Less(); + + case 37: + return genLowcodeFloat32LessEqual(); + + case 38: + return genLowcodeFloat32Mul(); + + case 39: + return genLowcodeFloat32Neg(); + + case 40: + return genLowcodeFloat32NotEqual(); + + case 41: + return genLowcodeFloat32Sqrt(); + + case 42: + return genLowcodeFloat32Sub(); + + case 43: + return genLowcodeFloat32ToFloat64(); + + case 44: + return genLowcodeFloat32ToInt32(); + + case 45: + return genLowcodeFloat32ToInt64(); + + case 46: + return genLowcodeFloat32ToUInt32(); + + case 47: + return genLowcodeFloat32ToUInt64(); + + case 48: + return genLowcodeFloat64Add(); + + case 49: + return genLowcodeFloat64Div(); + + case 50: + return genLowcodeFloat64Equal(); + + case 51: + return genLowcodeFloat64Great(); + + case 52: + return genLowcodeFloat64GreatEqual(); + + case 53: + return genLowcodeFloat64Less(); + + case 54: + return genLowcodeFloat64LessEqual(); + + case 55: + return genLowcodeFloat64Mul(); + + case 56: + return genLowcodeFloat64Neg(); + + case 57: + return genLowcodeFloat64NotEqual(); + + case 58: + return genLowcodeFloat64Sqrt(); + + case 59: + return genLowcodeFloat64Sub(); + + default: + return genLowcodeUnaryInlinePrimitive2(prim); + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnlockVM */ +static sqInt +genLowcodeUnlockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnpin */ +static sqInt +genLowcodeUnpin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem32 */ +static sqInt +genLowcodeUrem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem64 */ +static sqInt +genLowcodeUrem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor32 */ +static sqInt +genLowcodeXor32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor64 */ +static sqInt +genLowcodeXor64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondLow, firstLow); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From16 */ +static sqInt +genLowcodeZeroExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From8 */ +static sqInt +genLowcodeZeroExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From16 */ +static sqInt +genLowcodeZeroExtend64From16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From32 */ +static sqInt +genLowcodeZeroExtend64From32(void) +{ + AbstractInstruction *anInstruction; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From8 */ +static sqInt +genLowcodeZeroExtend64From8(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + /* StackToRegisterMappingCogit>>#genMarshalledSend:numArgs:sendTable: */ +static sqInt NoDbgRegParms +genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt annotation; + + assert(needsFrame); + /* begin annotationForSendTable: */ + if (sendTable == directedSuperSendTrampolines) { + annotation = IsDirectedSuperSend; + goto l1; + } + if (sendTable == superSendTrampolines) { + annotation = IsSuperSend; + goto l1; + } + assert(sendTable == ordinarySendTrampolines); + annotation = IsSendCall; +l1: /* end annotationForSendTable: */; + if ((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) { + genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + } + if (numArgs >= (NumSendTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + } + if (annotation == IsDirectedSuperSend) { + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tempOop)) { + annotateobjRef(gMoveCwR(tempOop, TempReg), tempOop); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tempOop, TempReg); + } + } + genLoadInlineCacheWithSelector(selectorIndex); + ((gCall(sendTable[((numArgs < (NumSendTrampolines - 1)) ? numArgs : (NumSendTrampolines - 1))]))->annotation = annotation); + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + return ssPushRegister(ReceiverResultReg); +} + + +/* Generate the abort for a method. This abort performs either a call of + ceSICMiss: to handle a single-in-line cache miss or a call of + ceStackOverflow: to handle a + stack overflow. It distinguishes the two by testing ResultReceiverReg. If + the register is zero then this is a stack-overflow because a) the receiver + has already + been pushed and so can be set to zero before calling the abort, and b) the + receiver must always contain an object (and hence be non-zero) on SIC + miss. */ + + /* StackToRegisterMappingCogit>>#genMethodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genMethodAbortTrampolineFor(sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpSICMiss; + + zeroOpcodeIndex(); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + /* begin JumpNonZero: */ + jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); + jmpTarget(jumpSICMiss, gLabel()); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSICMiss, trampolineNamenumRegArgs("ceMethodAbort", numArgs), 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged + target or a call of ceMNUFromPICMNUMethod:receiver: to handle an + MNU dispatch in a closed PIC. It distinguishes the two by testing + ClassReg. If the register is zero then this is an MNU. */ + + /* StackToRegisterMappingCogit>>#genPICAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genPICAbortTrampolineFor(sqInt numArgs) +{ + zeroOpcodeIndex(); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genInnerPICAbortTrampoline(trampolineNamenumRegArgs("cePICAbort", numArgs)); +} + + /* StackToRegisterMappingCogit>>#genPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +genPICMissTrampolineFor(sqInt numArgs) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumRegArgs("cePICMiss", numArgs), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genPopStackBytecode */ +static sqInt +genPopStackBytecode(void) +{ + AbstractInstruction *anInstruction; + + if (((ssTop())->spilled)) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, BytesPerWord, SPReg); + } + ssPop(1); + return 0; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. + Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveClosureValue */ +static sqInt +genPrimitiveClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail1; + AbstractInstruction *jumpFail2; + AbstractInstruction *jumpFail3; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailNArgs; + sqInt offset; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ClassReg); + jumpFail1 = genJumpImmediate(ClassReg); + genGetCompactClassIndexNonImmOfinto(ClassReg, TempReg); + genCmpClassMethodContextCompactIndexR(TempReg); + /* begin JumpNonZero: */ + jumpFail2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(MethodIndex, ClassReg, SendNumArgsReg); + jumpFail3 = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + /* begin MoveM16:r:R: */ + offset = offsetof(CogMethod, blockEntryOffset); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, ClassReg, TempReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + if (primitiveRoutine == primitiveClosureValueNoContextSwitch) { + if (blockNoContextSwitchOffset == null) { + return NotFullyInitialized; + } + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + } + /* begin JumpR: */ + genoperand(JumpR, TempReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFail1, jmpTarget(jumpFail2, jmpTarget(jumpFail3, jmpTarget(jumpFail4, gLabel()))))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveFullClosureValue */ +static sqInt +genPrimitiveFullClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailImmediateMethod; + AbstractInstruction *jumpFailNArgs; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(FullClosureCompiledBlockIndex, ReceiverResultReg, SendNumArgsReg); + jumpFailImmediateMethod = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + /* begin AddCq:R: */ + quickConstant2 = (primitiveRoutine == primitiveFullClosureValueNoContextSwitch + ? fullBlockNoContextSwitchEntryOffset() + : fullBlockEntryOffset()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, ClassReg); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFailImmediateMethod, jmpTarget(jumpFail4, gLabel()))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Generate an in-line perform primitive. The lookup code requires the + selector to be in Arg0Reg. + adjustArgumentsForPerform: adjusts the arguments once + genLookupForPerformNumArgs: has generated the code for the lookup. */ + + /* StackToRegisterMappingCogit>>#genPrimitivePerform */ +static sqInt +genPrimitivePerform(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (methodOrBlockNumArgs > 2) { + /* begin MoveMw:r:R: */ + offset = (methodOrBlockNumArgs) * BytesPerWord; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, SPReg, Arg0Reg); + } + return genLookupForPerformNumArgs(methodOrBlockNumArgs); +} + + /* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */ +static sqInt +genPushActiveContextBytecode(void) +{ + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + + genGetActiveContextNumArgslargeinBlock(methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + return ssPushRegister(ReceiverResultReg); +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 143 10001111 llllkkkk jjjjjjjj iiiiiiii Push Closure Num Copied llll Num + Args kkkk BlockSize jjjjjjjjiiiiiiii */ + + /* StackToRegisterMappingCogit>>#genPushClosureCopyCopiedValuesBytecode */ +static sqInt +genPushClosureCopyCopiedValuesBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = byte1 & 15), (numCopied = ((usqInt) byte1) >> 4), (((sqInt)((usqInt)(byte2) << 8))) + byte3); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* This is a version of genPushLiteralVariable: that looks ahead for a + directed super send bytecode + and does not generate any code for the dereference yet if followed by a + directed super send. + */ + + /* StackToRegisterMappingCogit>>#genPushLiteralVariableGivenDirectedSuper: */ +static sqInt NoDbgRegParms +genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex) +{ + sqInt bcpc; + sqInt descriptor; + BytecodeDescriptor *descriptor1; + sqInt eA; + sqInt eB; + sqInt exta; + sqInt extb; + sqInt savedB0; + sqInt savedB1; + sqInt savedB2; + sqInt savedB3; + sqInt savedEA; + sqInt savedEB; + sqInt savedNEB; + + /* begin nextDescriptorAndExtensionsInto: */ + descriptor1 = generatorAt(byte0); + savedB0 = byte0; + savedB1 = byte1; + savedB2 = byte2; + savedB3 = byte3; + savedEA = extA; + savedEB = extB; + savedNEB = numExtB; + bcpc = bytecodePC + ((descriptor1->numBytes)); + do { + if (bcpc > endPC) { + goto l1; + } + byte0 = (fetchByteofObject(bcpc, methodObj)) + bytecodeSetOffset; + descriptor1 = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor1, bcpc); + if (!((descriptor1->isExtension))) { + eA = extA; + eB = extB; + extA = savedEA; + extB = savedEB; + numExtB = savedNEB; + byte0 = savedB0; + byte1 = savedB1; + byte2 = savedB2; + byte3 = savedB3; + if ((descriptor1 != null) + && ((((descriptor1->generator)) == genExtSendSuperBytecode) + && (eB >= 64))) { + ssPushConstant(getLiteral(literalIndex)); + return 0; + } + + goto l1; + } + ((descriptor1->generator))(); + bcpc += (descriptor1->numBytes); + } while(1); +l1: /* end nextDescriptorAndExtensionsInto: */; + return genPushLiteralVariable(literalIndex); +} + + /* StackToRegisterMappingCogit>>#genPushLiteralVariable: */ +static sqInt NoDbgRegParms +genPushLiteralVariable(sqInt literalIndex) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt freeReg; + + freeReg = allocateRegNotConflictingWith(0); + + /* N.B. Do _not_ use ReceiverResultReg to avoid overwriting receiver in assignment in frameless methods. */ + /* So far descriptors are not rich enough to describe the entire dereference so generate the register + load but don't push the result. There is an order-of-evaluation issue if we defer the dereference. */ + association = getLiteral(literalIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, TempReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, TempReg); + } + genEnsureObjInRegNotForwardedscratchReg(TempReg, freeReg); + genLoadSlotsourceRegdestReg(ValueIndex, TempReg, freeReg); + ssPushRegister(freeReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genPushLiteral: */ +static sqInt NoDbgRegParms +genPushLiteral(sqInt literal) +{ + return ssPushConstant(literal); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextReceiverVariable: */ +static sqInt NoDbgRegParms +genPushMaybeContextReceiverVariable(sqInt slotIndex) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + ensureReceiverResultRegContainsSelf(); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + genLoadTempin(index, ReceiverResultReg); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushNewArrayBytecode */ +static sqInt +genPushNewArrayBytecode(void) +{ + sqInt i; + int popValues; + sqInt size; + + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + if ((popValues = byte1 > 0x7F)) { + ssFlushTo(simStackPtr); + } + else { + ssAllocateCallRegand(SendNumArgsReg, ReceiverResultReg); + } + size = byte1 & 0x7F; + if (!popValues) { + if (tryCollapseTempVectorInitializationOfSize(size)) { + return 0; + } + } + genNewArrayOfSizeinitialized(size, !popValues); + if (popValues) { + for (i = (size - 1); i >= 0; i += -1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(TempReg, i, ReceiverResultReg); + } + ssPop(size); + } + return ssPushRegister(ReceiverResultReg); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverBytecode */ +static sqInt +genPushReceiverBytecode(void) +{ + if ((optStatus.isReceiverResultRegLive)) { + return ssPushRegister(ReceiverResultReg); + } + assert((registerOrNone(&simSelf)) == NoReg); + return ssPushDesc(simSelf); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverVariable: */ +static sqInt NoDbgRegParms +genPushReceiverVariable(sqInt index) +{ + ensureReceiverResultRegContainsSelf(); + return ssPushBaseoffset(ReceiverResultReg, slotOffsetOfInstVarIndex(index)); +} + + +/* Ensure that the register args are pushed before the retpc for methods with + arity <= self numRegArgs. + */ +/* This won't be as clumsy on a RISC. But putting the receiver and + args above the return address means the CoInterpreter has a + single machine-code frame format which saves us a lot of work. */ + + /* StackToRegisterMappingCogit>>#genPushRegisterArgs */ +static void +genPushRegisterArgs(void) +{ + if (!(regArgsHaveBeenPushed + || (methodOrBlockNumArgs > 2))) { + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); + regArgsHaveBeenPushed = 1; + } +} + + /* StackToRegisterMappingCogit>>#genPushRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex) +{ + sqInt objectReg; + sqInt regMask; + sqInt resultReg; + + assert(needsFrame); + objectReg = allocateRegNotConflictingWith(0); + genLoadTempin(objectIndex, objectReg); + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << objectReg; + resultReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (resultReg == NoReg) { + resultReg = objectReg; + } + genLoadSlotsourceRegdestReg(byte1, objectReg, resultReg); + return ssPushRegister(resultReg); +} + + /* StackToRegisterMappingCogit>>#genPushRemoteTempLongBytecode */ +static sqInt +genPushRemoteTempLongBytecode(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt regMask; + sqInt remoteTempReg; + sqInt tempVectReg; + + tempVectReg = allocateRegNotConflictingWith(0); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(byte2); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, tempVectReg); + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << tempVectReg; + remoteTempReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (remoteTempReg == NoReg) { + remoteTempReg = tempVectReg; + } + genLoadSlotsourceRegdestReg(byte1, tempVectReg, remoteTempReg); + return ssPushRegister(remoteTempReg); +} + + +/* If a frameless method (not a block), only argument temps can be accessed. + This is assured by the use of needsFrameIfMod16GENumArgs: in pushTemp. */ + + /* StackToRegisterMappingCogit>>#genPushTemporaryVariable: */ +static sqInt NoDbgRegParms +genPushTemporaryVariable(sqInt index) +{ + assert((inBlock > 0) + || (needsFrame + || (index < methodOrBlockNumArgs))); + return ssPushDesc(simStack[index]); +} + + +/* In a frameless method ReceiverResultReg already contains self. + In a frameful method, ReceiverResultReg /may/ contain self. */ + + /* StackToRegisterMappingCogit>>#genReturnReceiver */ +static sqInt +genReturnReceiver(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + } + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromBlock */ +static sqInt +genReturnTopFromBlock(void) +{ + assert(inBlock > 0); + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genBlockReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromMethod */ +static sqInt +genReturnTopFromMethod(void) +{ + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genSendDirectedSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + assert((((ssTop())->type)) == SSConstant); + tempOop = ((ssTop())->constant); + ssPop(1); + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, directedSuperSendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSendSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, superSendTrampolines); +} + + +/* Generate a trampoline with four arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* StackToRegisterMappingCogit>>#genSendTrampolineFor:numArgs:called:arg:arg:arg:arg: */ +static sqInt NoDbgRegParms +genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3) +{ + sqInt routine; + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + /* begin selectorIndexDereferenceRoutine */ + routine = null; + if (!(routine == null)) { + /* begin Call: */ + genoperand(Call, routine); + } + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genSend:numArgs: */ +static sqInt NoDbgRegParms +genSendnumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, ordinarySendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorArithmetic */ +static sqInt +genSpecialSelectorArithmetic(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + sqInt argInt; + int argIsConst; + sqInt argIsInt; + sqInt index; + AbstractInstruction *jumpContinue; + AbstractInstruction *jumpNotSmallInts; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int rcvrIsConst; + sqInt rcvrIsInt; + sqInt result; + + primDescriptor = generatorAt(byte0); + argIsInt = ((argIsConst = (((ssTop())->type)) == SSConstant)) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((rcvrIsConst = (((ssValue(1))->type)) == SSConstant)) + && ((((rcvrInt = ((ssValue(1))->constant))) & 1)); + if (argIsInt + && (rcvrIsInt)) { + rcvrInt = (rcvrInt >> 1); + argInt = (argInt >> 1); + + switch ((primDescriptor->opcode)) { + case AddRR: + result = rcvrInt + argInt; + break; + case SubRR: + result = rcvrInt - argInt; + break; + case AndRR: + result = rcvrInt & argInt; + break; + case OrRR: + result = rcvrInt | argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + if (isIntegerValue(result)) { + + /* Must annotate the bytecode for correct pc mapping. */ + return (ssPop(2), + ssPushAnnotatedConstant((((usqInt)result << 1) | 1))); + } + return genSpecialSelectorSend(); + } + if ((rcvrIsConst + && (!rcvrIsInt)) + || (argIsConst + && (!argIsInt))) { + return genSpecialSelectorSend(); + } + if (!(argIsInt + || (rcvrIsInt))) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + ssFlushTo(simStackPtr - 2); + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + + switch ((primDescriptor->opcode)) { + case AddRR: + if (argIsInt) { + /* begin AddCq:R: */ + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + } + else { + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + if (rcvrIsInt) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + } + else { + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(ReceiverResultReg); + } + } + break; + case SubRR: + if (argIsInt) { + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + } + else { + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(Arg0Reg); + } + break; + case AndRR: + if (argIsInt) { + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + } + else { + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + case OrRR: + if (argIsInt) { + /* begin OrCq:R: */ + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + } + else { + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + default: + error("Case not found and no otherwise clause"); + } + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); + jmpTarget(jumpContinue, gLabel()); + return 0; +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorClass */ +static sqInt +genSpecialSelectorClass(void) +{ + sqInt topReg; + + topReg = registerOrNone(ssTop()); + ssPop(1); + if ((topReg == NoReg) + || (topReg == ClassReg)) { + ssAllocateRequiredRegand((topReg = SendNumArgsReg), ClassReg); + } + else { + ssAllocateRequiredReg(ClassReg); + } + ssPush(1); + popToReg(ssTop(), topReg); + genGetClassObjectOfintoscratchReginstRegIsReceiver(topReg, ClassReg, TempReg, 0); + return (ssPop(1), + ssPushRegister(ClassReg)); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorComparison */ +static sqInt +genSpecialSelectorComparison(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt argInt; + sqInt argIsInt; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt descr; + sqInt index; + sqInt inlineCAB; + AbstractInstruction *jumpNotSmallInts; + void *jumpTarget; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + BytecodeDescriptor *primDescriptor1; + sqInt rcvrIsInt; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + + ssFlushTo(simStackPtr - 2); + primDescriptor = generatorAt(byte0); + argIsInt = ((((ssTop())->type)) == SSConstant) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((((ssValue(1))->type)) == SSConstant) + && (((((ssValue(1))->constant)) & 1)); + if (argIsInt + && (rcvrIsInt)) { + return genStaticallyResolvedSpecialSelectorComparison(); + } + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor1 = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor1->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + + /* Further, only interested in inlining = and ~= if there's a SmallInteger constant involved. + The relational operators successfully statically predict SmallIntegers; the equality operators do not. */ + inlineCAB = ((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)); + if (inlineCAB + && ((((primDescriptor->opcode)) == JumpZero) + || (((primDescriptor->opcode)) == JumpNonZero))) { + inlineCAB = argIsInt + || (rcvrIsInt); + } + if (!inlineCAB) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + if (argIsInt) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + } + genConditionalBranchoperand(((branchDescriptor->isBranchTrue) + ? (primDescriptor->opcode) + : inverseBranchFor((primDescriptor->opcode))), ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC)))); + /* begin Jump: */ + jumpTarget = ensureNonMergeFixupAt(postBranchPC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + return genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); +} + + +/* Assumes both operands are ints */ + + /* StackToRegisterMappingCogit>>#genStaticallyResolvedSpecialSelectorComparison */ +static sqInt +genStaticallyResolvedSpecialSelectorComparison(void) +{ + sqInt argInt; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int result; + + primDescriptor = generatorAt(byte0); + argInt = ((ssTop())->constant); + rcvrInt = ((ssValue(1))->constant); + + switch ((primDescriptor->opcode)) { + case JumpLess: + result = rcvrInt < argInt; + break; + case JumpLessOrEqual: + result = rcvrInt <= argInt; + break; + case JumpGreater: + result = rcvrInt > argInt; + break; + case JumpGreaterOrEqual: + result = rcvrInt >= argInt; + break; + case JumpZero: + result = rcvrInt == argInt; + break; + case JumpNonZero: + result = rcvrInt != argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + ssPop(2); + return ssPushAnnotatedConstant((result + ? trueObject() + : falseObject())); +} + + +/* We need a frame because the association has to be in ReceiverResultReg for + the various trampolines + and ReceiverResultReg holds only the receiver in frameless methods. + */ + + /* StackToRegisterMappingCogit>>#genStorePop:LiteralVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt topReg; + + assert(needsFrame); + /* begin genLoadLiteralVariable:in: */ + association = getLiteral(litVarIndex); + voidReceiverResultRegContainsSelf(); + + ssAllocateRequiredReg(ReceiverResultReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, ReceiverResultReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, ReceiverResultReg); + } + genEnsureObjInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, ValueIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, ValueIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextRemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + /* StackToRegisterMappingCogit>>#genStorePop:ReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt needsImmCheck1; + sqInt needsStoreCheck1; + sqInt topReg; + + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + needsStoreCheck1 = (!useTwoPaths) + && (needsStoreCheck); + needsImmCheck1 = needsImmCheck + && (!useTwoPaths); + +# if IMMUTABILITY + if (needsImmCheck1) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck1, 1); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck1); +} + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt topReg; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The only reason we assert needsFrame here is that in a frameless method + ReceiverResultReg must and does contain only self, but the ceStoreCheck + trampoline expects the target of the store to be in ReceiverResultReg. So + in a frameless method we would have a conflict between the receiver and + the temote temp store, unless we we smart enough to realise that + ReceiverResultReg was unused after the literal variable store, unlikely + given that methods return self by default. */ + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteTemp:At:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt topReg; + + assert(needsFrame); + ssAllocateRequiredReg(ReceiverResultReg); + voidReceiverResultRegContainsSelf(); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(remoteTempIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, ReceiverResultReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + /* StackToRegisterMappingCogit>>#genStorePop:TemporaryVariable: */ +static sqInt NoDbgRegParms +genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt reg; + + ssFlushUpThroughTemporaryVariable(tempIndex); + reg = ssStorePoptoPreferredReg(popBoolean, TempReg); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfTemporary(tempIndex); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, reg, offset, FPReg); + return 0; +} + + +/* Generate a method return from within a method or a block. + Frameless method activation looks like + CISCs (x86): + receiver + args + sp-> ret pc. + RISCs (ARM): + receiver + args + ret pc in LR. + A fully framed activation is described in CoInterpreter + class>initializeFrameIndices. Return pops receiver and arguments off the + stack. Callee pushes the result. */ + + /* StackToRegisterMappingCogit>>#genUpArrowReturn */ +static sqInt +genUpArrowReturn(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt framelessReturn; + sqInt offset; + + + /* can't fall through */ + deadCode = 1; + if (inBlock > 0) { + assert(needsFrame); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceNonLocalReturnTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + +# if IMMUTABILITY + framelessReturn = needsFrame + && (!useTwoPaths); + +# else /* IMMUTABILITY */ + framelessReturn = needsFrame; + +# endif /* IMMUTABILITY */ + + if (framelessReturn) { + if (hasNativeFrame) { + leaveNativeFrame(); + } + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + } + else { + /* begin RetN: */ + offset = ((methodOrBlockNumArgs > 2) + || (regArgsHaveBeenPushed) + ? (methodOrBlockNumArgs + 1) * BytesPerWord + : 0); + genoperand(RetN, offset); + } + return 0; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + These are the targets of backward branches. A backward branch fixup's + simStackPtr needs to be set when generating the code for the bytecode at + the targetIndex. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#initializeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +initializeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + /* begin setIsBackwardBranchFixup */ + (fixup->simStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackSize) = 0; + + return fixup; +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramefulMethod: */ +static void NoDbgRegParms +initSimStackForFramefulMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSBaseOffset); + (simSelf.spilled = 1); + (simSelf.registerr = FPReg); + (simSelf.offset = FoxMFReceiver); + (optStatus.isReceiverResultRegLive = 0); + (optStatus.ssEntry = (&simSelf)); + + /* N.B. Includes num args */ + simSpillBase = methodOrBlockNumTemps; + simStackPtr = simSpillBase - 1; + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxCallerSavedIP + ((methodOrBlockNumArgs - i) * BytesPerWord)); + (desc->bcptr = startpc); + } + for (i = methodOrBlockNumArgs; i <= simStackPtr; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerWord)); + (desc->bcptr = startpc); + } +} + + +/* The register receiver (the closure itself) and args are pushed by the + closure value primitive(s) + and hence a frameless block has all arguments and copied values pushed to + the stack. However, + the method receiver (self) is put in the ReceiverResultRegister by the + block entry. */ + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessBlock: */ +static void NoDbgRegParms +initSimStackForFramelessBlock(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps >= methodOrBlockNumArgs); + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = SPReg); + (desc->offset = (methodOrBlockNumArgs - i) * BytesPerWord); + (desc->bcptr = startpc); + } + simSpillBase = (simStackPtr = methodOrBlockNumTemps - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessMethod: */ +static void NoDbgRegParms +initSimStackForFramelessMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps == methodOrBlockNumArgs); + assert((numRegArgs()) <= 2); + if (((methodOrBlockNumArgs >= 1) && (methodOrBlockNumArgs <= 2))) { + desc = simStackAt(0); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg0Reg); + (desc->bcptr = startpc); + if (methodOrBlockNumArgs > 1) { + desc = simStackAt(1); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg1Reg); + (desc->bcptr = startpc); + } + } + else { + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->registerr = SPReg); + (desc->spilled = 1); + (desc->offset = (methodOrBlockNumArgs - i) * BytesPerWord); + (desc->bcptr = startpc); + } + } + simSpillBase = (simStackPtr = methodOrBlockNumArgs - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#leaveNativeFrame */ +static void +leaveNativeFrame(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + + assert(needsFrame); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 1, TempReg); + /* begin MoveR:Aw: */ + address = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address); +} + + /* StackToRegisterMappingCogit>>#liveFloatRegisters */ +static sqInt +liveFloatRegisters(void) +{ + sqInt i; + sqInt regsSet; + + regsSet = 0; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | 0; + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeFloatRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + /* StackToRegisterMappingCogit>>#liveRegisters */ +static sqInt +liveRegisters(void) +{ + sqInt i; + sqInt regsSet; + + if (needsFrame) { + regsSet = 0; + } + else { + /* begin registerMaskFor: */ + regsSet = 1U << ReceiverResultReg; + if ((methodOrBlockNumArgs <= 2) + && (methodOrBlockNumArgs > 0)) { + regsSet = regsSet | (1U << Arg0Reg); + if (methodOrBlockNumArgs > 1) { + regsSet = regsSet | (1U << Arg1Reg); + } + } + } + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | (registerMask(simStackAt(i))); + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + +/* insert nops for dead code that is mapped so that bc + to mc mapping is not many to one */ + + /* StackToRegisterMappingCogit>>#mapDeadDescriptorIfNeeded: */ +static sqInt NoDbgRegParms +mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor) +{ + AbstractInstruction *abstractInstruction; + + flag("annotateInstruction"); + if (((descriptor->isMapped)) + || ((inBlock > 0) + && ((descriptor->isMappedInBlock)))) { + /* begin annotateBytecode: */ + abstractInstruction = gen(Nop); + (abstractInstruction->annotation = HasBytecodePC); + } + return 0; +} + + +/* Spill everything on the simulated stack that needs spilling (that below + receiver and arguments). + Marshall receiver and arguments to stack and/or registers depending on arg + count. If the args don't fit in registers push receiver and args (spill + everything), but still assign + the receiver to ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#marshallSendArguments: */ +static void NoDbgRegParms +marshallSendArguments(sqInt numArgs) +{ + sqInt anyRefs; + CogSimStackEntry * cascade0; + sqInt numSpilled; + + ssFlushTo((simStackPtr - numArgs) - 1); + if (numArgs > 2) { + + /* If there are no spills and no references to ReceiverResultReg + the fetch of ReceiverResultReg from the stack can be avoided + by assigning directly to ReceiverResultReg and pushing it. */ + numSpilled = numberOfSpillsInTopNItems(numArgs + 1); + anyRefs = anyReferencesToRegisterinTopNItems(ReceiverResultReg, numArgs + 1); + if ((numSpilled > 0) + || (anyRefs)) { + ssFlushTo(simStackPtr); + storeToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + else { + cascade0 = simStackAt(simStackPtr - numArgs); + storeToReg(cascade0, ReceiverResultReg); + (cascade0->type = SSRegister); + (cascade0->registerr = ReceiverResultReg); + ssFlushTo(simStackPtr); + } + } + else { + + /* Move the args to the register arguments, being careful to do + so last to first so e.g. previous contents don't get overwritten. + Also check for any arg registers in use by other args. */ + if (numArgs > 0) { + if (numArgs > 1) { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 2); + ssAllocateRequiredRegupThrough(Arg1Reg, simStackPtr - 1); + } + else { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 1); + } + } + if (numArgs > 1) { + popToReg(simStackAt(simStackPtr), Arg1Reg); + } + if (numArgs > 0) { + popToReg(simStackAt((simStackPtr - numArgs) + 1), Arg0Reg); + } + popToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + ssPop(numArgs + 1); +} + + +/* For assert checking; or rather for avoiding assert fails when dealing with + the hack for block temps in the SqueakV3PlusClosures bytecode set. + */ + + /* StackToRegisterMappingCogit>>#maybeCompilingFirstPassOfBlockWithInitialPushNil */ +static sqInt +maybeCompilingFirstPassOfBlockWithInitialPushNil(void) +{ + return (inBlock == InVanillaBlock) + && ((methodOrBlockNumTemps > methodOrBlockNumArgs) + && (blockPass == 1)); +} + + +/* If this bytecode has a fixup, some kind of merge needs to be done. There + are 4 cases: + 1) the bytecode has no fixup (fixup isNotAFixup) + do nothing + 2) the bytecode has a non merge fixup + the fixup has needsNonMergeFixup. + The code generating non merge fixup (currently only special selector code) + is responsible + for the merge so no need to do it. + We set deadCode to false as the instruction can be reached from jumps. + 3) the bytecode has a merge fixup, but execution flow *cannot* fall + through to the merge point. + the fixup has needsMergeFixup and deadCode = true. + ignores the current simStack as it does not mean anything + restores the simStack to the state the jumps to the merge point expects it + to be. + 4) the bytecode has a merge fixup and execution flow *can* fall through to + the merge point. + the fixup has needsMergeFixup and deadCode = false. + flushes the stack to the stack pointer so the fall through execution path + simStack is + in the state the merge point expects it to be. + restores the simStack to the state the jumps to the merge point expects it + to be. + + In addition, if this is a backjump merge point, we patch the fixup to hold + the current simStackPtr + for later assertions. */ +/* case 1 */ + + /* StackToRegisterMappingCogit>>#mergeWithFixupIfRequired: */ +static sqInt NoDbgRegParms +mergeWithFixupIfRequired(BytecodeFixup *fixup) +{ + CogSimStackEntry * cascade0; + sqInt i; + + if (((fixup->targetInstruction)) == 0) { + return 0; + } + if ((((usqInt)((fixup->targetInstruction)))) == NeedsNonMergeFixupFlag) { + deadCode = 0; + return 0; + } + assert(isMergeFixup(fixup)); + traceMerge(fixup); + if (deadCode) { + + /* case 3 */ + simStackPtr = (fixup->simStackPtr); + simNativeStackPtr = (fixup->simNativeStackPtr); + simNativeStackSize = (fixup->simNativeStackSize); + + } + else { + + /* case 4 */ + ssFlushTo(simStackPtr); + } + deadCode = 0; + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + (fixup->targetInstruction = gLabel()); + assert(simStackPtr == ((fixup->simStackPtr))); + assert(simNativeStackPtr == ((fixup->simNativeStackPtr))); + assert(simNativeStackSize == ((fixup->simNativeStackSize))); + + /* begin restoreSimStackAtMergePoint: */ + simSpillBase = methodOrBlockNumTemps; + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + for (i = methodOrBlockNumTemps; i <= simStackPtr; i += 1) { + cascade0 = simStackAt(i); + (cascade0->type = SSSpill); + (cascade0->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerOop)); + (cascade0->registerr = FPReg); + (cascade0->spilled = 1); + } + for (i = 0; i <= simNativeStackPtr; i += 1) { + ensureIsMarkedAsSpilled(simNativeStackAt(i)); + } + simNativeSpillBase = simNativeStackPtr + 1; + + return 0; +} + + /* StackToRegisterMappingCogit>>#methodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +methodAbortTrampolineFor(sqInt numArgs) +{ + return methodAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#needsFrameIfMod16GENumArgs: */ +static sqInt NoDbgRegParms +needsFrameIfMod16GENumArgs(sqInt stackDelta) +{ + return (byte0 % 16) >= methodOrBlockNumArgs; +} + + +/* As of August 2013, the code generator can't deal with spills in frameless + methods (the + issue is to do with the stack offset to get at an argument, which is + changed when there's a spill). + In e.g. TextColor>>#dominates: other ^other class == self class the second + send of class + needs also rto allocate a register that the first one used, but the first + one's register can't be + spilled. So avoid this by only allowing class to be sent if the stack + contains a single element. */ + + /* StackToRegisterMappingCogit>>#needsFrameIfStackGreaterThanOne: */ +static sqInt NoDbgRegParms +needsFrameIfStackGreaterThanOne(sqInt stackDelta) +{ + return stackDelta > 1; +} + + /* StackToRegisterMappingCogit>>#numberOfSpillsInTopNItems: */ +static sqInt NoDbgRegParms +numberOfSpillsInTopNItems(sqInt n) +{ + sqInt i; + + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((((simStackAt(i))->type)) == SSSpill) { + return n - (simStackPtr - i); + } + } + return 0; +} + + /* StackToRegisterMappingCogit>>#picAbortTrampolineFor: */ +static sqInt NoDbgRegParms +picAbortTrampolineFor(sqInt numArgs) +{ + return picAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#prevInstIsPCAnnotated */ +static sqInt +prevInstIsPCAnnotated(void) +{ + sqInt prevIndex; + AbstractInstruction *prevInst; + + if (!(opcodeIndex > 0)) { + return 0; + } + prevIndex = opcodeIndex - 1; + while (1) { + if (prevIndex <= 0) { + return 0; + } + prevInst = abstractInstructionAt(prevIndex); + if (isPCMappedAnnotation((!((prevInst->annotation)) + ? 0 + : (prevInst->annotation)))) { + return 1; + } + if (!(((prevInst->opcode)) == Label)) break; + prevIndex -= 1; + } + return 0; +} + + /* StackToRegisterMappingCogit>>#pushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + sqInt (* const pushNilSizeFunction)(sqInt,sqInt) = squeakV3orSistaV1PushNilSizenumInitialNils; + + return pushNilSizeFunction(aMethodObj, numInitialNils); +} + + +/* When a block must be recompiled due to overestimating the + numInitialNils fixups must be restored, which means rescannning + since backward branches need their targets initialized. */ + + /* StackToRegisterMappingCogit>>#reinitializeFixupsFrom:through: */ +static void NoDbgRegParms +reinitializeFixupsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt nExts; + sqInt pc; + BytecodeFixup * self_in_reinitialize; + sqInt targetPC; + + pc = start; + nExts = 0; + while (pc <= end) { + /* begin reinitialize */ + self_in_reinitialize = fixupAt(pc - initialPC); + (self_in_reinitialize->targetInstruction) = 0; + (self_in_reinitialize->simStackPtr) = 0; + (self_in_reinitialize->simNativeStackPtr) = 0; + + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0))) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + initializeFixupAt(targetPC - initialPC); + } + if ((descriptor->isBlockCreation)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + pc = (pc + ((descriptor->numBytes))) + distance; + } + else { + pc += (descriptor->numBytes); + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } +} + + +/* Scan the block to determine if the block needs a frame or not */ + + /* StackToRegisterMappingCogit>>#scanBlock: */ +static sqInt NoDbgRegParms +scanBlock(BlockStart *blockStart) +{ + BytecodeDescriptor *descriptor; + sqInt end; + sqInt framelessStackDelta; + sqInt nExts; + sqInt numPushNils; + sqInt (* const numPushNilsFunction)(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt) = squeakV3orSistaV1NumPushNils; + sqInt pc; + sqInt pushingNils; + + needsFrame = 0; + hasNativeFrame = 0; + + prevBCDescriptor = null; + methodOrBlockNumArgs = (blockStart->numArgs); + inBlock = InVanillaBlock; + pc = (blockStart->startpc); + end = ((blockStart->startpc)) + ((blockStart->span)); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); + pushingNils = 1; + while (pc < end) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + needsFrame = 1; + } + else { + framelessStackDelta += (descriptor->stackDelta); + } + } + /* begin maybeNoteDescriptor:blockStart: */ + if ((descriptor->isInstVarRef)) { + (blockStart->hasInstVarRef = 1); + } + if (pushingNils + && (!((descriptor->isExtension)))) { + + /* Count the initial number of pushed nils acting as temp initializers. We can't tell + whether an initial pushNil is an operand reference or a temp initializer, except + when the pushNil is a jump target (has a fixup), which never happens: + self systemNavigation browseAllSelect: + [:m| | ebc | + (ebc := m embeddedBlockClosures + select: [:ea| ea decompile statements first isMessage] + thenCollect: [:ea| ea decompile statements first selector]) notEmpty + and: [(#(whileTrue whileFalse whileTrue: whileFalse:) intersection: ebc) notEmpty]] + or if the bytecode set has a push multiple nils bytecode. We simply count initial nils. + Rarely we may end up over-estimating. We will correct by checking the stack depth + at the end of the block in compileBlockBodies. */ + if (((numPushNils = numPushNilsFunction(descriptor, pc, nExts, methodObj))) > 0) { + assert((((descriptor->numBytes)) == 1) + || (((descriptor->generator)) == genPushClosureTempsBytecode)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) + numPushNils); + } + else { + pushingNils = 0; + } + } + /* begin nextBytecodePCFor:at:exts:in: */ + pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) + : 0)); + if ((descriptor->isExtension)) { + nExts += 1; + } + else { + nExts = (extA = (numExtB = (extB = 0))); + } + prevBCDescriptor = descriptor; + } + if (!needsFrame) { + assert((framelessStackDelta >= 0) + && (((blockStart->numInitialNils)) >= framelessStackDelta)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) - framelessStackDelta); + } + return 0; +} + + +/* Scan the method (and all embedded blocks) to determine + - what the last bytecode is; extra bytes at the end of a method are used + to encode things like source pointers or temp names + - if the method needs a frame or not + - what are the targets of any backward branches. + - how many blocks it creates + Answer the block count or on error a negative error code */ + + /* StackToRegisterMappingCogit>>#scanMethod */ +static sqInt +scanMethod(void) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt framelessStackDelta; + sqInt latestContinuation; + sqInt nExts; + sqInt numBlocks; + sqInt pc; + sqInt seenInstVarStore; + sqInt targetPC; + + needsFrame = (useTwoPaths = (seenInstVarStore = 0)); + hasNativeFrame = 0; + + prevBCDescriptor = null; + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { + return 0; + } + pc = (latestContinuation = initialPC); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); + while (pc <= endPC) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + if (((descriptor->opcode)) == Nop) { + + /* unknown bytecode tag; see Cogit class>>#generatorTableFrom: */ + return EncounteredUnknownBytecode; + } + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + endPC = pc; + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + + /* With immutability we win simply by avoiding a frame build if the receiver is young and not immutable. */ + +# if IMMUTABILITY + if ((descriptor->is1ByteInstVarStore)) { + useTwoPaths = 1; + } + else { + needsFrame = 1; + useTwoPaths = 0; + } + +# else /* IMMUTABILITY */ + needsFrame = 1; + useTwoPaths = 0; + +# endif /* IMMUTABILITY */ + + } + else { + + /* Without immutability we win if there are two or more stores and the receiver is new. */ + framelessStackDelta += (descriptor->stackDelta); + +# if IMMUTABILITY + +# else /* IMMUTABILITY */ + if ((descriptor->is1ByteInstVarStore)) { + if (seenInstVarStore) { + useTwoPaths = 1; + } + else { + seenInstVarStore = 1; + } + } + +# endif /* IMMUTABILITY */ + + } + } + if (isBranch(descriptor)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + if ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0)) { + initializeFixupAt(targetPC - initialPC); + } + else { + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + if ((descriptor->isBlockCreation)) { + numBlocks += 1; + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + pc += (descriptor->numBytes); + nExts = ((descriptor->isExtension) + ? nExts + 1 + : (extA = (numExtB = (extB = 0)))); + prevBCDescriptor = descriptor; + } + return numBlocks; +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1PushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + return (methodUsesAlternateBytecodeSet(aMethodObj) + ? (/* begin sistaV1PushNilSize:numInitialNils: */ + numInitialNils) + : numInitialNils); +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1:Num:Push:Nils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + return (bytecodeSetOffset == 0 + ? (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0) + : (/* begin sistaV1:Num:Push:Nils: */ + (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0))); +} + + +/* Allocate a register needed in a run-time call (i.e. flush uses of the + register to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg: */ +static void NoDbgRegParms +ssAllocateCallReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | (1U << requiredReg), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and: */ +static void NoDbgRegParms +ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | (1U << requiredReg2)), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and:and: */ +static void NoDbgRegParms +ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | ((1U << requiredReg2) | (1U << requiredReg3))), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + liveRegs = NoReg; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveFloatRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatReg: */ +static void NoDbgRegParms +ssAllocateRequiredFloatReg(sqInt requiredReg) +{ + ssAllocateRequiredFloatRegMaskupThroughupThroughNative(1U << requiredReg, simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThroughupThroughNative(requiredRegsMask, stackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + /* begin registerMaskFor:and: */ + liveRegs = (1U << FPReg) | (1U << SPReg); + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if (((registerMask(simStackAt(i))) & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if (((nativeRegisterMask(simNativeStackAt(i))) & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg: */ +static void NoDbgRegParms +ssAllocateRequiredReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:and: */ +static void NoDbgRegParms +ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough((1U << requiredReg1) | (1U << requiredReg2), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, stackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushAll */ +static void +ssFlushAll(void) +{ + ssFlushTonativeFlushTo(simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo: */ +static void NoDbgRegParms +ssFlushTo(sqInt index) +{ + ssFlushTonativeFlushTo(index, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo:nativeFlushTo: */ +static void NoDbgRegParms +ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex) +{ + sqInt i; + + ssNativeFlushTo(nativeIndex); + + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + assert(((((simStackAt(i))->type)) == SSBaseOffset) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil())); + } + for (i = methodOrBlockNumTemps; i < simSpillBase; i += 1) { + assert(((simStackAt(i))->spilled)); + } + if (simSpillBase <= index) { + for (i = (((simSpillBase < methodOrBlockNumTemps) ? methodOrBlockNumTemps : simSpillBase)); i <= index; i += 1) { + assert(needsFrame); + ensureSpilledAtfrom(simStackAt(i), frameOffsetOfTemporary(i), FPReg); + } + simSpillBase = index + 1; + } +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughReceiverVariable: */ +static void NoDbgRegParms +ssFlushUpThroughReceiverVariable(sqInt slotIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == ReceiverResultReg) + && ((((simStackAt(index))->offset)) == (slotOffsetOfInstVarIndex(slotIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughTemporaryVariable: */ +static void NoDbgRegParms +ssFlushUpThroughTemporaryVariable(sqInt tempIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == FPReg) + && ((((simStackAt(index))->offset)) == (frameOffsetOfTemporary(tempIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + /* StackToRegisterMappingCogit>>#ssNativeFlushTo: */ +static void NoDbgRegParms +ssNativeFlushTo(sqInt index) +{ + sqInt allocatedScratchRegister; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt i; + sqInt loadedPointer; + sqInt offset; + sqInt offset1; + + if (simNativeSpillBase <= index) { + loadedPointer = 0; + allocatedScratchRegister = 0; + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= index; i += 1) { + if (!loadedPointer) { + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + loadedPointer = 1; + } + if ((spillingNeedsScratchRegister(simNativeStackAt(i))) + && (!allocatedScratchRegister)) { + /* begin PushR: */ + genoperand(PushR, FPReg); + allocatedScratchRegister = 1; + } + ensureSpilledSPscratchRegister(simNativeStackAt(i), TempReg, FPReg); + } + simNativeSpillBase = index + 1; + if (allocatedScratchRegister) { + /* begin PopR: */ + genoperand(PopR, FPReg); + } + if (loadedPointer) { + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, simNativeStackSize, TempReg); + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + } + } +} + + /* StackToRegisterMappingCogit>>#ssNativePop: */ +static void NoDbgRegParms +ssNativePop(sqInt n) +{ + assert((simNativeStackPtr - n) >= -1); + simNativeStackPtr -= n; + if (simNativeStackPtr >= 0) { + simNativeStackSize = ((ssNativeTop())->offset); + } + else { + simNativeStackSize = 0; + } +} + + /* StackToRegisterMappingCogit>>#ssNativePush: */ +static void NoDbgRegParms +ssNativePush(sqInt n) +{ + simNativeStackPtr += n; +} + + /* StackToRegisterMappingCogit>>#ssNativeTop */ +static CogSimStackNativeEntry * +ssNativeTop(void) +{ + assert(simNativeStackPtr >= 0); + return simNativeStackAt(simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssPopNativeSize: */ +static void NoDbgRegParms +ssPopNativeSize(sqInt popSize) +{ + sqInt popCount; + sqInt poppingSize; + sqInt stackPosition; + + poppingSize = 0; + stackPosition = simNativeStackPtr; + while ((poppingSize < popSize) + && (stackPosition >= 0)) { + poppingSize += stackSpillSize(simNativeStackAt(stackPosition)); + stackPosition -= 1; + } + assert(poppingSize == popSize); + popCount = simNativeStackPtr - stackPosition; + ssNativePop(popCount); +} + + /* StackToRegisterMappingCogit>>#ssPop: */ +static void NoDbgRegParms +ssPop(sqInt n) +{ + assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1)) + || (((!needsFrame) + && ((simStackPtr - n) >= -1)) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil()))); + simStackPtr -= n; +} + + /* StackToRegisterMappingCogit>>#ssPushAnnotatedConstant: */ +static sqInt NoDbgRegParms +ssPushAnnotatedConstant(sqInt literal) +{ + AbstractInstruction *abstractInstruction; + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushBase:offset: */ +static sqInt NoDbgRegParms +ssPushBaseoffset(sqInt reg, sqInt offset) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSBaseOffset); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->offset = offset); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushConstant: */ +static sqInt NoDbgRegParms +ssPushConstant(sqInt literal) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushDesc: */ +static sqInt NoDbgRegParms +ssPushDesc(SimStackEntry simStackEntry) +{ + if (((simStackEntry.type)) == SSSpill) { + (simStackEntry.type = SSBaseOffset); + } + (simStackEntry.spilled = 0); + (simStackEntry.bcptr = bytecodePC); + simStack[(simStackPtr += 1)] = simStackEntry; + updateSimSpillBase(); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat32(float aFloat32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat32 = aFloat32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat64(double aFloat64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat64 = aFloat64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt32(sqInt anInt32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt32 = anInt32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt64(sqLong anInt64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt64 = anInt64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantPointer: */ +static sqInt NoDbgRegParms +ssPushNativeConstantPointer(sqInt aNativePointer) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantNativePointer); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantNativePointer = aNativePointer); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterDoubleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterDoubleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterDoubleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterSingleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterSingleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterSingleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegister(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSNativeRegister); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister:secondRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterPair); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->registerSecond = secondReg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushRegister: */ +static sqInt NoDbgRegParms +ssPushRegister(sqInt reg) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSRegister); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPush: */ +static void NoDbgRegParms +ssPush(sqInt n) +{ + simStackPtr += n; +} + + +/* In addition to ssStorePop:toReg:, if this is a store and not + a popInto I change the simulated stack to use the register + for the top value */ + + /* StackToRegisterMappingCogit>>#ssStoreAndReplacePop:toReg: */ +static void NoDbgRegParms +ssStoreAndReplacePoptoReg(sqInt popBoolean, sqInt reg) +{ + char topSpilled; + + topSpilled = ((ssTop())->spilled); + ssStorePoptoReg(popBoolean + || (topSpilled), reg); + if (!popBoolean) { + if (!topSpilled) { + ssPop(1); + } + ssPushRegister(reg); + } +} + + +/* Store or pop the top simulated stack entry to a register. + Use preferredReg if the entry is not itself a register. + Answer the actual register the result ends up in. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toPreferredReg: */ +static sqInt NoDbgRegParms +ssStorePoptoPreferredReg(sqInt popBoolean, sqInt preferredReg) +{ + sqInt actualReg; + + actualReg = preferredReg; + if ((((ssTop())->type)) == SSRegister) { + assert(!(((ssTop())->spilled))); + actualReg = ((ssTop())->registerr); + } + ssStorePoptoReg(popBoolean, actualReg); + return actualReg; +} + + +/* Store or pop the top simulated stack entry to a register. + N.B.: popToReg: and storeToReg: does not generate anything if + it moves a register to the same register. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toReg: */ +static void NoDbgRegParms +ssStorePoptoReg(sqInt popBoolean, sqInt reg) +{ + if (popBoolean) { + popToReg(ssTop(), reg); + ssPop(1); + } + else { + storeToReg(ssTop(), reg); + } +} + + /* StackToRegisterMappingCogit>>#ssTop */ +static CogSimStackEntry * +ssTop(void) +{ + return simStackAt(simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssTopDescriptor */ +static SimStackEntry +ssTopDescriptor(void) +{ + return simStack[simStackPtr]; +} + + /* StackToRegisterMappingCogit>>#ssValue: */ +static CogSimStackEntry * NoDbgRegParms +ssValue(sqInt n) +{ + return simStackAt(simStackPtr - n); +} + + +/* If the sequence of bytecodes is + push: (Array new: 1) + popIntoTemp: tempIndex + pushConstant: const or pushTemp: n + popIntoTemp: 0 inVectorAt: tempIndex + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. + One might think that we should look for a sequence of more than + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */ + + /* StackToRegisterMappingCogit>>#tryCollapseTempVectorInitializationOfSize: */ +static sqInt NoDbgRegParms +tryCollapseTempVectorInitializationOfSize(sqInt slots) +{ + BytecodeDescriptor *pushArrayDesc; + BytecodeDescriptor *pushValueDesc; + sqInt reg; + sqInt remoteTempIndex; + BytecodeDescriptor *storeArrayDesc; + BytecodeDescriptor *storeValueDesc; + sqInt tempIndex; + + if (slots != 1) { + return 0; + } + pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); + assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); + storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; + } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } + pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { + return 0; + } + storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { + return 0; + } + genNewArrayOfSizeinitialized(1, 0); + evaluateat(pushValueDesc, (bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))); + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, 0, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + evaluateat(storeArrayDesc, bytecodePC + ((pushArrayDesc->numBytes))); + + /* + pushArrayDesc numBytes this gets added by nextBytecodePCFor:at:exts:in: */ + bytecodePC = ((bytecodePC + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + ((storeValueDesc->numBytes)); + return 1; +} + + /* StackToRegisterMappingCogit>>#updateSimSpillBase */ +static void +updateSimSpillBase(void) +{ + if (simSpillBase > simStackPtr) { + simSpillBase = ((simStackPtr < 0) ? 0 : simStackPtr); + } +} + + +/* Used when ReceiverResultReg is allocated for other than simSelf, and + there may be references to ReceiverResultReg which need to be spilled. */ + + /* StackToRegisterMappingCogit>>#voidReceiverResultRegContainsSelf */ +static void +voidReceiverResultRegContainsSelf(void) +{ + sqInt i; + sqInt spillIndex; + + (optStatus.isReceiverResultRegLive = 0); + spillIndex = -1; + for (i = (((methodOrBlockNumTemps < simSpillBase) ? simSpillBase : methodOrBlockNumTemps)); i <= simStackPtr; i += 1) { + if ((registerOrNone(simStackAt(i))) == ReceiverResultReg) { + spillIndex = i; + } + } + if (spillIndex > 0) { + ssFlushTo(simStackPtr - spillIndex); + } +} diff --git a/spurlowcodesrc/vm/cogitMIPSEL.c b/spurlowcodesrc/vm/cogitMIPSEL.c new file mode 100644 index 0000000000..2e659a2c39 --- /dev/null +++ b/spurlowcodesrc/vm/cogitMIPSEL.c @@ -0,0 +1,40291 @@ +/* Automatically generated by + CCodeGenerator VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + from + StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a " __DATE__ ; +char *__cogitBuildInfo = __buildInfo; + + + +#include +#include +#include "sq.h" +#include "sqCogStackAlignment.h" +#include "dispdbg.h" +#include "cogmethod.h" +#if COGMTVM +#include "cointerpmt.h" +#else +#include "cointerp.h" +#endif +#include "cogit.h" + + +/*** Constants ***/ +#define A0 4 +#define A1 5 +#define A2 6 +#define A3 7 +#define ADDIU 9 +#define ADDU 33 +#define AddCheckOverflowCqR 150 +#define AddCheckOverflowRR 151 +#define AddCqR 105 +#define AddCwR 113 +#define AddcCqR 119 +#define AddcRR 118 +#define AddRdRd 123 +#define AddRR 99 +#define AddRsRs 130 +#define AlignmentNops 3 +#define AltBlockCreationBytecodeSize 3 +#define AltFirstSpecialSelector 96 +#define AltNumSpecialSelectors 32 +#define AND 36 +#define ANDI 12 +#define AndCqR 107 +#define AndCqRR 121 +#define AndCwR 115 +#define AndRR 101 +#define AnnotationShift 5 +#define Arg0Reg 17 +#define Arg1Reg 18 +#define ArithmeticShiftRightCqR 90 +#define ArithmeticShiftRightRR 91 +#define AT 1 +#define BadRegisterSet 1 +#define BEQ 4 +#define BGEZ 1 +#define BGTZ 7 +#define BLEZ 6 +#define BLTZ 0 +#define BlockCreationBytecodeSize 4 +#define BNE 5 +#define BREAK 13 +#define BranchTemp 11 +#define BrEqualRR 155 +#define BrLongEqualRR 165 +#define BrLongNotEqualRR 166 +#define BrNotEqualRR 156 +#define BrSignedGreaterEqualRR 164 +#define BrSignedGreaterRR 163 +#define BrSignedLessEqualRR 162 +#define BrSignedLessRR 161 +#define BrUnsignedGreaterEqualRR 160 +#define BrUnsignedGreaterRR 159 +#define BrUnsignedLessEqualRR 158 +#define BrUnsignedLessRR 157 +#define BytecodeSetHasDirectedSuperSend 1 +#define Call 6 +#define CallerSavedRegisterMask 0x300FF00 +#define CallFull 7 +#define CallR 8 +#if !defined(CheckRememberedInTrampoline) /* Allow this to be overridden on the compiler command line */ +# define CheckRememberedInTrampoline 0 +#endif +#define ClassArrayCompactIndex 51 +#define ClassBlockClosureCompactIndex 37 +#define ClassFloatCompactIndex 34 +#define ClassFullBlockClosureCompactIndex 38 +#define ClassLargeNegativeInteger 42 +#define ClassLargePositiveInteger 13 +#define ClassMethodContextCompactIndex 36 +#define ClassReg 19 +#define ClosureFirstCopiedValueIndex 3 +#define ClosureIndex 4 +#define ClosureNumArgsIndex 2 +#define ClosureOuterContextIndex 0 +#define ClosureStartPCIndex 1 +#define CMBlock 3 +#define CMClosedPIC 4 +#define CMFree 1 +#define CMMaxUsageCount 7 +#define CMMethod 2 +#define CMOpenPIC 5 +#define Cmp 8 +#define CmpC32R 112 +#define CmpCqR 104 +#define CmpCwR 111 +#define CmpRdRd 122 +#define CmpRR 98 +#define CmpRsRs 129 +#define CompletePrimitive 4 +#define ConcreteVarBaseReg 22 +#define ConstZero 1 +#define ConvertRdR 137 +#define ConvertRdRs 139 +#define ConvertRRd 136 +#define ConvertRRs 141 +#define ConvertRsR 140 +#define ConvertRsRd 138 +#define Debug DEBUGVM +#define DIV 26 +#define DisplacementMask 0x1F +#define DisplacementX2N 0 +#define DivRdRd 126 +#define DivRR 147 +#define DivRsRs 133 +#undef DPFPReg0 +#undef DPFPReg1 +#undef DPFPReg2 +#undef DPFPReg3 +#undef DPFPReg4 +#undef DPFPReg5 +#undef DPFPReg6 +#undef DPFPReg7 +#define EncounteredUnknownBytecode -6 +#undef Extra0Reg +#define Fill32 4 +#define FirstAnnotation 64 +#define FirstJump 12 +#define FirstSpecialSelector 176 +#define FoxCallerSavedIP 4 +#define FoxMethod -4 +#define FoxMFReceiver -12 +#define FoxSavedFP 0 +#define FoxThisContext -8 +#define FP 30 +#define FPReg 30 +#define FullClosureCompiledBlockIndex 1 +#define FullClosureFirstCopiedValueIndex 4 +#define FullClosureReceiverIndex 3 +#define GCModeBecome 8 +#define GCModeFull 1 +#define GCModeNewSpace 2 +#define HasBytecodePC 5 +#define HeaderIndex 0 +#define HintLoad 0 +#define HintStore 1 +#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ +# define IMMUTABILITY 0 +#endif +#define InFullBlock 2 +#define InstanceSpecificationIndex 2 +#define InstructionPointerIndex 1 +#define InsufficientCodeSpace -2 +#define InVanillaBlock 1 +#define IsAbsPCReference 3 +#define IsAnnotationExtension 1 +#define IsDirectedSuperSend 9 +#define IsDisplacementX2N 0 +#define IsNSDynamicSuperSend null +#define IsNSImplicitReceiverSend null +#define IsNSSelfSend null +#define IsNSSendCall null +#define IsObjectReference 2 +#define IsRelativeCall 4 +#define IsSendCall 7 +#define IsSuperSend 8 +#define J 2 +#define JAL 3 +#define JALR 9 +#define JR 8 +#define Jump 16 +#define JumpAbove 31 +#define JumpAboveOrEqual 30 +#define JumpBelow 29 +#define JumpBelowOrEqual 32 +#define JumpCarry 23 +#define JumpFPEqual 33 +#define JumpFPGreater 37 +#define JumpFPGreaterOrEqual 38 +#define JumpFPLess 35 +#define JumpFPLessOrEqual 36 +#define JumpFPNotEqual 34 +#define JumpFPOrdered 39 +#define JumpFPUnordered 40 +#define JumpFull 12 +#define JumpGreater 27 +#define JumpGreaterOrEqual 26 +#define JumpLess 25 +#define JumpLessOrEqual 28 +#define JumpLong 13 +#define JumpLongNonZero 15 +#define JumpLongZero 14 +#define JumpNegative 19 +#define JumpNoCarry 24 +#define JumpNonNegative 20 +#define JumpNonZero 18 +#define JumpNoOverflow 22 +#define JumpOverflow 21 +#define JumpR 10 +#define JumpZero 17 +#define Label 1 +#define LargeContextSlots 62 +#define LastJump 40 +#define LB 32 +#define LBU 36 +#define LH 33 +#define LHU 37 +#define LinkReg 31 +#define Literal 2 +#define LiteralStart 1 +#define LoadEffectiveAddressMwrR 86 +#define LogicalShiftLeftCqR 94 +#define LogicalShiftLeftRR 95 +#define LogicalShiftRightCqR 92 +#define LogicalShiftRightRR 93 +#define LowcodeContextMark 60 +#define LowcodeVM 1 +#define LUI 15 +#define LW 35 +#define MapEnd 0 +#define MaxCompiledPrimitiveIndex 222 +#define MaxCPICCases 6 +#define MaxMethodSize 65535 +#define MaxNegativeErrorCode -8 +#define MaxNumArgs 15 +#define MaxStackAllocSize 1572864 +#define MaxStackCheckOffset 0xFFF +#define MaxX2NDisplacement 992 +#define MethodCacheClass 2 +#define MethodCacheMask 0xFFC +#define MethodCacheMethod 3 +#define MethodCacheSelector 1 +#define MethodIndex 3 +#define MethodTooBig -4 +#define MFHI 16 +#define MFLO 18 +#define MFMethodFlagHasContextFlag 1 +#define MFMethodFlagIsBlockFlag 2 +#define MoveAbR 46 +#define MoveAwR 42 +#define MoveC32R 71 +#define MoveCqR 69 +#define MoveCwR 70 +#define MoveHighR 149 +#define MoveLowR 148 +#define MoveM16rR 57 +#define MoveM32rR 61 +#define MoveM32rRs 79 +#define MoveM64rRd 76 +#define MoveM8rR 54 +#define MoveMbrR 65 +#define MoveMwrR 48 +#define MoveRAb 47 +#define MoveRAw 44 +#define MoveRdM64r 77 +#define MoveRdRd 75 +#define MoveRM16r 58 +#define MoveRM32r 62 +#define MoveRM8r 56 +#define MoveRMbr 66 +#define MoveRMwr 49 +#define MoveRR 41 +#define MoveRsM32r 80 +#define MoveRsRs 78 +#define MoveRXbrR 68 +#define MoveRXwrR 51 +#define MoveXbrRR 67 +#define MoveXwrRR 50 +#define MULT 24 +#define MULTIPLEBYTECODESETS 1 +#define MulCheckOverflowRR 152 +#define MulRdRd 125 +#define MulRR 146 +#define MulRsRs 132 +#define NeedsMergeFixupFlag 2 +#define NeedsNonMergeFixupFlag 1 +#define NegateR 88 +#define NewspeakVM 0 +#define Nop 5 +#define NoReg -1 +#define NotFullyInitialized -1 +#define NotR 89 +#define NumObjRefsInRuntime 0 +#define NumOopsPerNSC 6 +#define NumSendTrampolines 4 +#define NumSpecialSelectors 32 +#define NumStoreTrampolines 5 +#define NumTrampolines (IMMUTABILITY ? 82 : 77) +#define OneInstruction 4 +#define OR 37 +#define ORI 13 +#define OrCqR 108 +#define OrCwR 116 +#define OrRR 102 +#define Overflow 8 +#define OverflowTemp1 9 +#define OverflowTemp2 10 +#undef PCReg +#define PopR 81 +#define PREF 51 +#define PrefetchAw 85 +#define PrimCallCollectsProfileSamples 8 +#define PrimCallDoNotJIT 32 +#define PrimCallMayCallBack 4 +#define PrimCallNeedsNewMethod 1 +#define PrimCallNeedsPrimitiveFunction 2 +#define PrimErrNoMemory 9 +#define PrimErrWritePastObject 17 +#define PushCq 83 +#define PushCw 84 +#define PushR 82 +#define R0 0 +#define R28 28 +#define RA 31 +#define REGIMM 1 +#define ReceiverIndex 5 +#define ReceiverResultReg 16 +#define RetN 9 +#define RISCTempReg 1 +#define SB 40 +#define SelectorCannotInterpret 34 +#define SelectorDoesNotUnderstand 20 +#define SenderIndex 0 +#define SendNumArgsReg 20 +#define SH 41 +#define ShouldNotJIT -8 +#define SignExtend16RR 143 +#define SignExtend8RR 142 +#define SistaV1BytecodeSet 1 +#define SistaVM 1 +#define SLL 0 +#define SLLV 4 +#define SLT 42 +#define SLTI 10 +#define SLTIU 11 +#define SLTU 43 +#define SmallContextSlots 22 +#define SP 29 +#define SPECIAL 0 +#define SPReg 29 +#define SPURVM 1 +#define SqrtRd 127 +#define SqrtRs 134 +#define SRA 3 +#define SRAV 7 +#define SRL 2 +#define SRLV 6 +#define SSBaseOffset 1 +#define SSConstant 2 +#define SSConstantFloat32 15 +#define SSConstantFloat64 16 +#define SSConstantInt32 13 +#define SSConstantInt64 14 +#define SSConstantNativePointer 17 +#define SSNativeRegister 5 +#define SSRegister 3 +#define SSRegisterDoubleFloat 7 +#define SSRegisterPair 6 +#define SSRegisterSingleFloat 8 +#define SSSpill 4 +#define SSSpillFloat32 11 +#define SSSpillFloat64 12 +#define SSSpillInt64 10 +#define SSSpillNative 9 +#define StackPointerIndex 2 +#define Stop 11 +#define SUBU 35 +#define SubbRR 120 +#define SubCheckOverflowCqR 153 +#define SubCheckOverflowRR 154 +#define SubCqR 106 +#define SubCwR 114 +#define SubRdRd 124 +#define SubRR 100 +#define SubRsRs 131 +#define SW 43 +#define TargetReg 25 +#define TempReg 21 +#define TstCqR 109 +#define UnfailingPrimitive 3 +#define UnimplementedPrimitive -7 +#define UnknownSimStackPtrFlag -2 +#define V0 2 +#define ValueIndex 1 +#define VarBaseReg 22 +#define XOR 38 +#define XORI 14 +#define XorCqR 110 +#define XorCwR 117 +#define XorRdRd 128 +#define XorRR 103 +#define XorRsRs 135 +#define YoungSelectorInPIC -5 +#define ZeroExtend16RR 145 +#define ZeroExtend8RR 144 +#define ZR 0 + +typedef struct _AbstractInstruction { + unsigned char opcode; + unsigned char machineCodeSize; + unsigned char maxSize; + unsigned char annotation; + usqIntptr_t operands [3]; + usqIntptr_t address; + struct _AbstractInstruction *dependent; + usqIntptr_t machineCode [7]; + } AbstractInstruction; + +#define CogMIPSELCompiler AbstractInstruction +#define CogAbstractInstruction AbstractInstruction + + +typedef struct { + AbstractInstruction *fakeHeader; + AbstractInstruction *fillInstruction; + sqInt numArgs; + sqInt numCopied; + sqInt numInitialNils; + sqInt startpc; + AbstractInstruction *entryLabel; + AbstractInstruction *stackCheckLabel; + sqInt span; + sqInt hasInstVarRef; + } BlockStart; + +#define CogBlockStart BlockStart + + +typedef struct _BytecodeDescriptor { + sqInt (*generator )(void); + sqInt NoDbgRegParms (*spanFunction )(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt); + sqInt NoDbgRegParms (*needsFrameFunction )(sqInt); + signed char stackDelta; + unsigned char opcode; + unsigned char numBytes; + unsigned isBranchTrue : 1; + unsigned isBranchFalse : 1; + unsigned isReturn : 1; + unsigned isBlockCreation : 1; + unsigned isMapped : 1; + unsigned isMappedInBlock : 1; + unsigned isExtension : 1; + unsigned isInstVarRef : 1; + unsigned is1ByteInstVarStore : 1; + unsigned isCallPrimitive : 1; + } BytecodeDescriptor; + +#define CogBytecodeDescriptor BytecodeDescriptor + + +typedef struct { + sqInt (*primitiveGenerator )(void); + sqInt primNumArgs; + } PrimitiveDescriptor; + +#define CogPrimitiveDescriptor PrimitiveDescriptor + + +typedef struct { + char type; + char spilled; + sqInt annotateUse; + sqInt registerr; + sqInt offset; + sqInt constant; + sqInt bcptr; + } SimStackEntry; + +#define CogSimStackEntry SimStackEntry + + +typedef struct { + AbstractInstruction *targetInstruction; + sqInt instructionIndex; + sqInt simStackPtr; + sqInt simNativeStackPtr; + sqInt simNativeStackSize; + } BytecodeFixup; + +#define CogSSBytecodeFixup BytecodeFixup +#define CogBytecodeFixup BytecodeFixup + + +typedef struct { + sqInt isReceiverResultRegLive; + CogSimStackEntry *ssEntry; + } CogSSOptStatus; + + +typedef struct { + char type; + char spilled; + sqInt registerr; + sqInt registerSecond; + sqInt offset; + sqInt constant; + sqInt constantInt32; + sqLong constantInt64; + float constantFloat32; + double constantFloat64; + sqInt constantNativePointer; + sqInt bcptr; + } CogSimStackNativeEntry; + + + +/*** Function Prototypes ***/ + + +#if !PRODUCTION && defined(PlatformNoDbgRegParms) +# define NoDbgRegParms PlatformNoDbgRegParms +#endif + +#if !defined(NoDbgRegParms) +# define NoDbgRegParms /*empty*/ +#endif + + + +#if !defined(NeverInline) +# define NeverInline /*empty*/ +#endif + +static AbstractInstruction * NoDbgRegParms addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction); +static sqInt NoDbgRegParms availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask); +static sqInt NoDbgRegParms availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask); +static AbstractInstruction * NoDbgRegParms cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral); +static AbstractInstruction * NoDbgRegParms genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister); +static AbstractInstruction * NoDbgRegParms getJmpTarget(AbstractInstruction * self_in_getJmpTarget); +static AbstractInstruction * NoDbgRegParms initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal); +static AbstractInstruction * NoDbgRegParms initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal); +static sqInt NoDbgRegParms isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress); +static sqInt NoDbgRegParms isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress); +static AbstractInstruction * NoDbgRegParms jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction); +static usqIntptr_t NoDbgRegParms labelOffset(AbstractInstruction * self_in_labelOffset); +static sqInt NoDbgRegParms literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress); +static AbstractInstruction * NoDbgRegParms resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget); +static sqInt NoDbgRegParms rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static sqInt NoDbgRegParms rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction); +static sqInt NoDbgRegParms wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject); +static CogMethod * NoDbgRegParms cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod); +static sqInt NoDbgRegParms isBranch(BytecodeDescriptor * self_in_isBranch); +static sqInt NoDbgRegParms isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch); +static AbstractInstruction * NoDbgRegParms gAddCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gArithmeticShiftRightRR(sqInt reg1, sqInt reg2); +extern sqInt abortOffset(void); +static void addCleanBlockStarts(void); +extern void addCogMethodsToHeapMap(void); +static sqInt NoDbgRegParms addressIsInFixups(AbstractInstruction *address); +static sqInt NoDbgRegParms addressIsInInstructions(AbstractInstruction *address); +static sqInt NoDbgRegParms addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC); +static sqInt NoDbgRegParms alignUptoRoutineBoundary(sqInt anAddress); +static sqInt allMachineCodeObjectReferencesValid(void); +static sqInt allMethodsHaveCorrectHeader(void); +static AbstractInstruction * NoDbgRegParms annotateAbsolutePCRef(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); +static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); +static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); +static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); +extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +static AbstractInstruction * NoDbgRegParms CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved); +static AbstractInstruction * NoDbgRegParms gCall(sqInt callTarget); +static AbstractInstruction * NoDbgRegParms gCmpCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gCmpRR(sqInt reg1, sqInt reg2); +extern void callCogCodePopReceiver(void); +extern void callCogCodePopReceiverAndClassRegs(void); +extern sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver); +extern void ceFree(void*pointer); +extern void* ceMalloc(size_t size); +extern sqInt ceSICMiss(sqInt receiver); +extern void checkAssertsEnabledInCogit(void); +static sqInt NoDbgRegParms checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes); +static sqInt NoDbgRegParms checkMaybeObjRefInClosedPIC(sqInt maybeObject); +static sqInt NoDbgRegParms checkValidObjectReferencesInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms closedPICRefersToUnmarkedObject(CogMethod *cPIC); +extern char * codeEntryFor(char *address); +extern char * codeEntryNameFor(char *address); +extern sqInt cogCodeBase(void); +extern sqInt cogCodeConstituents(void); +static sqInt NoDbgRegParms cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase); +extern CogMethod * cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied); +extern void cogitPostGCAction(sqInt gcMode); +extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod); +extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs); +static CogMethod * NoDbgRegParms cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs); +static CogMethod * NoDbgRegParms cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase); +extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop); +extern void compactCogCompiledCode(void); +static void compactPICsWithFreedTargets(void); +static AbstractInstruction * compileAbort(void); +static sqInt NoDbgRegParms compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex); +static void NoDbgRegParms compileBlockEntry(BlockStart *blockStart); +static void NoDbgRegParms compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask); +static void NoDbgRegParms compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask); +static AbstractInstruction * compileCPICEntry(void); +static sqInt NoDbgRegParms compileEntireFullBlockMethod(sqInt numCopied); +static void compileEntry(void); +static sqInt compileFullBlockEntry(void); +static sqInt compileMethodBody(void); +static sqInt NoDbgRegParms compilePICAbort(sqInt numArgs); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void NoDbgRegParms compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone); +static void NoDbgRegParms compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone); +static void computeEntryOffsets(void); +static void computeFullBlockEntryOffsets(void); +static void computeMaximumSizes(void); +static sqInt NoDbgRegParms configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta); +static sqInt NoDbgRegParms cPICCompactAndIsNowEmpty(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasForwardedClass(CogMethod *cPIC); +static sqInt NoDbgRegParms cPICHasFreedTargets(CogMethod *cPIC); +static usqInt cPICPrototypeCaseOffset(void); +static sqInt NoDbgRegParms cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod); +static AbstractInstruction * NoDbgRegParms gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder); +extern sqInt defaultCogCodeSize(void); +static sqInt NoDbgRegParms deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader); +static sqInt NoDbgRegParms endPCOf(sqInt aMethod); +extern void enterCogCodePopReceiver(void); +static sqInt NoDbgRegParms expectedClosedPICPrototype(CogMethod *cPIC); +static sqInt extABytecode(void); +static sqInt extBBytecode(void); +static sqInt NoDbgRegParms fillInBlockHeadersAt(sqInt startAddress); +static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector); +static sqInt NoDbgRegParms findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc); +static usqInt NoDbgRegParms findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc); +static sqInt NoDbgRegParms findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod); +extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod); +static sqInt NoDbgRegParms findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc); +static usqInt NoDbgRegParms firstMappedPCFor(CogMethod *cogMethod); +static sqInt firstPrototypeMethodOop(void); +extern void followForwardedLiteralsIn(CogMethod *cogMethod); +extern void followForwardedMethods(void); +static sqInt NoDbgRegParms followMaybeObjRefInClosedPICAt(sqInt mcpc); +static sqInt NoDbgRegParms followMethodReferencesInClosedPIC(CogMethod *cPIC); +extern void freeUnmarkedMachineCode(void); +static AbstractInstruction * NoDbgRegParms genCallMustBeBooleanFor(sqInt boolean); +static sqInt genCheckForInterruptsTrampoline(void); +static AbstractInstruction * NoDbgRegParms genConditionalBranchoperand(sqInt opcode, sqInt operandOne); +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) ; +static void NoDbgRegParms genEnilopmartReturn(sqInt forCall); +static void NoDbgRegParms generateCaptureCStackPointers(sqInt captureFramePointer); +static void generateClosedPICPrototype(void); +static CogMethod * generateCogFullBlock(void); +static CogMethod * NoDbgRegParms generateCogMethod(sqInt selector); +static sqInt NoDbgRegParms generateInstructionsAt(sqInt eventualAbsoluteAddress); +static sqInt NoDbgRegParms generateMapAtstart(sqInt addressOrNull, sqInt startAddress); +static void generateOpenPICPrototype(void); +static void generateRunTimeTrampolines(void); +static void generateStackPointerCapture(void); +static void generateTrampolines(void); +static sqInt genFFICalloutTrampoline(void); +static void genGetLeafCallStackPointer(void); +static sqInt NoDbgRegParms genInnerPICAbortTrampoline(char *name); +static sqInt genLoadCStackPointersForPrimCall(void); +static void NoDbgRegParms genLoadInlineCacheWithSelector(sqInt selectorIndex); +static sqInt genNonLocalReturnTrampoline(void); +static sqInt NoDbgRegParms genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genSmalltalkToCStackSwitch(sqInt pushLinkReg); +static sqInt NoDbgRegParms genTrampolineForcalled(void *aRoutine, char *aString); +static sqInt NoDbgRegParms genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0); +static sqInt NoDbgRegParms genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask); +static sqInt NoDbgRegParms genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2); +static sqInt NoDbgRegParms genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean); +static sqInt NoDbgRegParms genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask); +static AbstractInstruction * NoDbgRegParms gen(sqInt opcode); +static AbstractInstruction * NoDbgRegParms genoperand(sqInt opcode, sqInt operand); +static AbstractInstruction * NoDbgRegParms genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo); +static AbstractInstruction * NoDbgRegParms genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree); +static sqInt NoDbgRegParms getLiteral(sqInt litIndex); +static sqInt NoDbgRegParms incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc); +static sqInt initialClosedPICUsageCount(void); +static void initializeBackend(void); +extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress); +static sqInt initialMethodUsageCount(void); +static sqInt initialOpenPICUsageCount(void); +static sqInt NoDbgRegParms inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc); +static sqInt NoDbgRegParms inverseBranchFor(sqInt opcode); +static sqInt NoDbgRegParms isPCMappedAnnotation(sqInt annotation); +extern sqInt isPCWithinMethodZone(void *address); +extern sqInt isSendReturnPC(sqInt retpc); +static AbstractInstruction * NoDbgRegParms gJumpFPEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreaterOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPGreater(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLessOrEqual(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPLess(void *jumpTarget); +static AbstractInstruction * NoDbgRegParms gJumpFPNotEqual(void *jumpTarget); +static AbstractInstruction * gLabel(void); +static AbstractInstruction * NoDbgRegParms gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * lastOpcode(void); +extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver); +static BytecodeDescriptor * loadBytesAndGetDescriptor(void); +static void NoDbgRegParms loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc); +static AbstractInstruction * NoDbgRegParms gMoveAwR(sqInt address, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCqR(sqInt quickConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveCwR(sqInt wordConstant, sqInt reg); +static AbstractInstruction * NoDbgRegParms gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg); +static AbstractInstruction * NoDbgRegParms gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg); +static AbstractInstruction * NoDbgRegParms gMoveRR(sqInt reg1, sqInt reg2); +static usqInt NoDbgRegParms mapEndFor(CogMethod *cogMethod); +static sqInt NoDbgRegParms mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg); +static sqInt NoDbgRegParms mapObjectReferencesInClosedPIC(CogMethod *cPIC); +static void mapObjectReferencesInGeneratedRuntime(void); +static void mapObjectReferencesInMachineCodeForBecome(void); +static void mapObjectReferencesInMachineCodeForFullGC(void); +static void mapObjectReferencesInMachineCodeForYoungGC(void); +extern void mapObjectReferencesInMachineCode(sqInt gcMode); +extern void markAndTraceMachineCodeOfMarkedMethods(void); +static void markAndTraceObjectReferencesInGeneratedRuntime(void); +static sqInt NoDbgRegParms markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit); +static sqInt NoDbgRegParms markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC); +static sqInt NoDbgRegParms markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +static sqInt NoDbgRegParms markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod); +extern void markMethodAndReferents(CogBlockMethod *aCogMethod); +extern usqInt maxCogMethodAddress(void); +static sqInt maybeAllocAndInitIRCs(void); +static sqInt NoDbgRegParms maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod); +static void NoDbgRegParms maybeMarkCountersIn(CogMethod *cogMethod); +static sqInt mclassIsSmallInteger(void); +extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod); +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); +static sqInt noCogMethodsMaximallyMarked(void); +static sqInt NoDbgRegParms noTargetsFreeInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms outputInstructionsAt(sqInt startAddress); +static sqInt NoDbgRegParms outputInstructionsForGeneratedRuntimeAt(sqInt startAddress); +static AbstractInstruction * NoDbgRegParms gPopR(sqInt reg); +static AbstractInstruction * NoDbgRegParms gPushCw(sqInt wordConstant); +extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver); +static sqInt picAbortDiscriminatorValue(void); +static sqInt picInterpretAbortOffset(void); +static AbstractInstruction * previousInstruction(void); +extern void printCogMethodFor(void *address); +extern void printPCMapPairsFor(CogMethod *cogMethod); +extern void printTrampolineTable(void); +static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(void); +static sqInt processorHasMultiplyAndMClassIsSmallInteger(void); +static void NoDbgRegParms recordGeneratedRunTimeaddress(char *aString, sqInt address); +extern sqInt recordPrimTraceFunc(void); +static void recordRunTimeObjectReferences(void); +static sqInt NoDbgRegParms registerMaskFor(sqInt reg); +static sqInt NoDbgRegParms registerMaskForandand(sqInt reg1, sqInt reg2, sqInt reg3); +static void NoDbgRegParms relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod); +static void NoDbgRegParms relocateCallsInClosedPIC(CogMethod *cPIC); +static sqInt NoDbgRegParms relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta); +static sqInt NoDbgRegParms remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr); +static sqInt NoDbgRegParms remapMaybeObjRefInClosedPICAt(sqInt mcpc); +static void NoDbgRegParms rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget); +static AbstractInstruction * NoDbgRegParms gSubCwR(sqInt wordConstant, sqInt reg); +static sqInt scanForCleanBlocks(void); +extern void setBreakMethod(sqInt anObj); +extern void setPostCompileHook(void (*aFunction)(CogMethod *)); +extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop); +static sqInt NoDbgRegParms spanForCleanBlockStartingAt(sqInt startPC); +static sqInt subsequentPrototypeMethodOop(void); +extern sqInt traceLinkedSendOffset(void); +static sqInt NoDbgRegParms trampolineArgConstant(sqInt booleanOrInteger); +static char * NoDbgRegParms trampolineNamenumArgs(char *routinePrefix, sqInt numArgs); +static char * NoDbgRegParms trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit); +static char * NoDbgRegParms trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs); +static sqInt unknownBytecode(void); +extern void unlinkAllSends(void); +static sqInt NoDbgRegParms unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector); +static sqInt NoDbgRegParms unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity); +static sqInt NoDbgRegParms unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod); +extern void unlinkSendsLinkedForInvalidClasses(void); +extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector); +extern void unlinkSendsToFree(void); +extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue); +static AbstractInstruction * NoDbgRegParms gXorCwR(sqInt wordConstant, sqInt reg); +static void zeroOpcodeIndex(void); +static void zeroOpcodeIndexForNewOpcodes(void); +extern void addAllToYoungReferrers(void); +static void NoDbgRegParms addToOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms addToYoungReferrers(CogMethod *cogMethod); +static sqInt NoDbgRegParms allocate(sqInt numBytes); +static void clearCogCompiledCode(void); +static void NoDbgRegParms clearSavedPICUsageCount(CogMethod *cogMethod); +static void compactCompiledCode(void); +static void NoDbgRegParms ensureInYoungReferrers(CogMethod *cogMethod); +static void followForwardedLiteralsInOpenPICList(void); +extern void freeMethod(CogMethod *cogMethod); +static void freeOlderMethodsForCompaction(void); +static sqInt kosherYoungReferrers(void); +static void NoDbgRegParms manageFromto(sqInt theStartAddress, sqInt theLimitAddress); +extern CogMethod * methodFor(void *address); +extern sqInt methodsCompiledToMachineCodeInto(sqInt arrayObj); +extern sqInt numMethods(void); +extern sqInt numMethodsOfType(sqInt cogMethodType); +static sqInt NoDbgRegParms occurrencesInYoungReferrers(CogMethod *cogMethod); +static CogMethod * NoDbgRegParms openPICWithSelector(sqInt aSelector); +static void planCompaction(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 NoDbgRegParms removeFromOpenPICList(CogMethod *anOpenPIC); +static void NoDbgRegParms restorePICUsageCount(CogMethod *cogMethod); +static void NoDbgRegParms savePICUsageCount(CogMethod *cogMethod); +static void voidYoungReferrersPostTenureAll(void); +extern char * whereIsMaybeCodeThing(sqInt anOop); +static sqInt NoDbgRegParms addiuRRC(AbstractInstruction * self_in_addiuRRC, sqInt destReg, sqInt srcReg, sqInt imm); +static sqInt NoDbgRegParms adduRRR(AbstractInstruction * self_in_adduRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms andiRRC(AbstractInstruction * self_in_andiRRC, sqInt destReg, sqInt srcReg, sqInt imm); +static sqInt NoDbgRegParms andRRR(AbstractInstruction * self_in_andRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms beqRRoffset(AbstractInstruction * self_in_beqRRoffset, sqInt leftReg, sqInt rightReg, sqInt offset); +static sqInt NoDbgRegParms bgezRoffset(AbstractInstruction * self_in_bgezRoffset, sqInt cmpReg, sqInt offset); +static sqInt NoDbgRegParms bgtzRoffset(AbstractInstruction * self_in_bgtzRoffset, sqInt cmpReg, sqInt offset); +static sqInt NoDbgRegParms blezRoffset(AbstractInstruction * self_in_blezRoffset, sqInt cmpReg, sqInt offset); +static sqInt NoDbgRegParms bltzRoffset(AbstractInstruction * self_in_bltzRoffset, sqInt cmpReg, sqInt offset); +static sqInt NoDbgRegParms bneRRoffset(AbstractInstruction * self_in_bneRRoffset, sqInt leftReg, sqInt rightReg, sqInt offset); +static sqInt NoDbgRegParms callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize); +static usqInt NoDbgRegParms callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress); +static sqInt NoDbgRegParms cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize); +static sqInt NoDbgRegParms computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize); +static usqInt NoDbgRegParms concretizeAddCheckOverflowCqR(AbstractInstruction * self_in_concretizeAddCheckOverflowCqR); +static usqInt NoDbgRegParms concretizeAddCheckOverflowRR(AbstractInstruction * self_in_concretizeAddCheckOverflowRR); +static usqInt NoDbgRegParms concretizeAddCqR(AbstractInstruction * self_in_concretizeAddCqR); +static usqInt NoDbgRegParms concretizeAddCwR(AbstractInstruction * self_in_concretizeAddCwR); +static usqInt NoDbgRegParms concretizeAddRR(AbstractInstruction * self_in_concretizeAddRR); +static AbstractInstruction * NoDbgRegParms concretizeAlignmentNops(AbstractInstruction * self_in_concretizeAlignmentNops); +static usqInt NoDbgRegParms concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR); +static usqInt NoDbgRegParms concretizeAndCqRR(AbstractInstruction * self_in_concretizeAndCqRR); +static usqInt NoDbgRegParms concretizeAndCwR(AbstractInstruction * self_in_concretizeAndCwR); +static usqInt NoDbgRegParms concretizeAndRR(AbstractInstruction * self_in_concretizeAndRR); +static usqInt NoDbgRegParms concretizeArithmeticShiftRightCqR(AbstractInstruction * self_in_concretizeArithmeticShiftRightCqR); +static usqInt NoDbgRegParms concretizeArithmeticShiftRightRR(AbstractInstruction * self_in_concretizeArithmeticShiftRightRR); +static sqInt NoDbgRegParms concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress); +static usqInt NoDbgRegParms concretizeBrEqualRR(AbstractInstruction * self_in_concretizeBrEqualRR); +static usqInt NoDbgRegParms concretizeBrLongEqualRR(AbstractInstruction * self_in_concretizeBrLongEqualRR); +static usqInt NoDbgRegParms concretizeBrLongNotEqualRR(AbstractInstruction * self_in_concretizeBrLongNotEqualRR); +static usqInt NoDbgRegParms concretizeBrNotEqualRR(AbstractInstruction * self_in_concretizeBrNotEqualRR); +static usqInt NoDbgRegParms concretizeBrSignedGreaterEqualRR(AbstractInstruction * self_in_concretizeBrSignedGreaterEqualRR); +static usqInt NoDbgRegParms concretizeBrSignedGreaterRR(AbstractInstruction * self_in_concretizeBrSignedGreaterRR); +static usqInt NoDbgRegParms concretizeBrSignedLessEqualRR(AbstractInstruction * self_in_concretizeBrSignedLessEqualRR); +static usqInt NoDbgRegParms concretizeBrSignedLessRR(AbstractInstruction * self_in_concretizeBrSignedLessRR); +static usqInt NoDbgRegParms concretizeBrUnsignedGreaterEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterEqualRR); +static usqInt NoDbgRegParms concretizeBrUnsignedGreaterRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterRR); +static usqInt NoDbgRegParms concretizeBrUnsignedLessEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedLessEqualRR); +static usqInt NoDbgRegParms concretizeBrUnsignedLessRR(AbstractInstruction * self_in_concretizeBrUnsignedLessRR); +static usqInt NoDbgRegParms concretizeCall(AbstractInstruction * self_in_concretizeCall); +static usqInt NoDbgRegParms concretizeCallFull(AbstractInstruction * self_in_concretizeCallFull); +static sqInt NoDbgRegParms concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR); +static sqInt NoDbgRegParms concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR); +static sqInt NoDbgRegParms concretizeCmpRR(AbstractInstruction * self_in_concretizeCmpRR); +static usqInt NoDbgRegParms concretizeDivRR(AbstractInstruction * self_in_concretizeDivRR); +static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32); +static usqInt NoDbgRegParms concretizeJump(AbstractInstruction * self_in_concretizeJump); +static usqInt NoDbgRegParms concretizeJumpFull(AbstractInstruction * self_in_concretizeJumpFull); +static usqInt NoDbgRegParms concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong); +static sqInt NoDbgRegParms concretizeJumpLongNonZero(AbstractInstruction * self_in_concretizeJumpLongNonZero); +static sqInt NoDbgRegParms concretizeJumpLongZero(AbstractInstruction * self_in_concretizeJumpLongZero); +static sqInt NoDbgRegParms concretizeJumpNonZero(AbstractInstruction * self_in_concretizeJumpNonZero); +static sqInt NoDbgRegParms concretizeJumpNoOverflow(AbstractInstruction * self_in_concretizeJumpNoOverflow); +static sqInt NoDbgRegParms concretizeJumpOverflow(AbstractInstruction * self_in_concretizeJumpOverflow); +static usqInt NoDbgRegParms concretizeJumpR(AbstractInstruction * self_in_concretizeJumpR); +static sqInt NoDbgRegParms concretizeJumpSignedGreaterEqual(AbstractInstruction * self_in_concretizeJumpSignedGreaterEqual); +static sqInt NoDbgRegParms concretizeJumpSignedGreaterThan(AbstractInstruction * self_in_concretizeJumpSignedGreaterThan); +static sqInt NoDbgRegParms concretizeJumpSignedLessEqual(AbstractInstruction * self_in_concretizeJumpSignedLessEqual); +static sqInt NoDbgRegParms concretizeJumpSignedLessThan(AbstractInstruction * self_in_concretizeJumpSignedLessThan); +static sqInt NoDbgRegParms concretizeJumpUnsignedGreaterEqual(AbstractInstruction * self_in_concretizeJumpUnsignedGreaterEqual); +static sqInt NoDbgRegParms concretizeJumpUnsignedGreaterThan(AbstractInstruction * self_in_concretizeJumpUnsignedGreaterThan); +static sqInt NoDbgRegParms concretizeJumpUnsignedLessEqual(AbstractInstruction * self_in_concretizeJumpUnsignedLessEqual); +static sqInt NoDbgRegParms concretizeJumpUnsignedLessThan(AbstractInstruction * self_in_concretizeJumpUnsignedLessThan); +static sqInt NoDbgRegParms concretizeJumpZero(AbstractInstruction * self_in_concretizeJumpZero); +static usqInt NoDbgRegParms concretizeLoadEffectiveAddressMwrR(AbstractInstruction * self_in_concretizeLoadEffectiveAddressMwrR); +static usqInt NoDbgRegParms concretizeLogicalShiftLeftCqR(AbstractInstruction * self_in_concretizeLogicalShiftLeftCqR); +static usqInt NoDbgRegParms concretizeLogicalShiftLeftRR(AbstractInstruction * self_in_concretizeLogicalShiftLeftRR); +static usqInt NoDbgRegParms concretizeLogicalShiftRightCqR(AbstractInstruction * self_in_concretizeLogicalShiftRightCqR); +static usqInt NoDbgRegParms concretizeLogicalShiftRightRR(AbstractInstruction * self_in_concretizeLogicalShiftRightRR); +static usqInt NoDbgRegParms concretizeMoveAbR(AbstractInstruction * self_in_concretizeMoveAbR); +static usqInt NoDbgRegParms concretizeMoveAwR(AbstractInstruction * self_in_concretizeMoveAwR); +static usqInt NoDbgRegParms concretizeMoveCqR(AbstractInstruction * self_in_concretizeMoveCqR); +static usqInt NoDbgRegParms concretizeMoveCwR(AbstractInstruction * self_in_concretizeMoveCwR); +static usqInt NoDbgRegParms concretizeMoveHighR(AbstractInstruction * self_in_concretizeMoveHighR); +static usqInt NoDbgRegParms concretizeMoveLowR(AbstractInstruction * self_in_concretizeMoveLowR); +static usqInt NoDbgRegParms concretizeMoveM16rR(AbstractInstruction * self_in_concretizeMoveM16rR); +static usqInt NoDbgRegParms concretizeMoveMbrR(AbstractInstruction * self_in_concretizeMoveMbrR); +static usqInt NoDbgRegParms concretizeMoveMwrR(AbstractInstruction * self_in_concretizeMoveMwrR); +static usqInt NoDbgRegParms concretizeMoveRAb(AbstractInstruction * self_in_concretizeMoveRAb); +static usqInt NoDbgRegParms concretizeMoveRAw(AbstractInstruction * self_in_concretizeMoveRAw); +static usqInt NoDbgRegParms concretizeMoveRM16r(AbstractInstruction * self_in_concretizeMoveRM16r); +static usqInt NoDbgRegParms concretizeMoveRMbr(AbstractInstruction * self_in_concretizeMoveRMbr); +static usqInt NoDbgRegParms concretizeMoveRMwr(AbstractInstruction * self_in_concretizeMoveRMwr); +static usqInt NoDbgRegParms concretizeMoveRR(AbstractInstruction * self_in_concretizeMoveRR); +static usqInt NoDbgRegParms concretizeMoveRXbrR(AbstractInstruction * self_in_concretizeMoveRXbrR); +static usqInt NoDbgRegParms concretizeMoveRXwrR(AbstractInstruction * self_in_concretizeMoveRXwrR); +static usqInt NoDbgRegParms concretizeMoveXbrRR(AbstractInstruction * self_in_concretizeMoveXbrRR); +static usqInt NoDbgRegParms concretizeMoveXwrRR(AbstractInstruction * self_in_concretizeMoveXwrRR); +static usqInt NoDbgRegParms concretizeMulCheckOverflowRR(AbstractInstruction * self_in_concretizeMulCheckOverflowRR); +static usqInt NoDbgRegParms concretizeNegateR(AbstractInstruction * self_in_concretizeNegateR); +static usqInt NoDbgRegParms concretizeNop(AbstractInstruction * self_in_concretizeNop); +static usqInt NoDbgRegParms concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR); +static usqInt NoDbgRegParms concretizeOrCwR(AbstractInstruction * self_in_concretizeOrCwR); +static usqInt NoDbgRegParms concretizeOrRR(AbstractInstruction * self_in_concretizeOrRR); +static usqInt NoDbgRegParms concretizePopR(AbstractInstruction * self_in_concretizePopR); +static usqInt NoDbgRegParms concretizePrefetchAw(AbstractInstruction * self_in_concretizePrefetchAw); +static usqInt NoDbgRegParms concretizePushCq(AbstractInstruction * self_in_concretizePushCq); +static usqInt NoDbgRegParms concretizePushCw(AbstractInstruction * self_in_concretizePushCw); +static usqInt NoDbgRegParms concretizePushR(AbstractInstruction * self_in_concretizePushR); +static usqInt NoDbgRegParms concretizeRetN(AbstractInstruction * self_in_concretizeRetN); +static usqInt NoDbgRegParms concretizeStop(AbstractInstruction * self_in_concretizeStop); +static usqInt NoDbgRegParms concretizeSubCheckOverflowCqR(AbstractInstruction * self_in_concretizeSubCheckOverflowCqR); +static usqInt NoDbgRegParms concretizeSubCheckOverflowRR(AbstractInstruction * self_in_concretizeSubCheckOverflowRR); +static usqInt NoDbgRegParms concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR); +static usqInt NoDbgRegParms concretizeSubCwR(AbstractInstruction * self_in_concretizeSubCwR); +static usqInt NoDbgRegParms concretizeSubRR(AbstractInstruction * self_in_concretizeSubRR); +static usqInt NoDbgRegParms concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR); +static usqInt NoDbgRegParms concretizeTstCwR(AbstractInstruction * self_in_concretizeTstCwR); +static sqInt NoDbgRegParms concretizeUnimplemented(AbstractInstruction * self_in_concretizeUnimplemented); +static usqInt NoDbgRegParms concretizeXorCwR(AbstractInstruction * self_in_concretizeXorCwR); +static usqInt NoDbgRegParms concretizeXorRR(AbstractInstruction * self_in_concretizeXorRR); +static void NoDbgRegParms dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize); +static sqInt NoDbgRegParms divRR(AbstractInstruction * self_in_divRR, sqInt dividendReg, sqInt divisorReg); +static sqInt NoDbgRegParms fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative); +static sqInt NoDbgRegParms functionAtAddress(AbstractInstruction * self_in_functionAtAddress, sqInt mcpc); +static sqInt NoDbgRegParms genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder); +static sqInt NoDbgRegParms genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer); +static sqInt NoDbgRegParms genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers); +static sqInt NoDbgRegParms genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers); +static AbstractInstruction * NoDbgRegParms genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored); +static sqInt NoDbgRegParms genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n); +static AbstractInstruction * NoDbgRegParms genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg); +static sqInt NoDbgRegParms genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs, sqInt regMask); +static sqInt NoDbgRegParms genSaveRegs(AbstractInstruction * self_in_genSaveRegs, sqInt regMask); +static sqInt NoDbgRegParms genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers); +static AbstractInstruction * NoDbgRegParms genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc); +static usqInt NoDbgRegParms high16BitsOf(AbstractInstruction * self_in_high16BitsOf, usqInt word); +static usqInt NoDbgRegParms inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, usqInt callSiteReturnAddress); +static sqInt NoDbgRegParms instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc); +static sqInt NoDbgRegParms isAddressRelativeToVarBase(AbstractInstruction * self_in_isAddressRelativeToVarBase, usqInt varAddress); +static sqInt NoDbgRegParms isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc); +static sqInt NoDbgRegParms isJump(AbstractInstruction * self_in_isJump); +static sqInt NoDbgRegParms isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc); +static sqInt NoDbgRegParms isPCDependent(AbstractInstruction * self_in_isPCDependent); +static sqInt NoDbgRegParms isShortOffset(AbstractInstruction * self_in_isShortOffset, sqInt offset); +static sqInt NoDbgRegParms itypersrteitherImmediate(AbstractInstruction * self_in_itypersrteitherImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate); +static sqInt NoDbgRegParms itypersrtsignedImmediate(AbstractInstruction * self_in_itypersrtsignedImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate); +static sqInt NoDbgRegParms itypersrtunsignedImmediate(AbstractInstruction * self_in_itypersrtunsignedImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate); +static sqInt NoDbgRegParms jA(AbstractInstruction * self_in_jA, sqInt target); +static sqInt NoDbgRegParms jalA(AbstractInstruction * self_in_jalA, sqInt target); +static sqInt NoDbgRegParms jalR(AbstractInstruction * self_in_jalR, sqInt targetReg); +static sqInt NoDbgRegParms jR(AbstractInstruction * self_in_jR, sqInt targetReg); +static sqInt NoDbgRegParms jtypetarget(AbstractInstruction * self_in_jtypetarget, sqInt op, sqInt target); +static sqInt NoDbgRegParms jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize); +static sqInt NoDbgRegParms jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize); +static usqInt NoDbgRegParms jumpLongConditionalTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongConditionalTargetBeforeFollowingAddress, sqInt mcpc); +static usqInt NoDbgRegParms jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc); +static sqInt NoDbgRegParms jumpShortByteSize(AbstractInstruction * self_in_jumpShortByteSize); +static usqInt NoDbgRegParms jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc); +static sqInt NoDbgRegParms lbRbaseoffset(AbstractInstruction * self_in_lbRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset); +static sqInt NoDbgRegParms lbuRbaseoffset(AbstractInstruction * self_in_lbuRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset); +static sqInt NoDbgRegParms lhRbaseoffset(AbstractInstruction * self_in_lhRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset); +static sqInt NoDbgRegParms lhuRbaseoffset(AbstractInstruction * self_in_lhuRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset); +static usqInt NoDbgRegParms literalAtAddress(AbstractInstruction * self_in_literalAtAddress, sqInt mcpc); +static sqInt NoDbgRegParms literalAtAddressput(AbstractInstruction * self_in_literalAtAddressput, sqInt mcpc, sqInt newLiteral); +static sqInt NoDbgRegParms literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress); +static sqInt NoDbgRegParms loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize); +static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize); +static usqInt NoDbgRegParms low16BitsOf(AbstractInstruction * self_in_low16BitsOf, usqInt word); +static sqInt NoDbgRegParms luiRC(AbstractInstruction * self_in_luiRC, sqInt destReg, sqInt imm); +static sqInt NoDbgRegParms lwRbaseoffset(AbstractInstruction * self_in_lwRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset); +static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes); +static sqInt NoDbgRegParms machineCodeWords(AbstractInstruction * self_in_machineCodeWords); +static sqInt NoDbgRegParms mfhiR(AbstractInstruction * self_in_mfhiR, sqInt destReg); +static sqInt NoDbgRegParms mfloR(AbstractInstruction * self_in_mfloR, sqInt destReg); +static sqInt NoDbgRegParms mipsbreak(AbstractInstruction * self_in_mipsbreak, sqInt code); +static sqInt NoDbgRegParms multRR(AbstractInstruction * self_in_multRR, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms nop(AbstractInstruction * self_in_nop); +static AbstractInstruction * NoDbgRegParms noteFollowingConditionalBranch(AbstractInstruction * self_in_noteFollowingConditionalBranch, AbstractInstruction *branch); +static AbstractInstruction * NoDbgRegParms noteFollowingOverflowBranch(AbstractInstruction * self_in_noteFollowingOverflowBranch, AbstractInstruction *branch); +static sqInt NoDbgRegParms numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs); +static sqInt NoDbgRegParms opcodeAtAddress(AbstractInstruction * self_in_opcodeAtAddress, sqInt mcpc); +static sqInt NoDbgRegParms oriRRC(AbstractInstruction * self_in_oriRRC, sqInt destReg, sqInt srcReg, sqInt imm); +static sqInt NoDbgRegParms orRRR(AbstractInstruction * self_in_orRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static AbstractInstruction * NoDbgRegParms padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr); +static sqInt NoDbgRegParms prefRoffsethint(AbstractInstruction * self_in_prefRoffsethint, sqInt baseReg, sqInt offset, sqInt hint); +static sqInt NoDbgRegParms pushLinkRegisterByteSize(AbstractInstruction * self_in_pushLinkRegisterByteSize); +static AbstractInstruction * NoDbgRegParms relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta); +static AbstractInstruction * NoDbgRegParms relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta); +static sqInt NoDbgRegParms rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms rewriteCPICJumpAttarget(AbstractInstruction * self_in_rewriteCPICJumpAttarget, usqInt addressFollowingJump, usqInt jumpTargetAddress); +static sqInt NoDbgRegParms rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress); +static AbstractInstruction * NoDbgRegParms rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, usqInt callSiteReturnAddress); +static AbstractInstruction * NoDbgRegParms rewriteITypeBranchAtAddresstarget(AbstractInstruction * self_in_rewriteITypeBranchAtAddresstarget, sqInt mcpc, sqInt newTarget); +static AbstractInstruction * NoDbgRegParms rewriteJTypeAtAddressdelta(AbstractInstruction * self_in_rewriteJTypeAtAddressdelta, sqInt mcpc, sqInt delta); +static AbstractInstruction * NoDbgRegParms rewriteJTypeAtAddresstarget(AbstractInstruction * self_in_rewriteJTypeAtAddresstarget, sqInt mcpc, sqInt newTarget); +static sqInt NoDbgRegParms rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress); +static sqInt NoDbgRegParms rtAtAddress(AbstractInstruction * self_in_rtAtAddress, sqInt mcpc); +static sqInt NoDbgRegParms rtypersrtrdsafunct(AbstractInstruction * self_in_rtypersrtrdsafunct, sqInt op, sqInt rs, sqInt rt, sqInt rd, sqInt sa, sqInt funct); +static sqInt NoDbgRegParms sbRbaseoffset(AbstractInstruction * self_in_sbRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset); +static sqInt NoDbgRegParms setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode); +static sqInt NoDbgRegParms shRbaseoffset(AbstractInstruction * self_in_shRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset); +static usqInt NoDbgRegParms sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress); +static sqInt NoDbgRegParms sllRRC(AbstractInstruction * self_in_sllRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount); +static sqInt NoDbgRegParms sllvRRR(AbstractInstruction * self_in_sllvRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms sltiRRC(AbstractInstruction * self_in_sltiRRC, sqInt destReg, sqInt leftReg, sqInt imm); +static sqInt NoDbgRegParms sltiuRRC(AbstractInstruction * self_in_sltiuRRC, sqInt destReg, sqInt leftReg, sqInt imm); +static sqInt NoDbgRegParms sltRRR(AbstractInstruction * self_in_sltRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms sltuRRR(AbstractInstruction * self_in_sltuRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms sraRRC(AbstractInstruction * self_in_sraRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount); +static sqInt NoDbgRegParms sravRRR(AbstractInstruction * self_in_sravRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms srlRRC(AbstractInstruction * self_in_srlRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount); +static sqInt NoDbgRegParms srlvRRR(AbstractInstruction * self_in_srlvRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms stop(AbstractInstruction * self_in_stop); +static AbstractInstruction * NoDbgRegParms stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr); +static sqInt NoDbgRegParms storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress); +static sqInt NoDbgRegParms subuRRR(AbstractInstruction * self_in_subuRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms swRbaseoffset(AbstractInstruction * self_in_swRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset); +static usqInt NoDbgRegParms targetFromITypeAtAddress(AbstractInstruction * self_in_targetFromITypeAtAddress, usqInt mcpc); +static usqInt NoDbgRegParms targetFromJTypeAtAddress(AbstractInstruction * self_in_targetFromJTypeAtAddress, usqInt mcpc); +static sqInt NoDbgRegParms xoriRRC(AbstractInstruction * self_in_xoriRRC, sqInt destReg, sqInt srcReg, sqInt imm); +static sqInt NoDbgRegParms xorRRR(AbstractInstruction * self_in_xorRRR, sqInt destReg, sqInt leftReg, sqInt rightReg); +static sqInt NoDbgRegParms zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative); +static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop); +static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg); +static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg); +static sqInt NoDbgRegParms genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg); +static void NoDbgRegParms genLcByteSizeOfto(sqInt oop, sqInt resultRegister); +static void NoDbgRegParms genLcFloat32toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcFloat64toOop(sqInt value, sqInt object); +static void NoDbgRegParms genLcInstantiateOop(sqInt classOop); +static void NoDbgRegParms genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize); +static void NoDbgRegParms genLcInt64ToOop(sqInt value); +static void NoDbgRegParms genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOopToInt64(sqInt value); +static void NoDbgRegParms genLcOopToPointer(sqInt object); +static void NoDbgRegParms genLcOopToUInt64(sqInt value); +static void NoDbgRegParms genLcOoptoFloat32(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoFloat64(sqInt object, sqInt value); +static void NoDbgRegParms genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh); +static void NoDbgRegParms genLcPointerToOopclass(sqInt pointer, sqInt pointerClass); +static void NoDbgRegParms genLcUInt64ToOop(sqInt value); +static void NoDbgRegParms genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh); +static sqInt NoDbgRegParms genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg); +static sqInt genPrimitiveAdd(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 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 * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison); +static sqInt NoDbgRegParms isUnannotatableConstant(CogSimStackEntry *simStackEntry); +static sqInt NoDbgRegParms genAddSmallIntegerTagsTo(sqInt aRegister); +static sqInt NoDbgRegParms genClearAndSetSmallIntegerTagsIn(sqInt scratchReg); +static void NoDbgRegParms genConvertCharacterToSmallIntegerInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToSmallIntegerInReg(sqInt reg); +static void NoDbgRegParms genConvertSmallIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertSmallIntegerToIntegerInReg(sqInt reg); +static void generateLowcodeObjectTrampolines(void); +static sqInt NoDbgRegParms genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg); +static sqInt NoDbgRegParms genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg); +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 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 void NoDbgRegParms genLcInt32ToOop(sqInt value); +static void NoDbgRegParms genLcOopToInt32(sqInt value); +static void NoDbgRegParms genLcOopToUInt32(sqInt value); +static void NoDbgRegParms genLcUInt32ToOop(sqInt value); +static sqInt genPrimitiveAt(void); +static sqInt genPrimitiveAtPut(void); +static sqInt genPrimitiveIdentityHash(void); +static sqInt genPrimitiveImmediateAsInteger(void); +static sqInt genPrimitiveNew(void); +static sqInt genPrimitiveNewWithArg(void); +static sqInt genPrimitiveShallowCopy(void); +static sqInt genPrimitiveStringAt(void); +static sqInt genPrimitiveStringAtPut(void); +static sqInt NoDbgRegParms genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg); +static sqInt NoDbgRegParms getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg); +static sqInt NoDbgRegParms inlineCacheTagForInstance(sqInt oop); +static AbstractInstruction * NoDbgRegParms jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static sqInt numSmallIntegerBits(void); +static sqInt NoDbgRegParms validInlineCacheTag(usqInt classIndexOrTagPattern); +static sqInt NoDbgRegParms cacheTagIsMarked(sqInt cacheTag); +static sqInt NoDbgRegParms checkValidOopReference(sqInt anOop); +static sqInt NoDbgRegParms couldBeObject(sqInt literal); +static sqInt NoDbgRegParms genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString); +static AbstractInstruction * NoDbgRegParms genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg); +static sqInt NoDbgRegParms genConvertCharacterToCodeInReg(sqInt reg); +static sqInt NoDbgRegParms genConvertIntegerToCharacterInReg(sqInt reg); +static sqInt NoDbgRegParms genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock); +static sqInt NoDbgRegParms genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock); +static sqInt NoDbgRegParms genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction); +static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg); +static void generateObjectRepresentationTrampolines(void); +static sqInt NoDbgRegParms genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock); +static sqInt NoDbgRegParms genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock); +static sqInt NoDbgRegParms genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg); +static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver); +static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg); +static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg); +static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg); +static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg); +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 AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister); +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg); +#endif /* IMMUTABILITY */ +static AbstractInstruction * NoDbgRegParms genJumpNotCharacterInScratchReg(sqInt reg); +static void NoDbgRegParms genLcFirstFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcFirstIndexableFieldPointer(sqInt objectReg); +static void NoDbgRegParms genLcIsBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIndexableto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsPointersto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcIsWordsto(sqInt objectReg, sqInt valueReg); +static void NoDbgRegParms genLcLoadObjectat(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcLoadObjectfield(sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex); +static void NoDbgRegParms genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex); +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 NoDbgRegParms genPrimitiveIdenticalOrNotIf(sqInt orNot); +static sqInt genPrimitiveObjectAt(void); +static sqInt genPrimitiveSize(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 genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg); +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +#if IMMUTABILITY +static sqInt NoDbgRegParms genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr); +#endif /* IMMUTABILITY */ +static sqInt getActiveContextAllocatesInMachineCode(void); +static sqInt NoDbgRegParms inlineCacheTagIsYoung(sqInt cacheTag); +static AbstractInstruction * NoDbgRegParms jumpNotCharacterUnsignedValueInRegister(sqInt reg); +static sqInt NoDbgRegParms markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address); +static void NoDbgRegParms markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address); +static void NoDbgRegParms markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil); +static sqInt NoDbgRegParms maybeCompileRetryOnPrimitiveFail(sqInt primIndex); +static sqInt NoDbgRegParms maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg); +static sqInt numCharacterBits(void); +extern sqInt numRegArgs(void); +static sqInt NoDbgRegParms remapObject(sqInt objOop); +static sqInt NoDbgRegParms remapOop(sqInt objOop); +static sqInt NoDbgRegParms shouldAnnotateObjectReference(sqInt anOop); +static sqInt NoDbgRegParms slotOffsetOfInstVarIndex(sqInt index); +static SimStackEntry * NoDbgRegParms ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister); +static SimStackEntry * NoDbgRegParms popToReg(SimStackEntry * self_in_popToReg, sqInt reg); +static sqInt NoDbgRegParms registerMask(SimStackEntry * self_in_registerMask); +static sqInt NoDbgRegParms registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone); +static sqInt NoDbgRegParms registerOrNone(SimStackEntry * self_in_registerOrNone); +static SimStackEntry * NoDbgRegParms storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled); +static CogSimStackNativeEntry * NoDbgRegParms ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister); +static sqInt NoDbgRegParms nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg); +static CogSimStackNativeEntry * NoDbgRegParms nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg); +static sqInt NoDbgRegParms spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister); +static sqInt NoDbgRegParms stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize); +static sqInt NoDbgRegParms isMergeFixup(BytecodeFixup * self_in_isMergeFixup); +static sqInt compileBlockDispatch(void); +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); +static sqInt frameOffsetOfNativeFrameMark(void); +static sqInt frameOffsetOfNativeFramePointer(void); +static sqInt frameOffsetOfNativeStackPointer(void); +static sqInt frameOffsetOfPreviousNativeStackPointer(void); +static sqInt NoDbgRegParms frameOffsetOfTemporary(sqInt index); +static sqInt genExtendedSendBytecode(void); +static sqInt genExtendedSuperBytecode(void); +static sqInt genExtJumpIfFalse(void); +static sqInt genExtJumpIfNotInstanceOfBehaviorsBytecode(void); +static sqInt genExtJumpIfTrue(void); +static sqInt genExtNopBytecode(void); +static sqInt genExtPushCharacterBytecode(void); +static sqInt genExtPushIntegerBytecode(void); +static sqInt genExtPushLiteralBytecode(void); +static sqInt genExtPushLitVarDirSupBytecode(void); +static sqInt genExtPushPseudoVariable(void); +static sqInt genExtPushReceiverVariableBytecode(void); +static sqInt genExtSendBytecode(void); +static sqInt genExtSendSuperBytecode(void); +static sqInt genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtStoreRemoteTempOrInstVarLongBytecode(void); +static sqInt genExtUnconditionalJump(void); +static sqInt genFastPrimFail(void); +static void NoDbgRegParms genFastPrimTraceUsingand(sqInt r1, sqInt r2); +static sqInt genLongJumpIfFalse(void); +static sqInt genLongJumpIfTrue(void); +static sqInt genLongPushTemporaryVariableBytecode(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); +static sqInt genLongStoreTemporaryVariableBytecode(void); +static sqInt genLongUnconditionalBackwardJump(void); +static sqInt genLongUnconditionalForwardJump(void); +static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs); +static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg); +static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName); +static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling); +static sqInt genPushClosureTempsBytecode(void); +static sqInt genPushConstantFalseBytecode(void); +static sqInt genPushConstantNilBytecode(void); +static sqInt genPushConstantOneBytecode(void); +static sqInt genPushConstantTrueBytecode(void); +static sqInt genPushConstantZeroBytecode(void); +static sqInt genPushLiteralConstantBytecode(void); +static sqInt NoDbgRegParms genPushLiteralIndex(sqInt literalIndex); +static sqInt genPushLiteralVariableBytecode(void); +static sqInt genPushLitVarDirSup16CasesBytecode(void); +static sqInt genPushQuickIntegerConstantBytecode(void); +static sqInt genPushReceiverVariableBytecode(void); +static sqInt genPushTemporaryVariableBytecode(void); +extern sqInt genQuickReturnConst(void); +extern sqInt genQuickReturnInstVar(void); +extern sqInt genQuickReturnSelf(void); +static sqInt genReturnFalse(void); +static sqInt genReturnNil(void); +static sqInt genReturnNilFromBlock(void); +static sqInt genReturnTrue(void); +static sqInt genSecondExtendedSendBytecode(void); +static sqInt genSendLiteralSelector0ArgsBytecode(void); +static sqInt genSendLiteralSelector1ArgBytecode(void); +static sqInt genSendLiteralSelector2ArgsBytecode(void); +static sqInt genShortJumpIfFalse(void); +static sqInt genShortJumpIfTrue(void); +static sqInt genShortUnconditionalJump(void); +static sqInt genSistaExtStoreAndPopLiteralVariableBytecode(void); +static sqInt genSistaExtStoreAndPopReceiverVariableBytecode(void); +static sqInt genSistaExtStoreLiteralVariableBytecode(void); +static sqInt genSistaExtStoreReceiverVariableBytecode(void); +static sqInt genSpecialSelectorEqualsEquals(void); +static sqInt genSpecialSelectorNotEqualsEquals(void); +static sqInt genSpecialSelectorSend(void); +static sqInt genStoreAndPopReceiverVariableBytecode(void); +static sqInt genStoreAndPopRemoteTempLongBytecode(void); +static sqInt genStoreAndPopTemporaryVariableBytecode(void); +static sqInt genStoreRemoteTempLongBytecode(void); +static sqInt genUnconditionalTrapBytecode(void); +static void NoDbgRegParms loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg); +static void NoDbgRegParms loadNativeFramePointerInto(sqInt reg); +static void NoDbgRegParms loadNativeLocalAddressto(sqInt baseOffset, sqInt reg); +extern sqInt mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj); +static void maybeCompileAllocFillerCheck(void); +static sqInt numSpecialSelectors(void); +static usqInt NoDbgRegParms pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod); +static sqInt NoDbgRegParms pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg); +static PrimitiveDescriptor * primitiveGeneratorOrNil(void); +extern void recordCallOffsetIn(CogMethod *cogMethod); +extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)); +static sqInt NoDbgRegParms v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static sqInt NoDbgRegParms v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +extern void voidCogCompiledCode(void); +static BlockStart * NoDbgRegParms addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span); +static void NoDbgRegParms adjustArgumentsForPerform(sqInt numArgs); +static sqInt NoDbgRegParms allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask); +static sqInt NoDbgRegParms allocateRegNotConflictingWith(sqInt regMask); +static sqInt NoDbgRegParms anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n); +static void NoDbgRegParms beginHighLevelCall(sqInt alignment); +extern void callCogCodePopReceiverArg0Regs(void); +extern void callCogCodePopReceiverArg1Arg0Regs(void); +static sqInt callSwitchToCStack(void); +static void callSwitchToSmalltalkStack(void); +static sqInt NoDbgRegParms compileAbstractInstructionsFromthrough(sqInt start, sqInt end); +static sqInt compileBlockBodies(void); +static void NoDbgRegParms compileBlockFrameBuild(BlockStart *blockStart); +static void NoDbgRegParms compileBlockFramelessEntry(BlockStart *blockStart); +static CogMethod * NoDbgRegParms compileCogFullBlockMethod(sqInt numCopied); +static CogMethod * NoDbgRegParms compileCogMethod(sqInt selector); +static sqInt compileEntireMethod(void); +static void compileFrameBuild(void); +static void NoDbgRegParms compileFullBlockFramelessEntry(sqInt numCopied); +static void NoDbgRegParms compileFullBlockMethodFrameBuild(sqInt numCopied); +#if IMMUTABILITY +static void compileTwoPathFrameBuild(void); +#endif /* IMMUTABILITY */ +static void compileTwoPathFramelessInit(void); +static sqInt NoDbgRegParms cPICMissTrampolineFor(sqInt numArgs); +static sqInt doubleExtendedDoAnythingBytecode(void); +static sqInt duplicateTopBytecode(void); +static void endHighLevelCallWithCleanup(void); +static void endHighLevelCallWithoutCleanup(void); +static BytecodeFixup * NoDbgRegParms ensureFixupAt(sqInt targetIndex); +static BytecodeFixup * NoDbgRegParms ensureNonMergeFixupAt(sqInt targetIndex); +static void ensureReceiverResultRegContainsSelf(void); +static void NoDbgRegParms evaluateat(BytecodeDescriptor *descriptor, sqInt pc); +static sqInt NoDbgRegParms freeAnyRegNotConflictingWith(sqInt regMask); +static sqInt genBlockReturn(void); +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) ; +static sqInt genCallPrimitiveBytecode(void); +static sqInt genExternalizePointersForPrimitiveCall(void); +static sqInt genExtPushClosureBytecode(void); +static sqInt genExtPushFullClosureBytecode(void); +static sqInt genExtPushRemoteTempOrInstVarLongBytecode(void); +static sqInt NoDbgRegParms genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean); +static void generateEnilopmarts(void); +static void generateMissAbortTrampolines(void); +static void generateSendTrampolines(void); +static void generateTracingTrampolines(void); +static sqInt NoDbgRegParms genForwardersInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot); +static sqInt NoDbgRegParms genInlinedIdenticalOrNotIf(sqInt orNot); +static sqInt NoDbgRegParms genJumpBackTo(sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpIfto(sqInt boolean, sqInt targetBytecodePC); +static sqInt NoDbgRegParms genJumpTo(sqInt targetBytecodePC); +static void NoDbgRegParms genLoadTempin(sqInt objectIndex, sqInt destReg); +static sqInt genLowcodeAdd32(void); +static sqInt genLowcodeAdd64(void); +static sqInt genLowcodeAlloca32(void); +static sqInt genLowcodeAlloca64(void); +static sqInt genLowcodeAnd32(void); +static sqInt genLowcodeAnd64(void); +static sqInt genLowcodeArithmeticRightShift32(void); +static sqInt genLowcodeArithmeticRightShift64(void); +static sqInt genLowcodeBeginCall(void); +static sqInt NoDbgRegParms genLowcodeBinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeBoolean32ToOop(void); +static sqInt genLowcodeBoolean64ToOop(void); +static sqInt genLowcodeByteSizeOf(void); +static sqInt genLowcodeCallArgumentFloat32(void); +static sqInt genLowcodeCallArgumentFloat64(void); +static sqInt genLowcodeCallArgumentInt32(void); +static sqInt genLowcodeCallArgumentInt64(void); +static sqInt genLowcodeCallArgumentPointer(void); +static sqInt genLowcodeCallArgumentSpace(void); +static sqInt genLowcodeCallArgumentStructure(void); +static sqInt genLowcodeCallInstruction(void); +static sqInt genLowcodeCallPhysical(void); +static sqInt genLowcodeCheckSessionIdentifier(void); +static sqInt genLowcodeCompareAndSwap32(void); +static sqInt genLowcodeDiv32(void); +static sqInt genLowcodeDiv64(void); +static sqInt genLowcodeDuplicateFloat32(void); +static sqInt genLowcodeDuplicateFloat64(void); +static sqInt genLowcodeDuplicateInt32(void); +static sqInt genLowcodeDuplicateInt64(void); +static sqInt genLowcodeDuplicatePointer(void); +static sqInt genLowcodeEffectiveAddress32(void); +static sqInt genLowcodeEffectiveAddress64(void); +static sqInt genLowcodeEndCall(void); +static sqInt genLowcodeEndCallNoCleanup(void); +static sqInt genLowcodeFirstFieldPointer(void); +static sqInt genLowcodeFirstIndexableFieldPointer(void); +static sqInt genLowcodeFloat32Add(void); +static sqInt genLowcodeFloat32Div(void); +static sqInt genLowcodeFloat32Equal(void); +static sqInt genLowcodeFloat32Great(void); +static sqInt genLowcodeFloat32GreatEqual(void); +static sqInt genLowcodeFloat32Less(void); +static sqInt genLowcodeFloat32LessEqual(void); +static sqInt genLowcodeFloat32Mul(void); +static sqInt genLowcodeFloat32Neg(void); +static sqInt genLowcodeFloat32NotEqual(void); +static sqInt genLowcodeFloat32Sqrt(void); +static sqInt genLowcodeFloat32Sub(void); +static sqInt genLowcodeFloat32ToFloat64(void); +static sqInt genLowcodeFloat32ToInt32(void); +static sqInt genLowcodeFloat32ToInt64(void); +static sqInt genLowcodeFloat32ToOop(void); +static sqInt genLowcodeFloat32ToUInt32(void); +static sqInt genLowcodeFloat32ToUInt64(void); +static sqInt genLowcodeFloat64Add(void); +static sqInt genLowcodeFloat64Div(void); +static sqInt genLowcodeFloat64Equal(void); +static sqInt genLowcodeFloat64Great(void); +static sqInt genLowcodeFloat64GreatEqual(void); +static sqInt genLowcodeFloat64Less(void); +static sqInt genLowcodeFloat64LessEqual(void); +static sqInt genLowcodeFloat64Mul(void); +static sqInt genLowcodeFloat64Neg(void); +static sqInt genLowcodeFloat64NotEqual(void); +static sqInt genLowcodeFloat64Sqrt(void); +static sqInt genLowcodeFloat64Sub(void); +static sqInt genLowcodeFloat64ToFloat32(void); +static sqInt genLowcodeFloat64ToInt32(void); +static sqInt genLowcodeFloat64ToInt64(void); +static sqInt genLowcodeFloat64ToOop(void); +static sqInt genLowcodeFloat64ToUInt32(void); +static sqInt genLowcodeFloat64ToUInt64(void); +static sqInt genLowcodeFree(void); +static sqInt genLowcodeInstantiateIndexable32Oop(void); +static sqInt genLowcodeInstantiateIndexableOop(void); +static sqInt genLowcodeInstantiateOop(void); +static sqInt genLowcodeInt32Equal(void); +static sqInt genLowcodeInt32Great(void); +static sqInt genLowcodeInt32GreatEqual(void); +static sqInt genLowcodeInt32Less(void); +static sqInt genLowcodeInt32LessEqual(void); +static sqInt genLowcodeInt32NotEqual(void); +static sqInt genLowcodeInt32ToFloat32(void); +static sqInt genLowcodeInt32ToFloat64(void); +static sqInt genLowcodeInt32ToOop(void); +static sqInt genLowcodeInt32ToPointer(void); +static sqInt genLowcodeInt64Equal(void); +static sqInt genLowcodeInt64Great(void); +static sqInt genLowcodeInt64GreatEqual(void); +static sqInt genLowcodeInt64Less(void); +static sqInt genLowcodeInt64LessEqual(void); +static sqInt genLowcodeInt64NotEqual(void); +static sqInt genLowcodeInt64ToFloat32(void); +static sqInt genLowcodeInt64ToFloat64(void); +static sqInt genLowcodeInt64ToOop(void); +static sqInt genLowcodeInt64ToPointer(void); +static sqInt genLowcodeIsBytes(void); +static sqInt genLowcodeIsFloatObject(void); +static sqInt genLowcodeIsIndexable(void); +static sqInt genLowcodeIsIntegerObject(void); +static sqInt genLowcodeIsPointers(void); +static sqInt genLowcodeIsWords(void); +static sqInt genLowcodeIsWordsOrBytes(void); +static sqInt genLowcodeLeftShift32(void); +static sqInt genLowcodeLeftShift64(void); +static sqInt genLowcodeLoadArgumentAddress(void); +static sqInt genLowcodeLoadArgumentFloat32(void); +static sqInt genLowcodeLoadArgumentFloat64(void); +static sqInt genLowcodeLoadArgumentInt16(void); +static sqInt genLowcodeLoadArgumentInt32(void); +static sqInt genLowcodeLoadArgumentInt64(void); +static sqInt genLowcodeLoadArgumentInt8(void); +static sqInt genLowcodeLoadArgumentPointer(void); +static sqInt genLowcodeLoadArgumentUInt16(void); +static sqInt genLowcodeLoadArgumentUInt32(void); +static sqInt genLowcodeLoadArgumentUInt64(void); +static sqInt genLowcodeLoadArgumentUInt8(void); +static sqInt genLowcodeLoadFloat32FromMemory(void); +static sqInt genLowcodeLoadFloat64FromMemory(void); +static sqInt genLowcodeLoadInt16FromMemory(void); +static sqInt genLowcodeLoadInt32FromMemory(void); +static sqInt genLowcodeLoadInt64FromMemory(void); +static sqInt genLowcodeLoadInt8FromMemory(void); +static sqInt genLowcodeLoadLocalAddress(void); +static sqInt genLowcodeLoadLocalFloat32(void); +static sqInt genLowcodeLoadLocalFloat64(void); +static sqInt genLowcodeLoadLocalInt16(void); +static sqInt genLowcodeLoadLocalInt32(void); +static sqInt genLowcodeLoadLocalInt64(void); +static sqInt genLowcodeLoadLocalInt8(void); +static sqInt genLowcodeLoadLocalPointer(void); +static sqInt genLowcodeLoadLocalUInt16(void); +static sqInt genLowcodeLoadLocalUInt32(void); +static sqInt genLowcodeLoadLocalUInt64(void); +static sqInt genLowcodeLoadLocalUInt8(void); +static sqInt genLowcodeLoadObjectAt(void); +static sqInt genLowcodeLoadObjectField(void); +static sqInt genLowcodeLoadPointerFromMemory(void); +static sqInt genLowcodeLoadUInt16FromMemory(void); +static sqInt genLowcodeLoadUInt32FromMemory(void); +static sqInt genLowcodeLoadUInt64FromMemory(void); +static sqInt genLowcodeLoadUInt8FromMemory(void); +static sqInt genLowcodeLocalFrameSize(void); +static sqInt genLowcodeLockRegisters(void); +static sqInt genLowcodeLockVM(void); +static sqInt genLowcodeMalloc32(void); +static sqInt genLowcodeMalloc64(void); +static sqInt genLowcodeMemcpy32(void); +static sqInt genLowcodeMemcpy64(void); +static sqInt genLowcodeMemcpyFixed(void); +static sqInt genLowcodeMoveFloat32ToPhysical(void); +static sqInt genLowcodeMoveFloat64ToPhysical(void); +static sqInt genLowcodeMoveInt32ToPhysical(void); +static sqInt genLowcodeMoveInt64ToPhysical(void); +static sqInt genLowcodeMovePointerToPhysical(void); +static sqInt genLowcodeMul32(void); +static sqInt genLowcodeMul64(void); +static sqInt genLowcodeNeg32(void); +static sqInt genLowcodeNeg64(void); +static sqInt genLowcodeNot32(void); +static sqInt genLowcodeNot64(void); +static sqInt NoDbgRegParms genLowcodeNullaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeOopEqual(void); +static sqInt genLowcodeOopNotEqual(void); +static sqInt genLowcodeOopSmallIntegerToInt32(void); +static sqInt genLowcodeOopSmallIntegerToInt64(void); +static sqInt genLowcodeOopToBoolean32(void); +static sqInt genLowcodeOopToBoolean64(void); +static sqInt genLowcodeOopToFloat32(void); +static sqInt genLowcodeOopToFloat64(void); +static sqInt genLowcodeOopToInt32(void); +static sqInt genLowcodeOopToInt64(void); +static sqInt genLowcodeOopToPointer(void); +static sqInt genLowcodeOopToPointerReinterpret(void); +static sqInt genLowcodeOopToUInt32(void); +static sqInt genLowcodeOopToUInt64(void); +static sqInt genLowcodeOr32(void); +static sqInt genLowcodeOr64(void); +static sqInt genLowcodePerformCallFloat32(void); +static sqInt genLowcodePerformCallFloat64(void); +static sqInt genLowcodePerformCallIndirectFloat32(void); +static sqInt genLowcodePerformCallIndirectFloat64(void); +static sqInt genLowcodePerformCallIndirectInt32(void); +static sqInt genLowcodePerformCallIndirectInt64(void); +static sqInt genLowcodePerformCallIndirectPointer(void); +static sqInt genLowcodePerformCallIndirectStructure(void); +static sqInt genLowcodePerformCallIndirectVoid(void); +static sqInt genLowcodePerformCallInt32(void); +static sqInt genLowcodePerformCallInt64(void); +static sqInt genLowcodePerformCallPointer(void); +static sqInt genLowcodePerformCallStructure(void); +static sqInt genLowcodePerformCallVoid(void); +static sqInt genLowcodePin(void); +static sqInt genLowcodePlaftormCode(void); +static sqInt genLowcodePointerAddConstantOffset(void); +static sqInt genLowcodePointerAddOffset32(void); +static sqInt genLowcodePointerAddOffset64(void); +static sqInt genLowcodePointerEqual(void); +static sqInt genLowcodePointerNotEqual(void); +static sqInt genLowcodePointerToInt32(void); +static sqInt genLowcodePointerToInt64(void); +static sqInt genLowcodePointerToOop(void); +static sqInt genLowcodePointerToOopReinterprer(void); +static sqInt genLowcodePopFloat32(void); +static sqInt genLowcodePopFloat64(void); +static sqInt genLowcodePopInt32(void); +static sqInt genLowcodePopInt64(void); +static sqInt genLowcodePopMultipleNative(void); +static sqInt genLowcodePopPointer(void); +static sqInt genLowcodePushConstantUInt32(void); +static sqInt genLowcodePushConstantUInt64(void); +static sqInt genLowcodePushNullPointer(void); +static sqInt genLowcodePushOne32(void); +static sqInt genLowcodePushOne64(void); +static sqInt genLowcodePushOneFloat32(void); +static sqInt genLowcodePushOneFloat64(void); +static sqInt genLowcodePushPhysicalFloat32(void); +static sqInt genLowcodePushPhysicalFloat64(void); +static sqInt genLowcodePushPhysicalInt32(void); +static sqInt genLowcodePushPhysicalInt64(void); +static sqInt genLowcodePushPhysicalPointer(void); +static sqInt genLowcodePushSessionIdentifier(void); +static sqInt genLowcodePushZero32(void); +static sqInt genLowcodePushZero64(void); +static sqInt genLowcodePushZeroFloat32(void); +static sqInt genLowcodePushZeroFloat64(void); +static sqInt genLowcodeRem32(void); +static sqInt genLowcodeRem64(void); +static sqInt genLowcodeRightShift32(void); +static sqInt genLowcodeRightShift64(void); +static sqInt genLowcodeSignExtend32From16(void); +static sqInt genLowcodeSignExtend32From8(void); +static sqInt genLowcodeSignExtend64From16(void); +static sqInt genLowcodeSignExtend64From32(void); +static sqInt genLowcodeSignExtend64From8(void); +static sqInt genLowcodeSmallInt32ToOop(void); +static sqInt genLowcodeStoreFloat32ToMemory(void); +static sqInt genLowcodeStoreFloat64ToMemory(void); +static sqInt genLowcodeStoreInt16ToMemory(void); +static sqInt genLowcodeStoreInt32ToMemory(void); +static sqInt genLowcodeStoreInt64ToMemory(void); +static sqInt genLowcodeStoreInt8ToMemory(void); +static sqInt genLowcodeStoreLocalFloat32(void); +static sqInt genLowcodeStoreLocalFloat64(void); +static sqInt genLowcodeStoreLocalInt16(void); +static sqInt genLowcodeStoreLocalInt32(void); +static sqInt genLowcodeStoreLocalInt64(void); +static sqInt genLowcodeStoreLocalInt8(void); +static sqInt genLowcodeStoreLocalPointer(void); +static sqInt genLowcodeStoreObjectField(void); +static sqInt genLowcodeStoreObjectFieldAt(void); +static sqInt genLowcodeStorePointerToMemory(void); +static sqInt genLowcodeSub32(void); +static sqInt genLowcodeSub64(void); +static sqInt NoDbgRegParms genLowcodeTrinaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeTruncate32To16(void); +static sqInt genLowcodeTruncate32To8(void); +static sqInt genLowcodeTruncate64To16(void); +static sqInt genLowcodeTruncate64To32(void); +static sqInt genLowcodeTruncate64To8(void); +static sqInt genLowcodeUdiv32(void); +static sqInt genLowcodeUdiv64(void); +static sqInt genLowcodeUint32Great(void); +static sqInt genLowcodeUint32GreatEqual(void); +static sqInt genLowcodeUint32Less(void); +static sqInt genLowcodeUint32LessEqual(void); +static sqInt genLowcodeUint32ToFloat32(void); +static sqInt genLowcodeUint32ToFloat64(void); +static sqInt genLowcodeUint32ToOop(void); +static sqInt genLowcodeUint64Great(void); +static sqInt genLowcodeUint64GreatEqual(void); +static sqInt genLowcodeUint64Less(void); +static sqInt genLowcodeUint64LessEqual(void); +static sqInt genLowcodeUint64ToFloat32(void); +static sqInt genLowcodeUint64ToFloat64(void); +static sqInt genLowcodeUint64ToOop(void); +static sqInt genLowcodeUmul32(void); +static sqInt genLowcodeUmul64(void); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive2(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive3(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive4(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive5(sqInt prim); +static sqInt NoDbgRegParms genLowcodeUnaryInlinePrimitive(sqInt prim); +static sqInt genLowcodeUnlockVM(void); +static sqInt genLowcodeUnpin(void); +static sqInt genLowcodeUrem32(void); +static sqInt genLowcodeUrem64(void); +static sqInt genLowcodeXor32(void); +static sqInt genLowcodeXor64(void); +static sqInt genLowcodeZeroExtend32From16(void); +static sqInt genLowcodeZeroExtend32From8(void); +static sqInt genLowcodeZeroExtend64From16(void); +static sqInt genLowcodeZeroExtend64From32(void); +static sqInt genLowcodeZeroExtend64From8(void); +static sqInt NoDbgRegParms genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable); +static sqInt NoDbgRegParms genMethodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms genPICMissTrampolineFor(sqInt numArgs); +static sqInt genPopStackBytecode(void); +static sqInt genPrimitiveClosureValue(void); +static sqInt genPrimitiveFullClosureValue(void); +static sqInt genPrimitivePerform(void); +static sqInt genPushActiveContextBytecode(void); +static sqInt genPushClosureCopyCopiedValuesBytecode(void); +static sqInt NoDbgRegParms genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteralVariable(sqInt literalIndex); +static sqInt NoDbgRegParms genPushLiteral(sqInt literal); +static sqInt NoDbgRegParms genPushMaybeContextReceiverVariable(sqInt slotIndex); +static sqInt NoDbgRegParms genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index); +static sqInt genPushNewArrayBytecode(void); +static sqInt genPushReceiverBytecode(void); +static sqInt NoDbgRegParms genPushReceiverVariable(sqInt index); +static void genPushRegisterArgs(void); +static sqInt NoDbgRegParms genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex); +static sqInt genPushRemoteTempLongBytecode(void); +static sqInt NoDbgRegParms genPushTemporaryVariable(sqInt index); +static sqInt genReturnReceiver(void); +static sqInt genReturnTopFromBlock(void); +static sqInt genReturnTopFromMethod(void); +static sqInt NoDbgRegParms genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs); +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 genSpecialSelectorArithmetic(void); +static sqInt genSpecialSelectorClass(void); +static sqInt genSpecialSelectorComparison(void); +static sqInt genStaticallyResolvedSpecialSelectorComparison(void); +static sqInt NoDbgRegParms genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck); +static sqInt NoDbgRegParms genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck); +static sqInt NoDbgRegParms genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex); +static sqInt genUpArrowReturn(void); +static BytecodeFixup * NoDbgRegParms initializeFixupAt(sqInt targetIndex); +static void NoDbgRegParms initSimStackForFramefulMethod(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessBlock(sqInt startpc); +static void NoDbgRegParms initSimStackForFramelessMethod(sqInt startpc); +static void leaveNativeFrame(void); +static sqInt liveFloatRegisters(void); +static sqInt liveRegisters(void); +static sqInt NoDbgRegParms mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor); +static void NoDbgRegParms marshallSendArguments(sqInt numArgs); +static sqInt maybeCompilingFirstPassOfBlockWithInitialPushNil(void); +static sqInt NoDbgRegParms mergeWithFixupIfRequired(BytecodeFixup *fixup); +static sqInt NoDbgRegParms methodAbortTrampolineFor(sqInt numArgs); +static sqInt NoDbgRegParms needsFrameIfMod16GENumArgs(sqInt stackDelta); +static sqInt NoDbgRegParms needsFrameIfStackGreaterThanOne(sqInt stackDelta); +static sqInt NoDbgRegParms numberOfSpillsInTopNItems(sqInt n); +static sqInt NoDbgRegParms picAbortTrampolineFor(sqInt numArgs); +static sqInt prevInstIsPCAnnotated(void); +static sqInt NoDbgRegParms pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static void NoDbgRegParms reinitializeFixupsFromthrough(sqInt start, sqInt end); +static sqInt NoDbgRegParms scanBlock(BlockStart *blockStart); +static sqInt scanMethod(void); +static sqInt NoDbgRegParms squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils); +static sqInt NoDbgRegParms squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); +static void NoDbgRegParms ssAllocateCallReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3); +static void NoDbgRegParms ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredFloatReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr); +static void NoDbgRegParms ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr); +static void NoDbgRegParms ssAllocateRequiredReg(sqInt requiredReg); +static void NoDbgRegParms ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2); +static void NoDbgRegParms ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr); +static void ssFlushAll(void); +static void NoDbgRegParms ssFlushTo(sqInt index); +static void NoDbgRegParms ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex); +static void NoDbgRegParms ssFlushUpThroughReceiverVariable(sqInt slotIndex); +static void NoDbgRegParms ssFlushUpThroughTemporaryVariable(sqInt tempIndex); +static void NoDbgRegParms ssNativeFlushTo(sqInt index); +static void NoDbgRegParms ssNativePop(sqInt n); +static void NoDbgRegParms ssNativePush(sqInt n); +static CogSimStackNativeEntry * ssNativeTop(void); +static void NoDbgRegParms ssPopNativeSize(sqInt popSize); +static void NoDbgRegParms ssPop(sqInt n); +static sqInt NoDbgRegParms ssPushAnnotatedConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushBaseoffset(sqInt reg, sqInt offset); +static sqInt NoDbgRegParms ssPushConstant(sqInt literal); +static sqInt NoDbgRegParms ssPushDesc(SimStackEntry simStackEntry); +static sqInt NoDbgRegParms ssPushNativeConstantFloat32(float aFloat32); +static sqInt NoDbgRegParms ssPushNativeConstantFloat64(double aFloat64); +static sqInt NoDbgRegParms ssPushNativeConstantInt32(sqInt anInt32); +static sqInt NoDbgRegParms ssPushNativeConstantInt64(sqLong anInt64); +static sqInt NoDbgRegParms ssPushNativeConstantPointer(sqInt aNativePointer); +static sqInt NoDbgRegParms ssPushNativeRegisterDoubleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegisterSingleFloat(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegister(sqInt reg); +static sqInt NoDbgRegParms ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg); +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); +static SimStackEntry ssTopDescriptor(void); +static CogSimStackEntry * NoDbgRegParms ssValue(sqInt n); +static sqInt NoDbgRegParms tryCollapseTempVectorInitializationOfSize(sqInt slots); +static void updateSimSpillBase(void); +static void voidReceiverResultRegContainsSelf(void); + + +/*** Variables ***/ +static AbstractInstruction * abstractOpcodes; +static AbstractInstruction aMethodLabel; +static AbstractInstruction * const backEnd = &aMethodLabel; +static usqInt baseAddress; +static sqInt blockCount; +static AbstractInstruction * blockEntryLabel; +static AbstractInstruction * blockEntryNoContextSwitch; +sqInt blockNoContextSwitchOffset; +static sqInt blockPass; +static BlockStart * blockStarts; +static sqInt breakBlock; +static sqInt breakMethod; +sqInt breakPC; +static sqInt byte0; +static sqInt byte1; +static sqInt byte2; +static sqInt byte3; +static sqInt bytecodePC; +static sqInt bytecodeSetOffset; +void * CFramePointer; +void * CStackPointer; +sqInt cbEntryOffset; +sqInt cbNoSwitchEntryOffset; +sqInt ceBaseFrameReturnTrampoline; +static sqInt ceByteSizeOfTrampoline; +void (*ceCall0ArgsPIC)(void); +void (*ceCall1ArgsPIC)(void); +void (*ceCall2ArgsPIC)(void); +void (*ceCallCogCodePopReceiverAndClassRegs)(void); +void (*ceCallCogCodePopReceiverArg0Regs)(void); +void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void); +void (*ceCallCogCodePopReceiverReg)(void); +sqInt ceCannotResumeTrampoline; +void (*ceCaptureCStackPointers)(void); +static usqIntptr_t (*ceCheckFeaturesFunction)(void); +sqInt ceCheckForInterruptTrampoline; +static sqInt ceCPICMissTrampoline; +void (*ceEnterCogCodePopReceiverReg)(void); +static sqInt ceFetchContextInstVarTrampoline; +static sqInt ceFFICalloutTrampoline; +static sqInt ceFloatObjectOfTrampoline; +static sqInt ceFloatValueOfTrampoline; +static void (*ceFlushICache)(usqIntptr_t from, usqIntptr_t to); +static sqInt ceFreeTrampoline; +usqIntptr_t (*ceGetFP)(void); +usqIntptr_t (*ceGetSP)(void); +static sqInt ceInstantiateClassIndexableSizeTrampoline; +static sqInt ceInstantiateClassTrampoline; +static sqInt ceLargeActiveContextInBlockTrampoline; +static sqInt ceLargeActiveContextInFullBlockTrampoline; +static sqInt ceLargeActiveContextInMethodTrampoline; +static sqInt ceMallocTrampoline; +static sqInt ceMethodAbortTrampoline; +static sqInt ceNonLocalReturnTrampoline; +static sqInt cePICAbortTrampoline; +static sqInt cePositive32BitIntegerTrampoline; +static sqInt cePositive32BitValueOfTrampoline; +static sqInt cePositive64BitIntegerTrampoline; +static sqInt cePositive64BitValueOfTrampoline; +static sqInt cePrimReturnEnterCogCode; +static sqInt cePrimReturnEnterCogCodeProfiling; +sqInt ceReturnToInterpreterTrampoline; +static sqInt ceScheduleScavengeTrampoline; +static sqInt ceSendMustBeBooleanAddFalseTrampoline; +static sqInt ceSendMustBeBooleanAddTrueTrampoline; +static sqInt ceSigned32BitIntegerTrampoline; +static sqInt ceSigned32BitValueOfTrampoline; +static sqInt ceSigned64BitIntegerTrampoline; +static sqInt ceSigned64BitValueOfTrampoline; +static sqInt ceSmallActiveContextInBlockTrampoline; +static sqInt ceSmallActiveContextInFullBlockTrampoline; +static sqInt ceSmallActiveContextInMethodTrampoline; +static sqInt ceStoreCheckContextReceiverTrampoline; +static sqInt ceStoreCheckTrampoline; +static sqInt ceStoreContextInstVarTrampoline; +#if IMMUTABILITY +sqInt ceStoreTrampolines[5]; +#endif +static sqInt ceTraceBlockActivationTrampoline; +static sqInt ceTraceLinkedSendTrampoline; +static sqInt ceTraceStoreTrampoline; +usqIntptr_t (*ceTryLockVMOwner)(void); +void (*ceUnlockVMOwner)(void); +sqInt cFramePointerInUse; +static sqInt checkedEntryAlignment; +static sqInt closedPICSize; +sqInt cmEntryOffset; +sqInt cmNoCheckEntryOffset; +static sqInt codeBase; +static sqInt codeModified; +static sqInt compilationTrace; +static sqInt cPICCaseSize; +static sqInt cPICEndOfCodeOffset; +static sqInt cPICEndSize; +static sqInt cPICPrototype; +static const int cStackAlignment = STACK_ALIGN_BYTES; +static sqInt currentCallCleanUpSize; +static sqInt deadCode; +static sqInt debugBytecodePointers; +static sqInt debugFixupBreaks; +static sqInt debugOpcodeIndices; +usqIntptr_t debugPrimCallStackOffset; +static sqInt debugStackPointers; +static sqInt directedSuperSendTrampolines[NumSendTrampolines]; +static sqInt disassemblingMethod; +static AbstractInstruction * endCPICCase0; +static sqInt endPC; +static AbstractInstruction * entry; +static sqInt entryPointMask; +static CogMethod * enumeratingCogMethod; +static sqInt expectedFPAlignment; +static sqInt expectedSPAlignment; +static sqInt extA; +static sqInt extB; +static sqInt externalPrimCallOffsets[MaxNumArgs + 1]; +static sqInt externalPrimJumpOffsets[MaxNumArgs + 1]; +static sqInt externalSetPrimOffsets[MaxNumArgs + 1]; +static sqInt firstCPICCaseOffset; +static sqInt firstSend; +static BytecodeFixup * fixups; +static AbstractInstruction * fullBlockEntry; +static AbstractInstruction * fullBlockNoContextSwitchEntry; +static BytecodeDescriptor generatorTable[512] = { + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushQuickIntegerConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extendedPushBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { extendedStoreBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { extendedStoreAndPopBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { doubleExtendedDoAnythingBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtendedSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, + { genSecondExtendedSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushActiveContextBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushClosureCopyCopiedValuesBytecode, v3BlockCodeSize, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalBackwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongUnconditionalForwardJump, v3LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfTrue, v3LongForwardBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genLongJumpIfFalse, v3LongForwardBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushReceiverVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLitVarDirSup16CasesBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushLiteralConstantBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantTrueBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantFalseBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantNilBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantZeroBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPushConstantOneBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushPseudoVariable, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genReturnReceiver, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTrue, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnFalse, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNil, 0, needsFrameIfInBlock, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnTopFromMethod, 0, needsFrameIfInBlock, -1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, + { genReturnNilFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genReturnTopFromBlock, 0, needsFrameNever, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { genExtNopBytecode, 0, needsFrameNever, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, SubRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLess, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreater, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpLessOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpGreaterOrEqual, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorComparison, 0, 0, 0, JumpNonZero, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, AndRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorArithmetic, 0, 0, 0, OrRR, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorClass, 0, needsFrameIfStackGreaterThanOne, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorNotEqualsEquals, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSpecialSelectorSend, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector1ArgBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSendLiteralSelector2ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortUnconditionalJump, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfTrue, v3ShortForwardBranchDistance, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genShortJumpIfFalse, v3ShortForwardBranchDistance, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 1, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genPopStackBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genUnconditionalTrapBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extABytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { extBBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtPushReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { genExtPushLitVarDirSupBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushLiteralBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genLongPushTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushIntegerBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushCharacterBytecode, 0, needsFrameNever, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtSendSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genExtUnconditionalJump, v4LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfTrue, v4LongBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genExtJumpIfFalse, v4LongBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, + { genSistaExtStoreAndPopReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreAndPopLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genSistaExtStoreReceiverVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 1, 0, 0 }, + { genSistaExtStoreLiteralVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genLongStoreTemporaryVariableBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { genCallPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushFullClosureBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtPushClosureBytecode, v4BlockCodeSize, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { genExtPushRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { genExtStoreRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtStoreAndPopRemoteTempOrInstVarLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, IMMUTABILITY, 0, 0, 0, 0, 0 }, + { genExtJumpIfNotInstanceOfBehaviorsBytecode, v4LongBranchIfNotInstanceOfDistance, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { unknownBytecode, 0, 0, 0, Nop, 3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 } +}; +static sqInt guardPageSize; +static sqInt hasNativeFrame; +static sqInt hasYoungReferent; +static sqInt inBlock; +static sqInt initialPC; +static sqInt introspectionData; +static sqInt introspectionDataIndex; +static int labelCounter; +static sqInt lastSend; +static usqInt limitAddress; +static sqInt maxCPICCases; +static sqInt maxLitIndex; +static sqInt methodAbortTrampolines[4]; +static sqInt methodBytesFreedSinceLastCompaction; +static sqInt methodCount; +static sqInt methodHeader; +static AbstractInstruction * const methodLabel = &aMethodLabel; +static sqInt methodObj; +static sqInt methodOrBlockNumArgs; +static sqInt methodOrBlockNumTemps; +static sqInt methodZoneBase; +static usqIntptr_t minValidCallAddress; +sqInt missOffset; +static usqInt mzFreeStart; +static sqInt needsFrame; +static AbstractInstruction * noCheckEntry; +static sqInt numAbstractOpcodes; +static sqInt numExtB; +static usqInt objectReferencesInRuntime[NumObjRefsInRuntime]; +static sqInt opcodeIndex; +static CogMethod *openPICList = 0; +static sqInt openPICSize; +static CogSSOptStatus optStatus; +static sqInt ordinarySendTrampolines[NumSendTrampolines]; +static sqInt picAbortTrampolines[4]; +static AbstractInstruction * picInterpretAbort; +static sqInt picMissTrampolines[4]; +static void (*postCompileHook)(CogMethod *); +static BytecodeDescriptor * prevBCDescriptor; +static AbstractInstruction * primInvokeInstruction; +static sqInt primitiveIndex; +static AbstractInstruction * primSetFunctionLabel; +void (*realCECallCogCodePopReceiverAndClassRegs)(void); +void (*realCECallCogCodePopReceiverArg0Regs)(void); +void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void); +void (*realCECallCogCodePopReceiverReg)(void); +void (*realCEEnterCogCodePopReceiverReg)(void); +static sqInt regArgsHaveBeenPushed; +static sqInt runtimeObjectRefIndex; +static AbstractInstruction * sendMiss; +static sqInt simNativeSpillBase; +static CogSimStackNativeEntry simNativeStack[19]; +static sqInt simNativeStackPtr; +static sqInt simNativeStackSize; +static CogSimStackEntry simSelf; +static sqInt simSpillBase; +static SimStackEntry simStack[70]; +static sqInt simStackPtr; +static AbstractInstruction * stackCheckLabel; +static AbstractInstruction * stackOverflowCall; +static sqInt superSendTrampolines[NumSendTrampolines]; +static sqInt tempOop; +int traceFlags = 8 /* prim trace log on by default */; +sqInt traceStores; +static char *trampolineAddresses[NumTrampolines*2]; +static sqInt trampolineTableIndex; +static sqInt uncheckedEntryAlignment; +static usqInt unpairedMethodList; +static sqInt useTwoPaths; +static usqInt youngReferrers; + + +/*** Macros ***/ +#define cPICNumCases stackCheckOffset +#define cPICNumCasesHack hack hack hack i.e. the getter macro does all the work +#define abstractInstructionAt(index) (&abstractOpcodes[index]) +#define allocateBlockStarts(numBlocks) do { \ + blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \ +} while (0) +#define backEnd() backEnd +#define blockAlignment(self) 8 +#define blockStartAt(index) (&blockStarts[index]) +#define breakOnImplicitReceiver() (traceFlags & 64) +#define ceBaseFrameReturnPC() ceBaseFrameReturnTrampoline +#define ceCannotResumePC() ((usqInt)ceCannotResumeTrampoline) +#define ceCheckFeatures() ceCheckFeaturesFunction() +#define ceReturnToInterpreterPC() ((usqInt)ceReturnToInterpreterTrampoline) +#define cFramePointerAddress() ((usqIntptr_t)&CFramePointer) +#define compileSendTrace() ((traceFlags & 258) == 258) +#define cr() putchar('\n') +#define cStackPointerAddress() ((usqIntptr_t)&CStackPointer) +#define entryOffset() cmEntryOffset +#define generatorAt(index) (&generatorTable[index]) +#define getCFramePointer() CFramePointer +#define getCStackPointer() CStackPointer +#define getIsObjectReference() 2 +#define halt() warning("halt") +#define haltmsg(msg) warning("halt: " msg) +#define interpretOffset() missOffset +#define methodLabel() methodLabel +#define methodZoneBase() methodZoneBase +#define minCallAddress() minValidCallAddress +#define noCheckEntryOffset() cmNoCheckEntryOffset +#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset +#define notYetImplemented() warning("not yet implemented") +#define printNum(n) printf("%ld", (long) n) +#define printOnTrace() (traceFlags & 1) +#define print(aString) printf(aString) +#define recordBlockTrace() (traceFlags & 4) +#define recordEventTrace() (traceFlags & 16) +#define recordOverflowTrace() (traceFlags & 32) +#define recordPrimTrace() (traceFlags & 8) +#define recordSendTrace() (traceFlags & 2) +#define reportError(n) warning("compilation error") +#define setCFramePointer(theFP) (CFramePointer = (void *)(theFP)) +#define setCStackPointer(theSP) (CStackPointer = (void *)(theSP)) +#define tryLockVMOwner() (ceTryLockVMOwner() != 0) +#define unlockVMOwner() ceUnlockVMOwner() +#define nextOpenPIC methodObject +#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work +#define freeStart() mzFreeStart +#define limitZony() ((CogMethod *)mzFreeStart) +#define methodBytesFreedSinceLastCompaction() methodBytesFreedSinceLastCompaction +#define roundUpLength(numBytes) ((numBytes) + 7 & -8) +#define youngReferrers() youngReferrers +#define flushICacheFromto(me,startAddress,endAddress) cacheflush((char*) startAddress, endAddress - startAddress, ICACHE) +#define numberOfSaveableRegisters(self) 0 +#define maybeConstant(sse) ((sse)->constant) +#define fullBlockEntryOffset() cbEntryOffset +#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset +#define fixupAt(index) (&fixups[index]) +#define simNativeStackAt(index) (simNativeStack + (index)) +#define simStackAt(index) (simStack + (index)) +#define traceDescriptor(ign) 0 +#define traceFixup(ign) 0 +#define traceMerge(ign) 0 +#define traceSimStack() 0 +#define traceSpill(ign) 0 +#define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType)) +#define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0])) +#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop)) +#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop)) +#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop)) +#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop)) +#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop)) + + + /* CogAbstractInstruction>>#addDependent: */ +static AbstractInstruction * NoDbgRegParms +addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) +{ + if (!(((self_in_addDependent->dependent)) == null)) { + (anInstruction->dependent = (self_in_addDependent->dependent)); + } + return ((self_in_addDependent->dependent) = anInstruction); +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. */ + + /* CogAbstractInstruction>>#availableFloatRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableFloatRegisterOrNoneFor(AbstractInstruction * self_in_availableFloatRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << DPFPReg0))) { + return DPFPReg0; + } + if (!(liveRegsMask & (1U << DPFPReg1))) { + return DPFPReg1; + } + if (!(liveRegsMask & (1U << DPFPReg2))) { + return DPFPReg2; + } + if (!(liveRegsMask & (1U << DPFPReg3))) { + return DPFPReg3; + } + if (!(liveRegsMask & (1U << DPFPReg4))) { + return DPFPReg4; + } + if (!(liveRegsMask & (1U << DPFPReg5))) { + return DPFPReg5; + } + if (!(liveRegsMask & (1U << DPFPReg6))) { + return DPFPReg6; + } + if (!(liveRegsMask & (1U << DPFPReg7))) { + return DPFPReg7; + } + return NoReg; +} + + +/* Answer an unused abstract register in the liveRegMask. + Subclasses with more registers can override to answer them. + N.B. Do /not/ allocate TempReg. */ + + /* CogAbstractInstruction>>#availableRegisterOrNoneFor: */ +static sqInt NoDbgRegParms +availableRegisterOrNoneFor(AbstractInstruction * self_in_availableRegisterOrNoneFor, sqInt liveRegsMask) +{ + if (!(liveRegsMask & (1U << Arg1Reg))) { + return Arg1Reg; + } + if (!(liveRegsMask & (1U << Arg0Reg))) { + return Arg0Reg; + } + if (!(liveRegsMask & (1U << SendNumArgsReg))) { + return SendNumArgsReg; + } + if (!(liveRegsMask & (1U << ClassReg))) { + return ClassReg; + } + if (!(liveRegsMask & (1U << ReceiverResultReg))) { + return ReceiverResultReg; + } + return NoReg; +} + + +/* For out-of-line literal support, clone a literal from a literal. */ + + /* CogAbstractInstruction>>#cloneLiteralFrom: */ +static AbstractInstruction * NoDbgRegParms +cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) +{ + assert((((existingLiteral->opcode)) == Literal) + && ((((self_in_cloneLiteralFrom->dependent)) == null) + && (((self_in_cloneLiteralFrom->address)) == null))); + (self_in_cloneLiteralFrom->opcode) = Literal; + (self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation); + ((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]); + ((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]); + ((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]); + return self_in_cloneLiteralFrom; +} + + /* CogAbstractInstruction>>#genWriteCResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = V0; + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCResultIntoReg; +} + + /* CogAbstractInstruction>>#genWriteCSecondResultIntoReg: */ +static AbstractInstruction * NoDbgRegParms +genWriteCSecondResultIntoReg(AbstractInstruction * self_in_genWriteCSecondResultIntoReg, sqInt abstractRegister) +{ + sqInt cResultReg; + + cResultReg = cResultRegisterHigh(); + if (abstractRegister != cResultReg) { + genoperandoperand(MoveRR, cResultReg, abstractRegister); + } + return self_in_genWriteCSecondResultIntoReg; +} + + +/* Get the target of a jump instruction. Jumps have the target in the first + operand. + */ + + /* CogAbstractInstruction>>#getJmpTarget */ +static AbstractInstruction * NoDbgRegParms +getJmpTarget(AbstractInstruction * self_in_getJmpTarget) +{ + return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0])); +} + + +/* For out-of-line literal support, initialize a sharable literal. */ + + /* CogAbstractInstruction>>#initializeSharableLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) +{ + (self_in_initializeSharableLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeSharableLiteral->annotation) = null; + (self_in_initializeSharableLiteral->address) = null; + (self_in_initializeSharableLiteral->dependent) = null; + ((self_in_initializeSharableLiteral->operands))[0] = literal; + ((self_in_initializeSharableLiteral->operands))[1] = 1; + ((self_in_initializeSharableLiteral->operands))[2] = -1; + return self_in_initializeSharableLiteral; +} + + +/* For out-of-line literal support, initialize an unsharable literal. */ + + /* CogAbstractInstruction>>#initializeUniqueLiteral: */ +static AbstractInstruction * NoDbgRegParms +initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) +{ + (self_in_initializeUniqueLiteral->opcode) = Literal; + + /* separate := nil for Slang */ + (self_in_initializeUniqueLiteral->annotation) = null; + (self_in_initializeUniqueLiteral->address) = null; + (self_in_initializeUniqueLiteral->dependent) = null; + ((self_in_initializeUniqueLiteral->operands))[0] = literal; + ((self_in_initializeUniqueLiteral->operands))[1] = 0; + ((self_in_initializeUniqueLiteral->operands))[2] = -1; + return self_in_initializeUniqueLiteral; +} + + /* CogAbstractInstruction>>#isAFixup: */ +static sqInt NoDbgRegParms +isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) +{ + return addressIsInFixups(fixupOrAddress); +} + + +/* 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 + to answer false + for values in the interpreter or the object memory. */ + + /* CogAbstractInstruction>>#isWithinMwOffsetRange: */ +static sqInt NoDbgRegParms +isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress) +{ + return 1; +} + + +/* Set the target of a jump instruction. These all have the target in the + first operand. */ + + /* CogAbstractInstruction>>#jmpTarget: */ +static AbstractInstruction * NoDbgRegParms +jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction) +{ + ((self_in_jmpTarget->operands))[0] = (((usqInt)anAbstractInstruction)); + return anAbstractInstruction; +} + + +/* 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 usqIntptr_t NoDbgRegParms +labelOffset(AbstractInstruction * self_in_labelOffset) +{ + return ((self_in_labelOffset->operands))[1]; +} + + +/* Answer the constant loaded by the instruction sequence just before this + address: + */ + + /* CogAbstractInstruction>>#literal32BeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literal32BeforeFollowingAddress(AbstractInstruction * self_in_literal32BeforeFollowingAddress, sqInt followingAddress) +{ + return literalBeforeFollowingAddress(self_in_literal32BeforeFollowingAddress, followingAddress); +} + + /* CogAbstractInstruction>>#resolveJumpTarget */ +static AbstractInstruction * NoDbgRegParms +resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget) +{ + BytecodeFixup *fixup; + + assert(isJump(self_in_resolveJumpTarget)); + fixup = ((BytecodeFixup *) (((self_in_resolveJumpTarget->operands))[0])); + if (isAFixup(self_in_resolveJumpTarget, fixup)) { + assert(addressIsInInstructions((fixup->targetInstruction))); + jmpTarget(self_in_resolveJumpTarget, (fixup->targetInstruction)); + } + return self_in_resolveJumpTarget; +} + + +/* Rewrite a CallFull instruction to call a different target. This variant is + used to rewrite cached primitive calls. + Answer the extent of the code change which is used to compute the range of + the icache to flush. + This defaults to rewriteCallAt:target:; processors that differentiate + between Call and CallFull will override. */ + + /* CogAbstractInstruction>>#rewriteCallFullAt:target: */ +static sqInt NoDbgRegParms +rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteCallAttarget(self_in_rewriteCallFullAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Rewrite a JumpFull instruction to jump to a different target. This variant + is used to rewrite cached primitive calls. + Answer the extent of the code change which is used to compute the range of + the icache to flush. + This defaults to rewriteJumpLongAt:target:; processors that differentiate + between Jump and JumpFull will override. */ + + /* CogAbstractInstruction>>#rewriteJumpFullAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) +{ + return rewriteJumpLongAttarget(self_in_rewriteJumpFullAttarget, callSiteReturnAddress, callTargetAddress); +} + + +/* Update an instruction that depends on a label outside + of generated code (e.g. a method or block header). */ + + /* CogAbstractInstruction>>#updateLabel: */ +static AbstractInstruction * NoDbgRegParms +updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction) +{ + assert((((self_in_updateLabel->opcode)) == MoveCwR) + || (((self_in_updateLabel->opcode)) == PushCw)); + ((self_in_updateLabel->operands))[0] = (((labelInstruction->address)) + (labelOffset(labelInstruction))); + return self_in_updateLabel; +} + + +/* A hack hook to allow ARM to override the simulated address for the + short-cut trampolines, + and to allow x64 to address CStackPointer and CFramePointer relative to + VarBaseReg. + */ + + /* CogAbstractInstruction>>#wantsNearAddressFor: */ +static sqInt NoDbgRegParms +wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject) +{ + return 0; +} + + /* CogBlockMethod>>#cmHomeMethod */ +static CogMethod * NoDbgRegParms +cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) +{ + return ((self_in_cmHomeMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) self_in_cmHomeMethod) + : ((CogMethod *) ((((usqInt)self_in_cmHomeMethod)) - ((self_in_cmHomeMethod->homeOffset))))); +} + + /* CogBytecodeDescriptor>>#isBranch */ +static sqInt NoDbgRegParms +isBranch(BytecodeDescriptor * self_in_isBranch) +{ + return (((self_in_isBranch->spanFunction)) != null) + && (!((self_in_isBranch->isBlockCreation))); +} + + /* CogBytecodeDescriptor>>#isUnconditionalBranch */ +static sqInt NoDbgRegParms +isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch) +{ + return (isBranch(self_in_isUnconditionalBranch)) + && (!(((self_in_isUnconditionalBranch->isBranchTrue)) + || ((self_in_isUnconditionalBranch->isBranchFalse)))); +} + + /* Cogit>>#AddCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAddCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#AndCq:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#AndCq:R:R: */ +static AbstractInstruction * NoDbgRegParms +gAndCqRR(sqInt quickConstant, sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *first; + + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(AndCqRR, quickConstant, srcReg, destReg); + return anInstruction; + + if (srcReg == destReg) { + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return anInstruction1; + } + first = genoperandoperand(MoveRR, srcReg, destReg); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + return first; +} + + /* Cogit>>#ArithmeticShiftRightR:R: */ +static AbstractInstruction * NoDbgRegParms +gArithmeticShiftRightRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(ArithmeticShiftRightRR, reg1, reg2); +} + + /* Cogit>>#abortOffset */ +sqInt +abortOffset(void) +{ + return missOffset; +} + + /* Cogit>>#addCleanBlockStarts */ +static void +addCleanBlockStarts(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt startPCOrNil; + + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + maxLitIndex = ((maxLitIndex < i) ? i : maxLitIndex); + addBlockStartAtnumArgsnumCopiedspan(startPCOrNil - 1, argumentCountOfClosure(lit), copiedValueCountOfClosure(lit), spanForCleanBlockStartingAt(startPCOrNil - 1)); + } + } +} + + +/* Perform an integrity/leak check using the heapMap. + Set a bit at each cog method's header. */ + + /* Cogit>>#addCogMethodsToHeapMap */ +void +addCogMethodsToHeapMap(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + heapMapAtWordPut(cogMethod, 1); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* Cogit>>#addressIsInFixups: */ +static sqInt NoDbgRegParms +addressIsInFixups(AbstractInstruction *address) +{ + return address >= (AbstractInstruction *)&fixups[0] && address < (AbstractInstruction *)&fixups[numAbstractOpcodes]; +} + + /* Cogit>>#addressIsInInstructions: */ +static sqInt NoDbgRegParms +addressIsInInstructions(AbstractInstruction *address) +{ + return !((usqInt)(address) & BytesPerWord-1) \ + && (address) >= &abstractOpcodes[0] \ + && (address) < &abstractOpcodes[opcodeIndex]; +} + + +/* calculate the end of the n'th case statement - which is complicated + because we have case 1 right at the top of our CPIC and then build up from + the last one. Yes I know this sounds strange, but trust me - I'm an + Engineer, we do things backwards all the emit + */ + + /* Cogit>>#addressOfEndOfCase:inCPIC: */ +static sqInt NoDbgRegParms +addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC) +{ + assert((n >= 1) + && (n <= MaxCPICCases)); + return (n == 1 + ? (((sqInt)cPIC)) + firstCPICCaseOffset + : ((((sqInt)cPIC)) + firstCPICCaseOffset) + (((MaxCPICCases + 1) - n) * cPICCaseSize)); +} + + /* Cogit>>#alignUptoRoutineBoundary: */ +static sqInt NoDbgRegParms +alignUptoRoutineBoundary(sqInt anAddress) +{ + return (((anAddress + 7) | 7) - 7); +} + + +/* Check that all methods have valid selectors, and that all linked sends are + to valid targets and have valid cache tags + */ + + /* Cogit>>#allMachineCodeObjectReferencesValid */ +static sqInt +allMachineCodeObjectReferencesValid(void) +{ + CogMethod *cogMethod; + sqInt ok; + + ok = 1; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (!(asserta(checkValidOopReference((cogMethod->selector))))) { + ok = 0; + } + if (!(asserta((cogMethodDoesntLookKosher(cogMethod)) == 0))) { + ok = 0; + } + } + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, ((sqInt)cogMethod))) == 0))) { + ok = 0; + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(asserta(noTargetsFreeInClosedPIC(cogMethod)))) { + ok = 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#allMethodsHaveCorrectHeader */ +static sqInt +allMethodsHaveCorrectHeader(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (!(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod()))) { + return 0; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + /* Cogit>>#annotateAbsolutePCRef: */ +static AbstractInstruction * NoDbgRegParms +annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = IsAbsPCReference); + return abstractInstruction; +} + + /* Cogit>>#annotateBytecode: */ +static AbstractInstruction * NoDbgRegParms +annotateBytecode(AbstractInstruction *abstractInstruction) +{ + (abstractInstruction->annotation = HasBytecodePC); + return abstractInstruction; +} + + /* Cogit>>#annotate:objRef: */ +static AbstractInstruction * NoDbgRegParms +annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) +{ + if (shouldAnnotateObjectReference(anOop)) { + if (isYoungObject(anOop)) { + hasYoungReferent = 1; + } + (abstractInstruction->annotation = IsObjectReference); + } + return abstractInstruction; +} + + /* Cogit>>#assertSaneJumpTarget: */ +static void NoDbgRegParms +assertSaneJumpTarget(AbstractInstruction *jumpTarget) +{ + assert((closedPICSize == null) + || ((openPICSize == null) + || ((addressIsInInstructions(jumpTarget)) + || ((((((usqInt)jumpTarget)) >= codeBase) && ((((usqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); +} + + /* Cogit>>#blockCreationBytecodeSizeForHeader: */ +static sqInt NoDbgRegParms +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) +{ + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? AltBlockCreationBytecodeSize + : BlockCreationBytecodeSize); +} + + +/* Evaluate binaryFunction with the block start mcpc and supplied arg for + each entry in the block dispatch. If the function answers non-zero answer + the value + it answered. Used to update back-references to the home method in + compaction. */ + + /* Cogit>>#blockDispatchTargetsFor:perform:arg: */ +static sqInt NoDbgRegParms +blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) +{ + sqInt blockEntry; + sqInt end; + sqInt pc; + sqInt result; + usqInt targetpc; + + if (((cogMethod->blockEntryOffset)) == 0) { + return null; + } + blockEntry = ((cogMethod->blockEntryOffset)) + (((sqInt)cogMethod)); + pc = blockEntry; + end = (mapEndFor(cogMethod)) - 1; + while (pc < end) { + if (isJumpAt(backEnd, pc)) { + targetpc = jumpTargetPCAt(backEnd, pc); + if (targetpc < blockEntry) { + result = binaryFunction(targetpc, arg); + if (result != 0) { + return result; + } + } + } + pc += instructionSizeAt(backEnd, pc); + } + return 0; +} + + +/* Answer the zero-relative bytecode pc matching the machine code pc argument + in cogMethod, given the start of the bytecodes for cogMethod's block or + method object. */ + + /* Cogit>>#bytecodePCFor:startBcpc:in: */ +sqInt +bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc1; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc1 = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc1)), startbcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc1 += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + return 0; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + return 0; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = findIsBackwardBranchMcpcBcpcMatchingMcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc1)), bcpc, (((void *)mcpc))); + if (result != 0) { + return result; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return 0; +} + + /* Cogit>>#CallRT:registersToBeSavedMask: */ +static AbstractInstruction * NoDbgRegParms +CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved) +{ + AbstractInstruction *abstractInstruction; + sqInt callerSavedRegsToBeSaved; + AbstractInstruction *lastInst; + sqInt reg; + sqInt registersToBePushed; + + reg = 0; + callerSavedRegsToBeSaved = CallerSavedRegisterMask & registersToBeSaved; + registersToBePushed = callerSavedRegsToBeSaved; + reg = 0; + while (registersToBePushed != 0) { + if (registersToBePushed & 1) { + /* begin PushR: */ + genoperand(PushR, reg); + } + reg += 1; + registersToBePushed = ((sqInt) registersToBePushed) >> 1; + } + + /* begin CallRT: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + lastInst = abstractInstruction; + while (reg >= 0) { + if (callerSavedRegsToBeSaved & (1U << reg)) { + /* begin PopR: */ + lastInst = genoperand(PopR, reg); + } + reg -= 1; + } + return lastInst; + +} + + /* Cogit>>#Call: */ +static AbstractInstruction * NoDbgRegParms +gCall(sqInt callTarget) +{ + return genoperand(Call, callTarget); +} + + /* Cogit>>#CmpCq:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#CmpCw:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(CmpCwR, wordConstant, reg); + return anInstruction; +} + + /* Cogit>>#CmpR:R: */ +static AbstractInstruction * NoDbgRegParms +gCmpRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(CmpRR, reg1, reg2); +} + + +/* This is a static version of ceCallCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiver */ +void +callCogCodePopReceiver(void) +{ + realCECallCogCodePopReceiverReg(); + error("what??"); + +} + + +/* This is a static version of ceCallCogCodePopReceiverAndClassRegs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#callCogCodePopReceiverAndClassRegs */ +void +callCogCodePopReceiverAndClassRegs(void) +{ + realCECallCogCodePopReceiverAndClassRegs(); +} + + +/* Code entry closed PIC miss. A send has fallen + through a closed (finite) polymorphic inline cache. + Either extend it or patch the send site to an open PIC. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#ceCPICMiss:receiver: */ +sqInt +ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver) +{ + sqInt cacheTag; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + sqInt outerReturn; + sqInt result; + sqInt selector; + + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(cPIC); + } + outerReturn = stackTop(); + assert(!(((inlineCacheTagAt(backEnd, outerReturn)) == (picAbortDiscriminatorValue())))); + if (((cPIC->cPICNumCases)) < MaxCPICCases) { + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (cPIC->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + + l1: /* end lookup:for:methodAndErrorSelectorInto: */; + } + else { + newTargetMethodOrNil = (errorSelectorOrNil = null); + } + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if ((((cPIC->cPICNumCases)) >= MaxCPICCases) + || (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((cPIC->selector), (cPIC->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(cPIC); + } + cogExtendPICCaseNMethodtagisMNUCase(cPIC, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + executeCogPICfromLinkedSendWithReceiverandCacheTag(cPIC, receiver, inlineCacheTagAt(backEnd, outerReturn)); + return null; +} + + /* Cogit>>#ceFree: */ +void +ceFree(void*pointer) +{ + free(pointer); +} + + /* Cogit>>#ceMalloc: */ +void* +ceMalloc(size_t size) +{ + return malloc(size); +} + + +/* An in-line cache check in a method has failed. The failing entry check has + jumped to the ceMethodAbort abort call at the start of the method which + has called this routine. + If possible allocate a closed PIC for the current and existing classes. + The stack looks like: + receiver + args + sender return address + sp=> ceMethodAbort call return address + So we can find the method that did the failing entry check at + ceMethodAbort call return address - missOffset + and we can find the send site from the outer return address. */ + + /* Cogit>>#ceSICMiss: */ +sqInt +ceSICMiss(sqInt receiver) +{ + sqInt cacheTag; + usqInt entryPoint; + sqInt errorSelectorOrNil; + sqInt errsel; + sqInt extent; + usqInt innerReturn; + sqInt method; + sqInt methodOrSelectorIndex; + sqInt newTargetMethodOrNil; + usqInt outerReturn; + CogMethod *pic; + sqInt result; + sqInt selector; + CogMethod *targetMethod; + + + /* Whether we can relink to a PIC or not we need to pop off the inner return and identify the target method. */ + innerReturn = ((usqInt)(popStack())); + targetMethod = ((CogMethod *) (innerReturn - missOffset)); + if (isOopForwarded(receiver)) { + return ceSendFromInLineCacheMiss(targetMethod); + } + outerReturn = ((usqInt)(stackTop())); + assert(((outerReturn >= methodZoneBase) && (outerReturn <= (freeStart())))); + entryPoint = callTargetFromReturnAddress(backEnd, outerReturn); + assert(((targetMethod->selector)) != (nilObject())); + assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint); + /* begin lookup:for:methodAndErrorSelectorInto: */ + selector = (targetMethod->selector); + methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + if (!(isOopCompiledMethod(methodOrSelectorIndex))) { + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorCannotInterpret; + + goto l1; + } + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, selector); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = null; + + goto l1; + } + if (methodOrSelectorIndex == SelectorDoesNotUnderstand) { + methodOrSelectorIndex = lookupMNUreceiver(splObj(SelectorDoesNotUnderstand), receiver); + if ((((usqInt)methodOrSelectorIndex)) > (maxLookupNoMNUErrorCode())) { + assert(isOopCompiledMethod(methodOrSelectorIndex)); + if ((!(methodHasCogMethod(methodOrSelectorIndex))) + && (methodShouldBeCogged(methodOrSelectorIndex))) { + + /* We assume cog:selector: will *not* reclaim the method zone */ + cogselector(methodOrSelectorIndex, splObj(SelectorDoesNotUnderstand)); + } + newTargetMethodOrNil = methodOrSelectorIndex; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = SelectorDoesNotUnderstand; + + goto l1; + } + newTargetMethodOrNil = null; + errorSelectorOrNil = methodOrSelectorIndex; + +l1: /* end lookup:for:methodAndErrorSelectorInto: */; + assert(outerReturn == (stackTop())); + cacheTag = inlineCacheTagForInstance(receiver); + if (((errorSelectorOrNil != null) + && (errorSelectorOrNil != SelectorDoesNotUnderstand)) + || (((inlineCacheTagAt(backEnd, outerReturn)) == 0) + || ((newTargetMethodOrNil == null) + || (isYoung(newTargetMethodOrNil))))) { + result = patchToOpenPICFornumArgsreceiver((targetMethod->selector), (targetMethod->cmNumArgs), receiver); + assert(!result); + return ceSendFromInLineCacheMiss(targetMethod); + } + pic = openPICWithSelector((targetMethod->selector)); + if ((pic == null) + || (!1)) { + + /* otherwise attempt to create a closed PIC for the two cases. */ + pic = cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase((targetMethod->selector), (targetMethod->cmNumArgs), targetMethod, newTargetMethodOrNil, cacheTag, errorSelectorOrNil == SelectorDoesNotUnderstand); + if ((((((sqInt)pic)) >= MaxNegativeErrorCode) && ((((sqInt)pic)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. + Continue as if this is an unlinked send. */ + if ((((sqInt)pic)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return ceSendFromInLineCacheMiss(targetMethod); + } + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + } + extent = (((pic->cmType)) == CMOpenPIC + ? rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat((targetMethod->selector), mframeHomeMethodExport(), outerReturn), (((sqInt)pic)) + cmEntryOffset) + : rewriteCallAttarget(backEnd, outerReturn, (((sqInt)pic)) + cmEntryOffset)); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + executeCogPICfromLinkedSendWithReceiverandCacheTag(pic, receiver, inlineCacheTagAt(backEnd, outerReturn)); + return null; +} + + /* Cogit>>#checkAssertsEnabledInCogit */ +void +checkAssertsEnabledInCogit(void) +{ + sqInt assertsAreEnabledInCogit; + + assertsAreEnabledInCogit = 0; + assert(assertsAreEnabledInCogit); +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRefAndTarget:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + usqInt cacheTag1; + sqInt entryPoint; + usqInt entryPoint1; + sqInt literal; + sqInt offset; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObject; + sqInt targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (!(asserta(checkValidOopReference(literal)))) { + return 1; + } + if ((couldBeObject(literal)) + && (isReallyYoungObject(literal))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 2; + } + } + } + if (annotation >= IsSendCall) { + if (!(asserta((((((CogMethod *) cogMethod))->cmType)) == CMMethod))) { + return 3; + } + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj) { + if (couldBeObject(cacheTag1)) { + if (!(asserta(checkValidOopReference(cacheTag1)))) { + return 4; + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 5; + } + } + if ((couldBeObject(cacheTag1)) + && (isReallyYoungObject(cacheTag1))) { + if (!(asserta(((((CogMethod *) cogMethod))->cmRefersToYoung)))) { + return 6; + } + } + } + else { + if (!(asserta(validInlineCacheTag(cacheTag1)))) { + return 7; + } + } + + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send; find which kind. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(asserta((((targetMethod1->cmType)) == CMMethod) + || ((((targetMethod1->cmType)) == CMClosedPIC) + || (((targetMethod1->cmType)) == CMOpenPIC))))) { + return 8; + } + + } + } + return 0; +} + + +/* Check for a valid object reference, if any, at a map entry. Answer a code + unique to each error for debugging. */ + + /* Cogit>>#checkIfValidOopRef:pc:cogMethod: */ +static sqInt NoDbgRegParms +checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + usqInt entryPoint; + sqInt literal; + sqInt off; + usqInt offset; + sqInt offset1; + usqInt selectorOrCacheTag; + sqInt *sendTable; + sqInt table; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (!(checkValidOopReference(literal))) { + print("object ref leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + offset = entryPoint; + } + else { + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable = superSendTrampolines; + + + } + } + offset = offset1; + + } + selectorOrCacheTag = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + if ((entryPoint > methodZoneBase) + && ((offset != cmNoCheckEntryOffset) + && ((((((CogMethod *) (entryPoint - offset)))->cmType)) != CMOpenPIC))) { + + /* linked non-super send, cacheTag is a cacheTag */ + if (!(validInlineCacheTag(selectorOrCacheTag))) { + print("cache tag leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + else { + + /* unlinked send or super send; cacheTag is a selector unless 64-bit, in which case it is an index. */ + if (!(checkValidOopReference(selectorOrCacheTag))) { + print("selector leak in CM "); + printHex(((sqInt)cogMethod)); + print(" @ "); + printHex(((sqInt)mcpc)); + cr(); + return 1; + } + } + } + return 0; +} + + +/* Answer if all references to objects in machine-code are valid. */ + + /* Cogit>>#checkIntegrityOfObjectReferencesInCode: */ +sqInt +checkIntegrityOfObjectReferencesInCode(sqInt gcModes) +{ + CogMethod *cogMethod; + sqInt count; + sqInt ok; + + cogMethod = ((CogMethod *) methodZoneBase); + ok = 1; + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if ((cogMethod->cmRefersToYoung)) { + if (((count = occurrencesInYoungReferrers(cogMethod))) != 1) { + print("young referrer CM "); + printHex(((sqInt)cogMethod)); + if (count == 0) { + print(" is not in youngReferrers"); + cr(); + } + else { + print(" is in youngReferrers "); + printNum(count); + print(" times!"); + cr(); + } + ok = 0; + } + } + if (!(checkValidOopReference((cogMethod->selector)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" selector"); + cr(); + ok = 0; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + if (!(checkValidObjectReference((cogMethod->methodObject)))) { + print("object leak in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if (!(isOopCompiledMethod((cogMethod->methodObject)))) { + print("non-method in CM "); + printHex(((sqInt)cogMethod)); + print(" methodObject"); + cr(); + ok = 0; + } + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + if (((isYoungObject((cogMethod->methodObject))) + || (isYoung((cogMethod->selector)))) + && (!((cogMethod->cmRefersToYoung)))) { + print("CM "); + printHex(((sqInt)cogMethod)); + print(" refers to young but not marked as such"); + cr(); + ok = 0; + } + + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(checkValidObjectReferencesInClosedPIC(cogMethod))) { + ok = 0; + } + } + else { + if (((cogMethod->cmType)) == CMOpenPIC) { + if ((mapForperformUntilarg(cogMethod, checkIfValidOopRefpccogMethod, ((sqInt)cogMethod))) != 0) { + ok = 0; + } + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return ok; +} + + /* Cogit>>#checkMaybeObjRefInClosedPIC: */ +static sqInt NoDbgRegParms +checkMaybeObjRefInClosedPIC(sqInt maybeObject) +{ + if (maybeObject == 0) { + return 1; + } + if (!(couldBeObject(maybeObject))) { + return 1; + } + return checkValidObjectReference(maybeObject); +} + + /* Cogit>>#checkValidObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt ok; + sqInt pc; + + ok = 1; + + /* first we check the obj ref at the beginning of the CPIC */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongByteSize(backEnd))); + cr(); + ok = 0; + } + + /* For each case we check any object reference at the end address - sizeof(conditional instruction) and then increment the end address by case size */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (!(checkMaybeObjRefInClosedPIC(literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + print("object leak in CPIC "); + printHex(((sqInt)cPIC)); + print(" @ "); + printHex(pc - (jumpLongConditionalByteSize(backEnd))); + cr(); + ok = 0; + } + pc += cPICCaseSize; + } + return ok; +} + + +/* Answer if the ClosedPIC refers to any unmarked objects or freed/freeable + target methods, + applying markAndTraceOrFreeCogMethod:firstVisit: to those targets to + determine if freed/freeable. + */ + + /* Cogit>>#closedPICRefersToUnmarkedObject: */ +static sqInt NoDbgRegParms +closedPICRefersToUnmarkedObject(CogMethod *cPIC) +{ + sqInt i; + sqInt object; + sqInt pc; + + if (!((isImmediate((cPIC->selector))) + || (isMarked((cPIC->selector))))) { + return 1; + } + pc = addressOfEndOfCaseinCPIC(1, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + if (couldBeObject((object = literalBeforeFollowingAddress(backEnd, (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))))) { + if (!(isMarked(object))) { + return 1; + } + } + if (markAndTraceOrFreePICTargetin(jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc), cPIC)) { + return 1; + } + } + return 0; +} + + /* Cogit>>#codeEntryFor: */ +char * +codeEntryFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i + 1]; + } + } + return null; +} + + /* Cogit>>#codeEntryNameFor: */ +char * +codeEntryNameFor(char *address) +{ + sqInt i; + + for (i = 0; i <= (trampolineTableIndex - 3); i += 2) { + if (((address >= (trampolineAddresses[i + 1])) && (address <= ((trampolineAddresses[i + 3]) - 1)))) { + return trampolineAddresses[i]; + } + } + return null; +} + + /* Cogit>>#cogCodeBase */ +sqInt +cogCodeBase(void) +{ + return codeBase; +} + + +/* Answer the contents of the code zone as an array of pair-wise element, + address in ascending address order. + Answer a string for a runtime routine or abstract label (beginning, end, + etc), a CompiledMethod for a CMMethod, + or a selector (presumably a Symbol) for a PIC. */ + + /* Cogit>>#cogCodeConstituents */ +sqInt +cogCodeConstituents(void) +{ + CogMethod *cogMethod; + sqInt constituents; + sqInt count; + sqInt i; + sqInt label; + sqInt value; + + + /* + 3 for start, freeStart and end */ + count = (trampolineTableIndex / 2) + 3; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + count += 1; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + constituents = instantiateClassindexableSize(classArray(), count * 2); + if (!(constituents)) { + return constituents; + } + pushRemappableOop(constituents); + if ((((label = stringForCString("CogCode"))) == null) + || (((value = positive32BitIntegerFor(codeBase))) == null)) { + return null; + } + storePointerUncheckedofObjectwithValue(0, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(1, topRemappableOop(), value); + for (i = 0; i < trampolineTableIndex; i += 2) { + if ((((label = stringForCString(trampolineAddresses[i]))) == null) + || (((value = positive32BitIntegerFor(((usqInt)(trampolineAddresses[i + 1]))))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(2 + i, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(3 + i, topRemappableOop(), value); + } + count = trampolineTableIndex + 2; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), (((cogMethod->cmType)) == CMMethod + ? (cogMethod->methodObject) + : (cogMethod->selector))); + if (!((value = positive32BitIntegerFor(((usqInt)cogMethod))))) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + count += 2; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if ((((label = stringForCString("CCFree"))) == null) + || (((value = positive32BitIntegerFor(mzFreeStart))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 1, topRemappableOop(), value); + if ((((label = stringForCString("CCEnd"))) == null) + || (((value = positive32BitIntegerFor(limitAddress))) == null)) { + popRemappableOop(); + return null; + } + storePointerUncheckedofObjectwithValue(count + 2, topRemappableOop(), label); + storePointerUncheckedofObjectwithValue(count + 3, topRemappableOop(), value); + constituents = popRemappableOop(); + beRootIfOld(constituents); + return constituents; +} + + +/* Extend the cPIC with the supplied case. If caseNMethod is cogged dispatch + direct to + its unchecked entry-point. If caseNMethod is not cogged, jump to the fast + interpreter dispatch, and if isMNUCase then dispatch to fast MNU + invocation and mark the cPIC as + having the MNU case for cache flushing. */ + + /* Cogit>>#cogExtendPIC:CaseNMethod:tag:isMNUCase: */ +static sqInt NoDbgRegParms +cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase) +{ + sqInt address; + sqInt operand; + usqIntptr_t target; + + compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase); + assert(!(inlineCacheTagIsYoung(caseNTag))); + assert((caseNMethod != null) + && (!(isYoung(caseNMethod)))); + if ((!isMNUCase) + && (methodHasCogMethod(caseNMethod))) { + + /* this isn't an MNU and we have an already cogged method to jump to */ + operand = 0; + target = (((sqInt)(cogMethodOf(caseNMethod)))) + cmNoCheckEntryOffset; + } + else { + operand = caseNMethod; + if (isMNUCase) { + + /* this is an MNU so tag the CPIC header and setup a jump to the MNUAbort */ + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) cPIC))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + target = (((sqInt)cPIC)) + (sizeof(CogMethod)); + } + else { + + /* setup a jump to the interpretAborth so we can cog the target method */ + target = (((sqInt)cPIC)) + (picInterpretAbortOffset()); + } + } + address = addressOfEndOfCaseinCPIC(((cPIC->cPICNumCases)) + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(address, caseNTag, operand, target); + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), address - cPICCaseSize); + flushICacheFromto(processor, ((usqInt)cPIC), (((usqInt)cPIC)) + closedPICSize); + (cPIC->cPICNumCases = ((cPIC->cPICNumCases)) + 1); + return 0; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cogFullBlockMethod:numCopied: */ +CogMethod * +cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied) +{ + CogMethod *cogMethod; + + + /* inline exclude: */ + assert(!((methodHasCogMethod(aMethodObj)))); + assert(isOopCompiledMethod(ultimateLiteralOf(aMethodObj))); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogFullBlockMethod(numCopied); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#cogitPostGCAction: */ +void +cogitPostGCAction(sqInt gcMode) +{ + +# if SPURVM + if (gcMode == GCModeBecome) { + followForwardedLiteralsInOpenPICList(); + } + +# endif /* SPURVM */ + + assert(allMethodsHaveCorrectHeader()); + assert(((gcMode & (GCModeFull + GCModeNewSpace)) == 0) + || (kosherYoungReferrers())); +} + + +/* Check that the header fields onf a non-free method are consistent with + the type. Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#cogMethodDoesntLookKosher: */ +sqInt +cogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + if (((((cogMethod->blockSize)) & (BytesPerWord - 1)) != 0) + || ((((cogMethod->blockSize)) < (sizeof(CogMethod))) + || (((cogMethod->blockSize)) >= 32768))) { + return 1; + } + if (((cogMethod->cmType)) == CMFree) { + return 2; + } + if (((cogMethod->cmType)) == CMMethod) { + if (!((((cogMethod->methodHeader)) & 1))) { + return 11; + } + if (!(couldBeObject((cogMethod->methodObject)))) { + return 12; + } + if ((((cogMethod->stackCheckOffset)) > 0) + && (((cogMethod->stackCheckOffset)) < cmNoCheckEntryOffset)) { + return 13; + } + return 0; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (((cogMethod->blockSize)) != openPICSize) { + return 21; + } + if (((cogMethod->methodHeader)) != 0) { + return 22; + } + if (((cogMethod->objectHeader)) >= 0) { + if ((((cogMethod->methodObject)) != 0) + && ((((cogMethod->methodObject)) < methodZoneBase) + || ((((cogMethod->methodObject)) > ((freeStart()) - openPICSize)) + || (((((cogMethod->methodObject)) & (BytesPerWord - 1)) != 0) + || ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) != CMOpenPIC))))) { + return 23; + } + } + if (((cogMethod->stackCheckOffset)) != 0) { + return 24; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (((cogMethod->blockSize)) != closedPICSize) { + return 0x1F; + } + if (!(((((cogMethod->cPICNumCases)) >= 1) && (((cogMethod->cPICNumCases)) <= MaxCPICCases)))) { + return 32; + } + if (((cogMethod->methodHeader)) != 0) { + return 33; + } + if (((cogMethod->methodObject)) != 0) { + return 34; + } + return 0; + } + return 9; +} + + +/* Attempt to create a one-case PIC for an MNU. + The tag for the case is at the send site and so doesn't need to be + generated. + */ + + /* Cogit>>#cogMNUPICSelector:receiver:methodOperand:numArgs: */ +CogMethod * +cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs) +{ + CogMethod *pic; + sqInt startAddress; + + if ((isYoung(selector)) + || ((inlineCacheTagForInstance(rcvr)) == 0)) { + return 0; + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 1); + assert(endCPICCase0 != null); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + callForCogCompiledCodeCompaction(); + return 0; + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureMNUCPICmethodOperandnumArgsdelta(((CogMethod *) startAddress), methodOperand, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 1; + (pic->cPICNumCases = 1); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 1); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Create an Open PIC. Temporarily create a direct call of + ceSendFromOpenPIC:. Should become a probe of the first-level method lookup + cache followed by a + call of ceSendFromOpenPIC: if the probe fails. */ + + /* Cogit>>#cogOpenPICSelector:numArgs: */ +static CogMethod * NoDbgRegParms +cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs) +{ + sqInt codeSize; + sqInt end; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + CogMethod *pic; + sqInt startAddress; + + compilationBreakpointisMNUCase(selector, numBytesOf(selector), 0); + startAddress = allocate(openPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + (methodLabel->address = startAddress); + (methodLabel->dependent = null); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + compileOpenPICnumArgs(selector, numArgs); + computeMaximumSizes(); + concretizeAt(methodLabel, startAddress); + codeSize = generateInstructionsAt(startAddress + (sizeof(CogMethod))); + mapSize = generateMapAtstart((startAddress + openPICSize) - 1, startAddress + cmNoCheckEntryOffset); + assert((((entry->address)) - startAddress) == cmEntryOffset); + assert(((roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize))) <= openPICSize); + end = outputInstructionsAt(startAddress + (sizeof(CogMethod))); + /* begin fillInOPICHeader:numArgs:selector: */ + pic = ((CogMethod *) startAddress); + (pic->cmType = CMOpenPIC); + (pic->objectHeader = 0); + (pic->blockSize = openPICSize); + addToOpenPICList(pic); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + if ((pic->cmRefersToYoung = isYoung(selector))) { + addToYoungReferrers(pic); + } + (pic->cmUsageCount = initialOpenPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (pic->cPICNumCases = 0); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMOpenPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(openPICSize == (roundUpLength(openPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + openPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to create a two-case PIC for case0CogMethod and + case1Method,case1Tag. The tag for case0CogMethod is at the send site and + so doesn't need to be generated. + case1Method may be any of + - a Cog method; link to its unchecked entry-point + - a CompiledMethod; link to ceInterpretMethodFromPIC: + - a CompiledMethod; link to ceMNUFromPICMNUMethod:receiver: */ + + /* Cogit>>#cogPICSelector:numArgs:Case0Method:Case1Method:tag:isMNUCase: */ +static CogMethod * NoDbgRegParms +cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase) +{ + CogMethod *pic; + sqInt startAddress; + + if (isYoung(selector)) { + return ((CogMethod *) YoungSelectorInPIC); + } + compilationBreakpointisMNUCase(selector, numBytesOf(selector), isMNUCase); + startAddress = allocate(closedPICSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + memcpy(((CogMethod *) startAddress), ((CogMethod *) cPICPrototype), closedPICSize); + configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs, startAddress - cPICPrototype); + /* begin fillInCPICHeader:numArgs:numCases:hasMNUCase:selector: */ + pic = ((CogMethod *) startAddress); + assert(!(isYoung(selector))); + (pic->cmType = CMClosedPIC); + (pic->objectHeader = 0); + (pic->blockSize = closedPICSize); + (pic->methodObject = 0); + (pic->methodHeader = 0); + (pic->selector = selector); + (pic->cmNumArgs = numArgs); + (pic->cmRefersToYoung = 0); + (pic->cmUsageCount = initialClosedPICUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) pic))->cpicHasMNUCaseOrCMIsFullBlock) = isMNUCase; + (pic->cPICNumCases = 2); + (pic->blockEntryOffset = 0); + assert(((pic->cmType)) == CMClosedPIC); + assert(((pic->selector)) == selector); + assert(((pic->cmNumArgs)) == numArgs); + assert(((pic->cPICNumCases)) == 2); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)pic)) + missOffset)) == (picAbortTrampolineFor(numArgs))); + assert(closedPICSize == (roundUpLength(closedPICSize))); + flushICacheFromto(processor, ((usqInt)pic), (((usqInt)pic)) + closedPICSize); + /* begin maybeEnableSingleStep */ + return pic; +} + + +/* Attempt to produce a machine code method for the bytecode method + object aMethodObj. N.B. If there is no code memory available do *NOT* + attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:) + depend on the zone remaining constant across method generation. */ + + /* Cogit>>#cog:selector: */ +CogMethod * +cogselector(sqInt aMethodObj, sqInt aSelectorOop) +{ + CogMethod *cogMethod; + + + /* inline exclude:selector: */ + assert(!((methodHasCogMethod(aMethodObj)))); + + assert(!((isOopCompiledMethod(ultimateLiteralOf(aMethodObj))))); + compilationBreakpointisMNUCase(aSelectorOop, lengthOf(aSelectorOop), 0); + if (aMethodObj == breakMethod) { + haltmsg("Compilation of breakMethod"); + } + if (methodUsesAlternateBytecodeSet(aMethodObj)) { + if ((numElementsIn(generatorTable)) <= 256) { + return null; + } + bytecodeSetOffset = 256; + } + else { + bytecodeSetOffset = 0; + } + ensureNoForwardedLiteralsIn(aMethodObj); + methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); + cogMethod = compileCogMethod(aSelectorOop); + if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return null; + } + return cogMethod; +} + + /* Cogit>>#compactCogCompiledCode */ +void +compactCogCompiledCode(void) +{ + assert(noCogMethodsMaximallyMarked()); + markActiveMethodsAndReferents(); + freeOlderMethodsForCompaction(); + compactPICsWithFreedTargets(); + planCompaction(); + updateStackZoneReferencesToCompiledCodePreCompaction(); + relocateMethodsPreCompaction(); + compactCompiledCode(); + assert(allMethodsHaveCorrectHeader()); + assert(kosherYoungReferrers()); + stopsFromto(backEnd, freeStart(), (youngReferrers()) - 1); + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(youngReferrers()))); +} + + /* Cogit>>#compactPICsWithFreedTargets */ +static void +compactPICsWithFreedTargets(void) +{ + CogMethod *cogMethod; + sqInt count; + + cogMethod = ((CogMethod *) methodZoneBase); + count = 0; + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICCompactAndIsNowEmpty(cogMethod))) { + (cogMethod->cmType = CMFree); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + count += 1; + } + assert(count == (numMethods())); +} + + +/* The start of a CogMethod has a call to a run-time abort routine that + either handles an in-line cache failure or a stack overflow. The routine + selects the + path depending on ReceiverResultReg; if zero it takes the stack overflow + path; if nonzero the in-line cache miss path. Neither of these paths + returns. The abort routine must be called; In the callee the method is + located by + adding the relevant offset to the return address of the call. + + N.B. This code must match that in compilePICAbort: so that the offset of + the return address of the call is the same in methods and closed PICs. */ + + /* Cogit>>#compileAbort */ +static AbstractInstruction * +compileAbort(void) +{ + AbstractInstruction *anInstruction; + sqInt callTarget; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + stackOverflowCall = anInstruction; + + /* If there is a link register it must be saved (pushed onto the stack) before it + is smashed by the abort call, and hence needs to be manually handled here */ + /* begin PushR: */ + sendMiss = genoperand(PushR, LinkReg); + /* begin Call: */ + callTarget = methodAbortTrampolineFor(methodOrBlockNumArgs); + return genoperand(Call, callTarget); + +} + + /* Cogit>>#compileBlockDispatchFrom:to: */ +static sqInt NoDbgRegParms +compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex) +{ + AbstractInstruction *anInstruction; + BlockStart *blockStart; + sqInt halfWay; + AbstractInstruction *jmp; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + sqInt quickConstant; + + if (lowBlockStartIndex == highBlockStartIndex) { + blockStart = blockStartAt(lowBlockStartIndex); + /* begin Jump: */ + jumpTarget = (blockStart->entryLabel); + genoperand(Jump, ((sqInt)jumpTarget)); + return null; + } + halfWay = (highBlockStartIndex + lowBlockStartIndex) / 2; + assert(((halfWay >= lowBlockStartIndex) && (halfWay <= highBlockStartIndex))); + + /* N.B. FLAGS := TempReg - startpc */ + blockStart = blockStartAt(halfWay); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)(((blockStart->startpc)) + 1) << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + if (lowBlockStartIndex == halfWay) { + /* begin JumpLessOrEqual: */ + jumpTarget1 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)jumpTarget1)); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + return null; + } + if ((halfWay + 1) == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + /* begin JumpGreater: */ + jumpTarget2 = (blockStart->entryLabel); + genConditionalBranchoperand(JumpGreater, ((sqInt)jumpTarget2)); + return compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + } + /* begin JumpGreater: */ + jmp = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + compileBlockDispatchFromto(lowBlockStartIndex, halfWay); + if (halfWay == highBlockStartIndex) { + blockStart = blockStartAt(highBlockStartIndex); + jmpTarget(jmp, (blockStart->entryLabel)); + } + else { + jmpTarget(jmp, gLabel()); + compileBlockDispatchFromto(halfWay + 1, highBlockStartIndex); + } + return 0; +} + + +/* Compile a block's entry. This looks like a dummy CogBlockMethod header + (for frame parsing) + followed by either a frame build, if a frame is required, or nothing. The + CogMethodHeader's objectHeader field is a back pointer to the method, but + this can't be filled in until code generation. */ + + /* Cogit>>#compileBlockEntry: */ +static void NoDbgRegParms +compileBlockEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt alignment; + + /* begin AlignmentNops: */ + alignment = blockAlignment(); + genoperand(AlignmentNops, alignment); + (blockStart->fakeHeader = gLabel()); + + switch (sizeof(CogBlockMethod)) { + case 8: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 12: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + case 16: + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + /* begin Fill32: */ + genoperand(Fill32, 0); + break; + default: + error("Case not found and no otherwise clause"); + } + (blockStart->entryLabel = gLabel()); + if (needsFrame) { + compileBlockFrameBuild(blockStart); + if (recordBlockTrace()) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceBlockActivationTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + } + else { + compileBlockFramelessEntry(blockStart); + } +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:floatResultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargfloatResultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, A0); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, A0); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, A1); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, A1); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, A2); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, A2); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, A3); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, A3); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + anInstruction11 = genoperand(CallFull, callTarget); + + if (resultRegOrNone != NoReg) { + cFloatResultToRd(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, A0); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, A0); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, A1); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, A1); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, A2); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, A2); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, A3); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, A3); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + anInstruction11 = genoperand(CallFull, callTarget); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:arg:arg:arg:arg:resultReg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsargargargargresultRegresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + /* begin genMarshallNArgs:arg:arg:arg:arg: */ + if (numArgs == 0) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst0 < NoReg) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, -2 - regOrConst0, A0); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst0, A0); + } + if (numArgs == 1) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst1 < NoReg) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, -2 - regOrConst1, A1); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst1, A1); + } + if (numArgs == 2) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst2 < NoReg) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, -2 - regOrConst2, A2); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst2, A2); + } + if (numArgs == 3) { + ((AbstractInstruction *) backEnd); + goto l11; + } + if (regOrConst3 < NoReg) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, -2 - regOrConst3, A3); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, regOrConst3, A3); + } + ((AbstractInstruction *) backEnd); +l11: /* end genMarshallNArgs:arg:arg:arg:arg: */; + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + anInstruction11 = genoperand(CallFull, callTarget); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + if (resultReg2OrNone != NoReg) { + genWriteCSecondResultIntoReg(backEnd, resultReg2OrNone); + } + genRemoveNArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Generate a call to aRoutine with up to 4 arguments. If resultRegOrNone is + not NoReg assign the C result to resultRegOrNone. If saveRegs, save all + registers. Hack: a negative arg value indicates an abstract register, a + non-negative value + indicates a constant. */ + + /* Cogit>>#compileCallFor:numArgs:floatArg:floatArg:floatArg:floatArg:resultReg:regsToSave: */ +static void NoDbgRegParms +compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt resultRegOrNone, sqInt regMask) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt callTarget; + sqInt delta; + sqInt numRegsPushed; + usqInt regMaskCopy; + sqInt regsToSave; + sqInt wordsPushedModAlignment; + + regsToSave = (resultRegOrNone == NoReg + ? regMask + : ((regMask | (1U << resultRegOrNone)) - (1U << resultRegOrNone))); + if (cStackAlignment > BytesPerWord) { + /* begin genAlignCStackSavingRegisters:numArgs:wordAlignment: */ + regMaskCopy = ((usqInt)regsToSave); + numRegsPushed = 0; + while (regMaskCopy != 0) { + numRegsPushed += regMaskCopy & 1; + regMaskCopy = ((usqInt) regMaskCopy >> 1); + } + if ((numRegsPushed == 0) + && ((numIntRegArgs(((AbstractInstruction *) backEnd))) >= numArgs)) { + goto l2; + } + wordsPushedModAlignment = (numRegsPushed + numArgs) % (cStackAlignment / BytesPerWord); + if (wordsPushedModAlignment != 0) { + delta = (cStackAlignment / BytesPerWord) - wordsPushedModAlignment; + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, delta * BytesPerWord, SPReg); + } + l2: /* end genAlignCStackSavingRegisters:numArgs:wordAlignment: */; + } + genSaveRegs(backEnd, regsToSave); + genMarshallNArgsfloatArgfloatArgfloatArgfloatArg(backEnd, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3); + /* begin CallFullRT: */ + callTarget = ((usqInt)aRoutine); + /* begin CallFull: */ + anInstruction1 = genoperand(CallFull, callTarget); + + if (resultRegOrNone != NoReg) { + genWriteCResultIntoReg(backEnd, resultRegOrNone); + } + genRemoveNFloatArgsFromStack(backEnd, numArgs); + genRestoreRegs(backEnd, regsToSave); +} + + +/* Compile the cache tag computation and the first comparison. Answer the + address of that comparison. */ + + /* Cogit>>#compileCPICEntry */ +static AbstractInstruction * +compileCPICEntry(void) +{ + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + +/* Compile the abstract instructions for the entire full block method. */ + + /* Cogit>>#compileEntireFullBlockMethod: */ +static sqInt NoDbgRegParms +compileEntireFullBlockMethod(sqInt numCopied) +{ + sqInt result; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileFullBlockEntry(); + compileFullBlockMethodFrameBuild(numCopied); + if (((result = compileMethodBody())) < 0) { + return result; + } + assert(blockCount == 0); + return 0; +} + + +/* The entry code to a method checks that the class of the current receiver + matches that in the inline cache. Other non-obvious elements are that its + alignment must be + different from the alignment of the noCheckEntry so that the method map + machinery can distinguish normal and super sends (super sends bind to the + noCheckEntry). */ + + /* Cogit>>#compileEntry */ +static void +compileEntry(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction * inst; + + entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)sendMiss)); + /* begin Label */ + noCheckEntry = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (compileSendTrace()) { + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceLinkedSendTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + /* begin PopR: */ + genoperand(PopR, LinkReg); + } +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Abort for stack overflow on full block activation (no inline cache miss + possible). The flag is SendNumArgsReg. */ + + /* Cogit>>#compileFullBlockEntry */ +static sqInt +compileFullBlockEntry(void) +{ + sqInt alignment; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt callTarget; + AbstractInstruction * jumpNoContextSwitch; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ReceiverResultReg); + stackOverflowCall = anInstruction; + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin Call: */ + callTarget = methodAbortTrampolineFor(methodOrBlockNumArgs); + genoperand(Call, callTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + fullBlockNoContextSwitchEntry = anInstruction1; + /* begin Jump: */ + jumpNoContextSwitch = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + alignment = ((BytesPerWord < 8) ? 8 : BytesPerWord); + genoperand(AlignmentNops, alignment); + /* begin MoveR:R: */ + fullBlockEntry = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpNoContextSwitch, gLabel()); + return 0; +} + + +/* Compile the top-level method body. */ + + /* Cogit>>#compileMethodBody */ +static sqInt +compileMethodBody(void) +{ + if (endPC < initialPC) { + return 0; + } + return compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +} + + +/* The start of a PIC has a call to a run-time abort routine that either + handles a dispatch to an + interpreted method or a dispatch of an MNU case. The routine selects the + path by testing + ClassReg, which holds the inline cache tag; if equal to the + picAbortDiscriminatorValue (zero) + it takes the MNU path; if nonzero the dispatch to interpreter path. + Neither of these paths + returns. The abort routine must be called; In the callee the PIC is + located by adding the + relevant offset to the return address of the call. + + N.B. This code must match that in compileAbort so that the offset of the + return address of + the call is the same in methods and closed PICs. */ + + /* Cogit>>#compilePICAbort: */ +static sqInt NoDbgRegParms +compilePICAbort(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + sqInt callTarget; + AbstractInstruction * picMNUAbort; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, ClassReg); + picMNUAbort = anInstruction; + + /* If there is a link register it must be saved (pushed onto the stack) before it + is smashed by the abort call, and hence needs to be manually handled here */ + /* begin PushR: */ + picInterpretAbort = genoperand(PushR, LinkReg); + /* begin Call: */ + callTarget = picAbortTrampolineFor(numArgs); + genoperand(Call, callTarget); + + return 0; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargfloatResultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin RetN: */ + genoperand(RetN, 0); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin RetN: */ + genoperand(RetN, 0); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsargargargargresultRegresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, resultReg2OrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin RetN: */ + genoperand(RetN, 0); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutine + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C + result back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#compileTrampolineFor:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg: */ +static void NoDbgRegParms +compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone) +{ + genSmalltalkToCStackSwitch(pushLinkReg); + compileCallFornumArgsfloatArgfloatArgfloatArgfloatArgresultRegregsToSave(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, resultRegOrNone, regMask); + genLoadStackPointers(backEnd); + if (pushLinkReg + && (1)) { + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin RetN: */ + genoperand(RetN, 0); + + } + else { + /* begin RetN: */ + genoperand(RetN, 0); + } +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeEntryOffsets */ +static void +computeEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + AbstractInstruction *sendMissCall; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + sendMissCall = compileAbort(); + compileEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cmEntryOffset = ((entry->address)) - methodZoneBase; + cmNoCheckEntryOffset = ((noCheckEntry->address)) - methodZoneBase; + missOffset = (((sendMissCall->address)) + ((sendMissCall->machineCodeSize))) - methodZoneBase; + entryPointMask = BytesPerWord - 1; + while ((cmEntryOffset & entryPointMask) == (cmNoCheckEntryOffset & entryPointMask)) { + entryPointMask = (entryPointMask + entryPointMask) + 1; + } + if (entryPointMask >= (roundUpLength(1))) { + error("cannot differentiate checked and unchecked entry-points with current cog method alignment"); + } + checkedEntryAlignment = cmEntryOffset & entryPointMask; + uncheckedEntryAlignment = cmNoCheckEntryOffset & entryPointMask; + assert(checkedEntryAlignment != uncheckedEntryAlignment); +} + + +/* Generate the entry code for a method to determine cmEntryOffset and + cmNoCheckEntryOffset. We + need cmNoCheckEntryOffset up front to be able to generate the map starting + from cmNoCheckEntryOffset */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#computeFullBlockEntryOffsets */ +static void +computeFullBlockEntryOffsets(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 24; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + methodOrBlockNumArgs = 0; + compileFullBlockEntry(); + computeMaximumSizes(); + generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + cbEntryOffset = ((fullBlockEntry->address)) - methodZoneBase; + cbNoSwitchEntryOffset = ((fullBlockNoContextSwitchEntry->address)) - methodZoneBase; + +} + + +/* This pass assigns maximum sizes to all abstract instructions and + eliminates jump fixups. + It hence assigns the maximum address an instruction will occur at which + allows the next + pass to conservatively size jumps. */ + + /* Cogit>>#computeMaximumSizes */ +static void +computeMaximumSizes(void) +{ + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt relativeAddress; + + relativeAddress = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + (abstractInstruction->address = relativeAddress); + (abstractInstruction->maxSize = computeMaximumSize(abstractInstruction)); + relativeAddress += (abstractInstruction->maxSize); + } +} + + +/* Configure a copy of the prototype CPIC for a two-case PIC for + case0CogMethod and + case1Method + case1Tag. + The tag for case0CogMethod is at the send site and so doesn't need to be + generated. case1Method may be any of + - a Cog method; jump to its unchecked entry-point + - a CompiledMethod; jump to the ceInterpretFromPIC trampoline + - nil; call ceMNUFromPIC + addDelta is the address change from the prototype to the new CPIC + location, needed + because the loading of the CPIC label at the end may use a literal instead + of a pc relative load. */ +/* self disassembleFrom: cPIC asInteger + (self sizeof: CogMethod) to: cPIC + asInteger + closedPICSize + */ + + /* Cogit>>#configureCPIC:Case0:Case1Method:tag:isMNUCase:numArgs:delta: */ +static sqInt NoDbgRegParms +configureCPICCase0Case1MethodtagisMNUCasenumArgsdelta(CogMethod *cPIC, CogMethod *case0CogMethod, sqInt case1Method, sqInt case1Tag, sqInt isMNUCase, sqInt numArgs, sqInt addrDelta) +{ + sqInt caseEndAddress; + sqInt operand; + usqIntptr_t targetEntry; + + assert(case1Method != null); + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + assert(!(inlineCacheTagIsYoung(case1Tag))); + if ((!isMNUCase) + && (methodHasCogMethod(case1Method))) { + operand = 0; + targetEntry = (((sqInt)(cogMethodOf(case1Method)))) + cmNoCheckEntryOffset; + } + else { + + /* We do not scavenge PICs, hence we cannot cache the MNU method if it is in new space. */ + operand = ((case1Method == null) + || (isYoungObject(case1Method)) + ? 0 + : case1Method); + targetEntry = (case1Method == null + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : (((sqInt)cPIC)) + (picInterpretAbortOffset())); + } + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)case0CogMethod)) + cmNoCheckEntryOffset); + + /* update the cpic case */ + caseEndAddress = addressOfEndOfCaseinCPIC(2, cPIC); + rewriteCPICCaseAttagobjReftarget(caseEndAddress, case1Tag, operand, ((sqInt)((isMNUCase + ? (((sqInt)cPIC)) + (sizeof(CogMethod)) + : targetEntry)))); + relocateMethodReferenceBeforeAddressby(backEnd, ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)), addrDelta); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + return 0; +} + + +/* Configure a copy of the prototype CPIC for a one-case MNU CPIC that calls + ceMNUFromPIC for + case0Tag The tag for case0 is at the send site and so doesn't need to be + generated. addDelta is the address change from the prototype to the new + CPIC location, needed + because the loading of the CPIC label at the end may be a literal instead + of a pc-relative load. */ +/* adjust the jump at missOffset, the ceAbortXArgs */ + + /* Cogit>>#configureMNUCPIC:methodOperand:numArgs:delta: */ +static sqInt NoDbgRegParms +configureMNUCPICmethodOperandnumArgsdelta(CogMethod *cPIC, sqInt methodOperand, sqInt numArgs, sqInt addrDelta) +{ + int operand; + sqInt target; + + rewriteCallAttarget(backEnd, (((sqInt)cPIC)) + missOffset, picAbortTrampolineFor(numArgs)); + + /* set the jump to the case0 method */ + operand = ((methodOperand == null) + || (isYoungObject(methodOperand)) + ? 0 + : methodOperand); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + firstCPICCaseOffset, (((sqInt)cPIC)) + (sizeof(CogMethod))); + storeLiteralbeforeFollowingAddress(backEnd, operand, ((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))); + rewriteJumpLongAttarget(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, cPICMissTrampolineFor(numArgs)); + relocateMethodReferenceBeforeAddressby(backEnd, ((((sqInt)cPIC)) + cPICEndOfCodeOffset) - (jumpLongByteSize(backEnd)), addrDelta); + /* begin rewriteCPIC:caseJumpTo: */ + target = addressOfEndOfCaseinCPIC(2, cPIC); + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), target); + return 0; +} + + +/* Scan the CPIC for target methods that have been freed and eliminate them. + Since the first entry cannot be eliminated, answer that the PIC should be + freed if the first entry is to a free target. Answer if the PIC is now + empty or should be freed. */ + + /* Cogit>>#cPICCompactAndIsNowEmpty: */ +static sqInt NoDbgRegParms +cPICCompactAndIsNowEmpty(CogMethod *cPIC) +{ + sqInt entryPoint; + sqInt followingAddress; + sqInt i; + sqInt methods[MaxCPICCases]; + sqInt pc; + int tags[MaxCPICCases]; + CogMethod *targetMethod; + sqInt targets[MaxCPICCases]; + sqInt used; + sqInt valid; + + used = 0; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + entryPoint = (i == 1 + ? jumpLongTargetBeforeFollowingAddress(backEnd, pc) + : jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc)); + + /* Collect all target triples except for triples whose entry-point is a freed method */ + valid = 1; + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + if (i == 1) { + return 1; + } + valid = 0; + } + } + if (valid) { + tags[used] = ((i > 1 + ? (/* begin literal32BeforeFollowingAddress: */ + (followingAddress = pc - (jumpLongConditionalByteSize(backEnd))), + literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), followingAddress)) + : 0)); + targets[used] = entryPoint; + methods[used] = (literalBeforeFollowingAddress(backEnd, pc - ((i == 1 + ? jumpLongByteSize(backEnd) + : (jumpLongConditionalByteSize(backEnd)) + (cmpC32RTempByteSize(backEnd)))))); + used += 1; + } + } + if (used == ((cPIC->cPICNumCases))) { + return 0; + } + if (used == 0) { + return 1; + } + (cPIC->cPICNumCases = used); + if (used == 1) { + pc = addressOfEndOfCaseinCPIC(2, cPIC); + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), pc); + return 0; + } + for (i = 1; i < used; i += 1) { + pc = addressOfEndOfCaseinCPIC(i + 1, cPIC); + rewriteCPICCaseAttagobjReftarget(pc, tags[i], methods[i], targets[i]); + } + /* begin rewriteCPIC:caseJumpTo: */ + rewriteCPICJumpAttarget(backEnd, (((((sqInt)cPIC)) + firstCPICCaseOffset) - (jumpLongByteSize(backEnd))) - (loadLiteralByteSize(backEnd)), pc - cPICCaseSize); + return 0; +} + + +/* The first case in a CPIC doesn't have a class reference so we need only + step over actually usd subsequent cases. + */ + + /* Cogit>>#cPICHasForwardedClass: */ +static sqInt NoDbgRegParms +cPICHasForwardedClass(CogMethod *cPIC) +{ + sqInt classIndex; + sqInt i; + sqInt pc; + + + /* start by finding the address of the topmost case, the cPICNumCases'th one */ + pc = (addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC)) - (jumpLongConditionalByteSize(backEnd)); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + /* begin literal32BeforeFollowingAddress: */ + classIndex = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), pc); + if (isForwardedClassIndex(classIndex)) { + return 1; + } + pc += cPICCaseSize; + } + return 0; +} + + +/* scan the CPIC for target methods that have been freed. */ + + /* Cogit>>#cPICHasFreedTargets: */ +static sqInt NoDbgRegParms +cPICHasFreedTargets(CogMethod *cPIC) +{ + usqInt entryPoint; + sqInt i; + sqInt pc; + CogMethod *targetMethod; + + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + + /* Find target from jump. Ignore jumps to the interpret and MNU calls within this PIC */ + entryPoint = (i == 1 + ? jumpLongTargetBeforeFollowingAddress(backEnd, pc) + : jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc)); + if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + if (((targetMethod->cmType)) == CMFree) { + return 1; + } + } + } + return 0; +} + + +/* Whimsey; we want 16rCA5E10 + cPICPrototypeCaseOffset to be somewhere in + the middle of the zone. + */ + + /* Cogit>>#cPICPrototypeCaseOffset */ +static usqInt +cPICPrototypeCaseOffset(void) +{ + return ((methodZoneBase + (youngReferrers())) / 2) - 13262352; +} + + +/* Are any of the jumps from this CPIC to targetMethod? */ + + /* Cogit>>#cPIC:HasTarget: */ +static sqInt NoDbgRegParms +cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) +{ + sqInt i; + sqInt pc; + usqInt target; + + target = (((usqInt)targetMethod)) + cmNoCheckEntryOffset; + + /* Since this is a fast test doing simple compares we don't need to care that some + cases have nonsense addresses in there. Just zip on through. */ + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + if (target == (jumpLongTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + for (i = 2; i <= MaxCPICCases; i += 1) { + pc += cPICCaseSize; + if (target == (jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc))) { + return 1; + } + } + return 0; +} + + +/* Division is a little weird on some processors. Defer to the backEnd + to allow it to generate any special code it may need to. */ + + /* Cogit>>#DivR:R:Quo:Rem: */ +static AbstractInstruction * NoDbgRegParms +gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) +{ + genDivRRQuoRem(backEnd, rDivisor, rDividend, rQuotient, rRemainder); + return abstractInstructionAt(opcodeIndex - 1); +} + + +/* Return the default number of bytes to allocate for native code at startup. + The actual value can be set via vmParameterAt: and/or a preference in the + ini file. */ + + /* Cogit>>#defaultCogCodeSize */ +sqInt +defaultCogCodeSize(void) +{ + return 1024 * 1536; +} + + +/* Answer the number of bytecodes to skip to get to the first bytecode + past the primitive call and any store of the error code. */ + + /* Cogit>>#deltaToSkipPrimAndErrorStoreIn:header: */ +static sqInt NoDbgRegParms +deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader) +{ + return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0) + && ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj))) + ? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader)) + : 0); +} + + /* Cogit>>#endPCOf: */ +static sqInt NoDbgRegParms +endPCOf(sqInt aMethod) +{ + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt end; + sqInt latestContinuation; + sqInt nExts; + sqInt pc; + sqInt prim; + sqInt targetPC; + + pc = (latestContinuation = startPCOfMethod(aMethod)); + if (((prim = primitiveIndexOf(aMethod))) > 0) { + if (isQuickPrimitiveIndex(prim)) { + return pc - 1; + } + } + /* begin bytecodeSetOffsetFor: */ + bsOffset = (methodUsesAlternateBytecodeSet(aMethod) + ? 256 + : 0); + nExts = 0; + end = numBytesOf(aMethod); + while (pc <= end) { + byte = fetchByteofObject(pc, aMethod); + descriptor = generatorAt(byte + bsOffset); + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + end = pc; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, aMethod); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + if ((descriptor->isBlockCreation)) { + pc += distance; + } + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + pc += (descriptor->numBytes); + } + return end; +} + + +/* This is a static version of ceEnterCogCodePopReceiverReg + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* Cogit>>#enterCogCodePopReceiver */ +void +enterCogCodePopReceiver(void) +{ + realCEEnterCogCodePopReceiverReg(); + error("what??"); + +} + + +/* Use asserts to check if the ClosedPICPrototype is as expected from + compileClosedPICPrototype, and can be updated as required via + rewriteCPICCaseAt:tag:objRef:target:. If all asserts pass, answer + 0, otherwise answer a bit mask identifying all the errors. */ +/* self disassembleFrom: methodZoneBase + (self sizeof: CogMethod) to: + methodZoneBase + closedPICSize + */ + + /* Cogit>>#expectedClosedPICPrototype: */ +static sqInt NoDbgRegParms +expectedClosedPICPrototype(CogMethod *cPIC) +{ + sqInt classTag; + usqInt classTagPC; + usqInt entryPoint; + sqInt errors; + sqInt i; + usqInt methodObjPC; + sqInt object; + usqInt pc; + + errors = 0; + + /* First jump is unconditional; subsequent ones are conditional */ + pc = (((usqInt)cPIC)) + firstCPICCaseOffset; + object = literalBeforeFollowingAddress(backEnd, pc - (jumpLongByteSize(backEnd))); + if (!(asserta(object == (firstPrototypeMethodOop())))) { + errors = 1; + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc); + if (!(asserta(entryPoint == ((cPICPrototypeCaseOffset()) + 13262352)))) { + errors += 2; + } + for (i = 1; i < MaxCPICCases; i += 1) { + + /* verify information in case is as expected. */ + pc += cPICCaseSize; + methodObjPC = (pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == ((subsequentPrototypeMethodOop()) + i)))) { + errors = errors | 4; + } + classTagPC = pc - (jumpLongConditionalByteSize(backEnd)); + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == (3133021973U + i)))) { + errors = errors | 8; + } + entryPoint = jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc); + if (!(asserta(entryPoint == (((cPICPrototypeCaseOffset()) + 13262352) + (i * 16))))) { + errors = errors | 16; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + object = literalBeforeFollowingAddress(backEnd, methodObjPC); + if (!(asserta(object == (((subsequentPrototypeMethodOop()) + i) ^ 2779096485U)))) { + errors = errors | 32; + } + /* begin literal32BeforeFollowingAddress: */ + classTag = literalBeforeFollowingAddress(((AbstractInstruction *) backEnd), classTagPC); + if (!(asserta(classTag == ((3133021973U + i) ^ 1515870810)))) { + errors = errors | 64; + } + entryPoint = jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc); + if (!(asserta(entryPoint == ((((cPICPrototypeCaseOffset()) + 13262352) + (i * 16)) ^ 5614160)))) { + errors = errors | 128; + } + rewriteCPICCaseAttagobjReftarget(pc, classTag ^ 1515870810, object ^ 2779096485U, entryPoint ^ 5614160); + } + entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, (pc + cPICEndSize)); + if (!(asserta(entryPoint == (cPICMissTrampolineFor(0))))) { + errors += 256; + } + return errors; +} + + +/* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A) */ + + /* Cogit>>#extABytecode */ +static sqInt +extABytecode(void) +{ + extA = (((usqInt) extA << 8)) + byte1; + return 0; +} + + +/* 225 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B) */ + + /* Cogit>>#extBBytecode */ +static sqInt +extBBytecode(void) +{ + extB = ((numExtB == 0) + && (byte1 > 0x7F) + ? byte1 - 256 + : (((usqInt) extB << 8)) + byte1); + numExtB += 1; + return 0; +} + + +/* Fill in the block headers now we know the exact layout of the code. */ + + /* Cogit>>#fillInBlockHeadersAt: */ +static sqInt NoDbgRegParms +fillInBlockHeadersAt(sqInt startAddress) +{ + CogBlockMethod *blockHeader; + BlockStart *blockStart; + sqInt i; + + if (!(needsFrame + && (blockCount > 0))) { + return null; + } + if (blockNoContextSwitchOffset == null) { + blockNoContextSwitchOffset = ((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)); + } + else { + assert(blockNoContextSwitchOffset == (((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address)))); + } + for (i = 0; i < blockCount; i += 1) { + blockStart = blockStartAt(i); + blockHeader = ((CogBlockMethod *) ((((blockStart->fakeHeader))->address))); + (blockHeader->homeOffset = ((((blockStart->fakeHeader))->address)) - startAddress); + (blockHeader->startpc = (blockStart->startpc)); + (blockHeader->cmType = CMBlock); + (blockHeader->cmNumArgs = (blockStart->numArgs)); + (blockHeader->cbUsesInstVars = (blockStart->hasInstVarRef)); + (blockHeader->stackCheckOffset = (((blockStart->stackCheckLabel)) == null + ? 0 + : ((((blockStart->stackCheckLabel))->address)) - ((((blockStart->fakeHeader))->address)))); + } + return 0; +} + + /* Cogit>>#fillInMethodHeader:size:selector: */ +static CogMethod * NoDbgRegParms +fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) +{ + CogMethod *originalMethod; + sqInt rawHeader; + + (method->cmType = CMMethod); + (method->objectHeader = nullHeaderForMachineCodeMethod()); + (method->blockSize = size); + (method->methodObject = methodObj); + + /* If the method has already been cogged (e.g. Newspeak accessors) then + leave the original method attached to its cog method, but get the right header. */ + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); + assert(((originalMethod->blockSize)) == size); + assert(methodHeader == ((originalMethod->methodHeader))); + } + else { + rawHeaderOfput(methodObj, ((sqInt)method)); + } + (method->methodHeader = methodHeader); + (method->selector = selector); + (method->cmNumArgs = argumentCountOfMethodHeader(methodHeader)); + if ((method->cmRefersToYoung = hasYoungReferent)) { + addToYoungReferrers(method); + } + (method->cmUsageCount = initialMethodUsageCount()); + /* begin cpicHasMNUCase: */ + ((((CogBlockMethod *) method))->cpicHasMNUCaseOrCMIsFullBlock) = 0; + (method->cmUsesPenultimateLit = maxLitIndex >= ((literalCountOfMethodHeader(methodHeader)) - 2)); + (method->blockEntryOffset = (blockEntryLabel != null + ? ((blockEntryLabel->address)) - (((sqInt)method)) + : 0)); + if (needsFrame) { + if (!((((stackCheckLabel->address)) - (((sqInt)method))) <= MaxStackCheckOffset)) { + error("too much code for stack check offset"); + } + } + (method->stackCheckOffset = (needsFrame + ? ((stackCheckLabel->address)) - (((sqInt)method)) + : 0)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)method)) + missOffset)) == (methodAbortTrampolineFor((method->cmNumArgs)))); + assert(size == (roundUpLength(size))); + flushICacheFromto(processor, ((usqInt)method), (((usqInt)method)) + size); + /* begin maybeEnableSingleStep */ + return method; +} + + /* Cogit>>#findBackwardBranch:IsBackwardBranch:Mcpc:Bcpc:MatchingBcpc: */ +static sqInt NoDbgRegParms +findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetBcpc) +{ + return ((isBackwardBranchAndAnnotation & 1) + && ((((sqInt)targetBcpc)) == bcpc) + ? ((sqInt)mcpc) + : 0); +} + + /* Cogit>>#findBlockMethodWithEntry:startBcpc: */ +static usqInt NoDbgRegParms +findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc) +{ + CogBlockMethod *cogBlockMethod; + + cogBlockMethod = ((CogBlockMethod *) (blockEntryMcpc - (sizeof(CogBlockMethod)))); + if (((cogBlockMethod->startpc)) == startBcpc) { + return ((usqInt)cogBlockMethod); + } + return 0; +} + + /* Cogit>>#findMapLocationForMcpc:inMethod: */ +static sqInt NoDbgRegParms +findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + if (mcpc == targetMcpc) { + return map; + } + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation != IsAnnotationExtension) { + mcpc += 4 * ((annotation == IsDisplacementX2N + ? ((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + if (mcpc >= targetMcpc) { + assert(mcpc == targetMcpc); + if (annotation == IsDisplacementX2N) { + map -= 1; + mapByte = byteAt(map); + annotation = ((usqInt) mapByte) >> AnnotationShift; + assert(annotation > IsAnnotationExtension); + } + return map; + } + map -= 1; + } + return 0; +} + + +/* Find the CMMethod or CMBlock that has zero-relative startbcpc as its first + bytecode pc. + As this is for cannot resume processing and/or conversion to machine-code + on backward + branch, it doesn't have to be fast. Enumerate block returns and map to + bytecode pcs. */ + + /* Cogit>>#findMethodForStartBcpc:inHomeMethod: */ +CogBlockMethod * +findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) == CMMethod); + if (startbcpc == (startPCOfMethodHeader((cogMethod->methodHeader)))) { + return ((CogBlockMethod *) cogMethod); + } + assert(((cogMethod->blockEntryOffset)) != 0); + return ((CogBlockMethod *) (blockDispatchTargetsForperformarg(cogMethod, findBlockMethodWithEntrystartBcpc, startbcpc))); +} + + +/* Machine code addresses map to the following bytecode for all bytecodes + except backward branches, where they map to the backward branch itself. + This is so that loops continue, rather than terminate prematurely. */ + + /* Cogit>>#find:IsBackwardBranch:Mcpc:Bcpc:MatchingMcpc: */ +static sqInt NoDbgRegParms +findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *targetMcpc) +{ + return (targetMcpc == mcpc + ? ((descriptor == null) + || (isBackwardBranchAndAnnotation & 1) + ? bcpc + : bcpc + ((descriptor->numBytes))) + : 0); +} + + /* Cogit>>#firstMappedPCFor: */ +static usqInt NoDbgRegParms +firstMappedPCFor(CogMethod *cogMethod) +{ + return ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); +} + + +/* Answer a fake value for the first method oop in the PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. */ + + /* Cogit>>#firstPrototypeMethodOop */ +static sqInt +firstPrototypeMethodOop(void) +{ + return (((((usqInt)99282957)) >= ((methodLabel->address))) + && ((((usqInt)99282957)) < (youngReferrers())) + ? 212332557 + : 99282957); +} + + /* Cogit>>#followForwardedLiteralsIn: */ +void +followForwardedLiteralsIn(CogMethod *cogMethod) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((cogMethod->cmType)) != CMMethod) + || (!(isForwarded((cogMethod->methodObject))))); + if (shouldRemapOop((cogMethod->selector))) { + (cogMethod->selector = remapObj((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + ensureInYoungReferrers(cogMethod); + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#followForwardedMethods */ +void +followForwardedMethods(void) +{ + CogMethod *cogMethod; + sqInt freedPIC; + + freedPIC = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + if (isForwarded((cogMethod->methodObject))) { + (cogMethod->methodObject = followForwarded((cogMethod->methodObject))); + if (isYoungObject((cogMethod->methodObject))) { + ensureInYoungReferrers(cogMethod); + } + } + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (followMethodReferencesInClosedPIC(cogMethod)) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } +} + + +/* Follow a potential object reference from a closed PIC. + This may be a method reference or null. + Answer if the followed literal is young. + 'mcpc' refers to the jump/branch instruction at the end of + each cpic case */ + + /* Cogit>>#followMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +followMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + if (!(isForwarded(object))) { + return isYoungObject(object); + } + subject = followForwarded(object); + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + return isYoungObject(subject); +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#followMethodReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +followMethodReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = followMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (followMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Free machine-code methods whose compiled methods are unmarked + and open PICs whose selectors are not marked, and closed PICs that + refer to unmarked objects. */ + + /* Cogit>>#freeUnmarkedMachineCode */ +void +freeUnmarkedMachineCode(void) +{ + CogMethod *cogMethod; + sqInt freedMethod; + + freedMethod = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (!(isMarked((cogMethod->methodObject))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((!(isImmediate((cogMethod->selector)))) + && (!(isMarked((cogMethod->selector)))))) { + freedMethod = 1; + freeMethod(cogMethod); + } + if ((((cogMethod->cmType)) == CMClosedPIC) + && (closedPICRefersToUnmarkedObject(cogMethod))) { + freedMethod = 1; + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedMethod) { + unlinkSendsToFree(); + } +} + + /* Cogit>>#genCallMustBeBooleanFor: */ +static AbstractInstruction * NoDbgRegParms +genCallMustBeBooleanFor(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt callTarget; + + /* begin CallRT: */ + callTarget = (boolean == (falseObject()) + ? ceSendMustBeBooleanAddFalseTrampoline + : ceSendMustBeBooleanAddTrueTrampoline); + /* begin annotateCall: */ + abstractInstruction = genoperand(Call, callTarget); + (abstractInstruction->annotation = IsRelativeCall); + return abstractInstruction; +} + + /* Cogit>>#genCheckForInterruptsTrampoline */ +static sqInt +genCheckForInterruptsTrampoline(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + + zeroOpcodeIndex(); + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, LinkReg, address); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCheckForInterrupts, "ceCheckForInterruptsTrampoline", 0, null, null, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genConditionalBranch:operand: */ +static AbstractInstruction * NoDbgRegParms +genConditionalBranchoperand(sqInt opcode, sqInt operandOne) +{ + return noteFollowingConditionalBranch(previousInstruction(), genoperand(opcode, operandOne)); +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. The desired arguments and entry-point are pushed on a stackPage's + stack. The enilopmart pops off the values to be loaded into registers and + then executes a return instruction to pop off the entry-point and jump to + it. + BEFORE AFTER (stacks grow down) + whatever stackPointer -> whatever + target address => reg1 = reg1val, etc + reg1val pc = target address + reg2val + stackPointer -> reg3val */ + + /* Cogit>>#genEnilopmartFor:and:and:forCall:called: */ +static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void) + +{ + AbstractInstruction *anInstruction; + sqInt endAddress; + sqInt enilopmart; + sqInt quickConstant; + sqInt size; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + + genLoadStackPointers(backEnd); + if (regArg3OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg3OrNone); + } + if (regArg2OrNone != NoReg) { + /* begin PopR: */ + genoperand(PopR, regArg2OrNone); + } + /* begin PopR: */ + genoperand(PopR, regArg1); + genEnilopmartReturn(forCall); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineName, enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* An enilopmart (the reverse of a trampoline) is a piece of code that makes + the system-call-like transition from the C runtime into generated machine + code. At the point the enilopmart enters machine code via a return + instruction, any argument registers have been loaded with their values and + the stack, if + for call, looks like + ret pc + stackPointer -> target address + + and if not for call, looks like + whatever + stackPointer -> target address + + If forCall and running on a CISC, ret pc must be left on the stack. If + forCall and + running on a RISC, ret pc must be popped into LinkReg. In either case, + target address must be removed from the stack and jumped/returned to. */ + + /* Cogit>>#genEnilopmartReturn: */ +static void NoDbgRegParms +genEnilopmartReturn(sqInt forCall) +{ + if (forCall) { + /* begin PopR: */ + genoperand(PopR, RISCTempReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin JumpR: */ + genoperand(JumpR, RISCTempReg); + } + else { + /* begin PopR: */ + genoperand(PopR, RISCTempReg); + /* begin JumpR: */ + genoperand(JumpR, RISCTempReg); + + } + +} + + +/* Generate the routine that writes the current values of the C frame and + stack pointers into + variables. These are used to establish the C stack in trampolines back + into the C run-time. + + This is a presumptuous quick hack for x86. It is presumptuous for two + reasons. Firstly + the system's frame and stack pointers may differ from those we use in + generated code, + e.g. on register-rich RISCs. Secondly the ABI may not support a simple + frameless call + as written here (for example 128-bit stack alignment on Mac OS X). */ + + /* Cogit>>#generateCaptureCStackPointers: */ +static void NoDbgRegParms +generateCaptureCStackPointers(sqInt captureFramePointer) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt quickConstant; + sqInt quickConstant1; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 32; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + + /* Must happen first; value may be used in accessing any of the following addresses */ + startAddress = methodZoneBase; + /* begin PushR: */ + genoperand(PushR, VarBaseReg); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + + if (captureFramePointer) { + /* begin MoveR:Aw: */ + address = cFramePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, FPReg, address); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, TempReg); + /* begin AddCq:R: */ + quickConstant1 = 0 + BytesPerWord; + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant1, TempReg); + /* begin MoveR:Aw: */ + address1 = cStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, TempReg, address1); + + /* begin PopR: */ + genoperand(PopR, VarBaseReg); + + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + flushICacheFromto(processor, ((usqInt)startAddress), ((usqInt)methodZoneBase)); + recordGeneratedRunTimeaddress("ceCaptureCStackPointers", startAddress); + ceCaptureCStackPointers = ((void (*)(void)) startAddress); +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ + + /* Cogit>>#generateClosedPICPrototype */ +static void +generateClosedPICPrototype(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + CogMethod *cPIC; + AbstractInstruction * cPICEndOfCodeLabel; + sqInt endAddress; + AbstractInstruction * endCPICCase1; + usqIntptr_t fixupSize; + sqInt h; + AbstractInstruction *jumpNext; + sqInt jumpTarget; + sqInt jumpTarget1; + sqInt jumpTarget2; + sqInt numArgs; + sqInt opcode; + usqIntptr_t opcodeSize; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + + + /* stack allocate the various collections so that they + are effectively garbage collected on return. */ + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = MaxCPICCases * 9; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + /* begin compileClosedPICPrototype */ + compilePICAbort((numArgs = 0)); + + /* At the end of the entry code we need to jump to the first case code, which is actually the last chunk. + On each entension we must update this jump to move back one case. */ + jumpNext = compileCPICEntry(); + /* begin MoveUniqueCw:R: */ + wordConstant2 = firstPrototypeMethodOop(); + /* begin gen:uniqueLiteral:operand: */ + anInstruction2 = genoperandoperand(MoveCwR, wordConstant2, SendNumArgsReg); + /* begin JumpLong: */ + jumpTarget1 = (cPICPrototypeCaseOffset()) + 13262352; + genoperand(JumpLong, jumpTarget1); + /* begin Label */ + endCPICCase0 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + for (h = 1; h < MaxCPICCases; h += 1) { + if (h == (MaxCPICCases - 1)) { + jmpTarget(jumpNext, gLabel()); + } + /* begin MoveUniqueCw:R: */ + wordConstant = (subsequentPrototypeMethodOop()) + h; + /* begin gen:uniqueLiteral:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg); + /* begin CmpC32:R: */ + wordConstant1 = 3133021973U + h; + /* begin gen:literal:operand: */ + opcode = CmpCwR; + /* begin checkLiteral:forInstruction: */ + anInstruction1 = genoperandoperand(opcode, wordConstant1, TempReg); + /* begin JumpLongZero: */ + jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16); + genConditionalBranchoperand(JumpLongZero, ((sqInt)jumpTarget)); + if (h == 1) { + /* begin Label */ + endCPICCase1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + /* begin MoveCw:R: */ + wordConstant3 = (methodLabel->address); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveCwR, wordConstant3, ClassReg); + /* begin JumpLong: */ + jumpTarget2 = cPICMissTrampolineFor(numArgs); + genoperand(JumpLong, jumpTarget2); + /* begin Label */ + cPICEndOfCodeLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + computeMaximumSizes(); + cPIC = ((CogMethod *) methodZoneBase); + closedPICSize = (sizeof(CogMethod)) + (generateInstructionsAt(methodZoneBase + (sizeof(CogMethod)))); + endAddress = outputInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + assert((methodZoneBase + closedPICSize) == endAddress); + firstCPICCaseOffset = ((endCPICCase0->address)) - methodZoneBase; + cPICEndOfCodeOffset = ((cPICEndOfCodeLabel->address)) - methodZoneBase; + cPICCaseSize = ((endCPICCase1->address)) - ((endCPICCase0->address)); + cPICEndSize = closedPICSize - (((MaxCPICCases - 1) * cPICCaseSize) + firstCPICCaseOffset); + closedPICSize = roundUpLength(closedPICSize); + assert(((picInterpretAbort->address)) == (((methodLabel->address)) + (picInterpretAbortOffset()))); + assert((expectedClosedPICPrototype(cPIC)) == 0); + storeLiteralbeforeFollowingAddress(backEnd, 0, ((endCPICCase0->address)) - (jumpLongByteSize(backEnd))); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + cPICPrototype = cPIC; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogFullBlock */ +static CogMethod * +generateCogFullBlock(void) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cbNoSwitchEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cbEntryOffset) == ((fullBlockEntry->address))); + assert((startAddress + cbNoSwitchEntryOffset) == ((fullBlockNoContextSwitchEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cbNoSwitchEntryOffset); + flag("TOCHECK"); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, nilObject()); + (method->cpicHasMNUCaseOrCMIsFullBlock = 1); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* We handle jump sizing simply. First we make a pass that asks each + instruction to compute its maximum size. Then we make a pass that + sizes jumps based on the maxmimum sizes. Then we make a pass + that fixes up jumps. When fixing up a jump the jump is not allowed to + choose a smaller offset but must stick to the size set in the second pass. */ + + /* Cogit>>#generateCogMethod: */ +static CogMethod * NoDbgRegParms +generateCogMethod(sqInt selector) +{ + sqInt codeSize; + usqIntptr_t headerSize; + sqInt mapSize; + CogMethod *method; + sqInt result; + sqInt startAddress; + sqInt totalSize; + + headerSize = sizeof(CogMethod); + (methodLabel->address = freeStart()); + computeMaximumSizes(); + concretizeAt(methodLabel, freeStart()); + codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize); + mapSize = generateMapAtstart(null, ((methodLabel->address)) + cmNoCheckEntryOffset); + totalSize = roundUpLength((headerSize + codeSize) + mapSize); + if (totalSize > MaxMethodSize) { + return ((CogMethod *) MethodTooBig); + } + startAddress = allocate(totalSize); + if (startAddress == 0) { + return ((CogMethod *) InsufficientCodeSpace); + } + assert((startAddress + cmEntryOffset) == ((entry->address))); + assert((startAddress + cmNoCheckEntryOffset) == ((noCheckEntry->address))); + result = outputInstructionsAt(startAddress + headerSize); + assert(((startAddress + headerSize) + codeSize) == result); + padIfPossibleWithStopsFromto(backEnd, result, ((startAddress + totalSize) - mapSize) - 1); + generateMapAtstart((startAddress + totalSize) - 1, startAddress + cmNoCheckEntryOffset); + fillInBlockHeadersAt(startAddress); + method = fillInMethodHeadersizeselector(((CogMethod *) startAddress), totalSize, selector); + if (!(postCompileHook == null)) { + postCompileHook(method); + postCompileHook = null; + } + return method; +} + + +/* Size pc-dependent instructions and assign eventual addresses to all + instructions. Answer the size of the code. + Compute forward branches based on virtual address (abstract code starts at + 0), assuming that any branches branched over are long. + Compute backward branches based on actual address. + Reuse the fixups array to record the pc-dependent instructions that need + to have + their code generation postponed until after the others. */ + + /* Cogit>>#generateInstructionsAt: */ +static sqInt NoDbgRegParms +generateInstructionsAt(sqInt eventualAbsoluteAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + BytecodeFixup *fixup; + sqInt i; + sqInt j; + sqInt pcDependentIndex; + + absoluteAddress = eventualAbsoluteAddress; + pcDependentIndex = 0; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + if (isPCDependent(abstractInstruction)) { + sizePCDependentInstructionAt(abstractInstruction, absoluteAddress); + fixup = fixupAt(pcDependentIndex); + pcDependentIndex += 1; + (fixup->instructionIndex = i); + absoluteAddress += (abstractInstruction->machineCodeSize); + } + else { + absoluteAddress = concretizeAt(abstractInstruction, absoluteAddress); + } + } + for (j = 0; j < pcDependentIndex; j += 1) { + fixup = fixupAt(j); + abstractInstruction = abstractInstructionAt((fixup->instructionIndex)); + concretizeAt(abstractInstruction, (abstractInstruction->address)); + } + return absoluteAddress - eventualAbsoluteAddress; +} + + +/* Generate the method map at addressrNull (or compute it if addressOrNull is + null). Answer the length of the map in byes. Each entry in the map is in + two parts. In the + least signficant bits are a displacement of how far from the start or + previous entry, + unless it is an IsAnnotationExtension byte, in which case those bits are + the extension. + In the most signficant bits are the type of annotation at the point + reached. A null + byte ends the map. */ + + /* Cogit>>#generateMapAt:start: */ +static sqInt NoDbgRegParms +generateMapAtstart(sqInt addressOrNull, sqInt startAddress) +{ + unsigned char annotation; + sqInt delta; + sqInt i; + AbstractInstruction *instruction; + sqInt length; + sqInt location; + sqInt mapEntry; + sqInt maxDelta; + usqIntptr_t mcpc; + + length = 0; + location = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + annotation = (instruction->annotation); + if (!(annotation == null)) { + /* begin mapEntryAddress */ + mcpc = ((instruction->address)) + ((instruction->machineCodeSize)); + while (((delta = (mcpc - location) / 4)) > DisplacementMask) { + maxDelta = (((((delta < MaxX2NDisplacement) ? delta : MaxX2NDisplacement)) | DisplacementMask) - DisplacementMask); + assert((((usqInt) maxDelta) >> AnnotationShift) <= DisplacementMask); + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, (((usqInt) maxDelta) >> AnnotationShift) + DisplacementX2N); + } + location += maxDelta * 4; + length += 1; + } + if (!(addressOrNull == null)) { + mapEntry = delta + (((sqInt)((usqInt)((((annotation < IsSendCall) ? annotation : IsSendCall))) << AnnotationShift))); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + location += delta * 4; + length += 1; + if (annotation > IsSendCall) { + + /* Add the necessary IsAnnotationExtension */ + if (!(addressOrNull == null)) { + mapEntry = (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift))) + (annotation - IsSendCall); + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, mapEntry); + } + length += 1; + } + } + } + if (!(addressOrNull == null)) { + /* begin addToMap:instruction:byte:at:for: */ + byteAtput(addressOrNull - length, MapEnd); + } + return length + 1; +} + + +/* Generate the prototype ClosedPIC to determine how much space as full PIC + takes. When we first allocate a closed PIC it only has one or two cases + and we want to grow it. + So we have to determine how big a full one is before hand. */ +/* stack allocate the various collections so that they + are effectively garbage collected on return. */ + + /* Cogit>>#generateOpenPICPrototype */ +static void +generateOpenPICPrototype(void) +{ + sqInt codeSize; + usqIntptr_t fixupSize; + sqInt mapSize; + usqIntptr_t opcodeSize; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 100; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + (methodLabel->address = methodZoneBase); + (methodLabel->dependent = null); + compileOpenPICnumArgs(specialSelector(0), 2); + computeMaximumSizes(); + concretizeAt(methodLabel, methodZoneBase); + codeSize = generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))); + mapSize = generateMapAtstart(null, methodZoneBase + cmNoCheckEntryOffset); + openPICSize = (roundUpLength((sizeof(CogMethod)) + codeSize)) + (roundUpLength(mapSize)); +} + + +/* Generate the run-time entries at the base of the native code zone and + update the base. + */ + + /* Cogit>>#generateRunTimeTrampolines */ +static void +generateRunTimeTrampolines(void) +{ + ceSendMustBeBooleanAddFalseTrampoline = genMustBeBooleanTrampolineForcalled(falseObject(), "ceSendMustBeBooleanAddFalseTrampoline"); + ceSendMustBeBooleanAddTrueTrampoline = genMustBeBooleanTrampolineForcalled(trueObject(), "ceSendMustBeBooleanAddTrueTrampoline"); + ceNonLocalReturnTrampoline = genNonLocalReturnTrampoline(); + + /* Neither of the context inst var access trampolines save registers. Their operation could cause + arbitrary update of stack frames, so the assumption is that callers flush the stack before calling + the context inst var access trampolines, and that everything except the result is dead afterwards. */ + ceCheckForInterruptTrampoline = genCheckForInterruptsTrampoline(); + ceFetchContextInstVarTrampoline = genTrampolineForcalledargargresult(ceContextinstVar, "ceFetchContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, SendNumArgsReg); + ceStoreContextInstVarTrampoline = genTrampolineForcalledargargargresult(ceContextinstVarvalue, "ceStoreContextInstVarTrampoline", ReceiverResultReg, SendNumArgsReg, ClassReg, ReceiverResultReg); + + /* These two are unusual; they are reached by return instructions. */ + ceCannotResumeTrampoline = genTrampolineForcalled(ceCannotResume, "ceCannotResumeTrampoline"); + ceBaseFrameReturnTrampoline = genReturnTrampolineForcalledarg(ceBaseFrameReturn, "ceBaseFrameReturnTrampoline", ReceiverResultReg); + ceReturnToInterpreterTrampoline = genReturnTrampolineForcalledarg(ceReturnToInterpreter, "ceReturnToInterpreterTrampoline", ReceiverResultReg); + ceMallocTrampoline = genTrampolineForcalledargresult(ceMalloc, "ceMallocTrampoline", ReceiverResultReg, TempReg); + ceFreeTrampoline = genTrampolineForcalledarg(ceFree, "ceFreeTrampoline", ReceiverResultReg); + ceFFICalloutTrampoline = genFFICalloutTrampoline(); + +} + + +/* Generate a routine ceCaptureCStackPointers that will capture the C stack + pointer, and, if it is in use, the C frame pointer. These are used in + trampolines to call + run-time routines in the interpreter from machine-code. */ + + /* Cogit>>#generateStackPointerCapture */ +static void +generateStackPointerCapture(void) +{ + sqInt oldMethodZoneBase; + sqInt oldTrampolineTableIndex; + + + /* For the benefit of the following assert, assume the minimum at first. */ + cFramePointerInUse = 0; + assertCStackWellAligned(); + oldMethodZoneBase = methodZoneBase; + oldTrampolineTableIndex = trampolineTableIndex; + generateCaptureCStackPointers(1); + ceCaptureCStackPointers(); + if (!((cFramePointerInUse = isCFramePointerInUse()))) { + methodZoneBase = oldMethodZoneBase; + trampolineTableIndex = oldTrampolineTableIndex; + generateCaptureCStackPointers(0); + } + assertCStackWellAligned(); +} + + +/* Generate the run-time entries and exits at the base of the native code + zone and update the base. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* Cogit>>#generateTrampolines */ +static void +generateTrampolines(void) +{ + usqIntptr_t fixupSize; + sqInt methodZoneStart; + usqIntptr_t opcodeSize; + + methodZoneStart = methodZoneBase; + (methodLabel->address = methodZoneStart); + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 80; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + hasYoungReferent = 0; + generateSendTrampolines(); + generateMissAbortTrampolines(); + generateObjectRepresentationTrampolines(); + generateRunTimeTrampolines(); + generateEnilopmarts(); + generateTracingTrampolines(); + recordGeneratedRunTimeaddress("methodZoneBase", methodZoneBase); + flushICacheFromto(processor, ((usqInt)methodZoneStart), ((usqInt)methodZoneBase)); +} + + /* Cogit>>#genFFICalloutTrampoline */ +static sqInt +genFFICalloutTrampoline(void) +{ + sqInt address; + sqInt address2; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction2; + sqInt startAddress; + + opcodeIndex = 0; + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, LinkReg, address); + + /* begin CallR: */ + genoperand(CallR, TempReg); + /* begin MoveAw:R: */ + address2 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction2 = genoperandoperand(MoveAwR, address2, LinkReg); + + /* begin RetN: */ + genoperand(RetN, 0); + startAddress = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceFFICalloutTrampoline", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a routine that answers the stack pointer immedately + after a leaf call, used for checking stack pointer alignment. */ + + /* Cogit>>#genGetLeafCallStackPointer */ +static void +genGetLeafCallStackPointer(void) +{ + usqIntptr_t fixupSize; + usqIntptr_t opcodeSize; + sqInt startAddress; + + /* begin allocateOpcodes:bytecodes: */ + numAbstractOpcodes = 4; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + startAddress = methodZoneBase; + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, V0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetFP", startAddress); + ceGetFP = ((usqIntptr_t (*)(void)) startAddress); + startAddress = methodZoneBase; + zeroOpcodeIndex(); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, V0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceGetSP", startAddress); + ceGetSP = ((usqIntptr_t (*)(void)) startAddress); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target + or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch + in a closed PIC. It distinguishes the two by testing ClassReg. If the + register is zero then this is an MNU. + + This poses a problem in 32-bit Spur, where zero is the cache tag for + immediate characters (tag pattern 2r10) because SmallIntegers have tag + patterns 2r11 + and 2r01, so anding with 1 reduces these to 0 & 1. We solve the ambiguity + by patching send sites with a 0 cache tag to open PICs instead of closed + PICs. */ + + /* Cogit>>#genInnerPICAbortTrampoline: */ +static sqInt NoDbgRegParms +genInnerPICAbortTrampoline(char *name) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpMNUCase; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpMNUCase = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceInterpretMethodFromPICreceiver, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg); + jmpTarget(jumpMNUCase, gLabel()); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceMNUFromPICMNUMethodreceiver, name, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 0, NoReg, 1); +} + + /* Cogit>>#genLoadCStackPointersForPrimCall */ +static sqInt +genLoadCStackPointersForPrimCall(void) +{ + sqInt address; + sqInt address1; + sqInt address2; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + + if (debugPrimCallStackOffset == 0) { + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + } + else { + /* begin MoveAw:R: */ + address1 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, debugPrimCallStackOffset, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SPReg); + } + if (cFramePointerInUse) { + /* begin MoveAw:R: */ + address2 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address2, FPReg); + } + return 0; +} + + +/* The in-line cache for a send is implemented as a constant load into + ClassReg. We always use a 32-bit load, even in 64-bits. + + In the initial (unlinked) state the in-line cache is notionally loaded + with the selector. + But since in 64-bits an arbitrary selector oop won't fit in a 32-bit + constant load, we + instead load the cache with the selector's index, either into the literal + frame of the + current method, or into the special selector array. Negative values are + 1-relative indices into the special selector array. + + When a send is linked, the load of the selector, or selector index, is + overwritten with a + load of the receiver's class, or class tag. Hence, the 64-bit VM is + currently constrained + to use class indices as cache tags. If out-of-line literals are used, + distinct caches /must + not/ share acche locations, for if they do, send cacheing will be confused + by the sharing. + Hence we use the MoveUniqueC32:R: instruction that will not share literal + locations. */ + + /* Cogit>>#genLoadInlineCacheWithSelector: */ +static void NoDbgRegParms +genLoadInlineCacheWithSelector(sqInt selectorIndex) +{ + AbstractInstruction *anInstruction; + sqInt cacheValue; + sqInt opcode; + sqInt selector; + + assert((selectorIndex < 0 + ? (((-selectorIndex) >= 1) && ((-selectorIndex) <= (numSpecialSelectors()))) + : ((selectorIndex >= 0) && (selectorIndex <= ((literalCountOf(methodObj)) - 1))))); + selector = (selectorIndex < 0 + ? specialSelector(-1 - selectorIndex) + : getLiteral(selectorIndex)); + assert(addressCouldBeOop(selector)); + if (isYoung(selector)) { + hasYoungReferent = 1; + } + cacheValue = selector; + + /* begin MoveUniqueC32:R: */ + opcode = MoveCwR; + /* begin uniqueLiteral:forInstruction: */ + anInstruction = genoperandoperand(opcode, cacheValue, ClassReg); +} + + /* Cogit>>#genNonLocalReturnTrampoline */ +static sqInt +genNonLocalReturnTrampoline(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + + zeroOpcodeIndex(); + /* begin MoveR:Aw: */ + address = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, LinkReg, address); + + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceNonLocalReturn, "ceNonLocalReturnTrampoline", 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate a trampoline for a routine used as a return address, that has one + argument. Hack: a negative value indicates an abstract register, a + non-negative value indicates a constant. */ + + /* Cogit>>#genReturnTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 0, NoReg, 0); +} + + +/* If the client requires, then on an ARM-like RISC processor, the return + address needs to + be pushed to the stack so that the interpreter sees the same stack layout + as on CISC. + */ + + /* Cogit>>#genSmalltalkToCStackSwitch: */ +static sqInt NoDbgRegParms +genSmalltalkToCStackSwitch(sqInt pushLinkReg) +{ + if (pushLinkReg) { + /* begin PushR: */ + genoperand(PushR, LinkReg); + } + genSaveStackPointers(backEnd); + if (cFramePointerInUse) { + genLoadCStackPointers(backEnd); + } + else { + genLoadCStackPointer(backEnd); + } + return 0; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called: */ +static sqInt NoDbgRegParms +genTrampolineForcalled(void *aRoutine, char *aString) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg: */ +static sqInt NoDbgRegParms +genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with two arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with two arguments that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, regOrConst0, regOrConst1, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:floatResult: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargfloatResult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargregsToSave(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, regMask, 1, NoReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:arg:result:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledargresultresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg, sqInt resultReg2) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, resultReg2, 0); +} + + +/* Generate a trampoline with one argument that answers a result. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:floatArg:result: */ +static sqInt NoDbgRegParms +genTrampolineForcalledfloatArgresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) +{ + return genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 1, regOrConst0, null, null, null, 0, 1, resultReg, 0); +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:floatResultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegfloatResultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegfloatResultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:arg:arg:arg:arg:regsToSave:pushLinkReg:resultReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt resultReg2OrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone, resultReg2OrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with up to four arguments. Generate either a call or + a jump to aRoutineOrNil + as requested by callJumpBar. If generating a call and resultRegOrNone is + not NoReg pass the C result + back in resultRegOrNone. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* Cogit>>#genTrampolineFor:called:numArgs:floatArg:floatArg:floatArg:floatArg:regsToSave:pushLinkReg:resultReg:appendOpcodes: */ +static sqInt NoDbgRegParms +genTrampolineForcallednumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultRegappendOpcodes(void *aRoutine, char *trampolineName, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt regMask, sqInt pushLinkReg, sqInt resultRegOrNone, sqInt appendBoolean) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + if (!appendBoolean) { + zeroOpcodeIndex(); + } + compileTrampolineFornumArgsfloatArgfloatArgfloatArgfloatArgregsToSavepushLinkRegresultReg(aRoutine, numArgs, regOrConst0, regOrConst1, regOrConst2, regOrConst3, regMask, pushLinkReg, resultRegOrNone); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(trampolineName, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate a trampoline with no arguments */ + + /* Cogit>>#genTrampolineFor:called:regsToSave: */ +static sqInt NoDbgRegParms +genTrampolineForcalledregsToSave(void *aRoutine, char *aString, sqInt regMask) +{ + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, regMask, 1, NoReg, 0); +} + + +/* */ + + /* Cogit>>#gen: */ +static AbstractInstruction * NoDbgRegParms +gen(sqInt opcode) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + return abstractInstruction; +} + + +/* */ +/* */ + + /* Cogit>>#gen:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperand(sqInt opcode, sqInt operand) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operand; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + return abstractInstruction; +} + + +/* */ +/* */ +/* */ +/* */ + + /* Cogit>>#gen:operand:operand:operand: */ +static AbstractInstruction * NoDbgRegParms +genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree) +{ + AbstractInstruction *abstractInstruction; + + assert(opcodeIndex < numAbstractOpcodes); + abstractInstruction = abstractInstructionAt(opcodeIndex); + opcodeIndex += 1; + (abstractInstruction->opcode = opcode); + ((abstractInstruction->operands))[0] = operandOne; + ((abstractInstruction->operands))[1] = operandTwo; + ((abstractInstruction->operands))[2] = operandThree; + return abstractInstruction; +} + + /* Cogit>>#getLiteral: */ +static sqInt NoDbgRegParms +getLiteral(sqInt litIndex) +{ + if (maxLitIndex < litIndex) { + maxLitIndex = litIndex; + } + return literalofMethod(litIndex, methodObj); +} + + /* Cogit>>#incrementUsageOfTargetIfLinkedSend:mcpc:ignored: */ +static sqInt NoDbgRegParms +incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + + if (annotation >= IsSendCall) { + assert(annotation != IsNSSendCall); + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmUsageCount)) < (CMMaxUsageCount / 2)) { + (targetMethod1->cmUsageCount = ((targetMethod1->cmUsageCount)) + 1); + } + + } + } + return 0; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#indexForSelector:in:at: */ +static sqInt NoDbgRegParms +indexForSelectorinat(sqInt selector, CogMethod *cogMethod, sqInt mcpc) +{ + sqInt i; + sqInt iLimiT; + sqInt methodOop; + + assert(((((usqInt)mcpc)) > (((usqInt)cogMethod))) + && (mcpc < ((((usqInt)cogMethod)) + ((cogMethod->blockSize))))); + for (i = 0; i < NumSpecialSelectors; i += 1) { + if (selector == (specialSelector(i))) { + return -1 - i; + } + } + + /* Then search the method's literal frame... open code fetchPointer:ofObject: for speed... */ + methodOop = (cogMethod->methodObject); + for (i = LiteralStart, iLimiT = (literalCountOfMethodHeader((cogMethod->methodHeader))); i <= iLimiT; i += 1) { + if ((longAt(((i * BytesPerOop) + BaseHeaderSize) + methodOop)) == selector) { + assert(selector == (literalofMethod(i - 1, methodOop))); + return i - 1; + } + } + error("could not find selector in method when unlinking send site"); + return 0; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialClosedPICUsageCount */ +static sqInt +initialClosedPICUsageCount(void) +{ + return CMMaxUsageCount / 2; +} + + /* Cogit>>#initializeBackend */ +static void +initializeBackend(void) +{ + (methodLabel->machineCodeSize = 0); + (methodLabel->opcode = Label); + ((methodLabel->operands))[0] = 0; + ((methodLabel->operands))[1] = 0; + assert(((registerMaskFor(VarBaseReg)) & CallerSavedRegisterMask) == 0); + +} + + /* Cogit>>#initializeCodeZoneFrom:upTo: */ +void +initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress) +{ + usqIntptr_t fixupSize; + sqInt numberOfAbstractOpcodes; + usqIntptr_t opcodeSize; + sqInt startAddress1; + + initializeBackend(); + stopsFromto(backEnd, startAddress, endAddress - 1); + sqMakeMemoryExecutableFromTo(startAddress, endAddress); + codeBase = (methodZoneBase = startAddress); + minValidCallAddress = (((((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) < (primitiveFailAddress())) ? (((codeBase < (interpretAddress())) ? codeBase : (interpretAddress()))) : (primitiveFailAddress())); + manageFromto(methodZoneBase, endAddress); + /* begin maybeGenerateCheckFeatures */ + /* begin maybeGenerateICacheFlush */ + /* begin generateVMOwnerLockFunctions */ + +# if COGMTVM + /* begin allocateOpcodes:bytecodes: */ + numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd); + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + abstractOpcodes = alloca(opcodeSize + fixupSize); + bzero(abstractOpcodes, opcodeSize + fixupSize); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; + zeroOpcodeIndex(); + startAddress1 = methodZoneBase; + generateLowLevelTryLock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress1); + ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress1); + zeroOpcodeIndex(); + initialPC = 0; + endPC = numAbstractOpcodes - 1; + startAddress1 = methodZoneBase; + generateLowLevelUnlock(backEnd, vmOwnerLockAddress()); + outputInstructionsForGeneratedRuntimeAt(startAddress1); + recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress1); + ceUnlockVMOwner = ((void (*)(void)) startAddress1); + +# endif /* COGMTVM */ + + genGetLeafCallStackPointer(); + generateStackPointerCapture(); + generateTrampolines(); + computeEntryOffsets(); + computeFullBlockEntryOffsets(); + generateClosedPICPrototype(); + manageFromto(methodZoneBase, endAddress); + generateOpenPICPrototype(); +} + + +/* Answer a usage count that reflects likely long-term usage. + Answer 1 for non-primitives or quick primitives (inst var accessors), + 2 for methods with interpreter primitives, and 3 for compiled primitives. */ + + /* Cogit>>#initialMethodUsageCount */ +static sqInt +initialMethodUsageCount(void) +{ + if ((primitiveIndex == 1) + || (isQuickPrimitiveIndex(primitiveIndex))) { + return 1; + } + if (!(primitiveGeneratorOrNil())) { + return 2; + } + return 3; +} + + +/* Answer a usage count that reflects likely long-term usage. */ + + /* Cogit>>#initialOpenPICUsageCount */ +static sqInt +initialOpenPICUsageCount(void) +{ + return CMMaxUsageCount - 1; +} + + +/* Answer the value to put in an inline-cache that is being loaded with the + selector. Usually this is simply the selector, but in 64-bits the cache is + only 32-bits wide + and so the cache is loaded with the index of the selector. */ + + /* Cogit>>#inlineCacheValueForSelector:in:at: */ +static sqInt NoDbgRegParms +inlineCacheValueForSelectorinat(sqInt selector, CogMethod *aCogMethod, sqInt mcpc) +{ + return selector; +} + + /* Cogit>>#inverseBranchFor: */ +static sqInt NoDbgRegParms +inverseBranchFor(sqInt opcode) +{ + + switch (opcode) { + case JumpLongZero: + return JumpLongNonZero; + + case JumpLongNonZero: + return JumpLongZero; + + case JumpZero: + return JumpNonZero; + + case JumpNonZero: + return JumpZero; + + case JumpNegative: + return JumpNonNegative; + + case JumpNonNegative: + return JumpNegative; + + case JumpOverflow: + return JumpNoOverflow; + + case JumpNoOverflow: + return JumpOverflow; + + case JumpCarry: + return JumpNoCarry; + + case JumpNoCarry: + return JumpCarry; + + case JumpLess: + return JumpGreaterOrEqual; + + case JumpGreaterOrEqual: + return JumpLess; + + case JumpGreater: + return JumpLessOrEqual; + + case JumpLessOrEqual: + return JumpGreater; + + case JumpBelow: + return JumpAboveOrEqual; + + case JumpAboveOrEqual: + return JumpBelow; + + case JumpAbove: + return JumpBelowOrEqual; + + case JumpBelowOrEqual: + return JumpAbove; + + default: + error("Case not found and no otherwise clause"); + } + error("invalid opcode for inverse"); + return 0; +} + + +/* See Cogit class>>initializeAnnotationConstants */ + + /* Cogit>>#isPCMappedAnnotation: */ +static sqInt NoDbgRegParms +isPCMappedAnnotation(sqInt annotation) +{ + return annotation >= HasBytecodePC; +} + + /* Cogit>>#isPCWithinMethodZone: */ +sqInt +isPCWithinMethodZone(void *address) +{ + return (((((usqInt)address)) >= methodZoneBase) && ((((usqInt)address)) <= (freeStart()))); +} + + +/* Answer if the instruction preceding retpc is a call instruction. */ + + /* Cogit>>#isSendReturnPC: */ +sqInt +isSendReturnPC(sqInt retpc) +{ + usqInt target; + + if (!(isCallPrecedingReturnPC(backEnd, retpc))) { + return 0; + } + target = callTargetFromReturnAddress(backEnd, retpc); + return (((target >= firstSend) && (target <= lastSend))) + || (((target >= methodZoneBase) && (target <= (freeStart())))); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPEqual(void *jumpTarget) +{ + /* begin genJumpFPEqual: */ + return genoperand(JumpFPEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreaterOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreaterOrEqual(void *jumpTarget) +{ + /* begin genJumpFPGreaterOrEqual: */ + return genoperand(JumpFPGreaterOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPGreater: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPGreater(void *jumpTarget) +{ + /* begin genJumpFPGreater: */ + return genoperand(JumpFPGreater, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLessOrEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLessOrEqual(void *jumpTarget) +{ + /* begin genJumpFPLessOrEqual: */ + return genoperand(JumpFPLessOrEqual, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPLess: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPLess(void *jumpTarget) +{ + /* begin genJumpFPLess: */ + return genoperand(JumpFPLess, ((sqInt)jumpTarget)); +} + + +/* Floating-point jumps are a little weird on some processors. Defer to + the backEnd to allow it to generate any special code it may need to. */ + + /* Cogit>>#JumpFPNotEqual: */ +static AbstractInstruction * NoDbgRegParms +gJumpFPNotEqual(void *jumpTarget) +{ + /* begin genJumpFPNotEqual: */ + return genoperand(JumpFPNotEqual, ((sqInt)jumpTarget)); +} + + /* Cogit>>#Label */ +static AbstractInstruction * +gLabel(void) +{ + return genoperandoperand(Label, (labelCounter += 1), bytecodePC); +} + + /* Cogit>>#LogicalShiftLeftCq:R: */ +static AbstractInstruction * NoDbgRegParms +gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg) +{ + return genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); +} + + /* Cogit>>#lastOpcode */ +static AbstractInstruction * +lastOpcode(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#linkSendAt:in:to:offset:receiver: */ +void +linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver) +{ + sqInt address; + sqInt extent; + sqInt inlineCacheTag; + + assert((theEntryOffset == cmEntryOffset) + || (theEntryOffset == cmNoCheckEntryOffset)); + assert(((callSiteReturnAddress >= methodZoneBase) && (callSiteReturnAddress <= (freeStart())))); + inlineCacheTag = (theEntryOffset == cmNoCheckEntryOffset + ? (targetMethod->selector) + : inlineCacheTagForInstance(receiver)); + address = (((sqInt)targetMethod)) + theEntryOffset; + extent = rewriteInlineCacheAttagtarget(backEnd, callSiteReturnAddress, inlineCacheTag, address); + flushICacheFromto(processor, (((usqInt)callSiteReturnAddress)) - extent, ((usqInt)callSiteReturnAddress)); +} + + /* Cogit>>#loadBytesAndGetDescriptor */ +static BytecodeDescriptor * +loadBytesAndGetDescriptor(void) +{ + BytecodeDescriptor *descriptor; + + byte0 = (fetchByteofObject(bytecodePC, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor, bytecodePC); + return descriptor; +} + + /* Cogit>>#loadSubsequentBytesForDescriptor:at: */ +static void NoDbgRegParms +loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc) +{ + if (((descriptor->numBytes)) > 1) { + byte1 = fetchByteofObject(pc + 1, methodObj); + if (((descriptor->numBytes)) > 2) { + byte2 = fetchByteofObject(pc + 2, methodObj); + if (((descriptor->numBytes)) > 3) { + byte3 = fetchByteofObject(pc + 3, methodObj); + if (((descriptor->numBytes)) > 4) { + notYetImplemented(); + } + } + } + } +} + + /* Cogit>>#MoveAw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveAwR(sqInt address, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, reg); + return anInstruction; +} + + /* Cogit>>#MoveCq:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCqR(sqInt quickConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + return anInstruction; +} + + /* Cogit>>#MoveCw:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, reg); + return anInstruction; +} + + /* Cogit>>#MoveMw:r:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, destReg); + return anInstruction; +} + + /* Cogit>>#MoveR:Mw:r: */ +static AbstractInstruction * NoDbgRegParms +gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, baseReg); + return anInstruction; +} + + /* Cogit>>#MoveR:R: */ +static AbstractInstruction * NoDbgRegParms +gMoveRR(sqInt reg1, sqInt reg2) +{ + return genoperandoperand(MoveRR, reg1, reg2); +} + + +/* Answer the address of the null byte at the end of the method map. */ + + /* Cogit>>#mapEndFor: */ +static usqInt NoDbgRegParms +mapEndFor(CogMethod *cogMethod) +{ + usqInt end; + + end = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while ((byteAt(end)) != MapEnd) { + end -= 1; + assert(end > (firstMappedPCFor(cogMethod))); + } + return end; +} + + +/* Unlinking/GC/Disassembly support */ + + /* Cogit>>#mapFor:performUntil:arg: */ +static sqInt NoDbgRegParms +mapForperformUntilarg(CogMethod *cogMethod, sqInt (*functionSymbol)(sqInt annotation, char *mcpc, sqInt arg), sqInt arg) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = functionSymbol(annotation, (((char *) mcpc)), arg); + if (result != 0) { + return result; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return 0; +} + + +/* Remap all object references in the closed PIC. Answer if any references + are young. + Set codeModified if any modifications are made. */ + + /* Cogit>>#mapObjectReferencesInClosedPIC: */ +static sqInt NoDbgRegParms +mapObjectReferencesInClosedPIC(CogMethod *cPIC) +{ + sqInt i; + sqInt pc; + sqInt refersToYoung; + + + /* first we check the potential method oop load at the beginning of the CPIC */ + pc = addressOfEndOfCaseinCPIC(1, cPIC); + + /* We find the end address of the cPICNumCases'th case and can then just step forward by the case size thereafter */ + refersToYoung = remapMaybeObjRefInClosedPICAt(pc - (jumpLongByteSize(backEnd))); + + /* Next we check the potential class ref in the compare instruction, and the potential method oop load for each case. */ + pc = addressOfEndOfCaseinCPIC((cPIC->cPICNumCases), cPIC); + for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { + if (remapMaybeObjRefInClosedPICAt((pc - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)))) { + refersToYoung = 1; + } + pc += cPICCaseSize; + } + return refersToYoung; +} + + +/* Update all references to objects in the generated runtime. */ + + /* Cogit>>#mapObjectReferencesInGeneratedRuntime */ +static void +mapObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + sqInt mappedLiteral; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = literalBeforeFollowingAddress(backEnd, mcpc); + mappedLiteral = remapObject(literal); + if (mappedLiteral != literal) { + storeLiteralbeforeFollowingAddress(backEnd, mappedLiteral, mcpc); + codeModified = 1; + } + } +} + + +/* Update all references to objects in machine code for a become. + Unlike incrementalGC or fullGC a method that does not refer to young may + refer to young as a result of the become operation. Unlike incrementalGC + or fullGC the reference from a Cog method to its methodObject *must not* + change since the two are two halves of the same object. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForBecome */ +static void +mapObjectReferencesInMachineCodeForBecome(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt remappedMethod; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = (freedPIC = 0); + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + assert(!hasYoungObj); + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + if ((isYoung((cogMethod->selector))) + || (mapObjectReferencesInClosedPIC(cogMethod))) { + freedPIC = 1; + freeMethod(cogMethod); + } + } + else { + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + remappedMethod = remapOop((cogMethod->methodObject)); + if (remappedMethod != ((cogMethod->methodObject))) { + if (methodHasCogMethod(remappedMethod)) { + error("attempt to become two cogged methods"); + } + if (!(withoutForwardingOnandwithsendToCogit((cogMethod->methodObject), remappedMethod, (cogMethod->cmUsesPenultimateLit), methodhasSameCodeAscheckPenultimate))) { + error("attempt to become cogged method into different method"); + } + if ((rawHeaderOf((cogMethod->methodObject))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + rawHeaderOfput(remappedMethod, ((sqInt)cogMethod)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + (cogMethod->methodHeader = rawHeaderOf(remappedMethod)); + (cogMethod->methodObject = remappedMethod); + } + } + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + ensureInYoungReferrers(cogMethod); + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (freedPIC) { + unlinkSendsToFree(); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for a full gc. Since + the current (New)ObjectMemory GC makes everything old in a full GC + a method not referring to young will not refer to young afterwards */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForFullGC */ +static void +mapObjectReferencesInMachineCodeForFullGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + codeModified = 0; + mapObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(!((cogMethod->cmRefersToYoung))); + mapObjectReferencesInClosedPIC(cogMethod); + } + else { + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)codeBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code for either a Spur + scavenging gc + or a Squeak V3 incremental GC. Avoid scanning all code by using the + youngReferrers list. In a young gc a method referring to young may no + longer refer to young, but a + method not referring to young cannot and will not refer to young + afterwards. */ + + /* Cogit>>#mapObjectReferencesInMachineCodeForYoungGC */ +static void +mapObjectReferencesInMachineCodeForYoungGC(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt hasYoungObj; + sqInt hasYoungObjPtr; + usqInt map; + sqInt mapByte; + usqInt mcpc; + usqInt pointer; + sqInt result; + sqInt val; + + val = 0; + hasYoungObj = 0; + hasYoungObjPtr = ((sqInt)((&hasYoungObj))); + codeModified = 0; + pointer = youngReferrers(); + while (pointer < limitAddress) { + assert(!hasYoungObj); + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) == CMFree) { + assert(!((cogMethod->cmRefersToYoung))); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if ((cogMethod->cmRefersToYoung)) { + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + (cogMethod->selector = remapOop((cogMethod->selector))); + if (isYoung((cogMethod->selector))) { + hasYoungObj = 1; + } + if (((cogMethod->cmType)) == CMMethod) { + assert(((cogMethod->objectHeader)) == (nullHeaderForMachineCodeMethod())); + (cogMethod->methodObject = remapOop((cogMethod->methodObject))); + if (isYoung((cogMethod->methodObject))) { + hasYoungObj = 1; + } + } + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = remapIfObjectRefpchasYoung(annotation, (((char *) mcpc)), hasYoungObjPtr); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + if (hasYoungObj) { + hasYoungObj = 0; + } + else { + (cogMethod->cmRefersToYoung = 0); + } + } + } + pointer += BytesPerWord; + } + pruneYoungReferrers(); + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Update all references to objects in machine code. */ + + /* Cogit>>#mapObjectReferencesInMachineCode: */ +void +mapObjectReferencesInMachineCode(sqInt gcMode) +{ + + switch (gcMode) { + case GCModeNewSpace: + mapObjectReferencesInMachineCodeForYoungGC(); + break; + case GCModeFull: + mapObjectReferencesInMachineCodeForFullGC(); + break; + case GCModeBecome: + mapObjectReferencesInMachineCodeForBecome(); + break; + default: + error("Case not found and no otherwise clause"); + } + if (!(asserta((freeStart()) <= (youngReferrers())))) { + error("youngReferrers list overflowed"); + } +} + + +/* Mark objects in machine-code of marked methods (or open PICs with marked + selectors). + */ + + /* Cogit>>#markAndTraceMachineCodeOfMarkedMethods */ +void +markAndTraceMachineCodeOfMarkedMethods(void) +{ + sqInt annotation; + sqInt annotation1; + CogMethod *cogMethod; + usqInt map; + usqInt map1; + sqInt mapByte; + sqInt mapByte1; + usqInt mcpc; + usqInt mcpc1; + sqInt result; + sqInt result1; + sqInt val; + sqInt val1; + + val = 0; + val1 = 0; + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + codeModified = 0; + markAndTraceObjectReferencesInGeneratedRuntime(); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralspcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + if ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector))))) { + /* begin markAndTraceLiteralsIn: */ + assert(((((cogMethod->cmType)) == CMMethod) + && (isMarked((cogMethod->methodObject)))) + || ((((cogMethod->cmType)) == CMOpenPIC) + && ((isImmediate((cogMethod->selector))) + || (isMarked((cogMethod->selector)))))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc1 = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map1 = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte1 = byteAt(map1))) != MapEnd) { + if (mapByte1 >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc1 += (mapByte1 & DisplacementMask) * 4; + if ((((annotation1 = ((usqInt) mapByte1) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte1 = byteAt(map1 - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation1 += mapByte1 & DisplacementMask; + map1 -= 1; + } + result1 = markLiteralspcmethod(annotation1, (((char *) mcpc1)), (((sqInt)cogMethod))); + if (result1 != 0) { + goto l4; + } + } + else { + if (mapByte1 < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc1 += (((sqInt)((usqInt)((mapByte1 - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map1 -= 1; + } + l4: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (leakCheckFullGC()) { + asserta(allMachineCodeObjectReferencesValid()); + } + if (codeModified) { + + /* After updating oops in inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Mark and trace any object references in the generated run-time. */ + + /* Cogit>>#markAndTraceObjectReferencesInGeneratedRuntime */ +static void +markAndTraceObjectReferencesInGeneratedRuntime(void) +{ + sqInt i; + sqInt literal; + usqInt mcpc; + + for (i = 0; i < runtimeObjectRefIndex; i += 1) { + mcpc = objectReferencesInRuntime[i]; + literal = literalBeforeFollowingAddress(backEnd, mcpc); + markAndTraceLiteralinatpc(literal, ((CogMethod *) null), ((usqInt)mcpc)); + } +} + + +/* Mark and trace objects in the argument and free if it is appropriate. + Answer if the method has been freed. firstVisit is a hint used to avoid + scanning methods we've already seen. False positives are fine. + For a CMMethod this + frees if the bytecode method isnt marked, + marks and traces object literals and selectors, + unlinks sends to targets that should be freed. + For a CMClosedPIC this + frees if it refers to anything that should be freed or isn't marked. + For a CMOpenPIC this + frees if the selector isn't marked. */ +/* this recurses at most one level down */ + + /* Cogit>>#markAndTraceOrFreeCogMethod:firstVisit: */ +static sqInt NoDbgRegParms +markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) +{ + sqInt annotation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + sqInt val; + + val = 0; + if (((cogMethod->cmType)) == CMFree) { + return 1; + } + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + if (((cogMethod->cmType)) == CMMethod) { + if (!(isMarked((cogMethod->methodObject)))) { + freeMethod(cogMethod); + return 1; + } + if (firstVisit) { + /* begin markLiteralsAndUnlinkUnmarkedSendsIn: */ + assert(((cogMethod->cmType)) == CMMethod); + assert(isMarked((cogMethod->methodObject))); + markAndTraceLiteralinat((cogMethod->selector), cogMethod, (&((cogMethod->selector)))); + maybeMarkCountersIn(cogMethod); + /* begin maybeMarkIRCsIn: */ + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = markLiteralsAndUnlinkIfUnmarkedSendpcmethod(annotation, (((char *) mcpc)), (((sqInt)cogMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + return 0; + } + if (((cogMethod->cmType)) == CMClosedPIC) { + if (!(closedPICRefersToUnmarkedObject(cogMethod))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + if (((cogMethod->cmType)) == CMOpenPIC) { + if (isMarked((cogMethod->selector))) { + return 0; + } + freeMethod(cogMethod); + return 1; + } + assert((((cogMethod->cmType)) == CMMethod) + || ((((cogMethod->cmType)) == CMClosedPIC) + || (((cogMethod->cmType)) == CMOpenPIC))); + return 0; +} + + +/* If entryPoint is that of some method, then mark and trace objects in it + and free if it is appropriate. + Answer if the method has been freed. */ + + /* Cogit>>#markAndTraceOrFreePICTarget:in: */ +static sqInt NoDbgRegParms +markAndTraceOrFreePICTargetin(sqInt entryPoint, CogMethod *cPIC) +{ + CogMethod *targetMethod; + + assert((entryPoint > methodZoneBase) + && (entryPoint < (freeStart()))); + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + return 0; + } + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert((((targetMethod->cmType)) == CMMethod) + || (((targetMethod->cmType)) == CMFree)); + return markAndTraceOrFreeCogMethodfirstVisit(targetMethod, (((usqInt)targetMethod)) > (((usqInt)cPIC))); +} + + +/* Mark and trace literals. Unlink sends that have unmarked cache tags or + targets. + */ + + /* Cogit>>#markLiteralsAndUnlinkIfUnmarkedSend:pc:method: */ +static sqInt NoDbgRegParms +markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + usqInt cacheTag1; + sqInt cacheTagMarked; + sqInt entryPoint; + usqInt entryPoint1; + sqInt literal; + sqInt sendTable; + sqInt *sendTable1; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + sqInt val; + + literal = 0; + val = 0; + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + cacheTagMarked = tagCouldBeObj1 + && (cacheTagIsMarked(cacheTag1)); + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((!cacheTagMarked) + || (markAndTraceOrFreeCogMethodfirstVisit(targetMethod1, (((usqInt)targetMethod1)) > (((usqInt)mcpc))))) { + + /* Either the cacheTag is unmarked (e.g. new class) or the target + has been freed (because it is unmarked), so unlink the send. */ + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + markAndTraceLiteralinat((targetMethod1->selector), targetMethod1, (&((targetMethod1->selector)))); + } + + } + else { + + /* cacheTag is selector */ + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + + } + return 0; +} + + +/* Mark and trace literals. + Additionally in Newspeak, void push implicits that have unmarked classes. */ + + /* Cogit>>#markLiterals:pc:method: */ +static sqInt NoDbgRegParms +markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) +{ + sqInt cacheTag; + usqInt cacheTag1; + sqInt entryPoint; + usqInt entryPoint1; + sqInt literal; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + + literal = 0; + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (markAndTraceLiteralinatpc(literal, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + codeModified = 1; + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1) { + if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) { + + /* cacheTag is selector */ + codeModified = 1; + } + } + + } + return 0; +} + + /* Cogit>>#markMethodAndReferents: */ +void +markMethodAndReferents(CogBlockMethod *aCogMethod) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + assert((((aCogMethod->cmType)) == CMMethod) + || (((aCogMethod->cmType)) == CMBlock)); + cogMethod = (((aCogMethod->cmType)) == CMMethod + ? ((CogMethod *) aCogMethod) + : cmHomeMethod(aCogMethod)); + (cogMethod->cmUsageCount = CMMaxUsageCount); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = incrementUsageOfTargetIfLinkedSendmcpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#maxCogMethodAddress */ +usqInt +maxCogMethodAddress(void) +{ + return ((usqInt)(limitZony())); +} + + +/* If this is the Newspeak VM and the objectRepresentation supports pinning + then allocate space for the implicit receiver caches on the heap. */ + + /* Cogit>>#maybeAllocAndInitIRCs */ +static sqInt +maybeAllocAndInitIRCs(void) +{ + return 1; + +} + + +/* Check that the header fields are consistent with the type. + Answer 0 if it is ok, otherwise answer a code for the error. */ + + /* Cogit>>#maybeFreeCogMethodDoesntLookKosher: */ +static sqInt NoDbgRegParms +maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod) +{ + sqInt result; + + result = cogMethodDoesntLookKosher(cogMethod); + return (result == 2 + ? 0 + : result); +} + + +/* In SIsta Spur counters are held on the heap in pinned objects which must + be marked + to avoid them being garbage collected. This is the hook through which that + happens. + */ + + /* Cogit>>#maybeMarkCountersIn: */ +static void NoDbgRegParms +maybeMarkCountersIn(CogMethod *cogMethod) +{ +} + + /* Cogit>>#mclassIsSmallInteger */ +static sqInt +mclassIsSmallInteger(void) +{ + return (methodClassOf(methodObj)) == (classSmallInteger()); +} + + +/* Answer the absolute machine code pc matching the zero-relative + bytecode pc of a backward branch in cogMethod, given the start + of the bytecodes for cogMethod's block or method object. */ + + /* Cogit>>#mcPCForBackwardBranch:startBcpc:in: */ +usqInt +mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc1; + sqInt bsOffset; + sqInt byte; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt targetPC; + + latestContinuation = 0; + /* begin mapFor:bcpc:performUntil:arg: */ + assert(((cogMethod->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + result = (((0 + (((int)((usqInt)(HasBytecodePC) << 1)))) & 1) + && ((((sqInt)(((void *)bcpc)))) == startbcpc) + ? ((sqInt)(((char *) mcpc))) + : 0); + if (result != 0) { + return result; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc1 = startbcpc; + if (((cogMethod->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc1 += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc1 == ((cogMethod->startpc))); + homeMethod = cmHomeMethod(cogMethod); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, -1, aMethodObj)) + : 0)); + bcpc1 = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc1 >= endbcpc) { + return ((sqInt) 0); + } + } + else { + if (((descriptor->isReturn)) + && (bcpc1 >= latestContinuation)) { + return ((sqInt) 0); + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj); + targetPC = (bcpc1 + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc1 + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc1, nExts, aMethodObj)) < 0)); + result = findBackwardBranchIsBackwardBranchMcpcBcpcMatchingBcpc(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc1, (((void *)bcpc))); + if (result != 0) { + return result; + } + bcpc1 = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + return ((sqInt) 0); +} + + +/* For the purposes of become: see if the two methods are similar, i.e. can + be safely becommed. + This is pretty strict. All literals and bytecodes must be identical. Only + trailer bytes and header + flags can differ. */ + + /* Cogit>>#method:hasSameCodeAs:checkPenultimate: */ +static sqInt NoDbgRegParms +methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) +{ + sqInt bi; + sqInt endPCA; + sqInt headerA; + sqInt headerB; + sqInt li; + sqInt numLitsA; + + headerA = methodHeaderOf(methodA); + headerB = methodHeaderOf(methodB); + numLitsA = literalCountOfMethodHeader(headerA); + endPCA = endPCOf(methodA); + if (((argumentCountOfMethodHeader(headerA)) != (argumentCountOfMethodHeader(headerB))) + || (((temporaryCountOfMethodHeader(headerA)) != (temporaryCountOfMethodHeader(headerB))) + || (((primitiveIndexOfMethodheader(methodA, headerA)) != (primitiveIndexOfMethodheader(methodB, headerB))) + || ((numLitsA != (literalCountOfMethodHeader(headerB))) + || (endPCA > (numBytesOf(methodB))))))) { + return 0; + } + for (li = 1; li < numLitsA; li += 1) { + if ((fetchPointerofObject(li, methodA)) != (fetchPointerofObject(li, methodB))) { + if ((li < (numLitsA - 1)) + || (comparePenultimateLiteral)) { + return 0; + } + } + } + for (bi = (startPCOfMethod(methodA)); bi <= endPCA; bi += 1) { + if ((fetchByteofObject(bi, methodA)) != (fetchByteofObject(bi, methodB))) { + return 0; + } + } + return 1; +} + + /* Cogit>>#minCogMethodAddress */ +sqInt +minCogMethodAddress(void) +{ + return methodZoneBase; +} + + /* Cogit>>#mnuOffset */ +sqInt +mnuOffset(void) +{ + return missOffset; +} + + /* Cogit>>#NegateR: */ +static AbstractInstruction * NoDbgRegParms +gNegateR(sqInt reg) +{ + return genoperand(NegateR, reg); +} + + /* Cogit>>#needsFrameIfImmutability: */ +static sqInt NoDbgRegParms +needsFrameIfImmutability(sqInt stackDelta) +{ + return IMMUTABILITY; +} + + /* Cogit>>#needsFrameIfInBlock: */ +static sqInt NoDbgRegParms +needsFrameIfInBlock(sqInt stackDelta) +{ + return inBlock > 0; +} + + /* Cogit>>#needsFrameNever: */ +static sqInt NoDbgRegParms +needsFrameNever(sqInt stackDelta) +{ + return 0; +} + + /* Cogit>>#noAssertMethodClassAssociationOf: */ +static sqInt NoDbgRegParms +noAssertMethodClassAssociationOf(sqInt methodPointer) +{ + return literalofMethod((literalCountOfMethodHeader(noAssertHeaderOf(methodPointer))) - 1, methodPointer); +} + + +/* Check that no method is maximally marked. A maximal mark is an indication + the method has been scanned to increase the usage count of its referent + methods. */ + + /* Cogit>>#noCogMethodsMaximallyMarked */ +static sqInt +noCogMethodsMaximallyMarked(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == CMMaxUsageCount)) { + return 0; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return 1; +} + + +/* Answer if all targets in the PIC are in-use methods. */ + + /* Cogit>>#noTargetsFreeInClosedPIC: */ +static sqInt NoDbgRegParms +noTargetsFreeInClosedPIC(CogMethod *cPIC) +{ + return !(cPICHasFreedTargets(cPIC)); +} + + +/* Store the generated machine code, answering the last address */ + + /* Cogit>>#outputInstructionsAt: */ +static sqInt NoDbgRegParms +outputInstructionsAt(sqInt startAddress) +{ + sqInt absoluteAddress; + AbstractInstruction *abstractInstruction; + sqInt i; + sqInt j; + + absoluteAddress = startAddress; + for (i = 0; i < opcodeIndex; i += 1) { + abstractInstruction = abstractInstructionAt(i); + assert(((abstractInstruction->address)) == absoluteAddress); + /* begin outputMachineCodeAt: */ + for (j = 0; j < ((abstractInstruction->machineCodeSize)); j += 4) { + longAtput(absoluteAddress + j, ((abstractInstruction->machineCode))[j / 4]); + } + absoluteAddress += (abstractInstruction->machineCodeSize); + } + return absoluteAddress; +} + + +/* Output instructions generated for one of the generated run-time routines, + a trampoline, etc + */ + + /* Cogit>>#outputInstructionsForGeneratedRuntimeAt: */ +static sqInt NoDbgRegParms +outputInstructionsForGeneratedRuntimeAt(sqInt startAddress) +{ + sqInt endAddress; + sqInt size; + + computeMaximumSizes(); + (methodLabel->address = startAddress); + size = generateInstructionsAt(startAddress); + endAddress = outputInstructionsAt(startAddress); + assert((startAddress + size) == endAddress); + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + return startAddress; +} + + /* Cogit>>#PopR: */ +static AbstractInstruction * NoDbgRegParms +gPopR(sqInt reg) +{ + return genoperand(PopR, reg); +} + + /* Cogit>>#PushCw: */ +static AbstractInstruction * NoDbgRegParms +gPushCw(sqInt wordConstant) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal: */ + anInstruction = genoperand(PushCw, wordConstant); + return anInstruction; +} + + +/* Code entry closed PIC full or miss to an instance of a young class or to a + young target method. + Attempt to patch the send site to an open PIC. Answer if the attempt + succeeded; in fact it will + only return if the attempt failed. + The stack looks like: + receiver + args + sp=> sender return address */ + + /* Cogit>>#patchToOpenPICFor:numArgs:receiver: */ +sqInt +patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver) +{ + sqInt extent; + CogMethod *oPIC; + sqInt outerReturn; + + + /* See if an Open PIC is already available. */ + outerReturn = stackTop(); + oPIC = openPICWithSelector(selector); + if (!(oPIC)) { + + /* otherwise attempt to create an Open PIC. */ + oPIC = cogOpenPICSelectornumArgs(selector, numArgs); + if ((((((sqInt)oPIC)) >= MaxNegativeErrorCode) && ((((sqInt)oPIC)) <= -1))) { + + /* For some reason the PIC couldn't be generated, most likely a lack of code memory. */ + if ((((sqInt)oPIC)) == InsufficientCodeSpace) { + callForCogCompiledCodeCompaction(); + } + return 0; + } + } + extent = rewriteInlineCacheAttagtarget(backEnd, outerReturn, inlineCacheValueForSelectorinat(selector, mframeHomeMethodExport(), outerReturn), (((sqInt)oPIC)) + cmEntryOffset); + flushICacheFromto(processor, (((usqInt)outerReturn)) - extent, ((usqInt)outerReturn)); + flushICacheFromto(processor, ((usqInt)oPIC), (((usqInt)oPIC)) + openPICSize); + executeCogMethodfromLinkedSendWithReceiver(oPIC, receiver); + return 1; +} + + +/* This value is used to decide between MNU processing + or interpretation in the closed PIC aborts. */ + + /* Cogit>>#picAbortDiscriminatorValue */ +static sqInt +picAbortDiscriminatorValue(void) +{ + return 0; +} + + +/* Answer the start of the abort sequence for invoking the interpreter in a + closed PIC. + */ + + /* Cogit>>#picInterpretAbortOffset */ +static sqInt +picInterpretAbortOffset(void) +{ + return (interpretOffset()) - ((pushLinkRegisterByteSize(backEnd)) + (callInstructionByteSize(backEnd))); +} + + /* Cogit>>#previousInstruction */ +static AbstractInstruction * +previousInstruction(void) +{ + assert(opcodeIndex > 0); + return abstractInstructionAt(opcodeIndex - 1); +} + + /* Cogit>>#printCogMethodFor: */ +void +printCogMethodFor(void *address) +{ + CogMethod *cogMethod; + + cogMethod = methodFor(address); + if (cogMethod == 0) { + if ((codeEntryFor(address)) == null) { + print("not a method"); + cr(); + } + else { + print("trampoline "); + print(codeEntryNameFor(address)); + cr(); + } + } + else { + printCogMethod(cogMethod); + } +} + + /* Cogit>>#printPCMapPairsFor: */ +void +printPCMapPairsFor(CogMethod *cogMethod) +{ + unsigned char annotation; + usqInt map; + unsigned char mapByte; + usqInt mcpc; + sqInt value; + + /* begin firstMappedPCFor: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + /* begin mapStartFor: */ + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + if (annotation == IsAnnotationExtension) { + value = (mapByte & DisplacementMask) + IsSendCall; + } + else { + value = annotation; + mcpc += 4 * ((annotation == IsDisplacementX2N + ? ((int)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift)) + : mapByte & DisplacementMask)); + } + printHexnp(map); + print(": "); + printf("%02x", mapByte); + printChar(' '); + printNum(annotation); + print(" ("); + + switch (value) { + case IsDisplacementX2N: + print("IsDisplacementX2N"); + break; + case IsAnnotationExtension: + print("IsAnnotationExtension"); + break; + case IsObjectReference: + print("IsObjectReference"); + break; + case IsAbsPCReference: + print("IsAbsPCReference"); + break; + case HasBytecodePC: + print("HasBytecodePC"); + break; + case IsRelativeCall: + print("IsRelativeCall"); + break; + case IsSendCall: + print("IsSendCall"); + break; + case IsSuperSend: + print("IsSuperSend"); + break; + case IsDirectedSuperSend: + print("IsDirectedSuperSend"); + break; + default: + print("??? "); + printHexnp(value); + + } + + print(") "); + printHexnp(mapByte & DisplacementMask); + printChar(' '); + putchar('@'); + printHex(mcpc); + cr(); + flush(); + map -= 1; + } +} + + /* Cogit>>#printTrampolineTable */ +void +printTrampolineTable(void) +{ + sqInt i; + + for (i = 0; i < trampolineTableIndex; i += 2) { + printHex(((sqInt)(trampolineAddresses[i + 1]))); + print(": "); + print(((char *) (trampolineAddresses[i]))); + cr(); + } +} + + /* Cogit>>#processorHasDivQuoRemAndMClassIsSmallInteger */ +static sqInt +processorHasDivQuoRemAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#processorHasMultiplyAndMClassIsSmallInteger */ +static sqInt +processorHasMultiplyAndMClassIsSmallInteger(void) +{ + return mclassIsSmallInteger(); +} + + /* Cogit>>#recordGeneratedRunTime:address: */ +static void NoDbgRegParms +recordGeneratedRunTimeaddress(char *aString, sqInt address) +{ + trampolineAddresses[trampolineTableIndex] = aString; + trampolineAddresses[trampolineTableIndex + 1] = (((char *) address)); + trampolineTableIndex += 2; +} + + +/* This one for C support code. */ + + /* Cogit>>#recordPrimTraceFunc */ +sqInt +recordPrimTraceFunc(void) +{ + return recordPrimTrace(); +} + + /* Cogit>>#recordRunTimeObjectReferences */ +static void +recordRunTimeObjectReferences(void) +{ + sqInt i; + AbstractInstruction *instruction; + + for (i = 0; i < opcodeIndex; i += 1) { + instruction = abstractInstructionAt(i); + if (((instruction->annotation)) == IsObjectReference) { + assert(runtimeObjectRefIndex < NumObjRefsInRuntime); + assert(!hasYoungReferent); + if (hasYoungReferent) { + error("attempt to generate run-time routine containing young object reference. Cannot initialize Cogit run-time."); + } + objectReferencesInRuntime[runtimeObjectRefIndex] = (((usqInt)(((instruction->address)) + ((instruction->machineCodeSize))))); + runtimeObjectRefIndex += 1; + } + } +} + + /* Cogit>>#registerMaskFor: */ +static sqInt NoDbgRegParms +registerMaskFor(sqInt reg) +{ + return 1U << reg; +} + + /* Cogit>>#registerMaskFor:and:and: */ +static sqInt NoDbgRegParms +registerMaskForandand(sqInt reg1, sqInt reg2, sqInt reg3) +{ + return ((1U << reg1) | (1U << reg2)) | (1U << reg3); +} + + /* Cogit>>#relocateCallsAndSelfReferencesInMethod: */ +static void NoDbgRegParms +relocateCallsAndSelfReferencesInMethod(CogMethod *cogMethod) +{ + sqInt annotation; + sqLong callDelta; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqLong refDelta; + sqInt result; + + refDelta = (cogMethod->objectHeader); + callDelta = 0; + assert((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)); + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cogMethod)) + missOffset)) == ((((cogMethod->cmType)) == CMMethod + ? methodAbortTrampolineFor((cogMethod->cmNumArgs)) + : picAbortTrampolineFor((cogMethod->cmNumArgs))))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cogMethod)) + missOffset, -callDelta); + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = relocateIfCallOrMethodReferencemcpcdelta(annotation, (((char *) mcpc)), refDelta); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } +l2: /* end mapFor:performUntil:arg: */; +} + + /* Cogit>>#relocateCallsInClosedPIC: */ +static void NoDbgRegParms +relocateCallsInClosedPIC(CogMethod *cPIC) +{ + sqLong callDelta; + sqInt entryPoint; + sqInt i; + sqInt pc; + sqLong refDelta; + CogMethod *targetMethod; + + refDelta = (cPIC->objectHeader); + callDelta = 0; + assert((callTargetFromReturnAddress(backEnd, (((sqInt)cPIC)) + missOffset)) == (picAbortTrampolineFor((cPIC->cmNumArgs)))); + relocateCallBeforeReturnPCby(backEnd, (((sqInt)cPIC)) + missOffset, -callDelta); + pc = (((sqInt)cPIC)) + firstCPICCaseOffset; + for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) { + pc = addressOfEndOfCaseinCPIC(i, cPIC); + entryPoint = (i == 1 + ? jumpLongTargetBeforeFollowingAddress(backEnd, pc) + : jumpLongConditionalTargetBeforeFollowingAddress(backEnd, pc)); + if (((((usqInt)cPIC)) <= (((usqInt)entryPoint))) + && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint)))) { + + /* Interpret/MNU */ + if (i == 1) { + relocateJumpLongBeforeFollowingAddressby(backEnd, pc, refDelta); + } + else { + relocateJumpLongConditionalBeforeFollowingAddressby(backEnd, pc, refDelta); + } + + } + else { + targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + assert(((targetMethod->cmType)) == CMMethod); + if (i == 1) { + relocateJumpLongBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + else { + relocateJumpLongConditionalBeforeFollowingAddressby(backEnd, pc, -(callDelta - ((targetMethod->objectHeader)))); + } + } + } + assert(((cPIC->cPICNumCases)) > 0); + relocateMethodReferenceBeforeAddressby(backEnd, (addressOfEndOfCaseinCPIC(2, cPIC)) + (loadLiteralByteSize(backEnd)), refDelta); + relocateJumpLongBeforeFollowingAddressby(backEnd, (((sqInt)cPIC)) + cPICEndOfCodeOffset, -callDelta); +} + + /* Cogit>>#relocateIfCallOrMethodReference:mcpc:delta: */ +static sqInt NoDbgRegParms +relocateIfCallOrMethodReferencemcpcdelta(sqInt annotation, char *mcpc, sqInt refDelta) +{ + sqInt callDelta; + sqInt entryPoint; + sqInt offset; + sqInt offset1; + sqInt sendTable; + sqInt *sendTable1; + CogMethod *targetMethod; + sqInt unlinkedRoutine; + + callDelta = 0; + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint <= methodZoneBase) { + + /* send is not linked; just relocate */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + /* begin offsetAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + offset1 = cmEntryOffset; + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + offset1 = cmNoCheckEntryOffset; + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + offset1 = cmNoCheckEntryOffset; + sendTable1 = superSendTrampolines; + + + } + } + targetMethod = ((CogMethod *) (entryPoint - offset1)); + if (((targetMethod->cmType)) != CMFree) { + + /* send target not freed; just relocate. */ + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -(callDelta - ((targetMethod->objectHeader)))); + + /* See comment in planCompaction */ + restorePICUsageCount(targetMethod); + + return 0; + } + unlinkedRoutine = sendTable1[((((targetMethod->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod->cmNumArgs)) : (NumSendTrampolines - 1))]; + unlinkedRoutine -= callDelta; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + return 0; + + } + if (annotation == IsRelativeCall) { + relocateCallBeforeReturnPCby(backEnd, ((sqInt)mcpc), -callDelta); + return 0; + } + if (annotation == IsAbsPCReference) { + relocateMethodReferenceBeforeAddressby(backEnd, ((sqInt)mcpc), refDelta); + } + return 0; +} + + /* Cogit>>#remapIfObjectRef:pc:hasYoung: */ +static sqInt NoDbgRegParms +remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr) +{ + sqInt cacheTag; + usqInt cacheTag1; + sqInt entryPoint; + usqInt entryPoint1; + sqInt ignored; + sqInt literal; + sqInt mappedCacheTag; + sqInt mappedLiteral; + sqInt *sendTable; + sqInt tagCouldBeObj; + sqInt tagCouldBeObj1; + CogMethod *targetMethod; + CogMethod *targetMethod1; + + if (annotation == IsObjectReference) { + literal = literalBeforeFollowingAddress(backEnd, ((usqInt)mcpc)); + if (couldBeObject(literal)) { + mappedLiteral = remapObject(literal); + if (literal != mappedLiteral) { + storeLiteralbeforeFollowingAddress(backEnd, mappedLiteral, ((usqInt)mcpc)); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedLiteral))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + } + if (annotation >= IsSendCall) { + /* begin offsetCacheTagAndCouldBeObjectAt:annotation:into: */ + cacheTag1 = inlineCacheTagAt(backEnd, ((sqInt)mcpc)); + + /* in-line cache tags are the selectors of sends if sends are unlinked, + the selectors of super sends (entry offset = cmNoCheckEntryOffset), + the selectors of open PIC sends (entry offset = cmEntryOffset, target is an Open PIC) + or in-line cache tags (classes, class indices, immediate bit patterns, etc). + Note that selectors can be immediate so there is no guarantee that they + are markable/remappable objects. */ + entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + tagCouldBeObj1 = (entryPoint1 < methodZoneBase) + || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment) + || (((entryPoint1 & entryPointMask) == checkedEntryAlignment) + && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))); + if (tagCouldBeObj1 + && (couldBeObject(cacheTag1))) { + mappedCacheTag = remapObject(cacheTag1); + if (cacheTag1 != mappedCacheTag) { + rewriteInlineCacheTagat(backEnd, mappedCacheTag, ((usqInt)mcpc)); + codeModified = 1; + } + if ((hasYoungPtr != 0) + && (isYoung(mappedCacheTag))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + } + if (hasYoungPtr != 0) { + + /* Since the unlinking routines may rewrite the cacheTag to the send's selector, and + since they don't have the cogMethod to hand and can't add it to youngReferrers, + the method must remain in youngReferrers if the targetMethod's selector is young. */ + if (entryPoint1 > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmEntryOffset)); + sendTable = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint1 - cmNoCheckEntryOffset)); + sendTable = superSendTrampolines; + + + } + } + if (isYoung((targetMethod1->selector))) { + (((sqInt *) hasYoungPtr))[0] = 1; + } + + } + } + + } + return 0; +} + + +/* Remap a potential object reference from a closed PIC. + This may be an object reference, an inline cache tag or null. + Answer if the updated literal is young. + mcpc is the address of the next instruction following either + the load of the method literal or the compare of the class tag. */ + + /* Cogit>>#remapMaybeObjRefInClosedPICAt: */ +static sqInt NoDbgRegParms +remapMaybeObjRefInClosedPICAt(sqInt mcpc) +{ + sqInt object; + sqInt subject; + + object = literalBeforeFollowingAddress(backEnd, mcpc); + if (!(couldBeObject(object))) { + return 0; + } + subject = remapOop(object); + if (object != subject) { + storeLiteralbeforeFollowingAddress(backEnd, subject, mcpc); + codeModified = 1; + } + return isYoungObject(subject); +} + + +/* Rewrite the three values involved in a CPIC case. Used by the initialize & + extend CPICs. + c.f. expectedClosedPICPrototype: */ +/* write the obj ref/operand via the second ldr */ + + /* Cogit>>#rewriteCPICCaseAt:tag:objRef:target: */ +static void NoDbgRegParms +rewriteCPICCaseAttagobjReftarget(sqInt followingAddress, sqInt newTag, sqInt newObjRef, sqInt newTarget) +{ + sqInt classTagPC; + sqInt methodObjPC; + + methodObjPC = (followingAddress - (jumpLongConditionalByteSize(backEnd))) - (cmpC32RTempByteSize(backEnd)); + storeLiteralbeforeFollowingAddress(backEnd, newObjRef, methodObjPC); + + /* rewite the tag via the first ldr */ + classTagPC = followingAddress - (jumpLongConditionalByteSize(backEnd)); + /* begin storeLiteral32:beforeFollowingAddress: */ + storeLiteralbeforeFollowingAddress(((AbstractInstruction *) backEnd), newTag, classTagPC); + + ((AbstractInstruction *) backEnd); + rewriteConditionalJumpLongAttarget(backEnd, followingAddress, newTarget); +} + + /* Cogit>>#SubCw:R: */ +static AbstractInstruction * NoDbgRegParms +gSubCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(SubCwR, wordConstant, reg); + return anInstruction; +} + + +/* Answer the number of clean blocks found in the literal frame */ + + /* Cogit>>#scanForCleanBlocks */ +static sqInt +scanForCleanBlocks(void) +{ + sqInt i; + sqInt iLimiT; + sqInt lit; + sqInt numCleanBlocks; + sqInt startPCOrNil; + + numCleanBlocks = 0; + for (i = 1, iLimiT = (literalCountOf(methodObj)); i <= iLimiT; i += 1) { + lit = fetchPointerofObject(i, methodObj); + startPCOrNil = startPCOrNilOfLiteralin(lit, methodObj); + if (!(startPCOrNil == null)) { + numCleanBlocks += 1; + } + } + return numCleanBlocks; +} + + /* Cogit>>#setBreakMethod: */ +void +setBreakMethod(sqInt anObj) +{ + breakMethod = anObj; +} + + /* Cogit>>#setPostCompileHook: */ +void +setPostCompileHook(void (*aFunction)(CogMethod *)) +{ + postCompileHook = aFunction; +} + + +/* If a method is compiled to machine code via a block entry it won't have a + selector. A subsequent send can find the method and hence fill in the + selector. + */ +/* self disassembleMethod: cogMethod */ + + /* Cogit>>#setSelectorOf:to: */ +void +setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop) +{ + compilationBreakpointisMNUCase(aSelectorOop, numBytesOf(aSelectorOop), 0); + assert(((cogMethod->cmType)) == CMMethod); + (cogMethod->selector = aSelectorOop); + if (isYoung(aSelectorOop)) { + ensureInYoungReferrers(cogMethod); + } +} + + /* Cogit>>#spanForCleanBlockStartingAt: */ +static sqInt NoDbgRegParms +spanForCleanBlockStartingAt(sqInt startPC) +{ + BytecodeDescriptor *descriptor; + usqInt end; + sqInt pc; + + pc = startPC; + end = numBytesOf(methodObj); + while (pc <= end) { + descriptor = generatorAt((fetchByteofObject(pc, methodObj)) + bytecodeSetOffset); + pc += (descriptor->numBytes); + if ((descriptor->isReturn)) { + return pc - startPC; + } + } + error("couldn't locate end of clean block"); + return 0; +} + + +/* Answer a fake value for the method oop in other than the first case in the + PIC prototype. + Since we use MoveUniqueCw:R: it must not be confused with a + method-relative address. + */ + + /* Cogit>>#subsequentPrototypeMethodOop */ +static sqInt +subsequentPrototypeMethodOop(void) +{ + return (((((usqInt)195929424)) >= ((methodLabel->address))) + && ((((usqInt)195929424)) < (youngReferrers())) + ? 233496237 + : 195929424); +} + + /* Cogit>>#traceLinkedSendOffset */ +sqInt +traceLinkedSendOffset(void) +{ + return (cmNoCheckEntryOffset + (callInstructionByteSize(backEnd))) + (pushLinkRegisterByteSize(backEnd)); +} + + +/* Encode true and false and 0 to N such that they can't be confused for + register numbers (including NoReg) + and can be tested for by isTrampolineArgConstant: and decoded by + trampolineArgValue: + */ + + /* Cogit>>#trampolineArgConstant: */ +static sqInt NoDbgRegParms +trampolineArgConstant(sqInt booleanOrInteger) +{ + assert(booleanOrInteger >= 0); + return -2 - booleanOrInteger; +} + + /* Cogit>>#trampolineName:numArgs: */ +static char * NoDbgRegParms +trampolineNamenumArgs(char *routinePrefix, sqInt numArgs) +{ + char *theString; + + /* begin trampolineName:numArgs:limit: */ + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= (NumSendTrampolines - 2) + ? '0' + numArgs + : 'N')); + return theString; +} + + +/* Malloc a string with the contents for the trampoline table */ + + /* Cogit>>#trampolineName:numArgs:limit: */ +static char * NoDbgRegParms +trampolineNamenumArgslimit(char *routinePrefix, int numArgs, sqInt argsLimit) +{ + char *theString; + + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#trampolineName:numRegArgs: */ +static char * NoDbgRegParms +trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs) +{ + sqInt argsLimit; + char *theString; + + /* begin trampolineName:numArgs:limit: */ + argsLimit = 2; + theString = malloc((strlen(routinePrefix)) + 6); + sprintf(theString, "%s%cArgs", routinePrefix, (numArgs <= argsLimit + ? '0' + numArgs + : 'N')); + return theString; +} + + /* Cogit>>#unknownBytecode */ +static sqInt +unknownBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* Unlink all sends in cog methods. */ + + /* Cogit>>#unlinkAllSends */ +void +unlinkAllSends(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) != CMFree) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); +} + + /* Cogit>>#unlinkIfFreeOrLinkedSend:pc:of: */ +static sqInt NoDbgRegParms +unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + CogMethod * targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((targetMethod1->cmType)) == CMFree) + || (((targetMethod1->selector)) == theSelector)) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfInvalidClassSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + usqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send, but maybe a super send or linked to an OpenPIC, in which case the cache tag will be a selector.... */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (!(((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) + || (((targetMethod1->cmType)) == CMOpenPIC))) { + if (!(isValidClassTag(inlineCacheTagAt(backEnd, ((sqInt)mcpc))))) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSendToFree:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if (((targetMethod1->cmType)) == CMFree) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:ignored: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) +{ + usqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + + } + } + return 0; +} + + /* Cogit>>#unlinkIfLinkedSend:pc:to: */ +static sqInt NoDbgRegParms +unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod) +{ + sqInt entryPoint; + sqInt sendTable; + sqInt *sendTable1; + sqInt targetMethod; + CogMethod *targetMethod1; + sqInt unlinkedRoutine; + + if (annotation >= IsSendCall) { + entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)); + if (entryPoint > methodZoneBase) { + + /* It's a linked send. */ + /* begin targetMethodAndSendTableFor:annotation:into: */ + if (annotation == IsSendCall) { + targetMethod1 = ((CogMethod *) (entryPoint - cmEntryOffset)); + sendTable1 = ordinarySendTrampolines; + } + else { + if (annotation == IsDirectedSuperSend) { + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = directedSuperSendTrampolines; + } + else { + assert(annotation == IsSuperSend); + targetMethod1 = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset)); + sendTable1 = superSendTrampolines; + + + } + } + if ((((sqInt)targetMethod1)) == theCogMethod) { + /* begin unlinkSendAt:targetMethod:sendTable: */ + unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; + rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), inlineCacheValueForSelectorinat((targetMethod1->selector), enumeratingCogMethod, mcpc), unlinkedRoutine); + codeModified = 1; + } + + } + } + return 0; +} + + +/* Unlink all sends in cog methods whose class tag is that of a forwarded + class. + */ + + /* Cogit>>#unlinkSendsLinkedForInvalidClasses */ +void +unlinkSendsLinkedForInvalidClasses(void) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + codeModified = (freedPIC = 0); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfInvalidClassSendpcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasForwardedClass(cogMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + +/* Unlink all sends in cog methods. Free all Closed PICs with the selector, + or with an MNU case if isMNUSelector. First check if any method actually + has the selector; if not there can't be any linked send to it. This + routine (including descendents) is performance critical. It contributes + perhaps 30% of entire execution time in Compiler recompileAll. */ + + /* Cogit>>#unlinkSendsOf:isMNUSelector: */ +void +unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt mustScanAndUnlink; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + cogMethod = ((CogMethod *) methodZoneBase); + mustScanAndUnlink = 0; + if (isMNUSelector) { + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) + && (((cogMethod->cmType)) == CMClosedPIC)) { + assert(((cogMethod->cmType)) == CMClosedPIC); + freeMethod(cogMethod); + mustScanAndUnlink = 1; + } + else { + if (((cogMethod->selector)) == selector) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + else { + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selector)) { + mustScanAndUnlink = 1; + if (((cogMethod->cmType)) == CMClosedPIC) { + freeMethod(cogMethod); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } + if (!mustScanAndUnlink) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfFreeOrLinkedSendpcof(annotation, (((char *) mcpc)), selector); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to free methods and/or pics. */ + + /* Cogit>>#unlinkSendsToFree */ +void +unlinkSendsToFree(void) +{ + sqInt annotation; + CogMethod *cogMethod; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + + if (!(methodZoneBase)) { + return; + } + codeModified = 0; + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendToFreepcignored(annotation, (((char *) mcpc)), 0); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if (((cogMethod->cmType)) == CMClosedPIC) { + assert(noTargetsFreeInClosedPIC(cogMethod)); + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } +} + + +/* Unlink all sends in cog methods to a particular target method. + If targetMethodObject isn't actually a method (perhaps being + used via invokeAsMethod) then there's nothing to do. */ + + /* Cogit>>#unlinkSendsTo:andFreeIf: */ +void +unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue) +{ + sqInt annotation; + CogMethod *cogMethod; + sqInt freedPIC; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt result; + CogMethod *targetMethod; + + if (!((isOopCompiledMethod(targetMethodObject)) + && (methodHasCogMethod(targetMethodObject)))) { + return; + } + targetMethod = cogMethodOf(targetMethodObject); + if (!(methodZoneBase)) { + return; + } + codeModified = (freedPIC = 0); + cogMethod = ((CogMethod *) methodZoneBase); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + /* begin mapFor:performUntil:arg: */ + mcpc = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? (((usqInt)cogMethod)) + cbNoSwitchEntryOffset + : (((usqInt)cogMethod)) + cmNoCheckEntryOffset); + map = ((((usqInt)cogMethod)) + ((cogMethod->blockSize))) - 1; + while (((mapByte = byteAt(map))) != MapEnd) { + if (mapByte >= FirstAnnotation) { + + /* If this is an IsSendCall annotation, peek ahead for an IsAnnotationExtension, and consume it. */ + mcpc += (mapByte & DisplacementMask) * 4; + if ((((annotation = ((usqInt) mapByte) >> AnnotationShift)) == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + result = unlinkIfLinkedSendpcto(annotation, (((char *) mcpc)), (((sqInt)targetMethod))); + if (result != 0) { + goto l2; + } + } + else { + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + l2: /* end mapFor:performUntil:arg: */; + } + else { + if ((((cogMethod->cmType)) == CMClosedPIC) + && (cPICHasTarget(cogMethod, targetMethod))) { + freeMethod(cogMethod); + freedPIC = 1; + } + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + if (freeIfTrue) { + freeMethod(targetMethod); + } + if (freedPIC) { + unlinkSendsToFree(); + } + else { + if (codeModified) { + + /* After possibly updating inline caches we need to flush the icache. */ + flushICacheFromto(processor, ((usqInt)methodZoneBase), ((usqInt)(limitZony()))); + } + } +} + + /* Cogit>>#XorCw:R: */ +static AbstractInstruction * NoDbgRegParms +gXorCwR(sqInt wordConstant, sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(XorCwR, wordConstant, reg); + return anInstruction; +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ +/* Eliminate stale dependent info. */ + + /* Cogit>>#zeroOpcodeIndex */ +static void +zeroOpcodeIndex(void) +{ + sqInt i; + + for (i = 0; i < opcodeIndex; i += 1) { + ((abstractOpcodes[i]).dependent = null); + } + zeroOpcodeIndexForNewOpcodes(); +} + + +/* Access for the object representations when they need to prepend code to + trampolines. + */ + + /* Cogit>>#zeroOpcodeIndexForNewOpcodes */ +static void +zeroOpcodeIndexForNewOpcodes(void) +{ + opcodeIndex = 0; +} + + /* CogMethodZone>>#addAllToYoungReferrers */ +void +addAllToYoungReferrers(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) == CMMethod) + || (((cogMethod->cmType)) == CMOpenPIC)) { + ensureInYoungReferrers(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#addToOpenPICList: */ +static void NoDbgRegParms +addToOpenPICList(CogMethod *anOpenPIC) +{ + assert(((anOpenPIC->cmType)) == CMOpenPIC); + assert((openPICList == null) + || (((openPICList->cmType)) == CMOpenPIC)); + (anOpenPIC->nextOpenPIC = ((usqInt)openPICList)); + openPICList = anOpenPIC; +} + + /* CogMethodZone>>#addToYoungReferrers: */ +static void NoDbgRegParms +addToYoungReferrers(CogMethod *cogMethod) +{ + assert(youngReferrers <= limitAddress); + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + assert((cogMethod->cmRefersToYoung)); + assert((youngReferrers <= limitAddress) + && (youngReferrers >= (limitAddress - (methodCount * BytesPerWord)))); + if (!(asserta((limitAddress - (methodCount * BytesPerWord)) >= mzFreeStart))) { + error("no room on youngReferrers list"); + } + youngReferrers -= BytesPerWord; + longAtput(youngReferrers, ((usqInt)cogMethod)); +} + + /* CogMethodZone>>#allocate: */ +static sqInt NoDbgRegParms +allocate(sqInt numBytes) +{ + usqInt allocation; + sqInt roundedBytes; + + roundedBytes = (numBytes + 7) & -8; + if ((mzFreeStart + roundedBytes) >= (limitAddress - (methodCount * BytesPerWord))) { + return 0; + } + allocation = mzFreeStart; + mzFreeStart += roundedBytes; + methodCount += 1; + return allocation; +} + + +/* Free all methods */ + + /* CogMethodZone>>#clearCogCompiledCode */ +static void +clearCogCompiledCode(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMMethod) { + freeMethod(cogMethod); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + manageFromto(baseAddress, limitAddress); +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#clearSavedPICUsageCount: */ +static void NoDbgRegParms +clearSavedPICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = 0); + } +} + + /* CogMethodZone>>#compactCompiledCode */ +static void +compactCompiledCode(void) +{ + unsigned short bytes; + CogMethod *dest; + sqLong objectHeaderValue; + CogMethod *source; + + objectHeaderValue = nullHeaderForMachineCodeMethod(); + source = ((CogMethod *) baseAddress); + openPICList = null; + methodCount = 0; + while ((source < (limitZony())) + && (((source->cmType)) != CMFree)) { + assert((cogMethodDoesntLookKosher(source)) == 0); + (source->objectHeader = objectHeaderValue); + if (((source->cmUsageCount)) > 0) { + (source->cmUsageCount = ((source->cmUsageCount)) / 2); + } + clearSavedPICUsageCount(source); + + if (((source->cmType)) == CMOpenPIC) { + (source->nextOpenPIC = ((usqInt)openPICList)); + openPICList = source; + } + methodCount += 1; + source = ((CogMethod *) (roundUpLength((((sqInt)source)) + ((source->blockSize))))); + } + if (source >= (limitZony())) { + haltmsg("no free methods; cannot compact."); + return; + } + dest = source; + while (source < (limitZony())) { + assert((maybeFreeCogMethodDoesntLookKosher(source)) == 0); + bytes = (source->blockSize); + if (((source->cmType)) != CMFree) { + methodCount += 1; + memmove(dest, source, bytes); + (dest->objectHeader = objectHeaderValue); + if (((dest->cmType)) == CMMethod) { + + /* For non-Newspeak there should be a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only update the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((dest->methodObject))))) == (((sqInt)source))) { + rawHeaderOfput((dest->methodObject), ((sqInt)dest)); + } + else { + assert((noAssertMethodClassAssociationOf((dest->methodObject))) == (nilObject())); + } + } + else { + clearSavedPICUsageCount(dest); + + if (((dest->cmType)) == CMOpenPIC) { + (dest->nextOpenPIC = ((usqInt)openPICList)); + openPICList = dest; + } + } + if (((dest->cmUsageCount)) > 0) { + (dest->cmUsageCount = ((dest->cmUsageCount)) / 2); + } + dest = ((CogMethod *) ((((usqInt)dest)) + bytes)); + } + source = ((CogMethod *) ((((usqInt)source)) + bytes)); + } + mzFreeStart = ((usqInt)dest); + methodBytesFreedSinceLastCompaction = 0; +} + + /* CogMethodZone>>#ensureInYoungReferrers: */ +static void NoDbgRegParms +ensureInYoungReferrers(CogMethod *cogMethod) +{ + if (!((cogMethod->cmRefersToYoung))) { + assert((occurrencesInYoungReferrers(cogMethod)) == 0); + (cogMethod->cmRefersToYoung = 1); + addToYoungReferrers(cogMethod); + } +} + + /* CogMethodZone>>#followForwardedLiteralsInOpenPICList */ +static void +followForwardedLiteralsInOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (openPIC != null) { + followForwardedLiteralsIn(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#freeMethod: */ +void +freeMethod(CogMethod *cogMethod) +{ + assert(((cogMethod->cmType)) != CMFree); + assert(((cogMethodDoesntLookKosher(cogMethod)) == 0) + || (((cogMethodDoesntLookKosher(cogMethod)) == 23) + && ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) == CMFree))); + if (((cogMethod->cmType)) == CMMethod) { + + /* For non-Newspeak there should ne a one-to-one mapping between bytecoded and + cog methods. For Newspeak not necessarily, but only for anonymous accessors. */ + /* Only reset the original method's header if it is referring to this CogMethod. */ + if ((((sqInt)(rawHeaderOf((cogMethod->methodObject))))) == (((sqInt)cogMethod))) { + rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader)); + } + else { + assert((noAssertMethodClassAssociationOf((cogMethod->methodObject))) == (nilObject())); + } + } + if (((cogMethod->cmType)) == CMOpenPIC) { + removeFromOpenPICList(cogMethod); + } + (cogMethod->cmRefersToYoung = 0); + (cogMethod->cmType = CMFree); + methodBytesFreedSinceLastCompaction += (cogMethod->blockSize); +} + + +/* Free methods, preferring older methods for compaction, up to some + fraction, currently a quarter. + */ + + /* CogMethodZone>>#freeOlderMethodsForCompaction */ +static void +freeOlderMethodsForCompaction(void) +{ + usqInt amountToFree; + CogMethod *cogMethod; + sqInt freeableUsage; + usqInt freedSoFar; + usqInt initialFreeSpace; + usqInt zoneSize; + + zoneSize = limitAddress - baseAddress; + initialFreeSpace = (limitAddress - mzFreeStart) + methodBytesFreedSinceLastCompaction; + freedSoFar = initialFreeSpace; + + /* 4 needs to be e.g. a start-up parameter */ + amountToFree = zoneSize / 4; + freeableUsage = 0; + do { + cogMethod = ((CogMethod *) baseAddress); + while (((((usqInt)cogMethod)) < mzFreeStart) + && (freedSoFar < amountToFree)) { + if ((((cogMethod->cmType)) == CMMethod + ? ((cogMethod->cmUsageCount)) <= freeableUsage + : (((cogMethod->cmType)) != CMFree) + && (((cogMethod->cmUsageCount)) == 0))) { + freeMethod(cogMethod); + freedSoFar += (cogMethod->blockSize); + } + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + } while((freedSoFar < amountToFree) + && (((freeableUsage += 1)) < CMMaxUsageCount)); +} + + +/* Answer that all entries in youngReferrers are in-use and have the + cmRefersToYoung flag set. + Used to check that the youngreferrers pruning routines work correctly. */ + + /* CogMethodZone>>#kosherYoungReferrers */ +static sqInt +kosherYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + if ((youngReferrers > limitAddress) + || (youngReferrers < mzFreeStart)) { + return 0; + } + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung)))) { + return 0; + } + pointer += BytesPerWord; + } + return 1; +} + + /* CogMethodZone>>#manageFrom:to: */ +static void NoDbgRegParms +manageFromto(sqInt theStartAddress, sqInt theLimitAddress) +{ + mzFreeStart = (baseAddress = theStartAddress); + youngReferrers = (limitAddress = theLimitAddress); + openPICList = null; + methodBytesFreedSinceLastCompaction = 0; + methodCount = 0; +} + + /* CogMethodZone>>#methodFor: */ +CogMethod * +methodFor(void *address) +{ + CogMethod *cogMethod; + CogMethod *nextMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((cogMethod < (limitZony())) + && ((((usqInt)cogMethod)) <= (((usqInt)address)))) { + /* begin methodAfter: */ + nextMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + if (nextMethod == cogMethod) { + return 0; + } + if (((((usqInt)address)) >= (((usqInt)cogMethod))) + && ((((usqInt)address)) < (((usqInt)nextMethod)))) { + return cogMethod; + } + cogMethod = nextMethod; + } + return 0; +} + + /* CogMethodZone>>#methodsCompiledToMachineCodeInto: */ +sqInt +methodsCompiledToMachineCodeInto(sqInt arrayObj) +{ + CogMethod *cogMethod; + sqInt methodIndex; + + methodIndex = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == CMMethod) { + storePointerUncheckedofObjectwithValue(methodIndex, arrayObj, (cogMethod->methodObject)); + methodIndex += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return methodIndex; +} + + /* CogMethodZone>>#numMethods */ +sqInt +numMethods(void) +{ + return methodCount; +} + + /* CogMethodZone>>#numMethodsOfType: */ +sqInt +numMethodsOfType(sqInt cogMethodType) +{ + CogMethod *cogMethod; + sqInt n; + + n = 0; + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cogMethodType) { + n += 1; + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + return n; +} + + /* CogMethodZone>>#occurrencesInYoungReferrers: */ +static sqInt NoDbgRegParms +occurrencesInYoungReferrers(CogMethod *cogMethod) +{ + sqInt count; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + count = 0; + pointer = youngReferrers; + while (pointer < limitAddress) { + if ((((sqInt)cogMethod)) == (longAt(pointer))) { + count += 1; + } + pointer += BytesPerWord; + } + return count; +} + + /* CogMethodZone>>#openPICWithSelector: */ +static CogMethod * NoDbgRegParms +openPICWithSelector(sqInt aSelector) +{ + CogMethod *openPIC; + + openPIC = openPICList; + do { + if ((openPIC == null) + || (((openPIC->selector)) == aSelector)) { + return openPIC; + } + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* Some methods have been freed. Compute how much each survivor needs to + move during the ensuing compaction and record it in the objectHeader + field. + For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#planCompaction */ +static void +planCompaction(void) +{ + CogMethod *cogMethod; + sqInt delta; + + delta = 0; + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) == CMFree) { + delta -= (cogMethod->blockSize); + } + else { + assert((cogMethodDoesntLookKosher(cogMethod)) == 0); + (cogMethod->objectHeader = delta); + savePICUsageCount(cogMethod); + + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethods */ +void +printCogMethods(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + printCogMethod(cogMethod); + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsOfType: */ +void +printCogMethodsOfType(sqInt cmType) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if (((cogMethod->cmType)) == cmType) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithMethod: */ +void +printCogMethodsWithMethod(sqInt methodOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->methodObject)) == methodOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithPrimitive: */ +void +printCogMethodsWithPrimitive(sqInt primIdx) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (primIdx == (primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader))))) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogMethodsWithSelector: */ +void +printCogMethodsWithSelector(sqInt selectorOop) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while (cogMethod < (limitZony())) { + if ((((cogMethod->cmType)) != CMFree) + && (((cogMethod->selector)) == selectorOop)) { + printCogMethod(cogMethod); + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } +} + + /* CogMethodZone>>#printCogYoungReferrers */ +void +printCogYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (!((cogMethod->cmRefersToYoung))) { + print("*"); + } + if (((cogMethod->cmType)) == CMFree) { + print("!"); + } + if (!(((cogMethod->cmRefersToYoung)) + && (((cogMethod->cmType)) != CMFree))) { + print(" "); + } + printCogMethod(cogMethod); + pointer += BytesPerWord; + } +} + + /* CogMethodZone>>#printOpenPICList */ +void +printOpenPICList(void) +{ + CogMethod *openPIC; + + openPIC = openPICList; + while (!(openPIC == null)) { + printCogMethod(openPIC); + openPIC = ((CogMethod *) ((openPIC->nextOpenPIC))); + } +} + + /* CogMethodZone>>#pruneYoungReferrers */ +static sqInt +pruneYoungReferrers(void) +{ + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((CogMethod *) (longAt(next))))->cmRefersToYoung)))) break; + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + if (((((CogMethod *) (longAt(source))))->cmRefersToYoung)) { + assert(source < (dest - BytesPerWord)); + longAtput((dest -= BytesPerWord), longAt(source)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + assert(kosherYoungReferrers()); + return 0; +} + + /* CogMethodZone>>#relocateAndPruneYoungReferrers */ +static sqInt +relocateAndPruneYoungReferrers(void) +{ + CogMethod *cogMethod; + usqInt dest; + usqInt next; + usqInt source; + + assert(youngReferrers <= limitAddress); + if (youngReferrers == limitAddress) { + return null; + } + dest = limitAddress; + while (1) { + next = dest - BytesPerWord; + if (!((next >= youngReferrers) + && (((((cogMethod = ((CogMethod *) (longAt(next))))->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))))) break; + if (((cogMethod->objectHeader)) != 0) { + longAtput(next, (((sqInt)cogMethod)) + ((cogMethod->objectHeader))); + } + dest = next; + } + assert(dest >= youngReferrers); + source = dest - BytesPerWord; + while (source >= youngReferrers) { + cogMethod = ((CogMethod *) (longAt(source))); + if ((((cogMethod->cmType)) != CMFree) + && ((cogMethod->cmRefersToYoung))) { + assert(source < (dest - BytesPerWord)); + if (((cogMethod->objectHeader)) != 0) { + cogMethod = ((CogMethod *) ((((sqInt)cogMethod)) + (((sqInt)((cogMethod->objectHeader)))))); + } + longAtput((dest -= BytesPerWord), ((sqInt)cogMethod)); + } + source -= BytesPerWord; + } + youngReferrers = dest; + return 0; +} + + +/* All surviving methods have had the amount they are going to relocate by + stored in their objectHeader fields. Relocate all relative calls so that + after the compaction of both the method containing each call and the call + target the calls invoke the same target. */ + + /* CogMethodZone>>#relocateMethodsPreCompaction */ +static sqInt +relocateMethodsPreCompaction(void) +{ + CogMethod *cogMethod; + + cogMethod = ((CogMethod *) baseAddress); + while ((((usqInt)cogMethod)) < mzFreeStart) { + if (((cogMethod->cmType)) != CMFree) { + if (((cogMethod->cmType)) == CMClosedPIC) { + relocateCallsInClosedPIC(cogMethod); + } + else { + relocateCallsAndSelfReferencesInMethod(cogMethod); + } + } + /* begin methodAfter: */ + cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); + } + relocateAndPruneYoungReferrers(); + return 1; +} + + /* CogMethodZone>>#removeFromOpenPICList: */ +static sqInt NoDbgRegParms +removeFromOpenPICList(CogMethod *anOpenPIC) +{ + CogMethod *prevPIC; + + assert(((anOpenPIC->cmType)) == CMOpenPIC); + if (anOpenPIC == openPICList) { + + /* N.B. Use self rather than coInterpreter to avoid attempting to cast nil. + Conversion to CogMethod done in the nextOpenPIC accessor. */ + openPICList = ((CogMethod *) ((anOpenPIC->nextOpenPIC))); + return null; + } + prevPIC = openPICList; + do { + assert((prevPIC != null) + && (((prevPIC->cmType)) == CMOpenPIC)); + if (((prevPIC->nextOpenPIC)) == (((sqInt)anOpenPIC))) { + (prevPIC->nextOpenPIC = (anOpenPIC->nextOpenPIC)); + return null; + } + prevPIC = ((CogMethod *) ((prevPIC->nextOpenPIC))); + } while(1); + return 0; +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#restorePICUsageCount: */ +static void NoDbgRegParms +restorePICUsageCount(CogMethod *cogMethod) +{ + if ((((cogMethod->cmType)) == CMClosedPIC) + && (((cogMethod->blockEntryOffset)) != 0)) { + (cogMethod->cmUsageCount = (cogMethod->blockEntryOffset)); + (cogMethod->blockEntryOffset = 0); + } +} + + +/* For Sista, where we want PICs to last so they can be observed, we need to + keep PICs unless + they are definitely unused. So we need to identify unused PICs. So in + planCompact, zero the + usage counts of all PICs, saving the actual usage count in + blockEntryOffset. Then in + relocateMethodsPreCompaction (actually in + relocateIfCallOrMethodReference:mcpc:delta:) restore the usage counts of + used PICs. Finally in compactCompiledCode, clear the blockEntryOffset + of the unused PICs; they will then have a zero count and be reclaimed in + the next code compaction. */ + + /* CogMethodZone>>#savePICUsageCount: */ +static void NoDbgRegParms +savePICUsageCount(CogMethod *cogMethod) +{ + if (((cogMethod->cmType)) == CMClosedPIC) { + (cogMethod->blockEntryOffset = (cogMethod->cmUsageCount)); + (cogMethod->cmUsageCount = 0); + } +} + + /* CogMethodZone>>#voidYoungReferrersPostTenureAll */ +static void +voidYoungReferrersPostTenureAll(void) +{ + CogMethod *cogMethod; + usqInt pointer; + + assert(youngReferrers <= limitAddress); + pointer = youngReferrers; + while (pointer < limitAddress) { + cogMethod = ((CogMethod *) (longAt(pointer))); + if (((cogMethod->cmType)) != CMFree) { + (cogMethod->cmRefersToYoung = 0); + } + pointer += BytesPerWord; + } + youngReferrers = limitAddress; +} + + /* CogMethodZone>>#whereIsMaybeCodeThing: */ +char * +whereIsMaybeCodeThing(sqInt anOop) +{ + if (oopisGreaterThanOrEqualToandLessThan(anOop, codeBase, limitAddress)) { + if (oopisLessThan(anOop, methodZoneBase)) { + return " is in generated runtime"; + } + if (oopisLessThan(anOop, mzFreeStart)) { + return " is in generated methods"; + } + if (oopisLessThan(anOop, youngReferrers)) { + return " is in code zone"; + } + return " is in young referrers"; + } + return null; +} + + /* CogMIPSELCompiler>>#addiuR:R:C: */ +static sqInt NoDbgRegParms +addiuRRC(AbstractInstruction * self_in_addiuRRC, sqInt destReg, sqInt srcReg, sqInt imm) +{ + return itypersrtsignedImmediate(self_in_addiuRRC, ADDIU, srcReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#adduR:R:R: */ +static sqInt NoDbgRegParms +adduRRR(AbstractInstruction * self_in_adduRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_adduRRR, SPECIAL, leftReg, rightReg, destReg, 0, ADDU); +} + + /* CogMIPSELCompiler>>#andiR:R:C: */ +static sqInt NoDbgRegParms +andiRRC(AbstractInstruction * self_in_andiRRC, sqInt destReg, sqInt srcReg, sqInt imm) +{ + return itypersrteitherImmediate(self_in_andiRRC, ANDI, srcReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#andR:R:R: */ +static sqInt NoDbgRegParms +andRRR(AbstractInstruction * self_in_andRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_andRRR, SPECIAL, leftReg, rightReg, destReg, 0, AND); +} + + /* CogMIPSELCompiler>>#beqR:R:offset: */ +static sqInt NoDbgRegParms +beqRRoffset(AbstractInstruction * self_in_beqRRoffset, sqInt leftReg, sqInt rightReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_beqRRoffset, BEQ, leftReg, rightReg, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#bgezR:offset: */ +static sqInt NoDbgRegParms +bgezRoffset(AbstractInstruction * self_in_bgezRoffset, sqInt cmpReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_bgezRoffset, REGIMM, cmpReg, BGEZ, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#bgtzR:offset: */ +static sqInt NoDbgRegParms +bgtzRoffset(AbstractInstruction * self_in_bgtzRoffset, sqInt cmpReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_bgtzRoffset, BGTZ, cmpReg, 0, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#blezR:offset: */ +static sqInt NoDbgRegParms +blezRoffset(AbstractInstruction * self_in_blezRoffset, sqInt cmpReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_blezRoffset, BLEZ, cmpReg, 0, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#bltzR:offset: */ +static sqInt NoDbgRegParms +bltzRoffset(AbstractInstruction * self_in_bltzRoffset, sqInt cmpReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_bltzRoffset, REGIMM, cmpReg, BLTZ, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#bneR:R:offset: */ +static sqInt NoDbgRegParms +bneRRoffset(AbstractInstruction * self_in_bneRRoffset, sqInt leftReg, sqInt rightReg, sqInt offset) +{ + assert((offset & 3) == 0); + assert(((offset >= -131072) && (offset <= 0x1FFFF))); + return itypersrtsignedImmediate(self_in_bneRRoffset, BNE, leftReg, rightReg, ((sqInt) offset) >> 2); +} + + /* CogMIPSELCompiler>>#callInstructionByteSize */ +static sqInt NoDbgRegParms +callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize) +{ + flag("todo"); + return 16; +} + + +/* csra - 16: lui t9, high + csra - 12: ori t9, low + csra - 8: jalr t9 + csra - 4: nop (delay slot) */ + + /* CogMIPSELCompiler>>#callTargetFromReturnAddress: */ +static usqInt NoDbgRegParms +callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress) +{ + assert((opcodeAtAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_callTargetFromReturnAddress))); + return literalAtAddress(self_in_callTargetFromReturnAddress, callSiteReturnAddress - 12); +} + + /* CogMIPSELCompiler>>#cmpC32RTempByteSize */ +static sqInt NoDbgRegParms +cmpC32RTempByteSize(AbstractInstruction * self_in_cmpC32RTempByteSize) +{ + return 8; +} + + +/* Each MIPS instruction has 4 bytes. Many abstract opcodes need more than + one instruction. Instructions that refer to constants and/or literals + depend on literals + being stored in-line or out-of-line. + + N.B. The ^N forms are to get around the bytecode compiler's long branch + limits which are exceeded when each case jumps around the otherwise. */ + + /* CogMIPSELCompiler>>#computeMaximumSize */ +static sqInt NoDbgRegParms +computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize) +{ + + switch ((self_in_computeMaximumSize->opcode)) { + case BrEqualRR: + case BrNotEqualRR: + case JumpR: + case Jump: + case JumpZero: + case JumpNonZero: + case JumpNegative: + case JumpNonNegative: + case JumpOverflow: + case JumpNoOverflow: + case JumpCarry: + case JumpNoCarry: + case JumpLess: + case JumpGreaterOrEqual: + case JumpGreater: + case JumpLessOrEqual: + case JumpBelow: + case JumpAboveOrEqual: + case JumpAbove: + case JumpBelowOrEqual: + case JumpFPEqual: + case JumpFPNotEqual: + case JumpFPLess: + case JumpFPGreaterOrEqual: + case JumpFPGreater: + case JumpFPLessOrEqual: + case JumpFPOrdered: + case JumpFPUnordered: + case RetN: + case MoveCqR: + case MoveCwR: + case MoveXbrRR: + case MoveRXbrR: + case PopR: + case PushR: + case ConvertRRd: + return 8; + + case BrUnsignedLessRR: + case BrUnsignedLessEqualRR: + case BrUnsignedGreaterRR: + case BrUnsignedGreaterEqualRR: + case BrSignedLessRR: + case BrSignedLessEqualRR: + case BrSignedGreaterRR: + case BrSignedGreaterEqualRR: + case AddCqR: + case AndCqRR: + case OrCqR: + case SubCqR: + case TstCqR: + case XorCqR: + case AddCwR: + case AndCwR: + case OrCwR: + case SubCwR: + case XorCwR: + case LoadEffectiveAddressMwrR: + case MoveXwrRR: + case MoveRXwrR: + case PrefetchAw: + return 12; + + case BrLongEqualRR: + case BrLongNotEqualRR: + case AndCqR: + case MoveRMwr: + case MoveMwrR: + case PushCw: + case PushCq: + return 16; + + case MulRR: + case DivRR: + case MoveLowR: + case MoveHighR: + case Literal: + case Fill32: + case Nop: + case Stop: + case AddRR: + case AndRR: + case OrRR: + case XorRR: + case SubRR: + case NegateR: + case LogicalShiftLeftCqR: + case LogicalShiftRightCqR: + case ArithmeticShiftRightCqR: + case LogicalShiftLeftRR: + case LogicalShiftRightRR: + case ArithmeticShiftRightRR: + case AddRdRd: + case CmpRdRd: + case SubRdRd: + case MulRdRd: + case DivRdRd: + case SqrtRd: + case MoveRR: + case MoveRdRd: + case MoveMbrR: + case MoveRMbr: + case MoveM16rR: + case MoveRM16r: + return 4; + + case Label: + return 0; + + case AlignmentNops: + return (((self_in_computeMaximumSize->operands))[0]) - 4; + + case Call: + case CallFull: + case JumpFull: + case JumpLong: + case JumpLongZero: + case JumpLongNonZero: + return 8 + 8; + + case CmpCqR: + case CmpCwR: + case AddCheckOverflowCqR: + case SubCheckOverflowCqR: + return 28; + + case CmpRR: + case AddCheckOverflowRR: + case SubCheckOverflowRR: + case MulCheckOverflowRR: + return 20; + + case MoveAwR: + case MoveAbR: + return (isAddressRelativeToVarBase(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[0]) + ? 4 + : 8 + 4); + + case MoveRAw: + case MoveRAb: + return (isAddressRelativeToVarBase(self_in_computeMaximumSize, ((self_in_computeMaximumSize->operands))[1]) + ? 4 + : 8 + 4); + + case MoveRdM64r: + case MoveM64rRd: + return 8 + 4; + + default: + error("Case not found and no otherwise clause"); + } + return 0; +} + + /* CogMIPSELCompiler>>#concretizeAddCheckOverflowCqR */ +static usqInt NoDbgRegParms +concretizeAddCheckOverflowCqR(AbstractInstruction * self_in_concretizeAddCheckOverflowCqR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt aWord4; + sqInt aWord5; + sqInt aWord6; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeAddCheckOverflowCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAddCheckOverflowCqR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeAddCheckOverflowCqR, AT, high16BitsOf(self_in_concretizeAddCheckOverflowCqR, rightImm)); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeAddCheckOverflowCqR, AT, AT, low16BitsOf(self_in_concretizeAddCheckOverflowCqR, rightImm)); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = adduRRR(self_in_concretizeAddCheckOverflowCqR, OverflowTemp1, leftReg, ZR); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = adduRRR(self_in_concretizeAddCheckOverflowCqR, destReg, leftReg, AT); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[12 / 4] = aWord3; + /* begin machineCodeAt:put: */ + aWord4 = xorRRR(self_in_concretizeAddCheckOverflowCqR, OverflowTemp2, destReg, AT); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[16 / 4] = aWord4; + /* begin machineCodeAt:put: */ + aWord5 = xorRRR(self_in_concretizeAddCheckOverflowCqR, OverflowTemp1, destReg, OverflowTemp1); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[20 / 4] = aWord5; + /* begin machineCodeAt:put: */ + aWord6 = andRRR(self_in_concretizeAddCheckOverflowCqR, Overflow, OverflowTemp1, OverflowTemp2); + ((self_in_concretizeAddCheckOverflowCqR->machineCode))[24 / 4] = aWord6; + return ((self_in_concretizeAddCheckOverflowCqR->machineCodeSize) = 28); +} + + /* CogMIPSELCompiler>>#concretizeAddCheckOverflowRR */ +static usqInt NoDbgRegParms +concretizeAddCheckOverflowRR(AbstractInstruction * self_in_concretizeAddCheckOverflowRR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt aWord4; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeAddCheckOverflowRR->operands))[0]; + + /* Save original LHS */ + destReg = (leftReg = ((self_in_concretizeAddCheckOverflowRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeAddCheckOverflowRR, OverflowTemp1, leftReg, ZR); + ((self_in_concretizeAddCheckOverflowRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = adduRRR(self_in_concretizeAddCheckOverflowRR, destReg, leftReg, rightReg); + ((self_in_concretizeAddCheckOverflowRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = xorRRR(self_in_concretizeAddCheckOverflowRR, OverflowTemp2, destReg, rightReg); + ((self_in_concretizeAddCheckOverflowRR->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = xorRRR(self_in_concretizeAddCheckOverflowRR, OverflowTemp1, destReg, OverflowTemp1); + ((self_in_concretizeAddCheckOverflowRR->machineCode))[12 / 4] = aWord3; + /* begin machineCodeAt:put: */ + aWord4 = andRRR(self_in_concretizeAddCheckOverflowRR, Overflow, OverflowTemp1, OverflowTemp2); + ((self_in_concretizeAddCheckOverflowRR->machineCode))[16 / 4] = aWord4; + return ((self_in_concretizeAddCheckOverflowRR->machineCodeSize) = 20); +} + + /* CogMIPSELCompiler>>#concretizeAddCqR */ +static usqInt NoDbgRegParms +concretizeAddCqR(AbstractInstruction * self_in_concretizeAddCqR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeAddCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAddCqR->operands))[1]); + if (!(((rightImm >= -32768) && (rightImm <= 0x7FFF)))) { + return concretizeAddCwR(self_in_concretizeAddCqR); + } + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizeAddCqR, destReg, leftReg, rightImm); + ((self_in_concretizeAddCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeAddCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeAddCwR */ +static usqInt NoDbgRegParms +concretizeAddCwR(AbstractInstruction * self_in_concretizeAddCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeAddCwR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAddCwR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeAddCwR, AT, high16BitsOf(self_in_concretizeAddCwR, rightImm)); + ((self_in_concretizeAddCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeAddCwR, AT, AT, low16BitsOf(self_in_concretizeAddCwR, rightImm)); + ((self_in_concretizeAddCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = adduRRR(self_in_concretizeAddCwR, destReg, leftReg, AT); + ((self_in_concretizeAddCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeAddCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeAddRR */ +static usqInt NoDbgRegParms +concretizeAddRR(AbstractInstruction * self_in_concretizeAddRR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeAddRR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAddRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeAddRR, destReg, leftReg, rightReg); + ((self_in_concretizeAddRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeAddRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeAlignmentNops */ +static AbstractInstruction * NoDbgRegParms +concretizeAlignmentNops(AbstractInstruction * self_in_concretizeAlignmentNops) +{ + sqInt p; + + assert((((self_in_concretizeAlignmentNops->machineCodeSize)) % 4) == 0); + for (p = 0; p < ((self_in_concretizeAlignmentNops->machineCodeSize)); p += 4) { + /* begin machineCodeAt:put: */ + ((self_in_concretizeAlignmentNops->machineCode))[p / 4] = 0; + } + return self_in_concretizeAlignmentNops; +} + + /* CogMIPSELCompiler>>#concretizeAndCqR */ +static usqInt NoDbgRegParms +concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeAndCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAndCqR->operands))[1]); + if (!(((rightImm >= -32768) && (rightImm <= 0x7FFF)))) { + return concretizeAndCwR(self_in_concretizeAndCqR); + } + /* begin machineCodeAt:put: */ + aWord = andiRRC(self_in_concretizeAndCqR, destReg, leftReg, rightImm); + ((self_in_concretizeAndCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeAndCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeAndCqRR */ +static usqInt NoDbgRegParms +concretizeAndCqRR(AbstractInstruction * self_in_concretizeAndCqRR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + usqIntptr_t dstReg; + usqIntptr_t srcReg; + usqIntptr_t value; + + value = ((self_in_concretizeAndCqRR->operands))[0]; + srcReg = ((self_in_concretizeAndCqRR->operands))[1]; + dstReg = ((self_in_concretizeAndCqRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeAndCqRR, AT, high16BitsOf(self_in_concretizeAndCqRR, value)); + ((self_in_concretizeAndCqRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeAndCqRR, AT, AT, low16BitsOf(self_in_concretizeAndCqRR, value)); + ((self_in_concretizeAndCqRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = andRRR(self_in_concretizeAndCqRR, dstReg, srcReg, AT); + ((self_in_concretizeAndCqRR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeAndCqRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeAndCwR */ +static usqInt NoDbgRegParms +concretizeAndCwR(AbstractInstruction * self_in_concretizeAndCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeAndCwR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAndCwR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeAndCwR, AT, high16BitsOf(self_in_concretizeAndCwR, rightImm)); + ((self_in_concretizeAndCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeAndCwR, AT, AT, low16BitsOf(self_in_concretizeAndCwR, rightImm)); + ((self_in_concretizeAndCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = andRRR(self_in_concretizeAndCwR, destReg, leftReg, AT); + ((self_in_concretizeAndCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeAndCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeAndRR */ +static usqInt NoDbgRegParms +concretizeAndRR(AbstractInstruction * self_in_concretizeAndRR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeAndRR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeAndRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = andRRR(self_in_concretizeAndRR, destReg, leftReg, rightReg); + ((self_in_concretizeAndRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeAndRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeArithmeticShiftRightCqR */ +static usqInt NoDbgRegParms +concretizeArithmeticShiftRightCqR(AbstractInstruction * self_in_concretizeArithmeticShiftRightCqR) +{ + sqInt aWord; + sqInt distance; + usqIntptr_t reg; + + distance = (((((self_in_concretizeArithmeticShiftRightCqR->operands))[0]) < 0x1F) ? (((self_in_concretizeArithmeticShiftRightCqR->operands))[0]) : 0x1F); + reg = ((self_in_concretizeArithmeticShiftRightCqR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = sraRRC(self_in_concretizeArithmeticShiftRightCqR, reg, reg, distance); + ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeArithmeticShiftRightCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeArithmeticShiftRightRR */ +static usqInt NoDbgRegParms +concretizeArithmeticShiftRightRR(AbstractInstruction * self_in_concretizeArithmeticShiftRightRR) +{ + sqInt aWord; + usqIntptr_t destReg; + usqIntptr_t distReg; + + distReg = ((self_in_concretizeArithmeticShiftRightRR->operands))[0]; + destReg = ((self_in_concretizeArithmeticShiftRightRR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = sravRRR(self_in_concretizeArithmeticShiftRightRR, destReg, destReg, distReg); + ((self_in_concretizeArithmeticShiftRightRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeArithmeticShiftRightRR->machineCodeSize) = 4); +} + + +/* 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, + setting machineCodeSize, and answer the following address. */ + + /* CogMIPSELCompiler>>#concretizeAt: */ +static sqInt NoDbgRegParms +concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress) +{ + assert((actualAddress % 4) == 0); + (self_in_concretizeAt->address) = actualAddress; + dispatchConcretize(self_in_concretizeAt); + assert((((self_in_concretizeAt->maxSize)) == null) + || (((self_in_concretizeAt->maxSize)) >= ((self_in_concretizeAt->machineCodeSize)))); + return actualAddress + ((self_in_concretizeAt->machineCodeSize)); +} + + /* CogMIPSELCompiler>>#concretizeBrEqualRR */ +static usqInt NoDbgRegParms +concretizeBrEqualRR(AbstractInstruction * self_in_concretizeBrEqualRR) +{ + sqInt aWord; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrEqualRR->address)) + 4))); + leftReg = ((self_in_concretizeBrEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrEqualRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = beqRRoffset(self_in_concretizeBrEqualRR, leftReg, rightReg, offset); + ((self_in_concretizeBrEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrEqualRR->machineCode))[4 / 4] = 0; + return ((self_in_concretizeBrEqualRR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeBrLongEqualRR */ +static usqInt NoDbgRegParms +concretizeBrLongEqualRR(AbstractInstruction * self_in_concretizeBrLongEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + usqInt jumpTargetAddr; + AbstractInstruction *jumpTargetInstruction; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + /* begin longJumpTargetAddress */ + jumpTarget = ((AbstractInstruction *) (((self_in_concretizeBrLongEqualRR->operands))[0])); + if ((addressIsInInstructions(jumpTarget)) + || (jumpTarget == (methodLabel()))) { + jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); + } + assert(jumpTarget != 0); + jumpTargetInstruction = jumpTarget; + flag("todo"); + jumpTargetAddr = (((usqInt)jumpTargetInstruction)) & 0xFFFFFFF; + leftReg = ((self_in_concretizeBrLongEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrLongEqualRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = bneRRoffset(self_in_concretizeBrLongEqualRR, leftReg, rightReg, 12); + ((self_in_concretizeBrLongEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrLongEqualRR->machineCode))[4 / 4] = 0; + /* begin machineCodeAt:put: */ + aWord1 = jA(self_in_concretizeBrLongEqualRR, jumpTargetAddr); + ((self_in_concretizeBrLongEqualRR->machineCode))[8 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrLongEqualRR->machineCode))[12 / 4] = 0; + return ((self_in_concretizeBrLongEqualRR->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeBrLongNotEqualRR */ +static usqInt NoDbgRegParms +concretizeBrLongNotEqualRR(AbstractInstruction * self_in_concretizeBrLongNotEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + usqInt jumpTargetAddr; + AbstractInstruction *jumpTargetInstruction; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + /* begin longJumpTargetAddress */ + jumpTarget = ((AbstractInstruction *) (((self_in_concretizeBrLongNotEqualRR->operands))[0])); + if ((addressIsInInstructions(jumpTarget)) + || (jumpTarget == (methodLabel()))) { + jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); + } + assert(jumpTarget != 0); + jumpTargetInstruction = jumpTarget; + flag("todo"); + jumpTargetAddr = (((usqInt)jumpTargetInstruction)) & 0xFFFFFFF; + leftReg = ((self_in_concretizeBrLongNotEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrLongNotEqualRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = beqRRoffset(self_in_concretizeBrLongNotEqualRR, leftReg, rightReg, 12); + ((self_in_concretizeBrLongNotEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrLongNotEqualRR->machineCode))[4 / 4] = 0; + /* begin machineCodeAt:put: */ + aWord1 = jA(self_in_concretizeBrLongNotEqualRR, jumpTargetAddr); + ((self_in_concretizeBrLongNotEqualRR->machineCode))[8 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrLongNotEqualRR->machineCode))[12 / 4] = 0; + return ((self_in_concretizeBrLongNotEqualRR->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeBrNotEqualRR */ +static usqInt NoDbgRegParms +concretizeBrNotEqualRR(AbstractInstruction * self_in_concretizeBrNotEqualRR) +{ + sqInt aWord; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrNotEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrNotEqualRR->address)) + 4))); + leftReg = ((self_in_concretizeBrNotEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrNotEqualRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = bneRRoffset(self_in_concretizeBrNotEqualRR, leftReg, rightReg, offset); + ((self_in_concretizeBrNotEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrNotEqualRR->machineCode))[4 / 4] = 0; + return ((self_in_concretizeBrNotEqualRR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeBrSignedGreaterEqualRR */ +static usqInt NoDbgRegParms +concretizeBrSignedGreaterEqualRR(AbstractInstruction * self_in_concretizeBrSignedGreaterEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrSignedGreaterEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrSignedGreaterEqualRR->address)) + 8))); + leftReg = ((self_in_concretizeBrSignedGreaterEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrSignedGreaterEqualRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltRRR(self_in_concretizeBrSignedGreaterEqualRR, BranchTemp, leftReg, rightReg); + ((self_in_concretizeBrSignedGreaterEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = beqRRoffset(self_in_concretizeBrSignedGreaterEqualRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrSignedGreaterEqualRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrSignedGreaterEqualRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrSignedGreaterEqualRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrSignedGreaterRR */ +static usqInt NoDbgRegParms +concretizeBrSignedGreaterRR(AbstractInstruction * self_in_concretizeBrSignedGreaterRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrSignedGreaterRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrSignedGreaterRR->address)) + 8))); + leftReg = ((self_in_concretizeBrSignedGreaterRR->operands))[1]; + rightReg = ((self_in_concretizeBrSignedGreaterRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltRRR(self_in_concretizeBrSignedGreaterRR, BranchTemp, rightReg, leftReg); + ((self_in_concretizeBrSignedGreaterRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = bneRRoffset(self_in_concretizeBrSignedGreaterRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrSignedGreaterRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrSignedGreaterRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrSignedGreaterRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrSignedLessEqualRR */ +static usqInt NoDbgRegParms +concretizeBrSignedLessEqualRR(AbstractInstruction * self_in_concretizeBrSignedLessEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrSignedLessEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrSignedLessEqualRR->address)) + 8))); + leftReg = ((self_in_concretizeBrSignedLessEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrSignedLessEqualRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltRRR(self_in_concretizeBrSignedLessEqualRR, BranchTemp, rightReg, leftReg); + ((self_in_concretizeBrSignedLessEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = beqRRoffset(self_in_concretizeBrSignedLessEqualRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrSignedLessEqualRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrSignedLessEqualRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrSignedLessEqualRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrSignedLessRR */ +static usqInt NoDbgRegParms +concretizeBrSignedLessRR(AbstractInstruction * self_in_concretizeBrSignedLessRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrSignedLessRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrSignedLessRR->address)) + 8))); + leftReg = ((self_in_concretizeBrSignedLessRR->operands))[1]; + rightReg = ((self_in_concretizeBrSignedLessRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltRRR(self_in_concretizeBrSignedLessRR, BranchTemp, leftReg, rightReg); + ((self_in_concretizeBrSignedLessRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = bneRRoffset(self_in_concretizeBrSignedLessRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrSignedLessRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrSignedLessRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrSignedLessRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrUnsignedGreaterEqualRR */ +static usqInt NoDbgRegParms +concretizeBrUnsignedGreaterEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrUnsignedGreaterEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrUnsignedGreaterEqualRR->address)) + 8))); + leftReg = ((self_in_concretizeBrUnsignedGreaterEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrUnsignedGreaterEqualRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltuRRR(self_in_concretizeBrUnsignedGreaterEqualRR, BranchTemp, leftReg, rightReg); + ((self_in_concretizeBrUnsignedGreaterEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = beqRRoffset(self_in_concretizeBrUnsignedGreaterEqualRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrUnsignedGreaterEqualRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrUnsignedGreaterEqualRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrUnsignedGreaterEqualRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrUnsignedGreaterRR */ +static usqInt NoDbgRegParms +concretizeBrUnsignedGreaterRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrUnsignedGreaterRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrUnsignedGreaterRR->address)) + 8))); + leftReg = ((self_in_concretizeBrUnsignedGreaterRR->operands))[1]; + rightReg = ((self_in_concretizeBrUnsignedGreaterRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltuRRR(self_in_concretizeBrUnsignedGreaterRR, BranchTemp, rightReg, leftReg); + ((self_in_concretizeBrUnsignedGreaterRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = bneRRoffset(self_in_concretizeBrUnsignedGreaterRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrUnsignedGreaterRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrUnsignedGreaterRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrUnsignedGreaterRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrUnsignedLessEqualRR */ +static usqInt NoDbgRegParms +concretizeBrUnsignedLessEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedLessEqualRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrUnsignedLessEqualRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrUnsignedLessEqualRR->address)) + 8))); + leftReg = ((self_in_concretizeBrUnsignedLessEqualRR->operands))[1]; + rightReg = ((self_in_concretizeBrUnsignedLessEqualRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltuRRR(self_in_concretizeBrUnsignedLessEqualRR, BranchTemp, rightReg, leftReg); + ((self_in_concretizeBrUnsignedLessEqualRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = beqRRoffset(self_in_concretizeBrUnsignedLessEqualRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrUnsignedLessEqualRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrUnsignedLessEqualRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrUnsignedLessEqualRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeBrUnsignedLessRR */ +static usqInt NoDbgRegParms +concretizeBrUnsignedLessRR(AbstractInstruction * self_in_concretizeBrUnsignedLessRR) +{ + sqInt aWord; + sqInt aWord1; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + usqIntptr_t leftReg; + sqInt offset; + usqIntptr_t rightReg; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeBrUnsignedLessRR->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeBrUnsignedLessRR->address)) + 8))); + leftReg = ((self_in_concretizeBrUnsignedLessRR->operands))[1]; + rightReg = ((self_in_concretizeBrUnsignedLessRR->operands))[2]; + assert(leftReg != BranchTemp); + assert(rightReg != BranchTemp); + /* begin machineCodeAt:put: */ + aWord = sltuRRR(self_in_concretizeBrUnsignedLessRR, BranchTemp, leftReg, rightReg); + ((self_in_concretizeBrUnsignedLessRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = bneRRoffset(self_in_concretizeBrUnsignedLessRR, BranchTemp, ZR, offset); + ((self_in_concretizeBrUnsignedLessRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + ((self_in_concretizeBrUnsignedLessRR->machineCode))[8 / 4] = 0; + return ((self_in_concretizeBrUnsignedLessRR->machineCodeSize) = 12); +} + + +/* Call is used only for calls within code-space, See CallFull for general + anywhere in address space calling + */ +/* Relative branches in MIPS have a displacement of +/- 131kB (signed 18 + bits), which is too small to cover + the method zone. */ + + /* CogMIPSELCompiler>>#concretizeCall */ +static usqInt NoDbgRegParms +concretizeCall(AbstractInstruction * self_in_concretizeCall) +{ + return concretizeCallFull(self_in_concretizeCall); +} + + /* CogMIPSELCompiler>>#concretizeCallFull */ +static usqInt NoDbgRegParms +concretizeCallFull(AbstractInstruction * self_in_concretizeCallFull) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + AbstractInstruction *jumpTarget; + usqInt jumpTargetAddr; + AbstractInstruction *jumpTargetInstruction; + + /* begin longJumpTargetAddress */ + jumpTarget = ((AbstractInstruction *) (((self_in_concretizeCallFull->operands))[0])); + if ((addressIsInInstructions(jumpTarget)) + || (jumpTarget == (methodLabel()))) { + jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); + } + assert(jumpTarget != 0); + jumpTargetInstruction = jumpTarget; + jumpTargetAddr = ((usqInt)jumpTargetInstruction); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeCallFull, TargetReg, high16BitsOf(self_in_concretizeCallFull, jumpTargetAddr)); + ((self_in_concretizeCallFull->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeCallFull, TargetReg, TargetReg, low16BitsOf(self_in_concretizeCallFull, jumpTargetAddr)); + ((self_in_concretizeCallFull->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = jalR(self_in_concretizeCallFull, TargetReg); + ((self_in_concretizeCallFull->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + ((self_in_concretizeCallFull->machineCode))[12 / 4] = 0; + return ((self_in_concretizeCallFull->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeCmpCqR */ +static sqInt NoDbgRegParms +concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR) +{ + return concretizeCmpCwR(self_in_concretizeCmpCqR); +} + + /* CogMIPSELCompiler>>#concretizeCmpCwR */ +static sqInt NoDbgRegParms +concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeCmpRR */ +static sqInt NoDbgRegParms +concretizeCmpRR(AbstractInstruction * self_in_concretizeCmpRR) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeDivRR */ +static usqInt NoDbgRegParms +concretizeDivRR(AbstractInstruction * self_in_concretizeDivRR) +{ + sqInt aWord; + usqIntptr_t dividendReg; + usqIntptr_t divisorReg; + + dividendReg = ((self_in_concretizeDivRR->operands))[0]; + divisorReg = ((self_in_concretizeDivRR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = divRR(self_in_concretizeDivRR, dividendReg, divisorReg); + ((self_in_concretizeDivRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeDivRR->machineCodeSize) = 4); +} + + +/* fill with operand 0 according to the processor's endianness. + You might think this is bogus and we should fill with stop instrurctions + instead, but this is used to leave room for a CMBlock header before the + code for a block; + the gaps get filled in by fillInBlockHeadersAt: after code has been + generated. */ + + /* CogMIPSELCompiler>>#concretizeFill32 */ +static usqInt NoDbgRegParms +concretizeFill32(AbstractInstruction * self_in_concretizeFill32) +{ + sqInt aWord; + + /* begin machineCodeAt:put: */ + aWord = ((self_in_concretizeFill32->operands))[0]; + ((self_in_concretizeFill32->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeFill32->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeJump */ +static usqInt NoDbgRegParms +concretizeJump(AbstractInstruction * self_in_concretizeJump) +{ + sqInt aWord; + AbstractInstruction *jumpTarget; + AbstractInstruction *jumpTarget1; + sqInt offset; + + /* begin computeJumpTargetOffsetPlus: */ + jumpTarget1 = ((AbstractInstruction *) (((self_in_concretizeJump->operands))[0])); + assertSaneJumpTarget(jumpTarget1); + if ((addressIsInInstructions(jumpTarget1)) + || (jumpTarget1 == (methodLabel()))) { + jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address))); + } + assert(jumpTarget1 != 0); + jumpTarget = jumpTarget1; + offset = (((int) jumpTarget)) - (((int) (((self_in_concretizeJump->address)) + 4))); + flag("BranchRange"); + /* begin machineCodeAt:put: */ + aWord = beqRRoffset(self_in_concretizeJump, ZR, ZR, offset); + ((self_in_concretizeJump->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeJump->machineCode))[4 / 4] = 0; + return ((self_in_concretizeJump->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeJumpFull */ +static usqInt NoDbgRegParms +concretizeJumpFull(AbstractInstruction * self_in_concretizeJumpFull) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + AbstractInstruction *jumpTarget; + usqInt jumpTargetAddr; + AbstractInstruction *jumpTargetInstruction; + + /* begin longJumpTargetAddress */ + jumpTarget = ((AbstractInstruction *) (((self_in_concretizeJumpFull->operands))[0])); + if ((addressIsInInstructions(jumpTarget)) + || (jumpTarget == (methodLabel()))) { + jumpTarget = ((AbstractInstruction *) ((jumpTarget->address))); + } + assert(jumpTarget != 0); + jumpTargetInstruction = jumpTarget; + jumpTargetAddr = ((usqInt)jumpTargetInstruction); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeJumpFull, TargetReg, high16BitsOf(self_in_concretizeJumpFull, jumpTargetAddr)); + ((self_in_concretizeJumpFull->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeJumpFull, TargetReg, TargetReg, low16BitsOf(self_in_concretizeJumpFull, jumpTargetAddr)); + ((self_in_concretizeJumpFull->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = jR(self_in_concretizeJumpFull, TargetReg); + ((self_in_concretizeJumpFull->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + ((self_in_concretizeJumpFull->machineCode))[12 / 4] = 0; + return ((self_in_concretizeJumpFull->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeJumpLong */ +static usqInt NoDbgRegParms +concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong) +{ + return concretizeJumpFull(self_in_concretizeJumpLong); +} + + /* CogMIPSELCompiler>>#concretizeJumpLongNonZero */ +static sqInt NoDbgRegParms +concretizeJumpLongNonZero(AbstractInstruction * self_in_concretizeJumpLongNonZero) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpLongZero */ +static sqInt NoDbgRegParms +concretizeJumpLongZero(AbstractInstruction * self_in_concretizeJumpLongZero) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpNonZero */ +static sqInt NoDbgRegParms +concretizeJumpNonZero(AbstractInstruction * self_in_concretizeJumpNonZero) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpNoOverflow */ +static sqInt NoDbgRegParms +concretizeJumpNoOverflow(AbstractInstruction * self_in_concretizeJumpNoOverflow) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpOverflow */ +static sqInt NoDbgRegParms +concretizeJumpOverflow(AbstractInstruction * self_in_concretizeJumpOverflow) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpR */ +static usqInt NoDbgRegParms +concretizeJumpR(AbstractInstruction * self_in_concretizeJumpR) +{ + sqInt aWord; + usqIntptr_t reg; + + flag("OABI"); + reg = ((self_in_concretizeJumpR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = jR(self_in_concretizeJumpR, reg); + ((self_in_concretizeJumpR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + ((self_in_concretizeJumpR->machineCode))[4 / 4] = 0; + return ((self_in_concretizeJumpR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeJumpSignedGreaterEqual */ +static sqInt NoDbgRegParms +concretizeJumpSignedGreaterEqual(AbstractInstruction * self_in_concretizeJumpSignedGreaterEqual) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpSignedGreaterThan */ +static sqInt NoDbgRegParms +concretizeJumpSignedGreaterThan(AbstractInstruction * self_in_concretizeJumpSignedGreaterThan) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpSignedLessEqual */ +static sqInt NoDbgRegParms +concretizeJumpSignedLessEqual(AbstractInstruction * self_in_concretizeJumpSignedLessEqual) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpSignedLessThan */ +static sqInt NoDbgRegParms +concretizeJumpSignedLessThan(AbstractInstruction * self_in_concretizeJumpSignedLessThan) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpUnsignedGreaterEqual */ +static sqInt NoDbgRegParms +concretizeJumpUnsignedGreaterEqual(AbstractInstruction * self_in_concretizeJumpUnsignedGreaterEqual) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpUnsignedGreaterThan */ +static sqInt NoDbgRegParms +concretizeJumpUnsignedGreaterThan(AbstractInstruction * self_in_concretizeJumpUnsignedGreaterThan) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpUnsignedLessEqual */ +static sqInt NoDbgRegParms +concretizeJumpUnsignedLessEqual(AbstractInstruction * self_in_concretizeJumpUnsignedLessEqual) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpUnsignedLessThan */ +static sqInt NoDbgRegParms +concretizeJumpUnsignedLessThan(AbstractInstruction * self_in_concretizeJumpUnsignedLessThan) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeJumpZero */ +static sqInt NoDbgRegParms +concretizeJumpZero(AbstractInstruction * self_in_concretizeJumpZero) +{ + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeLoadEffectiveAddressMwrR */ +static usqInt NoDbgRegParms +concretizeLoadEffectiveAddressMwrR(AbstractInstruction * self_in_concretizeLoadEffectiveAddressMwrR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t baseReg; + usqIntptr_t destReg; + sqInt offset; + + offset = ((self_in_concretizeLoadEffectiveAddressMwrR->operands))[0]; + baseReg = ((self_in_concretizeLoadEffectiveAddressMwrR->operands))[1]; + destReg = ((self_in_concretizeLoadEffectiveAddressMwrR->operands))[2]; + if (isShortOffset(self_in_concretizeLoadEffectiveAddressMwrR, offset)) { + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizeLoadEffectiveAddressMwrR, destReg, baseReg, offset); + ((self_in_concretizeLoadEffectiveAddressMwrR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeLoadEffectiveAddressMwrR->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeLoadEffectiveAddressMwrR, AT, high16BitsOf(self_in_concretizeLoadEffectiveAddressMwrR, offset)); + ((self_in_concretizeLoadEffectiveAddressMwrR->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeLoadEffectiveAddressMwrR, AT, AT, low16BitsOf(self_in_concretizeLoadEffectiveAddressMwrR, offset)); + ((self_in_concretizeLoadEffectiveAddressMwrR->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = adduRRR(self_in_concretizeLoadEffectiveAddressMwrR, destReg, baseReg, AT); + ((self_in_concretizeLoadEffectiveAddressMwrR->machineCode))[8 / 4] = aWord3; + return ((self_in_concretizeLoadEffectiveAddressMwrR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeLogicalShiftLeftCqR */ +static usqInt NoDbgRegParms +concretizeLogicalShiftLeftCqR(AbstractInstruction * self_in_concretizeLogicalShiftLeftCqR) +{ + sqInt aWord; + sqInt distance; + usqIntptr_t reg; + + distance = (((((self_in_concretizeLogicalShiftLeftCqR->operands))[0]) < 0x1F) ? (((self_in_concretizeLogicalShiftLeftCqR->operands))[0]) : 0x1F); + reg = ((self_in_concretizeLogicalShiftLeftCqR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = sllRRC(self_in_concretizeLogicalShiftLeftCqR, reg, reg, distance); + ((self_in_concretizeLogicalShiftLeftCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeLogicalShiftLeftCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeLogicalShiftLeftRR */ +static usqInt NoDbgRegParms +concretizeLogicalShiftLeftRR(AbstractInstruction * self_in_concretizeLogicalShiftLeftRR) +{ + sqInt aWord; + usqIntptr_t destReg; + usqIntptr_t distReg; + + distReg = ((self_in_concretizeLogicalShiftLeftRR->operands))[0]; + destReg = ((self_in_concretizeLogicalShiftLeftRR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = sllvRRR(self_in_concretizeLogicalShiftLeftRR, destReg, destReg, distReg); + ((self_in_concretizeLogicalShiftLeftRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeLogicalShiftLeftRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeLogicalShiftRightCqR */ +static usqInt NoDbgRegParms +concretizeLogicalShiftRightCqR(AbstractInstruction * self_in_concretizeLogicalShiftRightCqR) +{ + sqInt aWord; + sqInt distance; + usqIntptr_t reg; + + distance = (((((self_in_concretizeLogicalShiftRightCqR->operands))[0]) < 0x1F) ? (((self_in_concretizeLogicalShiftRightCqR->operands))[0]) : 0x1F); + reg = ((self_in_concretizeLogicalShiftRightCqR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = srlRRC(self_in_concretizeLogicalShiftRightCqR, reg, reg, distance); + ((self_in_concretizeLogicalShiftRightCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeLogicalShiftRightCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeLogicalShiftRightRR */ +static usqInt NoDbgRegParms +concretizeLogicalShiftRightRR(AbstractInstruction * self_in_concretizeLogicalShiftRightRR) +{ + sqInt aWord; + usqIntptr_t destReg; + usqIntptr_t distReg; + + distReg = ((self_in_concretizeLogicalShiftRightRR->operands))[0]; + destReg = ((self_in_concretizeLogicalShiftRightRR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = srlvRRR(self_in_concretizeLogicalShiftRightRR, destReg, destReg, distReg); + ((self_in_concretizeLogicalShiftRightRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeLogicalShiftRightRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveAbR */ +static usqInt NoDbgRegParms +concretizeMoveAbR(AbstractInstruction * self_in_concretizeMoveAbR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t destReg; + usqIntptr_t srcAddr; + + srcAddr = ((self_in_concretizeMoveAbR->operands))[0]; + destReg = ((self_in_concretizeMoveAbR->operands))[1]; + if ((srcAddr != null) + && ((((varBaseAddress()) - (1U << 15)) < srcAddr) + && (srcAddr < ((varBaseAddress()) + (1U << 15))))) { + /* begin machineCodeAt:put: */ + aWord = lwRbaseoffset(self_in_concretizeMoveAbR, destReg, ConcreteVarBaseReg, srcAddr - (varBaseAddress())); + ((self_in_concretizeMoveAbR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveAbR->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeMoveAbR, AT, high16BitsOf(self_in_concretizeMoveAbR, srcAddr)); + ((self_in_concretizeMoveAbR->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeMoveAbR, AT, AT, low16BitsOf(self_in_concretizeMoveAbR, srcAddr)); + ((self_in_concretizeMoveAbR->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = lbuRbaseoffset(self_in_concretizeMoveAbR, destReg, AT, 0); + ((self_in_concretizeMoveAbR->machineCode))[8 / 4] = aWord3; + return ((self_in_concretizeMoveAbR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMoveAwR */ +static usqInt NoDbgRegParms +concretizeMoveAwR(AbstractInstruction * self_in_concretizeMoveAwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t destReg; + usqIntptr_t srcAddr; + + srcAddr = ((self_in_concretizeMoveAwR->operands))[0]; + destReg = ((self_in_concretizeMoveAwR->operands))[1]; + if ((srcAddr != null) + && ((((varBaseAddress()) - (1U << 15)) < srcAddr) + && (srcAddr < ((varBaseAddress()) + (1U << 15))))) { + /* begin machineCodeAt:put: */ + aWord = lwRbaseoffset(self_in_concretizeMoveAwR, destReg, ConcreteVarBaseReg, srcAddr - (varBaseAddress())); + ((self_in_concretizeMoveAwR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveAwR->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeMoveAwR, AT, high16BitsOf(self_in_concretizeMoveAwR, srcAddr)); + ((self_in_concretizeMoveAwR->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeMoveAwR, AT, AT, low16BitsOf(self_in_concretizeMoveAwR, srcAddr)); + ((self_in_concretizeMoveAwR->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = lwRbaseoffset(self_in_concretizeMoveAwR, destReg, AT, 0); + ((self_in_concretizeMoveAwR->machineCode))[8 / 4] = aWord3; + return ((self_in_concretizeMoveAwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMoveCqR */ +static usqInt NoDbgRegParms +concretizeMoveCqR(AbstractInstruction * self_in_concretizeMoveCqR) +{ + sqInt aWord; + usqIntptr_t reg; + sqInt word; + + word = ((self_in_concretizeMoveCqR->operands))[0]; + reg = ((self_in_concretizeMoveCqR->operands))[1]; + if (!(((word >= -32768) && (word <= 0x7FFF)))) { + return concretizeMoveCwR(self_in_concretizeMoveCqR); + } + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizeMoveCqR, reg, ZR, word); + ((self_in_concretizeMoveCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveCwR */ +static usqInt NoDbgRegParms +concretizeMoveCwR(AbstractInstruction * self_in_concretizeMoveCwR) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t reg; + sqInt word; + + word = ((self_in_concretizeMoveCwR->operands))[0]; + reg = ((self_in_concretizeMoveCwR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeMoveCwR, reg, high16BitsOf(self_in_concretizeMoveCwR, word)); + ((self_in_concretizeMoveCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeMoveCwR, reg, reg, low16BitsOf(self_in_concretizeMoveCwR, word)); + ((self_in_concretizeMoveCwR->machineCode))[4 / 4] = aWord1; + return ((self_in_concretizeMoveCwR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeMoveHighR */ +static usqInt NoDbgRegParms +concretizeMoveHighR(AbstractInstruction * self_in_concretizeMoveHighR) +{ + sqInt aWord; + usqIntptr_t destReg; + + destReg = ((self_in_concretizeMoveHighR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = mfhiR(self_in_concretizeMoveHighR, destReg); + ((self_in_concretizeMoveHighR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveHighR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveLowR */ +static usqInt NoDbgRegParms +concretizeMoveLowR(AbstractInstruction * self_in_concretizeMoveLowR) +{ + sqInt aWord; + usqIntptr_t destReg; + + destReg = ((self_in_concretizeMoveLowR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = mfloR(self_in_concretizeMoveLowR, destReg); + ((self_in_concretizeMoveLowR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveLowR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveM16rR */ +static usqInt NoDbgRegParms +concretizeMoveM16rR(AbstractInstruction * self_in_concretizeMoveM16rR) +{ + sqInt aWord; + usqIntptr_t destReg; + sqInt offset; + usqIntptr_t srcReg; + + offset = ((self_in_concretizeMoveM16rR->operands))[0]; + srcReg = ((self_in_concretizeMoveM16rR->operands))[1]; + destReg = ((self_in_concretizeMoveM16rR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = lhuRbaseoffset(self_in_concretizeMoveM16rR, destReg, srcReg, offset); + ((self_in_concretizeMoveM16rR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveM16rR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveMbrR */ +static usqInt NoDbgRegParms +concretizeMoveMbrR(AbstractInstruction * self_in_concretizeMoveMbrR) +{ + sqInt aWord; + usqIntptr_t destReg; + sqInt offset; + usqIntptr_t srcReg; + + offset = ((self_in_concretizeMoveMbrR->operands))[0]; + srcReg = ((self_in_concretizeMoveMbrR->operands))[1]; + destReg = ((self_in_concretizeMoveMbrR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = lbuRbaseoffset(self_in_concretizeMoveMbrR, destReg, srcReg, offset); + ((self_in_concretizeMoveMbrR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveMbrR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveMwrR */ +static usqInt NoDbgRegParms +concretizeMoveMwrR(AbstractInstruction * self_in_concretizeMoveMwrR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt aWord4; + usqIntptr_t baseReg; + usqIntptr_t destReg; + sqInt offset; + + offset = ((self_in_concretizeMoveMwrR->operands))[0]; + baseReg = ((self_in_concretizeMoveMwrR->operands))[1]; + destReg = ((self_in_concretizeMoveMwrR->operands))[2]; + if (isShortOffset(self_in_concretizeMoveMwrR, offset)) { + /* begin machineCodeAt:put: */ + aWord = lwRbaseoffset(self_in_concretizeMoveMwrR, destReg, baseReg, offset); + ((self_in_concretizeMoveMwrR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveMwrR->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeMoveMwrR, AT, high16BitsOf(self_in_concretizeMoveMwrR, offset)); + ((self_in_concretizeMoveMwrR->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeMoveMwrR, AT, AT, low16BitsOf(self_in_concretizeMoveMwrR, offset)); + ((self_in_concretizeMoveMwrR->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = adduRRR(self_in_concretizeMoveMwrR, AT, baseReg, AT); + ((self_in_concretizeMoveMwrR->machineCode))[8 / 4] = aWord3; + /* begin machineCodeAt:put: */ + aWord4 = lwRbaseoffset(self_in_concretizeMoveMwrR, destReg, AT, 0); + ((self_in_concretizeMoveMwrR->machineCode))[12 / 4] = aWord4; + return ((self_in_concretizeMoveMwrR->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeMoveRAb */ +static usqInt NoDbgRegParms +concretizeMoveRAb(AbstractInstruction * self_in_concretizeMoveRAb) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t destAddr; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRAb->operands))[0]; + destAddr = ((self_in_concretizeMoveRAb->operands))[1]; + if ((destAddr != null) + && ((((varBaseAddress()) - (1U << 15)) < destAddr) + && (destAddr < ((varBaseAddress()) + (1U << 15))))) { + /* begin machineCodeAt:put: */ + aWord = swRbaseoffset(self_in_concretizeMoveRAb, srcReg, ConcreteVarBaseReg, destAddr - (varBaseAddress())); + ((self_in_concretizeMoveRAb->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRAb->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeMoveRAb, AT, high16BitsOf(self_in_concretizeMoveRAb, destAddr)); + ((self_in_concretizeMoveRAb->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeMoveRAb, AT, AT, low16BitsOf(self_in_concretizeMoveRAb, destAddr)); + ((self_in_concretizeMoveRAb->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = sbRbaseoffset(self_in_concretizeMoveRAb, srcReg, AT, 0); + ((self_in_concretizeMoveRAb->machineCode))[8 / 4] = aWord3; + return ((self_in_concretizeMoveRAb->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMoveRAw */ +static usqInt NoDbgRegParms +concretizeMoveRAw(AbstractInstruction * self_in_concretizeMoveRAw) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t destAddr; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRAw->operands))[0]; + destAddr = ((self_in_concretizeMoveRAw->operands))[1]; + if ((destAddr != null) + && ((((varBaseAddress()) - (1U << 15)) < destAddr) + && (destAddr < ((varBaseAddress()) + (1U << 15))))) { + /* begin machineCodeAt:put: */ + aWord = swRbaseoffset(self_in_concretizeMoveRAw, srcReg, ConcreteVarBaseReg, destAddr - (varBaseAddress())); + ((self_in_concretizeMoveRAw->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRAw->machineCodeSize) = 4); + } + /* begin machineCodeAt:put: */ + aWord1 = luiRC(self_in_concretizeMoveRAw, AT, high16BitsOf(self_in_concretizeMoveRAw, destAddr)); + ((self_in_concretizeMoveRAw->machineCode))[0 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = oriRRC(self_in_concretizeMoveRAw, AT, AT, low16BitsOf(self_in_concretizeMoveRAw, destAddr)); + ((self_in_concretizeMoveRAw->machineCode))[4 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = swRbaseoffset(self_in_concretizeMoveRAw, srcReg, AT, 0); + ((self_in_concretizeMoveRAw->machineCode))[8 / 4] = aWord3; + return ((self_in_concretizeMoveRAw->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMoveRM16r */ +static usqInt NoDbgRegParms +concretizeMoveRM16r(AbstractInstruction * self_in_concretizeMoveRM16r) +{ + sqInt aWord; + usqIntptr_t destReg; + sqInt offset; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRM16r->operands))[0]; + offset = ((self_in_concretizeMoveRM16r->operands))[1]; + destReg = ((self_in_concretizeMoveRM16r->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = shRbaseoffset(self_in_concretizeMoveRM16r, srcReg, destReg, offset); + ((self_in_concretizeMoveRM16r->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRM16r->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveRMbr */ +static usqInt NoDbgRegParms +concretizeMoveRMbr(AbstractInstruction * self_in_concretizeMoveRMbr) +{ + sqInt aWord; + usqIntptr_t destReg; + sqInt offset; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRMbr->operands))[0]; + offset = ((self_in_concretizeMoveRMbr->operands))[1]; + destReg = ((self_in_concretizeMoveRMbr->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = sbRbaseoffset(self_in_concretizeMoveRMbr, srcReg, destReg, offset); + ((self_in_concretizeMoveRMbr->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRMbr->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveRMwr */ +static usqInt NoDbgRegParms +concretizeMoveRMwr(AbstractInstruction * self_in_concretizeMoveRMwr) +{ + sqInt aWord; + usqIntptr_t baseReg; + sqInt offset; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRMwr->operands))[0]; + offset = ((self_in_concretizeMoveRMwr->operands))[1]; + baseReg = ((self_in_concretizeMoveRMwr->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = swRbaseoffset(self_in_concretizeMoveRMwr, srcReg, baseReg, offset); + ((self_in_concretizeMoveRMwr->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRMwr->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveRR */ +static usqInt NoDbgRegParms +concretizeMoveRR(AbstractInstruction * self_in_concretizeMoveRR) +{ + sqInt aWord; + usqIntptr_t destReg; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRR->operands))[0]; + destReg = ((self_in_concretizeMoveRR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeMoveRR, destReg, srcReg, ZR); + ((self_in_concretizeMoveRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeMoveRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeMoveRXbrR */ +static usqInt NoDbgRegParms +concretizeMoveRXbrR(AbstractInstruction * self_in_concretizeMoveRXbrR) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t baseReg; + usqIntptr_t indexReg; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRXbrR->operands))[0]; + indexReg = ((self_in_concretizeMoveRXbrR->operands))[1]; + baseReg = ((self_in_concretizeMoveRXbrR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeMoveRXbrR, AT, baseReg, indexReg); + ((self_in_concretizeMoveRXbrR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = sbRbaseoffset(self_in_concretizeMoveRXbrR, srcReg, AT, 0); + ((self_in_concretizeMoveRXbrR->machineCode))[4 / 4] = aWord1; + return ((self_in_concretizeMoveRXbrR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeMoveRXwrR */ +static usqInt NoDbgRegParms +concretizeMoveRXwrR(AbstractInstruction * self_in_concretizeMoveRXwrR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + usqIntptr_t baseReg; + usqIntptr_t indexReg; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizeMoveRXwrR->operands))[0]; + indexReg = ((self_in_concretizeMoveRXwrR->operands))[1]; + baseReg = ((self_in_concretizeMoveRXwrR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = sllRRC(self_in_concretizeMoveRXwrR, AT, indexReg, 2); + ((self_in_concretizeMoveRXwrR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = adduRRR(self_in_concretizeMoveRXwrR, AT, baseReg, AT); + ((self_in_concretizeMoveRXwrR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = swRbaseoffset(self_in_concretizeMoveRXwrR, srcReg, AT, 0); + ((self_in_concretizeMoveRXwrR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeMoveRXwrR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMoveXbrRR */ +static usqInt NoDbgRegParms +concretizeMoveXbrRR(AbstractInstruction * self_in_concretizeMoveXbrRR) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t baseReg; + usqIntptr_t destReg; + usqIntptr_t indexReg; + + + /* index is number of *bytes* */ + indexReg = ((self_in_concretizeMoveXbrRR->operands))[0]; + baseReg = ((self_in_concretizeMoveXbrRR->operands))[1]; + destReg = ((self_in_concretizeMoveXbrRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeMoveXbrRR, AT, baseReg, indexReg); + ((self_in_concretizeMoveXbrRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = lbuRbaseoffset(self_in_concretizeMoveXbrRR, destReg, AT, 0); + ((self_in_concretizeMoveXbrRR->machineCode))[4 / 4] = aWord1; + return ((self_in_concretizeMoveXbrRR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeMoveXwrRR */ +static usqInt NoDbgRegParms +concretizeMoveXwrRR(AbstractInstruction * self_in_concretizeMoveXwrRR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + usqIntptr_t baseReg; + usqIntptr_t destReg; + usqIntptr_t indexReg; + + indexReg = ((self_in_concretizeMoveXwrRR->operands))[0]; + baseReg = ((self_in_concretizeMoveXwrRR->operands))[1]; + destReg = ((self_in_concretizeMoveXwrRR->operands))[2]; + /* begin machineCodeAt:put: */ + aWord = sllRRC(self_in_concretizeMoveXwrRR, AT, indexReg, 2); + ((self_in_concretizeMoveXwrRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = adduRRR(self_in_concretizeMoveXwrRR, AT, baseReg, AT); + ((self_in_concretizeMoveXwrRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = lwRbaseoffset(self_in_concretizeMoveXwrRR, destReg, AT, 0); + ((self_in_concretizeMoveXwrRR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeMoveXwrRR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeMulCheckOverflowRR */ +static usqInt NoDbgRegParms +concretizeMulCheckOverflowRR(AbstractInstruction * self_in_concretizeMulCheckOverflowRR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeMulCheckOverflowRR->operands))[0]; + + /* Overflow occured if the sign bit of the low part is different from the high part. */ + destReg = (leftReg = ((self_in_concretizeMulCheckOverflowRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = multRR(self_in_concretizeMulCheckOverflowRR, leftReg, rightReg); + ((self_in_concretizeMulCheckOverflowRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = mfloR(self_in_concretizeMulCheckOverflowRR, destReg); + ((self_in_concretizeMulCheckOverflowRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = sraRRC(self_in_concretizeMulCheckOverflowRR, OverflowTemp1, destReg, 0x1F); + ((self_in_concretizeMulCheckOverflowRR->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = mfhiR(self_in_concretizeMulCheckOverflowRR, OverflowTemp2); + ((self_in_concretizeMulCheckOverflowRR->machineCode))[12 / 4] = aWord3; + return ((self_in_concretizeMulCheckOverflowRR->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizeNegateR */ +static usqInt NoDbgRegParms +concretizeNegateR(AbstractInstruction * self_in_concretizeNegateR) +{ + sqInt aWord; + usqIntptr_t reg; + + reg = ((self_in_concretizeNegateR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = subuRRR(self_in_concretizeNegateR, reg, ZR, reg); + ((self_in_concretizeNegateR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeNegateR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeNop */ +static usqInt NoDbgRegParms +concretizeNop(AbstractInstruction * self_in_concretizeNop) +{ + /* begin machineCodeAt:put: */ + ((self_in_concretizeNop->machineCode))[0 / 4] = 0; + return ((self_in_concretizeNop->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeOrCqR */ +static usqInt NoDbgRegParms +concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeOrCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeOrCqR->operands))[1]); + if (!(((rightImm >= 0) && (rightImm <= 0xFFFF)))) { + return concretizeOrCwR(self_in_concretizeOrCqR); + } + /* begin machineCodeAt:put: */ + aWord = oriRRC(self_in_concretizeOrCqR, destReg, leftReg, rightImm); + ((self_in_concretizeOrCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeOrCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeOrCwR */ +static usqInt NoDbgRegParms +concretizeOrCwR(AbstractInstruction * self_in_concretizeOrCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeOrCwR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeOrCwR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeOrCwR, AT, high16BitsOf(self_in_concretizeOrCwR, rightImm)); + ((self_in_concretizeOrCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeOrCwR, AT, AT, low16BitsOf(self_in_concretizeOrCwR, rightImm)); + ((self_in_concretizeOrCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = orRRR(self_in_concretizeOrCwR, destReg, leftReg, AT); + ((self_in_concretizeOrCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeOrCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeOrRR */ +static usqInt NoDbgRegParms +concretizeOrRR(AbstractInstruction * self_in_concretizeOrRR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeOrRR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeOrRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = orRRR(self_in_concretizeOrRR, destReg, leftReg, rightReg); + ((self_in_concretizeOrRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeOrRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizePopR */ +static usqInt NoDbgRegParms +concretizePopR(AbstractInstruction * self_in_concretizePopR) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t destReg; + + destReg = ((self_in_concretizePopR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = lwRbaseoffset(self_in_concretizePopR, destReg, SP, 0); + ((self_in_concretizePopR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = addiuRRC(self_in_concretizePopR, SP, SP, 4); + ((self_in_concretizePopR->machineCode))[4 / 4] = aWord1; + return ((self_in_concretizePopR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizePrefetchAw */ +static usqInt NoDbgRegParms +concretizePrefetchAw(AbstractInstruction * self_in_concretizePrefetchAw) +{ + usqIntptr_t addressOperand; + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + + addressOperand = ((self_in_concretizePrefetchAw->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizePrefetchAw, AT, high16BitsOf(self_in_concretizePrefetchAw, addressOperand)); + ((self_in_concretizePrefetchAw->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizePrefetchAw, AT, AT, low16BitsOf(self_in_concretizePrefetchAw, addressOperand)); + ((self_in_concretizePrefetchAw->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = prefRoffsethint(self_in_concretizePrefetchAw, AT, 0, HintLoad); + ((self_in_concretizePrefetchAw->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizePrefetchAw->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizePushCq */ +static usqInt NoDbgRegParms +concretizePushCq(AbstractInstruction * self_in_concretizePushCq) +{ + return concretizePushCw(self_in_concretizePushCq); +} + + /* CogMIPSELCompiler>>#concretizePushCw */ +static usqInt NoDbgRegParms +concretizePushCw(AbstractInstruction * self_in_concretizePushCw) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + usqIntptr_t value; + + value = ((self_in_concretizePushCw->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizePushCw, AT, high16BitsOf(self_in_concretizePushCw, value)); + ((self_in_concretizePushCw->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizePushCw, AT, AT, low16BitsOf(self_in_concretizePushCw, value)); + ((self_in_concretizePushCw->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = addiuRRC(self_in_concretizePushCw, SP, SP, -4); + ((self_in_concretizePushCw->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = swRbaseoffset(self_in_concretizePushCw, AT, SP, 0); + ((self_in_concretizePushCw->machineCode))[12 / 4] = aWord3; + return ((self_in_concretizePushCw->machineCodeSize) = 16); +} + + /* CogMIPSELCompiler>>#concretizePushR */ +static usqInt NoDbgRegParms +concretizePushR(AbstractInstruction * self_in_concretizePushR) +{ + sqInt aWord; + sqInt aWord1; + usqIntptr_t srcReg; + + srcReg = ((self_in_concretizePushR->operands))[0]; + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizePushR, SP, SP, -4); + ((self_in_concretizePushR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = swRbaseoffset(self_in_concretizePushR, srcReg, SP, 0); + ((self_in_concretizePushR->machineCode))[4 / 4] = aWord1; + return ((self_in_concretizePushR->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeRetN */ +static usqInt NoDbgRegParms +concretizeRetN(AbstractInstruction * self_in_concretizeRetN) +{ + sqInt aWord; + sqInt aWord1; + sqInt offset; + + offset = ((self_in_concretizeRetN->operands))[0]; + /* begin machineCodeAt:put: */ + aWord1 = jR(self_in_concretizeRetN, RA); + ((self_in_concretizeRetN->machineCode))[0 / 4] = aWord1; + if (offset == 0) { + /* begin machineCodeAt:put: */ + ((self_in_concretizeRetN->machineCode))[4 / 4] = 0; + } + else { + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizeRetN, SP, SP, offset); + ((self_in_concretizeRetN->machineCode))[4 / 4] = aWord; + } + return ((self_in_concretizeRetN->machineCodeSize) = 8); +} + + /* CogMIPSELCompiler>>#concretizeStop */ +static usqInt NoDbgRegParms +concretizeStop(AbstractInstruction * self_in_concretizeStop) +{ + sqInt aWord; + + /* begin machineCodeAt:put: */ + aWord = stop(self_in_concretizeStop); + ((self_in_concretizeStop->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeStop->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeSubCheckOverflowCqR */ +static usqInt NoDbgRegParms +concretizeSubCheckOverflowCqR(AbstractInstruction * self_in_concretizeSubCheckOverflowCqR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt aWord4; + sqInt aWord5; + sqInt aWord6; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeSubCheckOverflowCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeSubCheckOverflowCqR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeSubCheckOverflowCqR, AT, high16BitsOf(self_in_concretizeSubCheckOverflowCqR, rightImm)); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeSubCheckOverflowCqR, AT, AT, low16BitsOf(self_in_concretizeSubCheckOverflowCqR, rightImm)); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = adduRRR(self_in_concretizeSubCheckOverflowCqR, OverflowTemp1, leftReg, ZR); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = subuRRR(self_in_concretizeSubCheckOverflowCqR, destReg, leftReg, AT); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[12 / 4] = aWord3; + /* begin machineCodeAt:put: */ + aWord4 = xorRRR(self_in_concretizeSubCheckOverflowCqR, OverflowTemp2, destReg, AT); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[16 / 4] = aWord4; + /* begin machineCodeAt:put: */ + aWord5 = xorRRR(self_in_concretizeSubCheckOverflowCqR, OverflowTemp1, destReg, OverflowTemp1); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[20 / 4] = aWord5; + /* begin machineCodeAt:put: */ + aWord6 = andRRR(self_in_concretizeSubCheckOverflowCqR, Overflow, OverflowTemp1, OverflowTemp2); + ((self_in_concretizeSubCheckOverflowCqR->machineCode))[24 / 4] = aWord6; + return ((self_in_concretizeSubCheckOverflowCqR->machineCodeSize) = 28); +} + + /* CogMIPSELCompiler>>#concretizeSubCheckOverflowRR */ +static usqInt NoDbgRegParms +concretizeSubCheckOverflowRR(AbstractInstruction * self_in_concretizeSubCheckOverflowRR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt aWord3; + sqInt aWord4; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeSubCheckOverflowRR->operands))[0]; + + /* Save original LHS */ + destReg = (leftReg = ((self_in_concretizeSubCheckOverflowRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = adduRRR(self_in_concretizeSubCheckOverflowRR, OverflowTemp1, leftReg, ZR); + ((self_in_concretizeSubCheckOverflowRR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = subuRRR(self_in_concretizeSubCheckOverflowRR, destReg, leftReg, rightReg); + ((self_in_concretizeSubCheckOverflowRR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = xorRRR(self_in_concretizeSubCheckOverflowRR, OverflowTemp2, destReg, rightReg); + ((self_in_concretizeSubCheckOverflowRR->machineCode))[8 / 4] = aWord2; + /* begin machineCodeAt:put: */ + aWord3 = xorRRR(self_in_concretizeSubCheckOverflowRR, OverflowTemp1, destReg, OverflowTemp1); + ((self_in_concretizeSubCheckOverflowRR->machineCode))[12 / 4] = aWord3; + /* begin machineCodeAt:put: */ + aWord4 = andRRR(self_in_concretizeSubCheckOverflowRR, Overflow, OverflowTemp1, OverflowTemp2); + ((self_in_concretizeSubCheckOverflowRR->machineCode))[16 / 4] = aWord4; + return ((self_in_concretizeSubCheckOverflowRR->machineCodeSize) = 20); +} + + /* CogMIPSELCompiler>>#concretizeSubCqR */ +static usqInt NoDbgRegParms +concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeSubCqR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeSubCqR->operands))[1]); + if (!((((-rightImm) >= -32768) && ((-rightImm) <= 0x7FFF)))) { + return concretizeSubCwR(self_in_concretizeSubCqR); + } + /* begin machineCodeAt:put: */ + aWord = addiuRRC(self_in_concretizeSubCqR, destReg, leftReg, -rightImm); + ((self_in_concretizeSubCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeSubCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeSubCwR */ +static usqInt NoDbgRegParms +concretizeSubCwR(AbstractInstruction * self_in_concretizeSubCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeSubCwR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeSubCwR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeSubCwR, AT, high16BitsOf(self_in_concretizeSubCwR, rightImm)); + ((self_in_concretizeSubCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeSubCwR, AT, AT, low16BitsOf(self_in_concretizeSubCwR, rightImm)); + ((self_in_concretizeSubCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = subuRRR(self_in_concretizeSubCwR, destReg, leftReg, AT); + ((self_in_concretizeSubCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeSubCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeSubRR */ +static usqInt NoDbgRegParms +concretizeSubRR(AbstractInstruction * self_in_concretizeSubRR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeSubRR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeSubRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = subuRRR(self_in_concretizeSubRR, destReg, leftReg, rightReg); + ((self_in_concretizeSubRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeSubRR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeTstCqR */ +static usqInt NoDbgRegParms +concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR) +{ + sqInt aWord; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeTstCqR->operands))[0]; + leftReg = ((self_in_concretizeTstCqR->operands))[1]; + if (!(((rightImm >= -32768) && (rightImm <= 0x7FFF)))) { + return concretizeTstCwR(self_in_concretizeTstCqR); + } + /* begin machineCodeAt:put: */ + aWord = andiRRC(self_in_concretizeTstCqR, Cmp, leftReg, rightImm); + ((self_in_concretizeTstCqR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeTstCqR->machineCodeSize) = 4); +} + + /* CogMIPSELCompiler>>#concretizeTstCwR */ +static usqInt NoDbgRegParms +concretizeTstCwR(AbstractInstruction * self_in_concretizeTstCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeTstCwR->operands))[0]; + leftReg = ((self_in_concretizeTstCwR->operands))[1]; + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeTstCwR, AT, high16BitsOf(self_in_concretizeTstCwR, rightImm)); + ((self_in_concretizeTstCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeTstCwR, AT, AT, low16BitsOf(self_in_concretizeTstCwR, rightImm)); + ((self_in_concretizeTstCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = andRRR(self_in_concretizeTstCwR, Cmp, leftReg, AT); + ((self_in_concretizeTstCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeTstCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeUnimplemented */ +static sqInt NoDbgRegParms +concretizeUnimplemented(AbstractInstruction * self_in_concretizeUnimplemented) +{ + error("Unimplemented RTL instruction"); + return 0; +} + + /* CogMIPSELCompiler>>#concretizeXorCwR */ +static usqInt NoDbgRegParms +concretizeXorCwR(AbstractInstruction * self_in_concretizeXorCwR) +{ + sqInt aWord; + sqInt aWord1; + sqInt aWord2; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightImm; + + rightImm = ((self_in_concretizeXorCwR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeXorCwR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = luiRC(self_in_concretizeXorCwR, AT, high16BitsOf(self_in_concretizeXorCwR, rightImm)); + ((self_in_concretizeXorCwR->machineCode))[0 / 4] = aWord; + /* begin machineCodeAt:put: */ + aWord1 = oriRRC(self_in_concretizeXorCwR, AT, AT, low16BitsOf(self_in_concretizeXorCwR, rightImm)); + ((self_in_concretizeXorCwR->machineCode))[4 / 4] = aWord1; + /* begin machineCodeAt:put: */ + aWord2 = xorRRR(self_in_concretizeXorCwR, destReg, leftReg, AT); + ((self_in_concretizeXorCwR->machineCode))[8 / 4] = aWord2; + return ((self_in_concretizeXorCwR->machineCodeSize) = 12); +} + + /* CogMIPSELCompiler>>#concretizeXorRR */ +static usqInt NoDbgRegParms +concretizeXorRR(AbstractInstruction * self_in_concretizeXorRR) +{ + sqInt aWord; + sqInt destReg; + usqIntptr_t leftReg; + usqIntptr_t rightReg; + + rightReg = ((self_in_concretizeXorRR->operands))[0]; + destReg = (leftReg = ((self_in_concretizeXorRR->operands))[1]); + /* begin machineCodeAt:put: */ + aWord = xorRRR(self_in_concretizeXorRR, destReg, leftReg, rightReg); + ((self_in_concretizeXorRR->machineCode))[0 / 4] = aWord; + return ((self_in_concretizeXorRR->machineCodeSize) = 4); +} + + +/* Attempt to generate concrete machine code for the instruction at address. + This is the inner dispatch of concretizeAt: actualAddress which exists + only to get around the branch size limits in the SqueakV3 (blue book + derived) bytecode set. */ + + /* CogMIPSELCompiler>>#dispatchConcretize */ +static void NoDbgRegParms +dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) +{ + AbstractInstruction *dependentChain; + + + switch ((self_in_dispatchConcretize->opcode)) { + case BrEqualRR: + concretizeBrEqualRR(self_in_dispatchConcretize); + return; + + case BrNotEqualRR: + concretizeBrNotEqualRR(self_in_dispatchConcretize); + return; + + case BrUnsignedLessRR: + concretizeBrUnsignedLessRR(self_in_dispatchConcretize); + return; + + case BrUnsignedLessEqualRR: + concretizeBrUnsignedLessEqualRR(self_in_dispatchConcretize); + return; + + case BrUnsignedGreaterRR: + concretizeBrUnsignedGreaterRR(self_in_dispatchConcretize); + return; + + case BrUnsignedGreaterEqualRR: + concretizeBrUnsignedGreaterEqualRR(self_in_dispatchConcretize); + return; + + case BrSignedLessRR: + concretizeBrSignedLessRR(self_in_dispatchConcretize); + return; + + case BrSignedLessEqualRR: + concretizeBrSignedLessEqualRR(self_in_dispatchConcretize); + return; + + case BrSignedGreaterRR: + concretizeBrSignedGreaterRR(self_in_dispatchConcretize); + return; + + case BrSignedGreaterEqualRR: + concretizeBrSignedGreaterEqualRR(self_in_dispatchConcretize); + return; + + case BrLongEqualRR: + concretizeBrLongEqualRR(self_in_dispatchConcretize); + return; + + case BrLongNotEqualRR: + concretizeBrLongNotEqualRR(self_in_dispatchConcretize); + return; + + case MulRR: + case JumpNegative: + case JumpNonNegative: + case JumpCarry: + case JumpNoCarry: + case JumpFPEqual: + case JumpFPNotEqual: + case JumpFPLess: + case JumpFPGreaterOrEqual: + case JumpFPGreater: + case JumpFPLessOrEqual: + case JumpFPOrdered: + case JumpFPUnordered: + case XorCqR: + case AddRdRd: + case CmpRdRd: + case DivRdRd: + case MulRdRd: + case SubRdRd: + case SqrtRd: + case MoveRMbr: + case MoveM64rRd: + case MoveRdM64r: + case ConvertRRd: + concretizeUnimplemented(self_in_dispatchConcretize); + return; + + case DivRR: + concretizeDivRR(self_in_dispatchConcretize); + return; + + case MoveLowR: + concretizeMoveLowR(self_in_dispatchConcretize); + return; + + case MoveHighR: + concretizeMoveHighR(self_in_dispatchConcretize); + return; + + case Label: + /* begin concretizeLabel */ + dependentChain = (self_in_dispatchConcretize->dependent); + while (!(dependentChain == null)) { + updateLabel(dependentChain, self_in_dispatchConcretize); + dependentChain = (dependentChain->dependent); + } + (self_in_dispatchConcretize->machineCodeSize) = 0; + return; + + case AlignmentNops: + concretizeAlignmentNops(self_in_dispatchConcretize); + return; + + case Fill32: + concretizeFill32(self_in_dispatchConcretize); + return; + + case Nop: + concretizeNop(self_in_dispatchConcretize); + return; + + case Call: + concretizeCall(self_in_dispatchConcretize); + return; + + case CallFull: + concretizeCallFull(self_in_dispatchConcretize); + return; + + case JumpR: + concretizeJumpR(self_in_dispatchConcretize); + return; + + case JumpFull: + concretizeJumpFull(self_in_dispatchConcretize); + return; + + case JumpLong: + concretizeJumpLong(self_in_dispatchConcretize); + return; + + case JumpLongZero: + concretizeJumpLongZero(self_in_dispatchConcretize); + return; + + case JumpLongNonZero: + concretizeJumpLongNonZero(self_in_dispatchConcretize); + return; + + case Jump: + concretizeJump(self_in_dispatchConcretize); + return; + + case JumpZero: + concretizeJumpZero(self_in_dispatchConcretize); + return; + + case JumpNonZero: + concretizeJumpNonZero(self_in_dispatchConcretize); + return; + + case JumpOverflow: + concretizeJumpOverflow(self_in_dispatchConcretize); + return; + + case JumpNoOverflow: + concretizeJumpNoOverflow(self_in_dispatchConcretize); + return; + + case JumpLess: + concretizeJumpSignedLessThan(self_in_dispatchConcretize); + return; + + case JumpGreaterOrEqual: + concretizeJumpSignedGreaterEqual(self_in_dispatchConcretize); + return; + + case JumpGreater: + concretizeJumpSignedGreaterThan(self_in_dispatchConcretize); + return; + + case JumpLessOrEqual: + concretizeJumpSignedLessEqual(self_in_dispatchConcretize); + return; + + case JumpBelow: + concretizeJumpUnsignedLessThan(self_in_dispatchConcretize); + return; + + case JumpAboveOrEqual: + concretizeJumpUnsignedGreaterEqual(self_in_dispatchConcretize); + return; + + case JumpAbove: + concretizeJumpUnsignedGreaterThan(self_in_dispatchConcretize); + return; + + case JumpBelowOrEqual: + concretizeJumpUnsignedLessEqual(self_in_dispatchConcretize); + return; + + case RetN: + concretizeRetN(self_in_dispatchConcretize); + return; + + case Stop: + concretizeStop(self_in_dispatchConcretize); + return; + + case AddCqR: + concretizeAddCqR(self_in_dispatchConcretize); + return; + + case AndCqR: + concretizeAndCqR(self_in_dispatchConcretize); + return; + + case AndCqRR: + concretizeAndCqRR(self_in_dispatchConcretize); + return; + + case CmpCqR: + concretizeCmpCqR(self_in_dispatchConcretize); + return; + + case OrCqR: + concretizeOrCqR(self_in_dispatchConcretize); + return; + + case SubCqR: + concretizeSubCqR(self_in_dispatchConcretize); + return; + + case TstCqR: + concretizeTstCqR(self_in_dispatchConcretize); + return; + + case AddCwR: + concretizeAddCwR(self_in_dispatchConcretize); + return; + + case AndCwR: + concretizeAndCwR(self_in_dispatchConcretize); + return; + + case CmpCwR: + concretizeCmpCwR(self_in_dispatchConcretize); + return; + + case OrCwR: + concretizeOrCwR(self_in_dispatchConcretize); + return; + + case SubCwR: + concretizeSubCwR(self_in_dispatchConcretize); + return; + + case XorCwR: + concretizeXorCwR(self_in_dispatchConcretize); + return; + + case AddRR: + concretizeAddRR(self_in_dispatchConcretize); + return; + + case AndRR: + concretizeAndRR(self_in_dispatchConcretize); + return; + + case CmpRR: + concretizeCmpRR(self_in_dispatchConcretize); + return; + + case OrRR: + concretizeOrRR(self_in_dispatchConcretize); + return; + + case SubRR: + concretizeSubRR(self_in_dispatchConcretize); + return; + + case XorRR: + concretizeXorRR(self_in_dispatchConcretize); + return; + + case NegateR: + concretizeNegateR(self_in_dispatchConcretize); + return; + + case LoadEffectiveAddressMwrR: + concretizeLoadEffectiveAddressMwrR(self_in_dispatchConcretize); + return; + + case ArithmeticShiftRightCqR: + concretizeArithmeticShiftRightCqR(self_in_dispatchConcretize); + return; + + case LogicalShiftRightCqR: + concretizeLogicalShiftRightCqR(self_in_dispatchConcretize); + return; + + case LogicalShiftLeftCqR: + concretizeLogicalShiftLeftCqR(self_in_dispatchConcretize); + return; + + case ArithmeticShiftRightRR: + concretizeArithmeticShiftRightRR(self_in_dispatchConcretize); + return; + + case LogicalShiftLeftRR: + concretizeLogicalShiftLeftRR(self_in_dispatchConcretize); + return; + + case LogicalShiftRightRR: + concretizeLogicalShiftRightRR(self_in_dispatchConcretize); + return; + + case MoveCqR: + concretizeMoveCqR(self_in_dispatchConcretize); + return; + + case MoveCwR: + concretizeMoveCwR(self_in_dispatchConcretize); + return; + + case MoveRR: + concretizeMoveRR(self_in_dispatchConcretize); + return; + + case MoveAwR: + concretizeMoveAwR(self_in_dispatchConcretize); + return; + + case MoveRAw: + concretizeMoveRAw(self_in_dispatchConcretize); + return; + + case MoveAbR: + concretizeMoveAbR(self_in_dispatchConcretize); + return; + + case MoveRAb: + concretizeMoveRAb(self_in_dispatchConcretize); + return; + + case MoveMbrR: + concretizeMoveMbrR(self_in_dispatchConcretize); + return; + + case MoveM16rR: + concretizeMoveM16rR(self_in_dispatchConcretize); + return; + + case MoveRM16r: + concretizeMoveRM16r(self_in_dispatchConcretize); + return; + + case MoveMwrR: + concretizeMoveMwrR(self_in_dispatchConcretize); + return; + + case MoveXbrRR: + concretizeMoveXbrRR(self_in_dispatchConcretize); + return; + + case MoveRXbrR: + concretizeMoveRXbrR(self_in_dispatchConcretize); + return; + + case MoveXwrRR: + concretizeMoveXwrRR(self_in_dispatchConcretize); + return; + + case MoveRXwrR: + concretizeMoveRXwrR(self_in_dispatchConcretize); + return; + + case MoveRMwr: + concretizeMoveRMwr(self_in_dispatchConcretize); + return; + + case PopR: + concretizePopR(self_in_dispatchConcretize); + return; + + case PushR: + concretizePushR(self_in_dispatchConcretize); + return; + + case PushCq: + concretizePushCq(self_in_dispatchConcretize); + return; + + case PushCw: + concretizePushCw(self_in_dispatchConcretize); + return; + + case PrefetchAw: + concretizePrefetchAw(self_in_dispatchConcretize); + return; + + case AddCheckOverflowCqR: + concretizeAddCheckOverflowCqR(self_in_dispatchConcretize); + return; + + case AddCheckOverflowRR: + concretizeAddCheckOverflowRR(self_in_dispatchConcretize); + return; + + case SubCheckOverflowCqR: + concretizeSubCheckOverflowCqR(self_in_dispatchConcretize); + return; + + case SubCheckOverflowRR: + concretizeSubCheckOverflowRR(self_in_dispatchConcretize); + return; + + case MulCheckOverflowRR: + concretizeMulCheckOverflowRR(self_in_dispatchConcretize); + return; + + default: + error("Case not found and no otherwise clause"); + } + return; +} + + /* CogMIPSELCompiler>>#divR:R: */ +static sqInt NoDbgRegParms +divRR(AbstractInstruction * self_in_divRR, sqInt dividendReg, sqInt divisorReg) +{ + flag("todo"); + return rtypersrtrdsafunct(self_in_divRR, SPECIAL, dividendReg, divisorReg, 0, 0, DIV); +} + + +/* Answer if CallFull and/or JumpFull are relative and hence need relocating + on method + compation. If so, they are annotated with IsRelativeCall in methods and + relocated in + relocateIfCallOrMethodReference:mcpc:delta: */ + + /* CogMIPSELCompiler>>#fullCallsAreRelative */ +static sqInt NoDbgRegParms +fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative) +{ + return 0; +} + + /* CogMIPSELCompiler>>#functionAtAddress: */ +static sqInt NoDbgRegParms +functionAtAddress(AbstractInstruction * self_in_functionAtAddress, sqInt mcpc) +{ + return (longAt(mcpc)) & 0x3F; +} + + /* CogMIPSELCompiler>>#genDivR:R:Quo:Rem: */ +static sqInt NoDbgRegParms +genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder) +{ + genoperandoperand(DivRR, abstractRegDividend, abstractRegDivisor); + genoperand(MoveLowR, abstractRegQuotient); + genoperand(MoveHighR, abstractRegRemainder); + return 0; +} + + +/* Load the stack pointer register with that of the C stack, effecting + a switch to the C stack. Used when machine code calls into the + CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogMIPSELCompiler>>#genLoadCStackPointer */ +static sqInt NoDbgRegParms +genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer) +{ + sqInt address; + AbstractInstruction *anInstruction; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + return 0; +} + + +/* Load the frame and stack pointer registers with those of the C stack, + effecting a switch to the C stack. Used when machine code calls into + the CoInterpreter run-time (e.g. to invoke interpreter primitives). */ + + /* CogMIPSELCompiler>>#genLoadCStackPointers */ +static sqInt NoDbgRegParms +genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveAw:R: */ + address = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + /* begin MoveAw:R: */ + address1 = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, FPReg); + return 0; +} + + +/* Switch back to the Smalltalk stack. Assign SPReg first + because typically it is used immediately afterwards. */ + + /* CogMIPSELCompiler>>#genLoadStackPointers */ +static sqInt NoDbgRegParms +genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveAw:R: */ + address = stackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, SPReg); + /* begin MoveAw:R: */ + address1 = framePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, FPReg); + return 0; +} + + /* CogMIPSELCompiler>>#genMulR:R: */ +static AbstractInstruction * NoDbgRegParms +genMulRR(AbstractInstruction * self_in_genMulRR, sqInt regSource, sqInt regDest) +{ + return genoperandoperand(MulRR, regSource, regDest); +} + + +/* Ensure that the register args are pushed before the outer and + inner retpcs at an entry miss for arity <= self numRegArgs. The + outer retpc is that of a call at a send site. The inner is the call + from a method or PIC abort/miss to the trampoline. */ +/* Putting the receiver and args above the return address means the + CoInterpreter has a single machine-code frame format which saves + us a lot of work. */ +/* Iff there are register args convert + sp -> outerRetpc (send site retpc) + linkReg = innerRetpc (PIC abort/miss retpc) + to + base -> receiver + (arg0) + (arg1) + sp -> outerRetpc (send site retpc) + sp -> linkReg/innerRetpc (PIC abort/miss retpc) */ + + /* CogMIPSELCompiler>>#genPushRegisterArgsForAbortMissNumArgs: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + flag("inefficient"); + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); + if (numArgs > 0) { + /* begin PushR: */ + genoperand(PushR, Arg0Reg); + if (numArgs > 1) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + } + } + /* begin PushR: */ + genoperand(PushR, TempReg); + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + return self_in_genPushRegisterArgsForAbortMissNumArgs; +} + + +/* Ensure that the register args are pushed before the retpc for arity <= + self numRegArgs. + */ +/* This is easy on a RISC like ARM because the return address is in the link + register. Putting + the receiver and args above the return address means the CoInterpreter has + a single + machine-code frame format which saves us a lot of work + NOTA BENE: we do NOT push the return address here, which means it must be + dealt with later. */ + + /* CogMIPSELCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) +{ + flag("inefficient"); + if (numArgs <= 2) { + assert((numRegArgs()) <= 2); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + if (numArgs > 0) { + /* begin PushR: */ + genoperand(PushR, Arg0Reg); + if (numArgs > 1) { + /* begin PushR: */ + genoperand(PushR, Arg1Reg); + } + } + } + return self_in_genPushRegisterArgsForNumArgsscratchReg; +} + + +/* This is a no-op on MIPS since the ABI passes up to 4 args in registers and + trampolines currently observe that limit. + */ + + /* CogMIPSELCompiler>>#genRemoveNArgsFromStack: */ +static sqInt NoDbgRegParms +genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) +{ + assert(n <= 4); + return 0; +} + + +/* Restore the general purpose registers except for abstractReg for a + trampoline call. + */ + + /* CogMIPSELCompiler>>#genRestoreRegsExcept: */ +static AbstractInstruction * NoDbgRegParms +genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) +{ + flag("bogus"); + return self_in_genRestoreRegsExcept; +} + + +/* Restore the registers in regMask as saved by genSaveRegs:. + We don't need to do anything because all of the abstract registers are + allocated to C preserved registers. But for the future... */ + + /* CogMIPSELCompiler>>#genRestoreRegs: */ +static sqInt NoDbgRegParms +genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs, sqInt regMask) +{ + sqInt reg; + + assert(regMask == 0); + assert(!((regMask & (registerMaskForandand(SP, FP, RA))))); + for (reg = R0; reg <= R28; reg += 1) { + if (regMask & (1U << reg)) { + /* begin PopR: */ + genoperand(PopR, reg); + } + } + return 0; +} + + +/* Save the registers in regMask for a call into the C run-time from a + trampoline. We don't need to do anything because all of the abstract + registers are + allocated to C preserved registers. But for the future... */ + + /* CogMIPSELCompiler>>#genSaveRegs: */ +static sqInt NoDbgRegParms +genSaveRegs(AbstractInstruction * self_in_genSaveRegs, sqInt regMask) +{ + sqInt reg; + + assert(regMask == 0); + assert(!((regMask & (registerMaskForandand(SP, FP, RA))))); + for (reg = R28; reg >= R0; reg += -1) { + if (regMask & (1U << reg)) { + /* begin PushR: */ + genoperand(PushR, reg); + } + } + return 0; +} + + +/* Save the frame and stack pointer registers to the framePointer + and stackPointer variables. Used to save the machine code frame + for use by the run-time when calling into the CoInterpreter run-time. */ + + /* CogMIPSELCompiler>>#genSaveStackPointers */ +static sqInt NoDbgRegParms +genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveR:Aw: */ + address = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, FPReg, address); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, SPReg, address1); + return 0; +} + + /* CogMIPSELCompiler>>#genSubstituteReturnAddress: */ +static AbstractInstruction * NoDbgRegParms +genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, retpc, RA); + return anInstruction; +} + + /* CogMIPSELCompiler>>#high16BitsOf: */ +static usqInt NoDbgRegParms +high16BitsOf(AbstractInstruction * self_in_high16BitsOf, usqInt word) +{ + return ((usqInt) word) >> 16; +} + + +/* Answer the inline cache tag for the return address of a send. */ +/* MoveCwR ClassReg selectorIndex/expectedClass + Call: unlinked send stub/expectedTarget + Push ReceiverResult <-- callSiteReturnAddress */ +/* lui s3, selector/tagHigh + ori s3, s3, selector/tagLow + lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jalr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#inlineCacheTagAt: */ +static usqInt NoDbgRegParms +inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, usqInt callSiteReturnAddress) +{ + assert((opcodeAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 24)) == LUI); + assert((opcodeAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 20)) == ORI); + assert((opcodeAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_inlineCacheTagAt))); + return literalAtAddress(self_in_inlineCacheTagAt, callSiteReturnAddress - 20); +} + + +/* Answer the instruction size at pc. */ + + /* CogMIPSELCompiler>>#instructionSizeAt: */ +static sqInt NoDbgRegParms +instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc) +{ + return 4; +} + + +/* Support for addressing variables off the dedicated VarBaseReg */ + + /* CogMIPSELCompiler>>#isAddressRelativeToVarBase: */ +static sqInt NoDbgRegParms +isAddressRelativeToVarBase(AbstractInstruction * self_in_isAddressRelativeToVarBase, usqInt varAddress) +{ + return (varAddress != null) + && ((((varBaseAddress()) - (1U << 15)) < varAddress) + && (varAddress < ((varBaseAddress()) + (1U << 15)))); +} + + +/* Assuming mcpc is a send return pc answer if the instruction before it is a + call (not a CallFull). + */ +/* cogit disassembleFrom: mcpc - 8 to: mcpc. */ + + /* CogMIPSELCompiler>>#isCallPrecedingReturnPC: */ +static sqInt NoDbgRegParms +isCallPrecedingReturnPC(AbstractInstruction * self_in_isCallPrecedingReturnPC, sqInt mcpc) +{ + if ((opcodeAtAddress(self_in_isCallPrecedingReturnPC, mcpc - 8)) == JAL) { + return 1; + } + if (((opcodeAtAddress(self_in_isCallPrecedingReturnPC, mcpc - 8)) == SPECIAL) + && ((functionAtAddress(self_in_isCallPrecedingReturnPC, mcpc - 8)) == JALR)) { + return 1; + } + return 0; +} + + /* CogMIPSELCompiler>>#isJump */ +static sqInt NoDbgRegParms +isJump(AbstractInstruction * self_in_isJump) +{ + return (((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump))) + || (((((self_in_isJump->opcode)) >= BrEqualRR) && (((self_in_isJump->opcode)) <= BrLongNotEqualRR))); +} + + +/* cogit disassembleFrom: pc to: pc + 4. */ + + /* CogMIPSELCompiler>>#isJumpAt: */ +static sqInt NoDbgRegParms +isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc) +{ + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == J) { + return 1; + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == SPECIAL) { + if ((functionAtAddress(self_in_isJumpAt, pc)) == JR) { + return 1; + } + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == BEQ) { + return 1; + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == BNE) { + return 1; + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == BLEZ) { + return 1; + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == BGTZ) { + return 1; + } + if ((opcodeAtAddress(self_in_isJumpAt, pc)) == REGIMM) { + if ((rtAtAddress(self_in_isJumpAt, pc)) == BLTZ) { + return 1; + } + if ((rtAtAddress(self_in_isJumpAt, pc)) == BGEZ) { + return 1; + } + } + return 0; +} + + +/* Answer if the receiver is a pc-dependent instruction. */ + + /* CogMIPSELCompiler>>#isPCDependent */ +static sqInt NoDbgRegParms +isPCDependent(AbstractInstruction * self_in_isPCDependent) +{ + return (isJump(self_in_isPCDependent)) + || (((self_in_isPCDependent->opcode)) == AlignmentNops); +} + + /* CogMIPSELCompiler>>#isShortOffset: */ +static sqInt NoDbgRegParms +isShortOffset(AbstractInstruction * self_in_isShortOffset, sqInt offset) +{ + return ((offset >= -32768) && (offset <= 0x7FFF)); +} + + /* CogMIPSELCompiler>>#itype:rs:rt:eitherImmediate: */ +static sqInt NoDbgRegParms +itypersrteitherImmediate(AbstractInstruction * self_in_itypersrteitherImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate) +{ + assert(((op >= 0) && (op <= 0x3F))); + assert(((rs >= 0) && (rs <= 0x1F))); + assert(((rt >= 0) && (rt <= 0x1F))); + return (((((sqInt)((usqInt)(op) << 26))) | (((sqInt)((usqInt)(rs) << 21)))) | (((sqInt)((usqInt)(rt) << 16)))) | (immediate & 0xFFFF); +} + + /* CogMIPSELCompiler>>#itype:rs:rt:signedImmediate: */ +static sqInt NoDbgRegParms +itypersrtsignedImmediate(AbstractInstruction * self_in_itypersrtsignedImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate) +{ + assert(((op >= 0) && (op <= 0x3F))); + assert(((rs >= 0) && (rs <= 0x1F))); + assert(((rt >= 0) && (rt <= 0x1F))); + assert(((immediate >= -32768) && (immediate <= 0x7FFF))); + return (((((sqInt)((usqInt)(op) << 26))) | (((sqInt)((usqInt)(rs) << 21)))) | (((sqInt)((usqInt)(rt) << 16)))) | (immediate & 0xFFFF); +} + + /* CogMIPSELCompiler>>#itype:rs:rt:unsignedImmediate: */ +static sqInt NoDbgRegParms +itypersrtunsignedImmediate(AbstractInstruction * self_in_itypersrtunsignedImmediate, sqInt op, sqInt rs, sqInt rt, sqInt immediate) +{ + assert(((op >= 0) && (op <= 0x3F))); + assert(((rs >= 0) && (rs <= 0x1F))); + assert(((rt >= 0) && (rt <= 0x1F))); + assert(((immediate >= 0) && (immediate <= 0xFFFF))); + return (((((sqInt)((usqInt)(op) << 26))) | (((sqInt)((usqInt)(rs) << 21)))) | (((sqInt)((usqInt)(rt) << 16)))) | immediate; +} + + /* CogMIPSELCompiler>>#jA: */ +static sqInt NoDbgRegParms +jA(AbstractInstruction * self_in_jA, sqInt target) +{ + assert((target & 3) == 0); + return jtypetarget(self_in_jA, J, ((usqInt) (target & 0xFFFFFFF)) >> 2); +} + + /* CogMIPSELCompiler>>#jalA: */ +static sqInt NoDbgRegParms +jalA(AbstractInstruction * self_in_jalA, sqInt target) +{ + assert((target & 3) == 0); + return jtypetarget(self_in_jalA, JAL, ((usqInt) (target & 0xFFFFFFF)) >> 2); +} + + /* CogMIPSELCompiler>>#jalR: */ +static sqInt NoDbgRegParms +jalR(AbstractInstruction * self_in_jalR, sqInt targetReg) +{ + return rtypersrtrdsafunct(self_in_jalR, SPECIAL, targetReg, 0, RA, 0, JALR); +} + + /* CogMIPSELCompiler>>#jR: */ +static sqInt NoDbgRegParms +jR(AbstractInstruction * self_in_jR, sqInt targetReg) +{ + return rtypersrtrdsafunct(self_in_jR, SPECIAL, targetReg, 0, 0, 0, JR); +} + + /* CogMIPSELCompiler>>#jtype:target: */ +static sqInt NoDbgRegParms +jtypetarget(AbstractInstruction * self_in_jtypetarget, sqInt op, sqInt target) +{ + assert(((op >= 0) && (op <= 0x3F))); + assert(((target >= 0) && (target <= 0x7FFFFFF))); + return (((sqInt)((usqInt)(op) << 26))) | target; +} + + /* CogMIPSELCompiler>>#jumpLongByteSize */ +static sqInt NoDbgRegParms +jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize) +{ + flag("bogus"); + return 16; +} + + /* CogMIPSELCompiler>>#jumpLongConditionalByteSize */ +static sqInt NoDbgRegParms +jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize) +{ + return 16; +} + + +/* mcpc - 16: beq/ne Cmp, ZR, +12 + mcpc - 12: nop (delay slot) + mcpc - 8: j psuedo-address + mcpc - 4: nop (delay slot) */ + + /* CogMIPSELCompiler>>#jumpLongConditionalTargetBeforeFollowingAddress: */ +static usqInt NoDbgRegParms +jumpLongConditionalTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongConditionalTargetBeforeFollowingAddress, sqInt mcpc) +{ + assert(((opcodeAtAddress(self_in_jumpLongConditionalTargetBeforeFollowingAddress, mcpc - 16)) == BEQ) + || ((opcodeAtAddress(self_in_jumpLongConditionalTargetBeforeFollowingAddress, mcpc - 16)) == BNE)); + assert((longAt(mcpc - 12)) == (nop(self_in_jumpLongConditionalTargetBeforeFollowingAddress))); + assert((opcodeAtAddress(self_in_jumpLongConditionalTargetBeforeFollowingAddress, mcpc - 8)) == J); + assert((longAt(mcpc - 4)) == (nop(self_in_jumpLongConditionalTargetBeforeFollowingAddress))); + return targetFromJTypeAtAddress(self_in_jumpLongConditionalTargetBeforeFollowingAddress, mcpc - 8); +} + + +/* Answer the target address for the long jump immediately preceding mcpc */ + + /* CogMIPSELCompiler>>#jumpLongTargetBeforeFollowingAddress: */ +static usqInt NoDbgRegParms +jumpLongTargetBeforeFollowingAddress(AbstractInstruction * self_in_jumpLongTargetBeforeFollowingAddress, sqInt mcpc) +{ + assert((longAt(mcpc - 4)) == (nop(self_in_jumpLongTargetBeforeFollowingAddress))); + assert((opcodeAtAddress(self_in_jumpLongTargetBeforeFollowingAddress, mcpc - 8)) == SPECIAL); + assert((functionAtAddress(self_in_jumpLongTargetBeforeFollowingAddress, mcpc - 8)) == JR); + return literalAtAddress(self_in_jumpLongTargetBeforeFollowingAddress, mcpc - 12); +} + + /* CogMIPSELCompiler>>#jumpShortByteSize */ +static sqInt NoDbgRegParms +jumpShortByteSize(AbstractInstruction * self_in_jumpShortByteSize) +{ + return 8; +} + + +/* cogit disassembleFrom: pc to: pc + 4. */ + + /* CogMIPSELCompiler>>#jumpTargetPCAt: */ +static usqInt NoDbgRegParms +jumpTargetPCAt(AbstractInstruction * self_in_jumpTargetPCAt, sqInt pc) +{ + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == J) { + return targetFromJTypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == BEQ) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == BNE) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == BLEZ) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == BGTZ) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((opcodeAtAddress(self_in_jumpTargetPCAt, pc)) == REGIMM) { + if ((rtAtAddress(self_in_jumpTargetPCAt, pc)) == BLTZ) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + if ((rtAtAddress(self_in_jumpTargetPCAt, pc)) == BGEZ) { + return targetFromITypeAtAddress(self_in_jumpTargetPCAt, pc); + } + } + /* begin unreachable */ + error("UNREACHABLE"); + return self_in_jumpTargetPCAt; +} + + /* CogMIPSELCompiler>>#lbR:base:offset: */ +static sqInt NoDbgRegParms +lbRbaseoffset(AbstractInstruction * self_in_lbRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_lbRbaseoffset, LB, baseReg, destReg, offset); +} + + /* CogMIPSELCompiler>>#lbuR:base:offset: */ +static sqInt NoDbgRegParms +lbuRbaseoffset(AbstractInstruction * self_in_lbuRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_lbuRbaseoffset, LBU, baseReg, destReg, offset); +} + + /* CogMIPSELCompiler>>#lhR:base:offset: */ +static sqInt NoDbgRegParms +lhRbaseoffset(AbstractInstruction * self_in_lhRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_lhRbaseoffset, LH, baseReg, destReg, offset); +} + + /* CogMIPSELCompiler>>#lhuR:base:offset: */ +static sqInt NoDbgRegParms +lhuRbaseoffset(AbstractInstruction * self_in_lhuRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_lhuRbaseoffset, LHU, baseReg, destReg, offset); +} + + /* CogMIPSELCompiler>>#literalAtAddress: */ +static usqInt NoDbgRegParms +literalAtAddress(AbstractInstruction * self_in_literalAtAddress, sqInt mcpc) +{ + usqInt high; + usqInt low; + + assert((opcodeAtAddress(self_in_literalAtAddress, mcpc)) == ORI); + assert((opcodeAtAddress(self_in_literalAtAddress, mcpc - 4)) == LUI); + low = (longAt(mcpc)) & 0xFFFF; + high = (longAt(mcpc - 4)) & 0xFFFF; + return (high << 16) | low; +} + + /* CogMIPSELCompiler>>#literalAtAddress:put: */ +static sqInt NoDbgRegParms +literalAtAddressput(AbstractInstruction * self_in_literalAtAddressput, sqInt mcpc, sqInt newLiteral) +{ + usqInt newLower; + usqInt newUpper; + usqInt oldLower; + usqInt oldUpper; + + assert((opcodeAtAddress(self_in_literalAtAddressput, mcpc - 4)) == LUI); + assert((opcodeAtAddress(self_in_literalAtAddressput, mcpc)) == ORI); + oldUpper = longAt(mcpc - 4); + newUpper = (oldUpper & 0xFFFF0000U) | (high16BitsOf(self_in_literalAtAddressput, newLiteral)); + longAtput(mcpc - 4, newUpper); + oldLower = longAt(mcpc); + newLower = (oldLower & 0xFFFF0000U) | (low16BitsOf(self_in_literalAtAddressput, newLiteral)); + longAtput(mcpc, newLower); + assert((opcodeAtAddress(self_in_literalAtAddressput, mcpc - 4)) == LUI); + assert((opcodeAtAddress(self_in_literalAtAddressput, mcpc)) == ORI); + assert((literalAtAddress(self_in_literalAtAddressput, mcpc)) == newLiteral); + return newLiteral; +} + + +/* Answer the literal embedded in the instruction immediately preceding + followingAddress. This is used in the MoveCwR, PushCw and CmpCwR cases. */ +/* Cmp/MoveCwR + pc-8 lui rx, uper + pc-4 ori rx, rx, lower */ + + /* CogMIPSELCompiler>>#literalBeforeFollowingAddress: */ +static sqInt NoDbgRegParms +literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress) +{ + if ((opcodeAtAddress(self_in_literalBeforeFollowingAddress, followingAddress - 4)) == ORI) { + return literalAtAddress(self_in_literalBeforeFollowingAddress, followingAddress - 4); + } + if (((opcodeAtAddress(self_in_literalBeforeFollowingAddress, followingAddress - 4)) == SW) + && ((opcodeAtAddress(self_in_literalBeforeFollowingAddress, followingAddress - 8)) == ADDIU)) { + return literalAtAddress(self_in_literalBeforeFollowingAddress, followingAddress - 12); + } + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#loadLiteralByteSize */ +static sqInt NoDbgRegParms +loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize) +{ + return 8; +} + + +/* Answer the byte size of a MoveCwR opcode's corresponding machine code + when the argument is a PIC. This is for the self-reference at the end of a + closed PIC. */ + + /* CogMIPSELCompiler>>#loadPICLiteralByteSize */ +static sqInt NoDbgRegParms +loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize) +{ + return loadLiteralByteSize(self_in_loadPICLiteralByteSize); +} + + /* CogMIPSELCompiler>>#low16BitsOf: */ +static usqInt NoDbgRegParms +low16BitsOf(AbstractInstruction * self_in_low16BitsOf, usqInt word) +{ + return word & 0xFFFF; +} + + /* CogMIPSELCompiler>>#luiR:C: */ +static sqInt NoDbgRegParms +luiRC(AbstractInstruction * self_in_luiRC, sqInt destReg, sqInt imm) +{ + return itypersrteitherImmediate(self_in_luiRC, LUI, 0, destReg, imm); +} + + /* CogMIPSELCompiler>>#lwR:base:offset: */ +static sqInt NoDbgRegParms +lwRbaseoffset(AbstractInstruction * self_in_lwRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_lwRbaseoffset, LW, baseReg, destReg, offset); +} + + /* CogMIPSELCompiler>>#machineCodeBytes */ +static sqInt NoDbgRegParms +machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes) +{ + return (machineCodeWords(self_in_machineCodeBytes)) * 4; +} + + +/* Answer the maximum number of words of machine code generated for any + abstract instruction. + e.g. AddCheckOverflowCqR */ + + /* CogMIPSELCompiler>>#machineCodeWords */ +static sqInt NoDbgRegParms +machineCodeWords(AbstractInstruction * self_in_machineCodeWords) +{ + return 7; +} + + /* CogMIPSELCompiler>>#mfhiR: */ +static sqInt NoDbgRegParms +mfhiR(AbstractInstruction * self_in_mfhiR, sqInt destReg) +{ + flag("todo"); + return rtypersrtrdsafunct(self_in_mfhiR, SPECIAL, 0, 0, destReg, 0, MFHI); +} + + /* CogMIPSELCompiler>>#mfloR: */ +static sqInt NoDbgRegParms +mfloR(AbstractInstruction * self_in_mfloR, sqInt destReg) +{ + flag("todo"); + return rtypersrtrdsafunct(self_in_mfloR, SPECIAL, 0, 0, destReg, 0, MFLO); +} + + /* CogMIPSELCompiler>>#mipsbreak: */ +static sqInt NoDbgRegParms +mipsbreak(AbstractInstruction * self_in_mipsbreak, sqInt code) +{ + assert(((code >= 0) && (code <= 0xFFFFF))); + return (((sqInt)((usqInt)(code) << 6))) | BREAK; +} + + /* CogMIPSELCompiler>>#multR:R: */ +static sqInt NoDbgRegParms +multRR(AbstractInstruction * self_in_multRR, sqInt leftReg, sqInt rightReg) +{ + flag("todo"); + return rtypersrtrdsafunct(self_in_multRR, SPECIAL, leftReg, rightReg, 0, 0, MULT); +} + + /* CogMIPSELCompiler>>#nop */ +static sqInt NoDbgRegParms +nop(AbstractInstruction * self_in_nop) +{ + return 0; +} + + +/* Support for processors without condition codes, such as the MIPS. + Answer the branch opcode. Modify the receiver and the branch to + implement a suitable conditional branch that doesn't depend on + condition codes being set by the receiver. */ + + /* CogMIPSELCompiler>>#noteFollowingConditionalBranch: */ +static AbstractInstruction * NoDbgRegParms +noteFollowingConditionalBranch(AbstractInstruction * self_in_noteFollowingConditionalBranch, AbstractInstruction *branch) +{ + usqIntptr_t newBranchLeft; + sqInt newBranchOpcode; + usqIntptr_t newBranchRight; + + if ((((branch->opcode)) == JumpOverflow) + || (((branch->opcode)) == JumpNoOverflow)) { + return noteFollowingOverflowBranch(self_in_noteFollowingConditionalBranch, branch); + } + + switch ((branch->opcode)) { + case JumpZero: + newBranchOpcode = BrEqualRR; + + break; + case JumpNonZero: + newBranchOpcode = BrNotEqualRR; + + break; + case JumpBelow: + newBranchOpcode = BrUnsignedLessRR; + + break; + case JumpBelowOrEqual: + newBranchOpcode = BrUnsignedLessEqualRR; + + break; + case JumpAbove: + newBranchOpcode = BrUnsignedGreaterRR; + + break; + case JumpAboveOrEqual: + newBranchOpcode = BrUnsignedGreaterEqualRR; + + break; + case JumpLess: + case JumpNegative: + newBranchOpcode = BrSignedLessRR; + + break; + case JumpLessOrEqual: + newBranchOpcode = BrSignedLessEqualRR; + + break; + case JumpGreater: + newBranchOpcode = BrSignedGreaterRR; + + break; + case JumpGreaterOrEqual: + newBranchOpcode = BrSignedGreaterEqualRR; + + break; + case JumpLongZero: + newBranchOpcode = BrLongEqualRR; + + break; + case JumpLongNonZero: + newBranchOpcode = BrLongNotEqualRR; + + break; + default: + /* begin unreachable */ + error("UNREACHABLE"); + newBranchOpcode = 0; + + } + + switch ((self_in_noteFollowingConditionalBranch->opcode)) { + case BrEqualRR: + case BrUnsignedLessRR: + + /* I.e., two jumps after a compare. */ + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[1]; + newBranchRight = ((self_in_noteFollowingConditionalBranch->operands))[2]; + break; + case CmpRR: + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[1]; + newBranchRight = ((self_in_noteFollowingConditionalBranch->operands))[0]; + (self_in_noteFollowingConditionalBranch->opcode) = Label; + break; + case CmpCqR: + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[1]; + newBranchRight = AT; + (self_in_noteFollowingConditionalBranch->opcode) = MoveCqR; + ((self_in_noteFollowingConditionalBranch->operands))[1] = AT; + break; + case CmpCwR: + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[1]; + newBranchRight = AT; + (self_in_noteFollowingConditionalBranch->opcode) = MoveCwR; + ((self_in_noteFollowingConditionalBranch->operands))[1] = AT; + break; + case TstCqR: + newBranchLeft = Cmp; + newBranchRight = ZR; + break; + case AndCqR: + case OrRR: + case XorRR: + case SubCwR: + case SubCqR: + case ArithmeticShiftRightCqR: + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[1]; + newBranchRight = ZR; + break; + case AndCqRR: + newBranchLeft = ((self_in_noteFollowingConditionalBranch->operands))[2]; + newBranchRight = ZR; + break; + default: + /* begin unreachable */ + error("UNREACHABLE"); + + } + /* begin rewriteOpcode:with:with: */ + (branch->opcode) = newBranchOpcode; + ((branch->operands))[1] = newBranchLeft; + ((branch->operands))[2] = newBranchRight; + return branch; +} + + +/* Support for processors without condition codes, such as the MIPS. + Answer the branch opcode. Modify the receiver and the branch to + implement a suitable conditional branch that doesn't depend on + condition codes being set by the receiver. */ + + /* CogMIPSELCompiler>>#noteFollowingOverflowBranch: */ +static AbstractInstruction * NoDbgRegParms +noteFollowingOverflowBranch(AbstractInstruction * self_in_noteFollowingOverflowBranch, AbstractInstruction *branch) +{ + sqInt newBranchOpcode; + + if (((self_in_noteFollowingOverflowBranch->opcode)) == MulRR) { + (self_in_noteFollowingOverflowBranch->opcode) = MulCheckOverflowRR; + + switch ((branch->opcode)) { + case JumpOverflow: + newBranchOpcode = BrNotEqualRR; + + break; + case JumpNoOverflow: + newBranchOpcode = BrEqualRR; + + break; + default: + /* begin unreachable */ + error("UNREACHABLE"); + newBranchOpcode = 0; + + } + /* begin rewriteOpcode:with:with: */ + (branch->opcode) = newBranchOpcode; + ((branch->operands))[1] = OverflowTemp1; + ((branch->operands))[2] = OverflowTemp2; + return branch; + } + + switch ((self_in_noteFollowingOverflowBranch->opcode)) { + case AddCqR: + (self_in_noteFollowingOverflowBranch->opcode) = AddCheckOverflowCqR; + + break; + case AddRR: + (self_in_noteFollowingOverflowBranch->opcode) = AddCheckOverflowRR; + + break; + case SubCqR: + (self_in_noteFollowingOverflowBranch->opcode) = SubCheckOverflowCqR; + + break; + case SubRR: + (self_in_noteFollowingOverflowBranch->opcode) = SubCheckOverflowRR; + + break; + default: + /* begin unreachable */ + error("UNREACHABLE"); + (self_in_noteFollowingOverflowBranch->opcode) = 0; + + } + + switch ((branch->opcode)) { + case JumpOverflow: + newBranchOpcode = BrSignedLessRR; + + break; + case JumpNoOverflow: + newBranchOpcode = BrSignedGreaterEqualRR; + + break; + default: + /* begin unreachable */ + error("UNREACHABLE"); + newBranchOpcode = 0; + + } + /* begin rewriteOpcode:with:with: */ + (branch->opcode) = newBranchOpcode; + ((branch->operands))[1] = Overflow; + ((branch->operands))[2] = ZR; + return branch; +} + + /* CogMIPSELCompiler>>#numIntRegArgs */ +static sqInt NoDbgRegParms +numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs) +{ + flag("OABI"); + return 4; +} + + /* CogMIPSELCompiler>>#opcodeAtAddress: */ +static sqInt NoDbgRegParms +opcodeAtAddress(AbstractInstruction * self_in_opcodeAtAddress, sqInt mcpc) +{ + return ((usqInt) (longAt(mcpc))) >> 26; +} + + /* CogMIPSELCompiler>>#oriR:R:C: */ +static sqInt NoDbgRegParms +oriRRC(AbstractInstruction * self_in_oriRRC, sqInt destReg, sqInt srcReg, sqInt imm) +{ + return itypersrteitherImmediate(self_in_oriRRC, ORI, srcReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#orR:R:R: */ +static sqInt NoDbgRegParms +orRRR(AbstractInstruction * self_in_orRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_orRRR, SPECIAL, leftReg, rightReg, destReg, 0, OR); +} + + /* CogMIPSELCompiler>>#padIfPossibleWithStopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr) +{ + sqInt addr; + + for (addr = startAddr; addr < endAddr; addr += 4) { + longAtput(addr, stop(self_in_padIfPossibleWithStopsFromto)); + } + return self_in_padIfPossibleWithStopsFromto; +} + + /* CogMIPSELCompiler>>#prefR:offset:hint: */ +static sqInt NoDbgRegParms +prefRoffsethint(AbstractInstruction * self_in_prefRoffsethint, sqInt baseReg, sqInt offset, sqInt hint) +{ + flag("todo"); + assert((hint == HintLoad) + || (hint == HintStore)); + return itypersrtsignedImmediate(self_in_prefRoffsethint, PREF, baseReg, hint, offset); +} + + /* CogMIPSELCompiler>>#pushLinkRegisterByteSize */ +static sqInt NoDbgRegParms +pushLinkRegisterByteSize(AbstractInstruction * self_in_pushLinkRegisterByteSize) +{ + return 8; +} + + /* CogMIPSELCompiler>>#relocateCallBeforeReturnPC:by: */ +static AbstractInstruction * NoDbgRegParms +relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta) +{ + usqInt target; + + assert((delta % 4) == 0); + if (delta == 0) { + return self_in_relocateCallBeforeReturnPCby; + } + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 16)) == LUI); + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 12)) == ORI); + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 8)) == SPECIAL); + assert((functionAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 8)) == JALR); + assert((longAt(retpc - 4)) == (nop(self_in_relocateCallBeforeReturnPCby))); + target = literalAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 12); + target += delta; + literalAtAddressput(self_in_relocateCallBeforeReturnPCby, retpc - 12, target); + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 16)) == LUI); + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 12)) == ORI); + assert((opcodeAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 8)) == SPECIAL); + assert((functionAtAddress(self_in_relocateCallBeforeReturnPCby, retpc - 8)) == JALR); + assert((longAt(retpc - 4)) == (nop(self_in_relocateCallBeforeReturnPCby))); + return self_in_relocateCallBeforeReturnPCby; +} + + +/* lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jr t9 + nop (delay slot) + ... <-- pc */ + + /* CogMIPSELCompiler>>#relocateJumpLongBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + sqInt newTarget; + usqInt oldTarget; + + assert((delta % 4) == 0); + if (delta == 0) { + return self_in_relocateJumpLongBeforeFollowingAddressby; + } + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 16)) == LUI); + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 12)) == ORI); + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 8)) == SPECIAL); + assert((functionAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 8)) == JR); + assert((longAt(pc - 4)) == (nop(self_in_relocateJumpLongBeforeFollowingAddressby))); + oldTarget = literalAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 12); + newTarget = oldTarget + delta; + literalAtAddressput(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 12, newTarget); + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 16)) == LUI); + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 12)) == ORI); + assert((opcodeAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 8)) == SPECIAL); + assert((functionAtAddress(self_in_relocateJumpLongBeforeFollowingAddressby, pc - 8)) == JR); + assert((longAt(pc - 4)) == (nop(self_in_relocateJumpLongBeforeFollowingAddressby))); + return self_in_relocateJumpLongBeforeFollowingAddressby; +} + + +/* lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jalr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#relocateJumpLongConditionalBeforeFollowingAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateJumpLongConditionalBeforeFollowingAddressby(AbstractInstruction * self_in_relocateJumpLongConditionalBeforeFollowingAddressby, sqInt pc, sqInt delta) +{ + assert((opcodeAtAddress(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc - 16)) == BNE); + assert((longAt(pc - 12)) == (nop(self_in_relocateJumpLongConditionalBeforeFollowingAddressby))); + assert((opcodeAtAddress(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc - 8)) == J); + assert((longAt(pc - 4)) == (nop(self_in_relocateJumpLongConditionalBeforeFollowingAddressby))); + rewriteJTypeAtAddressdelta(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc - 8, delta); + assert((opcodeAtAddress(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc - 16)) == BNE); + assert((longAt(pc - 12)) == (nop(self_in_relocateJumpLongConditionalBeforeFollowingAddressby))); + assert((opcodeAtAddress(self_in_relocateJumpLongConditionalBeforeFollowingAddressby, pc - 8)) == J); + assert((longAt(pc - 4)) == (nop(self_in_relocateJumpLongConditionalBeforeFollowingAddressby))); + return self_in_relocateJumpLongConditionalBeforeFollowingAddressby; +} + + +/* cogit disassembleFrom: pc - 16 to: pc + 16 a StackToRegisterMappingCogit. */ + + /* CogMIPSELCompiler>>#relocateMethodReferenceBeforeAddress:by: */ +static AbstractInstruction * NoDbgRegParms +relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta) +{ + usqInt newValue; + usqInt oldValue; + + if (((opcodeAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 8)) == ADDIU) + && ((opcodeAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 4)) == SW)) { + + /* PushCw */ + oldValue = literalAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 12); + newValue = oldValue + delta; + literalAtAddressput(self_in_relocateMethodReferenceBeforeAddressby, pc - 12, newValue); + assert((literalAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 12)) == newValue); + return self_in_relocateMethodReferenceBeforeAddressby; + } + oldValue = literalAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 4); + newValue = oldValue + delta; + literalAtAddressput(self_in_relocateMethodReferenceBeforeAddressby, pc - 4, newValue); + assert((literalAtAddress(self_in_relocateMethodReferenceBeforeAddressby, pc - 4)) == newValue); + return self_in_relocateMethodReferenceBeforeAddressby; +} + + +/* Rewrite a call instruction to call a different target. This variant is + used to link PICs + in ceSendMiss et al,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ +/* lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jalr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#rewriteCallAt:target: */ +static sqInt NoDbgRegParms +rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteCallAttarget))); + literalAtAddressput(self_in_rewriteCallAttarget, callSiteReturnAddress - 12, callTargetAddress); + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteCallAttarget, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteCallAttarget))); + return 20; +} + + +/* Rewrite a jump instruction to call a different target. This variant is + used to reset the + jumps in the prototype CPIC to suit each use,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ + + /* CogMIPSELCompiler>>#rewriteConditionalJumpLongAt:target: */ +static AbstractInstruction * NoDbgRegParms +rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + assert((opcodeAtAddress(self_in_rewriteConditionalJumpLongAttarget, callSiteReturnAddress - 8)) == J); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteConditionalJumpLongAttarget))); + rewriteJTypeAtAddresstarget(self_in_rewriteConditionalJumpLongAttarget, callSiteReturnAddress - 8, callTargetAddress); + assert((opcodeAtAddress(self_in_rewriteConditionalJumpLongAttarget, callSiteReturnAddress - 8)) == J); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteConditionalJumpLongAttarget))); + return self_in_rewriteConditionalJumpLongAttarget; +} + + +/* Rewrite a jump instruction to call a different target. This variant is + used to reset the + jumps in the prototype CPIC to suit each use,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ +/* self CmpR: ClassReg R: TempReg. + ^self JumpNonZero: 0 */ +/* bne s5, s3, +156 ; =BE7C + nop (delay slot) + .... <-- addressFollowingJump */ + + /* CogMIPSELCompiler>>#rewriteCPICJumpAt:target: */ +static AbstractInstruction * NoDbgRegParms +rewriteCPICJumpAttarget(AbstractInstruction * self_in_rewriteCPICJumpAttarget, usqInt addressFollowingJump, usqInt jumpTargetAddress) +{ + assert((opcodeAtAddress(self_in_rewriteCPICJumpAttarget, addressFollowingJump - 8)) == BNE); + assert((longAt(addressFollowingJump - 4)) == (nop(self_in_rewriteCPICJumpAttarget))); + rewriteITypeBranchAtAddresstarget(self_in_rewriteCPICJumpAttarget, addressFollowingJump - 8, jumpTargetAddress); + assert((opcodeAtAddress(self_in_rewriteCPICJumpAttarget, addressFollowingJump - 8)) == BNE); + assert((longAt(addressFollowingJump - 4)) == (nop(self_in_rewriteCPICJumpAttarget))); + return self_in_rewriteCPICJumpAttarget; +} + + +/* Rewrite an inline cache to call a different target for a new tag. This + variant is used + to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of + the code + change which is used to compute the range of the icache to flush. */ +/* MoveCwR ClassReg selectorIndex/expectedClass + Call: unlinked send stub/expectedTarget + Push ReceiverResult <-- callSiteReturnAddress */ +/* lui s3, selector/tagHigh + ori s3, s3, selector/tagLow + lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jalr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#rewriteInlineCacheAt:tag:target: */ +static sqInt NoDbgRegParms +rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress) +{ + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 24)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 20)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteInlineCacheAttagtarget))); + literalAtAddressput(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 20, cacheTag); + literalAtAddressput(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 12, callTargetAddress); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 24)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 20)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteInlineCacheAttagtarget, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteInlineCacheAttagtarget))); + return 24; +} + + +/* Rewrite an inline cache with a new tag. This variant is used + by the garbage collector. */ +/* MoveCwR ClassReg selectorIndex/expectedClass + Call: unlinked send stub/expectedTarget + Push ReceiverResult <-- callSiteReturnAddress */ +/* lui s3, selector/tagHigh + ori s3, s3, selector/tagLow + lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jalr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#rewriteInlineCacheTag:at: */ +static AbstractInstruction * NoDbgRegParms +rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, usqInt callSiteReturnAddress) +{ + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 24)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 20)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteInlineCacheTagat))); + literalAtAddressput(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 20, cacheTag); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 24)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 20)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteInlineCacheTagat, callSiteReturnAddress - 8)) == JALR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteInlineCacheTagat))); + return self_in_rewriteInlineCacheTagat; +} + + /* CogMIPSELCompiler>>#rewriteITypeBranchAtAddress:target: */ +static AbstractInstruction * NoDbgRegParms +rewriteITypeBranchAtAddresstarget(AbstractInstruction * self_in_rewriteITypeBranchAtAddresstarget, sqInt mcpc, sqInt newTarget) +{ + sqInt newDisplacement; + unsigned int newInstruction; + sqInt oldInstruction; + + + /* Displacement is relative to delay slot. */ + newDisplacement = newTarget - (mcpc + 4); + + /* Displacement is in words. */ + newDisplacement = ((sqInt) newDisplacement) >> 2; + newDisplacement = newDisplacement & 0xFFFF; + oldInstruction = longAt(mcpc); + newInstruction = (oldInstruction & 0xFFFF0000U) | newDisplacement; + longAtput(mcpc, newInstruction); + return self_in_rewriteITypeBranchAtAddresstarget; +} + + /* CogMIPSELCompiler>>#rewriteJTypeAtAddress:delta: */ +static AbstractInstruction * NoDbgRegParms +rewriteJTypeAtAddressdelta(AbstractInstruction * self_in_rewriteJTypeAtAddressdelta, sqInt mcpc, sqInt delta) +{ + usqInt newTarget; + usqInt oldTarget; + + oldTarget = targetFromJTypeAtAddress(self_in_rewriteJTypeAtAddressdelta, mcpc); + newTarget = oldTarget + delta; + rewriteJTypeAtAddresstarget(self_in_rewriteJTypeAtAddressdelta, mcpc, newTarget); + return self_in_rewriteJTypeAtAddressdelta; +} + + /* CogMIPSELCompiler>>#rewriteJTypeAtAddress:target: */ +static AbstractInstruction * NoDbgRegParms +rewriteJTypeAtAddresstarget(AbstractInstruction * self_in_rewriteJTypeAtAddresstarget, sqInt mcpc, sqInt newTarget) +{ + sqInt regionMask; + + assert((opcodeAtAddress(self_in_rewriteJTypeAtAddresstarget, mcpc)) == J); + + /* mcpc + 4: relative to delay slot not j */ + regionMask = 4026531840U; + assert(((mcpc + 4) & regionMask) == (newTarget & regionMask)); + longAtput(mcpc, jA(self_in_rewriteJTypeAtAddresstarget, newTarget)); + return self_in_rewriteJTypeAtAddresstarget; +} + + +/* Rewrite a jump instruction to call a different target. This variant is + used to reset the + jumps in the prototype CPIC to suit each use,. + Answer the extent of the code change which is used to compute the range of + the icache to flush. */ +/* lui t9, stub/targetHigh + ori t9, t9, stub/targetLow + jr t9 + nop (delay slot) + ... <-- callSiteReturnAddress */ + + /* CogMIPSELCompiler>>#rewriteJumpLongAt:target: */ +static sqInt NoDbgRegParms +rewriteJumpLongAttarget(AbstractInstruction * self_in_rewriteJumpLongAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) +{ + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 8)) == JR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteJumpLongAttarget))); + literalAtAddressput(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 12, callTargetAddress); + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 16)) == LUI); + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 12)) == ORI); + assert((opcodeAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 8)) == SPECIAL); + assert((functionAtAddress(self_in_rewriteJumpLongAttarget, callSiteReturnAddress - 8)) == JR); + assert((longAt(callSiteReturnAddress - 4)) == (nop(self_in_rewriteJumpLongAttarget))); + return 20; +} + + /* CogMIPSELCompiler>>#rtAtAddress: */ +static sqInt NoDbgRegParms +rtAtAddress(AbstractInstruction * self_in_rtAtAddress, sqInt mcpc) +{ + return (((usqInt) (longAt(mcpc))) >> 16) & 0x1F; +} + + /* CogMIPSELCompiler>>#rtype:rs:rt:rd:sa:funct: */ +static sqInt NoDbgRegParms +rtypersrtrdsafunct(AbstractInstruction * self_in_rtypersrtrdsafunct, sqInt op, sqInt rs, sqInt rt, sqInt rd, sqInt sa, sqInt funct) +{ + assert(((op >= 0) && (op <= 0x3F))); + assert(((rs >= 0) && (rs <= 0x1F))); + assert(((rt >= 0) && (rt <= 0x1F))); + assert(((rd >= 0) && (rd <= 0x1F))); + assert(((sa >= 0) && (sa <= 0x1F))); + assert(((funct >= 0) && (funct <= 0x3F))); + return (((((((sqInt)((usqInt)(op) << 26))) | (((sqInt)((usqInt)(rs) << 21)))) | (((sqInt)((usqInt)(rt) << 16)))) | (((sqInt)((usqInt)(rd) << 11)))) | (((sqInt)((usqInt)(sa) << 6)))) | funct; +} + + /* CogMIPSELCompiler>>#sbR:base:offset: */ +static sqInt NoDbgRegParms +sbRbaseoffset(AbstractInstruction * self_in_sbRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_sbRbaseoffset, SB, baseReg, srcReg, offset); +} + + +/* Not really, but we can merge this in noteFollowingConditionalBranch:. */ + + /* CogMIPSELCompiler>>#setsConditionCodesFor: */ +static sqInt NoDbgRegParms +setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode) +{ + if (((self_in_setsConditionCodesFor->opcode)) == XorRR) { + return 1; + } + if (((self_in_setsConditionCodesFor->opcode)) == ArithmeticShiftRightCqR) { + return 1; + } + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#shR:base:offset: */ +static sqInt NoDbgRegParms +shRbaseoffset(AbstractInstruction * self_in_shRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_shRbaseoffset, SH, baseReg, srcReg, offset); +} + + +/* Size a jump and set its address. The target may be another instruction + or an absolute address. On entry the address inst var holds our virtual + address. On exit address is set to eventualAbsoluteAddress, which is + where this instruction will be output. The span of a jump to a following + instruction is therefore between that instruction's address and this + instruction's address ((which are both still their virtual addresses), but + the span of a jump to a preceding instruction or to an absolute address is + between that instruction's address (which by now is its eventual absolute + address) or absolute address and eventualAbsoluteAddress. + + ARM is simple; the 26-bit call/jump range means no short jumps. This + routine only has to determine the targets of jumps, not determine sizes. */ + + /* CogMIPSELCompiler>>#sizePCDependentInstructionAt: */ +static usqInt NoDbgRegParms +sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress) +{ + usqIntptr_t alignment; + + if (((self_in_sizePCDependentInstructionAt->opcode)) == AlignmentNops) { + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + alignment = ((self_in_sizePCDependentInstructionAt->operands))[0]; + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = ((eventualAbsoluteAddress + (alignment - 1)) & (-alignment)) - eventualAbsoluteAddress); + } + assert((isJump(self_in_sizePCDependentInstructionAt)) + || ((((self_in_sizePCDependentInstructionAt->opcode)) == Call) + || (((self_in_sizePCDependentInstructionAt->opcode)) == CallFull))); + if (isJump(self_in_sizePCDependentInstructionAt)) { + resolveJumpTarget(self_in_sizePCDependentInstructionAt); + } + (self_in_sizePCDependentInstructionAt->address) = eventualAbsoluteAddress; + return ((self_in_sizePCDependentInstructionAt->machineCodeSize) = (self_in_sizePCDependentInstructionAt->maxSize)); +} + + /* CogMIPSELCompiler>>#sllR:R:C: */ +static sqInt NoDbgRegParms +sllRRC(AbstractInstruction * self_in_sllRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount) +{ + return rtypersrtrdsafunct(self_in_sllRRC, SPECIAL, 0, sourceReg, destReg, shiftAmount, SLL); +} + + /* CogMIPSELCompiler>>#sllvR:R:R: */ +static sqInt NoDbgRegParms +sllvRRR(AbstractInstruction * self_in_sllvRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_sllvRRR, SPECIAL, rightReg, leftReg, destReg, 0, SLLV); +} + + /* CogMIPSELCompiler>>#sltiR:R:C: */ +static sqInt NoDbgRegParms +sltiRRC(AbstractInstruction * self_in_sltiRRC, sqInt destReg, sqInt leftReg, sqInt imm) +{ + return itypersrtsignedImmediate(self_in_sltiRRC, SLTI, leftReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#sltiuR:R:C: */ +static sqInt NoDbgRegParms +sltiuRRC(AbstractInstruction * self_in_sltiuRRC, sqInt destReg, sqInt leftReg, sqInt imm) +{ + return itypersrtsignedImmediate(self_in_sltiuRRC, SLTIU, leftReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#sltR:R:R: */ +static sqInt NoDbgRegParms +sltRRR(AbstractInstruction * self_in_sltRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_sltRRR, SPECIAL, leftReg, rightReg, destReg, 0, SLT); +} + + /* CogMIPSELCompiler>>#sltuR:R:R: */ +static sqInt NoDbgRegParms +sltuRRR(AbstractInstruction * self_in_sltuRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_sltuRRR, SPECIAL, leftReg, rightReg, destReg, 0, SLTU); +} + + /* CogMIPSELCompiler>>#sraR:R:C: */ +static sqInt NoDbgRegParms +sraRRC(AbstractInstruction * self_in_sraRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount) +{ + return rtypersrtrdsafunct(self_in_sraRRC, SPECIAL, 0, sourceReg, destReg, shiftAmount, SRA); +} + + /* CogMIPSELCompiler>>#sravR:R:R: */ +static sqInt NoDbgRegParms +sravRRR(AbstractInstruction * self_in_sravRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_sravRRR, SPECIAL, rightReg, leftReg, destReg, 0, SRAV); +} + + /* CogMIPSELCompiler>>#srlR:R:C: */ +static sqInt NoDbgRegParms +srlRRC(AbstractInstruction * self_in_srlRRC, sqInt destReg, sqInt sourceReg, sqInt shiftAmount) +{ + return rtypersrtrdsafunct(self_in_srlRRC, SPECIAL, 0, sourceReg, destReg, shiftAmount, SRL); +} + + /* CogMIPSELCompiler>>#srlvR:R:R: */ +static sqInt NoDbgRegParms +srlvRRR(AbstractInstruction * self_in_srlvRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_srlvRRR, SPECIAL, rightReg, leftReg, destReg, 0, SRLV); +} + + /* CogMIPSELCompiler>>#stop */ +static sqInt NoDbgRegParms +stop(AbstractInstruction * self_in_stop) +{ + return mipsbreak(self_in_stop, 0); +} + + /* CogMIPSELCompiler>>#stopsFrom:to: */ +static AbstractInstruction * NoDbgRegParms +stopsFromto(AbstractInstruction * self_in_stopsFromto, sqInt startAddr, sqInt endAddr) +{ + sqInt addr; + + assert((((endAddr - startAddr) + 1) % 4) == 0); + for (addr = startAddr; addr <= endAddr; addr += 4) { + longAtput(addr, stop(self_in_stopsFromto)); + } + return self_in_stopsFromto; +} + + +/* Rewrite the long constant loaded by a MoveCwR or PushCw before the given + address + */ + + /* CogMIPSELCompiler>>#storeLiteral:beforeFollowingAddress: */ +static sqInt NoDbgRegParms +storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress) +{ + flag("bogus"); + if ((opcodeAtAddress(self_in_storeLiteralbeforeFollowingAddress, followingAddress - 4)) == ORI) { + return literalAtAddressput(self_in_storeLiteralbeforeFollowingAddress, followingAddress - 4, literal); + } + if (((opcodeAtAddress(self_in_storeLiteralbeforeFollowingAddress, followingAddress - 4)) == SW) + && ((opcodeAtAddress(self_in_storeLiteralbeforeFollowingAddress, followingAddress - 8)) == ADDIU)) { + return literalAtAddressput(self_in_storeLiteralbeforeFollowingAddress, followingAddress - 12, literal); + } + /* begin unreachable */ + error("UNREACHABLE"); + return 0; +} + + /* CogMIPSELCompiler>>#subuR:R:R: */ +static sqInt NoDbgRegParms +subuRRR(AbstractInstruction * self_in_subuRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_subuRRR, SPECIAL, leftReg, rightReg, destReg, 0, SUBU); +} + + /* CogMIPSELCompiler>>#swR:base:offset: */ +static sqInt NoDbgRegParms +swRbaseoffset(AbstractInstruction * self_in_swRbaseoffset, sqInt srcReg, sqInt baseReg, sqInt offset) +{ + return itypersrtsignedImmediate(self_in_swRbaseoffset, SW, baseReg, srcReg, offset); +} + + /* CogMIPSELCompiler>>#targetFromITypeAtAddress: */ +static usqInt NoDbgRegParms +targetFromITypeAtAddress(AbstractInstruction * self_in_targetFromITypeAtAddress, usqInt mcpc) +{ + usqInt offset; + + offset = (longAt(mcpc)) & 0xFFFF; + offset = offset << 2; + return (mcpc + offset) + OneInstruction; +} + + /* CogMIPSELCompiler>>#targetFromJTypeAtAddress: */ +static usqInt NoDbgRegParms +targetFromJTypeAtAddress(AbstractInstruction * self_in_targetFromJTypeAtAddress, usqInt mcpc) +{ + sqInt targetLow; + + + /* mcpc + 4: relative to delay slot not j */ + targetLow = (longAt(mcpc)) & 0x3FFFFFF; + return ((mcpc + 4) & 4026531840U) + (((sqInt)((usqInt)(targetLow) << 2))); +} + + /* CogMIPSELCompiler>>#xoriR:R:C: */ +static sqInt NoDbgRegParms +xoriRRC(AbstractInstruction * self_in_xoriRRC, sqInt destReg, sqInt srcReg, sqInt imm) +{ + return itypersrteitherImmediate(self_in_xoriRRC, XORI, srcReg, destReg, imm); +} + + /* CogMIPSELCompiler>>#xorR:R:R: */ +static sqInt NoDbgRegParms +xorRRR(AbstractInstruction * self_in_xorRRR, sqInt destReg, sqInt leftReg, sqInt rightReg) +{ + return rtypersrtrdsafunct(self_in_xorRRR, SPECIAL, leftReg, rightReg, destReg, 0, XOR); +} + + +/* Answer if Call and JumpLong are relative and hence need to take the + caller's relocation delta into account during code compaction, rather than + just the + callee's delta. */ + + /* CogMIPSELCompiler>>#zoneCallsAreRelative */ +static sqInt NoDbgRegParms +zoneCallsAreRelative(AbstractInstruction * self_in_zoneCallsAreRelative) +{ + return 0; +} + + /* CogObjectRepresentation>>#checkValidObjectReference: */ +static sqInt NoDbgRegParms +checkValidObjectReference(sqInt anOop) +{ + return (!(isImmediate(anOop))) + && ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentation>>#genCmpClassFloatCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassFloatCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassFloatCompactIndex, reg); + return anInstruction; +} + + /* CogObjectRepresentation>>#genCmpClassMethodContextCompactIndexR: */ +static AbstractInstruction * NoDbgRegParms +genCmpClassMethodContextCompactIndexR(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, reg); + return anInstruction; +} + + +/* Get the method header (first word) of a CompiledMethod into headerReg. + Deal with the method possibly being cogged. */ + + /* CogObjectRepresentation>>#genGetMethodHeaderOf:into:scratch: */ +static sqInt NoDbgRegParms +genGetMethodHeaderOfintoscratch(sqInt methodReg, sqInt headerReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpNotCogged; + sqInt offset; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, methodReg, headerReg); + /* begin genJumpSmallInteger:scratchReg: */ + jumpNotCogged = genJumpSmallInteger(headerReg); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodHeader); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, headerReg, headerReg); + jmpTarget(jumpNotCogged, gLabel()); + return 0; +} + + +/* TODO: Optimize this one avoiding the trampoline */ + + /* CogObjectRepresentation>>#genLcByteSizeOf:to: */ +static void NoDbgRegParms +genLcByteSizeOfto(sqInt oop, sqInt resultRegister) +{ + AbstractInstruction *abstractInstruction; + + if (oop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, oop, Arg0Reg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceByteSizeOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, resultRegister); + ssPushNativeRegister(resultRegister); +} + + /* CogObjectRepresentation>>#genLcFloat32:toOop: */ +static void NoDbgRegParms +genLcFloat32toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, value, DPFPReg0); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcFloat64:toOop: */ +static void NoDbgRegParms +genLcFloat64toOop(sqInt value, sqInt object) +{ + AbstractInstruction *abstractInstruction; + + if (value != DPFPReg0) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, DPFPReg0); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatObjectOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop: */ +static void NoDbgRegParms +genLcInstantiateOop(sqInt classOop) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:constantIndexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopconstantIndexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + if (classOop != Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, indexableSize, Arg1Reg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInstantiateOop:indexableSize: */ +static void NoDbgRegParms +genLcInstantiateOopindexableSize(sqInt classOop, sqInt indexableSize) +{ + AbstractInstruction *abstractInstruction; + + if (classOop != Arg0Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, classOop, Arg0Reg); + } + if (indexableSize != Arg1Reg) { + if (indexableSize == Arg0Reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg1Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, indexableSize, Arg1Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, classOop); + ssPushRegister(classOop); +} + + /* CogObjectRepresentation>>#genLcInt64ToOop: */ +static void NoDbgRegParms +genLcInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOopToInt64: */ +static void NoDbgRegParms +genLcOopToInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + +/* Assume this is always correct */ + + /* CogObjectRepresentation>>#genLcOopToPointer: */ +static void NoDbgRegParms +genLcOopToPointer(sqInt object) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, object, object); + ssPushNativeRegister(object); +} + + /* CogObjectRepresentation>>#genLcOopToUInt64: */ +static void NoDbgRegParms +genLcOopToUInt64(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat32: */ +static void NoDbgRegParms +genLcOoptoFloat32(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, DPFPReg0, value); + ssPushNativeRegisterSingleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toFloat64: */ +static void NoDbgRegParms +genLcOoptoFloat64(sqInt object, sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFloatValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (DPFPReg0 != value) { + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, DPFPReg0, value); + } + ssPushNativeRegisterDoubleFloat(value); +} + + /* CogObjectRepresentation>>#genLcOop:toInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcOop:toUInt64:highPart: */ +static void NoDbgRegParms +genLcOoptoUInt64highPart(sqInt object, sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (object != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, object, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + if (Arg0Reg != valueHigh) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, valueHigh); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, valueLow); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); +} + + /* CogObjectRepresentation>>#genLcPointerToOop:class: */ +static void NoDbgRegParms +genLcPointerToOopclass(sqInt pointer, sqInt pointerClass) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin PushR: */ + genoperand(PushR, pointer); + annotateobjRef(gMoveCwR(pointerClass, Arg0Reg), pointerClass); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, BytesPerOop, Arg1Reg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceInstantiateClassIndexableSizeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin PopR: */ + genoperand(PopR, pointer); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, pointer, BaseHeaderSize, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushRegister(pointer); +} + + /* CogObjectRepresentation>>#genLcUInt64ToOop: */ +static void NoDbgRegParms +genLcUInt64ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* Put the arguments in the correct registers */ + + /* CogObjectRepresentation>>#genLcUInt64ToOop:highPart: */ +static void NoDbgRegParms +genLcUInt64ToOophighPart(sqInt valueLow, sqInt valueHigh) +{ + AbstractInstruction *abstractInstruction; + + if (valueLow != ReceiverResultReg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, TempReg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, ReceiverResultReg); + } + if (valueHigh != Arg0Reg) { + if (valueHigh == ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, Arg0Reg); + } + else { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, Arg0Reg); + } + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive64BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentation>>#genLoadSlot:sourceReg:destReg: */ +static sqInt NoDbgRegParms +genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, (index * BytesPerWord) + BaseHeaderSize, sourceReg, destReg); + return 0; +} + + /* CogObjectRepresentation>>#genPrimitiveAdd */ +static sqInt +genPrimitiveAdd(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, ReceiverResultReg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitAnd */ +static sqInt +genPrimitiveBitAnd(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitOr */ +static sqInt +genPrimitiveBitOr(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + +/* rTemp := rArg0 + rClass := tTemp + rTemp := rTemp & 1 + jz nonInt + rClass >>= 1 + cmp 0,rClass + jge neg + cmp 31,rClass // numSmallIntegerBits, jge for sign + jge tooBig + rTemp := rReceiver + rTemp <<= rClass + rTemp >>= rClass (arithmetic) + cmp rTemp,rReceiver + jnz ovfl + rReceiver := rReceiver - 1 + rReceiver := rReceiver <<= rClass + rReceiver := rReceiver + 1 + ret + neg: + rClass := 0 - rClass + cmp 31,rClass // numSmallIntegerBits + jge inRange + rClass := 31 + inRange + rReceiver := rReceiver >>= rClass. + rReceiver := rReceiver | smallIntegerTags. + ret + ovfl + tooBig + nonInt: + fail + */ + + /* CogObjectRepresentation>>#genPrimitiveBitShift */ +static sqInt +genPrimitiveBitShift(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpInRange; + AbstractInstruction *jumpNegative; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + AbstractInstruction *jumpTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpNegative))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpNegative: */ + jumpNegative = genConditionalBranchoperand(JumpNegative, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant1, ClassReg); + /* begin JumpGreaterOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, TempReg); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, ClassReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, ReceiverResultReg); + /* begin JumpNonZero: */ + jumpOvfl = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, ClassReg, ReceiverResultReg); + genAddSmallIntegerTagsTo(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNegative, gNegateR(ClassReg)); + /* begin CmpCq:R: */ + quickConstant2 = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant2, ClassReg); + /* begin JumpLessOrEqual: */ + jumpInRange = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + quickConstant = numSmallIntegerBits(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, ClassReg); + jmpTarget(jumpInRange, gArithmeticShiftRightRR(ClassReg, ReceiverResultReg)); + genClearAndSetSmallIntegerTagsIn(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, jmpTarget(jumpTooBig, jmpTarget(jumpOvfl, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveBitXor */ +static sqInt +genPrimitiveBitXor(void) +{ + AbstractInstruction *jumpNotSI; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin XorR:R: */ + genoperandoperand(XorRR, Arg0Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotSI, gLabel()); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveClass */ +static sqInt +genPrimitiveClass(void) +{ + sqInt reg; + sqInt reg1; + + reg = ReceiverResultReg; + if (methodOrBlockNumArgs > 0) { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + reg1 = (reg = Arg0Reg); + assert(0 < (numRegArgs())); + } + if ((genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ReceiverResultReg, TempReg, reg == ReceiverResultReg)) == BadRegisterSet) { + genGetClassObjectOfintoscratchReginstRegIsReceiver(reg, ClassReg, TempReg, reg == ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDiv */ +static sqInt +genPrimitiveDiv(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, 0, Arg1Reg); + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, TempReg); + jmpTarget(jumpSameSign, (convert = gLabel())); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveDivide */ +static sqInt +genPrimitiveDivide(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpInexact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOverflow; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpNonZero: */ + jumpInexact = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + jumpOverflow = genJumpNotSmallIntegerValuescratch(TempReg, Arg1Reg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOverflow, jmpTarget(jumpInexact, jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())))); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveEqual */ +static sqInt +genPrimitiveEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpZero, gJumpFPEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterOrEqual */ +static sqInt +genPrimitiveGreaterOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreaterOrEqual, gJumpFPGreaterOrEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveGreaterThan */ +static sqInt +genPrimitiveGreaterThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpGreater, gJumpFPGreater, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveIdentical */ +static sqInt +genPrimitiveIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(0); +} + + /* CogObjectRepresentation>>#genPrimitiveLessOrEqual */ +static sqInt +genPrimitiveLessOrEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLessOrEqual, gJumpFPGreaterOrEqual, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveLessThan */ +static sqInt +genPrimitiveLessThan(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpLess, gJumpFPGreater, 1); +} + + /* CogObjectRepresentation>>#genPrimitiveMod */ +static sqInt +genPrimitiveMod(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpSameSign; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genRemoveSmallIntegerTagsInScratchReg(ClassReg); + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genRemoveSmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, Arg1Reg); + } + /* begin JumpGreaterOrEqual: */ + jumpSameSign = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, ClassReg, Arg1Reg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ClassReg); + jmpTarget(jumpSameSign, jmpTarget(jumpExact, gLabel())); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveMultiply */ +static sqInt +genPrimitiveMultiply(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(processorHasMultiplyAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + genRemoveSmallIntegerTagsInScratchReg(Arg1Reg); + /* begin MulR:R: */ + genMulRR(backEnd, Arg1Reg, ClassReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genSetSmallIntegerTagsIn(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + +/* subclasses override if they can */ + + /* CogObjectRepresentation>>#genPrimitiveNewMethod */ +static sqInt +genPrimitiveNewMethod(void) +{ + return UnimplementedPrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveNotEqual */ +static sqInt +genPrimitiveNotEqual(void) +{ + return genSmallIntegerComparisonorDoubleComparisoninvert(JumpNonZero, gJumpFPNotEqual, 0); +} + + /* CogObjectRepresentation>>#genPrimitiveNotIdentical */ +static sqInt +genPrimitiveNotIdentical(void) +{ + return genPrimitiveIdenticalOrNotIf(1); +} + + /* CogObjectRepresentation>>#genPrimitiveQuo */ +static sqInt +genPrimitiveQuo(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *convert; + AbstractInstruction *jumpExact; + AbstractInstruction *jumpIsSI; + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpZero; + + if (!(processorHasDivQuoRemAndMClassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ClassReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + genShiftAwaySmallIntegerTagsInScratchReg(ClassReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpZero))) { + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0, ClassReg); + } + /* begin JumpZero: */ + jumpZero = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + genShiftAwaySmallIntegerTagsInScratchReg(TempReg); + gDivRRQuoRem(ClassReg, TempReg, TempReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ClassReg); + /* begin JumpZero: */ + jumpExact = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + convert = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpExact, gLabel()); + jumpIsSI = genJumpIsSmallIntegerValuescratch(TempReg, Arg1Reg); + jmpTarget(jumpIsSI, convert); + jmpTarget(jumpZero, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genPrimitiveSubtract */ +static sqInt +genPrimitiveSubtract(void) +{ + AbstractInstruction *jumpNotSI; + AbstractInstruction *jumpOvfl; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotSI = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, TempReg); + /* begin JumpOverflow: */ + jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0)); + genAddSmallIntegerTagsTo(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOvfl, jmpTarget(jumpNotSI, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#genSmallIntegerComparison: */ +static sqInt NoDbgRegParms +genSmallIntegerComparison(sqInt jumpOpcode) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpTrue; + + if (!(mclassIsSmallInteger())) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpFail = genJumpNotSmallInteger(Arg0Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + jumpTrue = genConditionalBranchoperand(jumpOpcode, 0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpFail, gLabel()); + return CompletePrimitive; +} + + +/* Stack looks like + return address */ + + /* CogObjectRepresentation>>#genSmallIntegerComparison:orDoubleComparison:invert: */ +static sqInt NoDbgRegParms +genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction * NoDbgRegParms (*jumpFPOpcodeGenerator)(void *), sqInt invertComparison) +{ + AbstractInstruction *anInstruction; + sqInt constant; + AbstractInstruction *jumpCond; + AbstractInstruction *jumpFail; + AbstractInstruction *jumpNonInt; + sqInt r; + + r = genSmallIntegerComparison(jumpOpcode); + if (r < 0) { + return r; + } + +# if defined(DPFPReg0) + + /* Fall through on non-SmallInteger argument. Argument may be a Float : let us check or fail */ + jumpNonInt = genJumpImmediate(Arg0Reg); + + genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg); + genCmpClassFloatCompactIndexR(SendNumArgsReg); + /* begin JumpNonZero: */ + jumpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(ReceiverResultReg); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, ReceiverResultReg, DPFPReg0); + genGetDoubleValueOfinto(Arg0Reg, DPFPReg1); + if (invertComparison) { + + /* May need to invert for NaNs */ + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg0, DPFPReg1); + } + else { + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, DPFPReg1, DPFPReg0); + } + + /* FP jumps are a little weird */ + jumpCond = jumpFPOpcodeGenerator(0); + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNonInt, jmpTarget(jumpFail, gLabel())); + + +# endif /* defined(DPFPReg0) */ + + return CompletePrimitive; +} + + /* CogObjectRepresentation>>#isUnannotatableConstant: */ +static sqInt NoDbgRegParms +isUnannotatableConstant(CogSimStackEntry *simStackEntry) +{ + return (((simStackEntry->type)) == SSConstant) + && ((isImmediate((simStackEntry->constant))) + || (!(shouldAnnotateObjectReference((simStackEntry->constant))))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genAddSmallIntegerTagsTo: */ +static sqInt NoDbgRegParms +genAddSmallIntegerTagsTo(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, aRegister); + return 0; +} + + +/* Set the SmallInteger tag bits when the tag bits may be filled with + garbage. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genClearAndSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genClearAndSetSmallIntegerTagsIn(sqInt scratchReg) +{ + return genSetSmallIntegerTagsIn(scratchReg); +} + + +/* Convert the Character in reg to a SmallInteger, assuming + the Character's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertCharacterToSmallIntegerInReg: */ +static void NoDbgRegParms +genConvertCharacterToSmallIntegerInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertIntegerToSmallIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToSmallIntegerInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, reg); + return 0; +} + + +/* Convert the SmallInteger in reg to a Character, assuming + the SmallInteger's value is a valid character. */ +/* self assume: objectMemory smallIntegerTag = 1 */ + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToCharacterInReg: */ +static void NoDbgRegParms +genConvertSmallIntegerToCharacterInReg(sqInt reg) +{ + assert(((numCharacterBits()) + 1) == (numSmallIntegerBits())); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, reg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genConvertSmallIntegerToIntegerInReg: */ +static sqInt NoDbgRegParms +genConvertSmallIntegerToIntegerInReg(sqInt reg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, reg); + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#generateLowcodeObjectTrampolines */ +static void +generateLowcodeObjectTrampolines(void) +{ + ceFloatObjectOfTrampoline = genTrampolineForcalledfloatArgresult(floatObjectOf, "ceFloatObjectOfTrampoline", DPFPReg0, TempReg); + ceFloatValueOfTrampoline = genTrampolineForcalledargfloatResult(floatValueOf, "ceFloatValueOfTrampoline", ReceiverResultReg, DPFPReg0); + ceInstantiateClassIndexableSizeTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassIndexableSizeTrampoline", Arg0Reg, Arg1Reg, TempReg); + ceInstantiateClassTrampoline = genTrampolineForcalledargargresult(instantiateClassindexableSize, "ceInstantiateClassTrampoline", ReceiverResultReg, 0, TempReg); + ceByteSizeOfTrampoline = genTrampolineForcalledargresult(byteSizeOf, "ceByteSizeOfTrampoline", Arg0Reg, TempReg); + cePositive64BitIntegerTrampoline = genTrampolineForcalledargargresult(positive64BitIntegerFor, "cePositive64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + cePositive64BitValueOfTrampoline = genTrampolineForcalledargresultresult(positive64BitValueOf, "cePositive64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + ceSigned64BitIntegerTrampoline = genTrampolineForcalledargargresult(signed64BitIntegerFor, "ceSigned64BitIntegerTrampoline", ReceiverResultReg, Arg0Reg, TempReg); + ceSigned64BitValueOfTrampoline = genTrampolineForcalledargresultresult(signed64BitValueOf, "ceSigned64BitValueOfTrampoline", ReceiverResultReg, TempReg, Arg0Reg); + + cePositive32BitIntegerTrampoline = genTrampolineForcalledargresult(positive32BitIntegerFor, "cePositive32BitIntegerTrampoline", ReceiverResultReg, TempReg); + cePositive32BitValueOfTrampoline = genTrampolineForcalledargresult(positive32BitValueOf, "cePositive32BitValueOfTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitIntegerTrampoline = genTrampolineForcalledargresult(signed32BitIntegerFor, "ceSigned32BitIntegerTrampoline", ReceiverResultReg, TempReg); + ceSigned32BitValueOfTrampoline = genTrampolineForcalledargresult(signed32BitValueOf, "ceSigned32BitValueOfTrampoline", ReceiverResultReg, TempReg); +} + + +/* indexReg contains the 1-relative index of an element in tableObj. + Since BaseHeaderSize > BytesPerOop we must adjust it to use + it as a zero-relative index from the beginning of the object. */ + + /* CogObjectRepresentationFor32BitSpur>>#genFetchIndexRegister:from:into: */ +static sqInt NoDbgRegParms +genFetchIndexRegisterfrominto(sqInt indexReg, sqInt tableObj, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + assert(indexReg != destReg); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, (BaseHeaderSize / BytesPerWord) - 1, indexReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tableObj)) { + annotateobjRef(gMoveCwR(tableObj, destReg), tableObj); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tableObj, destReg); + } + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, indexReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, encoded as a + SmallInteger. + */ +/* Get header word in scratchReg */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:asSmallIntegerInto: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + genConvertIntegerToSmallIntegerInReg(destReg); + return 0; +} + + +/* Fetch the instance's identity hash into destReg, unencoded. */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetHashFieldNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 4, instReg, destReg); + /* begin AndCq:R: */ + quickConstant = identityHashHalfWordMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return 0; +} + + +/* Extract the inline cache tag for the object in sourceReg into destReg. The + inline cache tag for a given object is the value loaded in inline caches + to distinguish + objects of different classes. In Spur this is either the tags for + immediates, (with + 1 & 3 collapsed to 1 for SmallIntegers, and 2 collapsed to 0 for + Characters), or + the receiver's classIndex. + If forEntry is true answer the entry label at which control is to enter + (cmEntryOffset). If forEntry is false, control enters at the start. + If forEntry is true, generate something like this: + Limm: + andl $0x1, rDest + j Lcmp + Lentry: + movl rSource, rDest + andl $0x3, rDest + jnz Limm + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + If forEntry is false, generate something like the following. + At least on a 2.2GHz Intel Core i7 the following is slightly faster than + the above, + 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks + Lentry: + movl rSource, rDest + andl $0x3, rDest + jz LnotImm + andl $1, rDest + j Lcmp + LnotImm: + movl 0(%edx), rDest + andl $0x3fffff, rDest + Lcmp: + But we expect most SmallInteger arithmetic to be performed in-line and so + prefer the + version that is faster for non-immediates (because it branches for + immediates only). */ + + /* CogObjectRepresentationFor32BitSpur>>#genGetInlineCacheClassTagFrom:into:forEntry: */ +static AbstractInstruction * NoDbgRegParms +genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *entryLabel; + AbstractInstruction *immLabel; + AbstractInstruction *jumpCompare; + AbstractInstruction *jumpNotImm; + sqInt quickConstant; + + if (forEntry) { + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, 1, destReg); + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + /* begin AlignmentNops: */ + genoperand(AlignmentNops, BytesPerWord); + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)immLabel)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, destReg); + jmpTarget(jumpCompare, gLabel()); + } + else { + /* begin Label */ + entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + gAndCqRR(tagMask(), sourceReg, destReg); + /* begin JumpZero: */ + jumpNotImm = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin AndCq:R: */ + anInstruction3 = genoperandoperand(AndCqR, 1, destReg); + /* begin Jump: */ + jumpCompare = genoperand(Jump, ((sqInt)0)); + flag("endianness"); + jmpTarget(jumpNotImm, gMoveMwrR(0, sourceReg, destReg)); + jmpTarget(jumpCompare, gAndCqR(classIndexMask(), destReg)); + } + return entryLabel; +} + + /* CogObjectRepresentationFor32BitSpur>>#genGetOverflowSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetOverflowSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, -BaseHeaderSize, srcReg, destReg); + return 0; +} + + +/* Generate a test for aRegister containing an integer value in the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpIsSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpIsSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpGreaterOrEqual: */ + genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerInScratchReg(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 1, aRegister); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + +/* Generate a test for aRegister containing an integer value outside the + SmallInteger range, and a jump if so, answering the jump. + c.f. Spur32BitMemoryManager>>isIntegerValue: */ + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallIntegerValue:scratch: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg) +{ + return (/* begin MoveR:R: */ + genoperandoperand(MoveRR, aRegister, scratchReg), + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg), + /* begin XorR:R: */ + genoperandoperand(XorRR, aRegister, scratchReg), + /* begin JumpLess: */ + genConditionalBranchoperand(JumpLess, ((sqInt)0))); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpNotSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genJumpSmallInteger: */ +static AbstractInstruction * NoDbgRegParms +genJumpSmallInteger(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + + /* begin TstCq:R: */ + anInstruction = genoperandoperand(TstCqR, 1, aRegister); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcInt32ToOop: */ +static void NoDbgRegParms +genLcInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToInt32: */ +static void NoDbgRegParms +genLcOopToInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceSigned32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcOopToUInt32: */ +static void NoDbgRegParms +genLcOopToUInt32(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitValueOfTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); +} + + /* CogObjectRepresentationFor32BitSpur>>#genLcUInt32ToOop: */ +static void NoDbgRegParms +genLcUInt32ToOop(sqInt value) +{ + AbstractInstruction *abstractInstruction; + + if (value != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, cePositive32BitIntegerTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAt */ +static sqInt +genPrimitiveAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *convertToIntAndReturn; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpIsArray; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpIsWords; + AbstractInstruction *jumpMethodOutOfBounds; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpZero: */ + jumpIsArray = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpBelow: */ + jumpNotIndexable = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpBelowOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsWords = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable, gLabel()); + /* begin Jump: */ + jumpNotIndexable = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsArray, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction7 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), nSlotsOrBytesReg)); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction9 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + methodInBounds = anInstruction9; + + /* formatReg already contains a value <= 16r1f, so no need to zero it */ + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, formatReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, formatReg, ReceiverResultReg); + + /* begin Label */ + convertToIntAndReturn = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genConvertIntegerToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, nSlotsOrBytesReg)); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpIsWords, gCmpRR(Arg1Reg, nSlotsOrBytesReg)); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotSmallIntegerUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)convertToIntAndReturn)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, formatReg); + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant6 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(AndCqR, quickConstant6, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg1Reg); + /* begin AddCq:R: */ + anInstruction14 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + /* begin Jump: */ + jumpMethodOutOfBounds = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpFixedFieldsOutOfBounds, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpMethodOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel()))))))))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveAtPut */ +static sqInt +genPrimitiveAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpArrayOutOfBounds; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpFixedFieldsOutOfBounds; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImmediate; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNonSmallIntegerValue; + AbstractInstruction *jumpNotIndexableBits; + AbstractInstruction *jumpNotIndexablePointers; + AbstractInstruction * jumpNotPointers; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + AbstractInstruction *methodInBounds; + sqInt nSlotsOrBytesReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + + nSlotsOrBytesReg = ClassReg; + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpImmediate = genJumpImmediate(ReceiverResultReg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, nSlotsOrBytesReg); + /* begin CmpCq:R: */ + quickConstant1 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpAbove: */ + jumpNotPointers = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg1Reg, TempReg, 0); + /* begin CmpCq:R: */ + quickConstant2 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpBelow: */ + jumpNotIndexablePointers = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin JumpNonZero: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpArrayOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpHasFixedFields, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, formatReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, formatReg); + /* begin JumpZero: */ + jumpIsContext = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, nSlotsOrBytesReg); + genGetClassObjectOfClassIndexintoscratchReg(formatReg, nSlotsOrBytesReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, nSlotsOrBytesReg, formatReg); + /* begin PopR: */ + genoperand(PopR, nSlotsOrBytesReg); + genConvertSmallIntegerToIntegerInReg(formatReg); + /* begin AndCq:R: */ + quickConstant3 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant3, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin AddCq:R: */ + anInstruction9 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), formatReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpFixedFieldsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, formatReg, Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, Arg1Reg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotPointers, gLabel()); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNonSmallIntegerValue = genJumpNotSmallInteger(Arg1Reg); + /* begin CmpCq:R: */ + quickConstant4 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, formatReg); + /* begin JumpBelow: */ + jumpNotIndexableBits = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + if (!(setsConditionCodesFor(lastOpcode(), JumpLess))) { + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + } + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction13 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR((((usqInt)0xFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), nSlotsOrBytesReg); + gAndCqRR(BytesPerWord - 1, formatReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant7, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + methodInBounds = genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR((((usqInt)0xFFFF << 1) | 1), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, nSlotsOrBytesReg); + /* begin AndCq:R: */ + anInstruction16 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, nSlotsOrBytesReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsCompiledMethod, gLabel()); + getLiteralCountOfplusOneinBytesintoscratch(ReceiverResultReg, 1, 1, nSlotsOrBytesReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, nSlotsOrBytesReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)methodInBounds)); + jmpTarget(jumpIsContext, jmpTarget(jumpNotIndexableBits, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpArrayOutOfBounds, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexablePointers, jmpTarget(jumpNonSmallIntegerValue, jmpTarget(jumpFixedFieldsOutOfBounds, gLabel()))))))))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpIsContext)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction17 = genoperandoperand(AddCqR, 1, Arg0Reg); + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadIndex, jmpTarget(jumpImmediate, gLabel())); + return 0; +} + + +/* Arguably we should fail for immediates, but so far no one has complained, + so... + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveIdentityHash */ +static sqInt +genPrimitiveIdentityHash(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpNotSet; + AbstractInstruction *jumpSI; + AbstractInstruction * ret; + + jumpImm = genJumpImmediate(ReceiverResultReg); + genGetHashFieldNonImmOfasSmallIntegerInto(ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, ConstZero, TempReg); + /* begin JumpZero: */ + jumpNotSet = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + ret = genoperand(RetN, 0); + jmpTarget(jumpImm, gLabel()); + jumpSI = genJumpSmallInteger(ReceiverResultReg); + jmpTarget(jumpSI, ret); + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)ret)); + jmpTarget(jumpNotSet, gLabel()); + return 0; +} + + +/* :Assume the receiuver is never a SmallInteger. One would use ^self for + that. + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveImmediateAsInteger */ +static sqInt +genPrimitiveImmediateAsInteger(void) +{ + genConvertCharacterToSmallIntegerInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + +/* Implement primitiveNew for convenient cases: + - the receiver has a hash + - the receiver is fixed size (excluding ephemerons to save instructions & + miniscule time) + - single word header/num slots < numSlotsMask + - the result fits in eden (actually below scavengeThreshold) + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNew */ +static sqInt +genPrimitiveNew(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpUnhashed; + AbstractInstruction *jumpVariableOrEphemeron; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + AbstractInstruction *skip; + + if (methodOrBlockNumArgs != 0) { + return UnimplementedPrimitive; + } + + /* inst spec will hold class's instance specification, then byte size and finally end of new object. */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* get freeStart as early as possible so as not to wait later... */ + instSpecReg = (byteSizeReg = ClassReg); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = fixedFieldsFieldWidth(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(AndCqR, quickConstant3, TempReg); + /* begin AndCq:R: */ + quickConstant4 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(AndCqR, quickConstant4, instSpecReg); + /* begin CmpCq:R: */ + quickConstant5 = nonIndexablePointerFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + /* begin JumpAbove: */ + jumpVariableOrEphemeron = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + /* begin JumpAboveOrEqual: */ + jumpTooBig = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction13 = genoperandoperand(CmpCqR, 0, byteSizeReg); + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction14 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant7 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, byteSizeReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, byteSizeReg, address1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, Arg1Reg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + /* begin MoveCq:R: */ + quickConstant2 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(MoveCqR, quickConstant2, fillReg); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction7; + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + /* begin AddCq:R: */ + anInstruction17 = genoperandoperand(AddCqR, 8, Arg1Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpUnhashed, jmpTarget(jumpVariableOrEphemeron, jmpTarget(jumpTooBig, jmpTarget(jumpNoSpace, gLabel())))); + return 0; +} + + +/* Implement primitiveNewWithArg for convenient cases: + - the receiver has a hash + - the receiver is variable and not compiled method + - single word header/num slots < numSlotsMask + - the result fits in eden + See superclass method for dynamic frequencies of formats. + For the moment we implement only arrayFormat, firstByteFormat & + firstLongFormat + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveNewWithArg */ +static sqInt +genPrimitiveNewWithArg(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt byteSizeReg; + AbstractInstruction *fillLoop; + sqInt fillReg; + sqInt halfHeaderReg; + sqInt instSpecReg; + AbstractInstruction *jumpArrayFormat; + AbstractInstruction *jumpArrayTooBig; + AbstractInstruction *jumpByteFormat; + AbstractInstruction *jumpBytePrepDone; + AbstractInstruction *jumpByteTooBig; + AbstractInstruction *jumpFailCuzFixed; + AbstractInstruction *jumpHasSlots; + AbstractInstruction *jumpLongPrepDone; + AbstractInstruction *jumpLongTooBig; + AbstractInstruction *jumpNElementsNonInt; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpUnhashed; + sqInt maxSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt quickConstant6; + sqInt quickConstant7; + sqInt quickConstant8; + AbstractInstruction *skip; + sqInt wordConstant; + + if (methodOrBlockNumArgs != 1) { + return UnimplementedPrimitive; + } + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + + /* inst spec will hold class's instance specification and then byte size and finally numSlots half of header */ + halfHeaderReg = (fillReg = SendNumArgsReg); + + /* The max slots we'll allocate here are those for a single header */ + instSpecReg = (byteSizeReg = ClassReg); + + /* get freeStart as early as possible so as not to wait later... */ + maxSlots = (numSlotsMask()) - 1; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, Arg1Reg); + genGetHashFieldNonImmOfinto(ReceiverResultReg, halfHeaderReg); + /* begin JumpZero: */ + jumpUnhashed = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + + /* get class's format inst var for inst spec (format field) */ + jumpNElementsNonInt = genJumpNotSmallInteger(Arg0Reg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ReceiverResultReg, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = (fixedFieldsFieldWidth()) + 1; + genoperandoperand(LogicalShiftRightCqR, quickConstant, instSpecReg); + /* begin AndCq:R: */ + quickConstant3 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(AndCqR, quickConstant3, instSpecReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, TempReg); + /* begin LogicalShiftLeftCq:R: */ + quickConstant1 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + /* begin CmpCq:R: */ + quickConstant4 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(CmpCqR, quickConstant4, instSpecReg); + /* begin JumpZero: */ + jumpArrayFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant5 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction14 = genoperandoperand(CmpCqR, quickConstant5, instSpecReg); + /* begin JumpZero: */ + jumpByteFormat = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant6 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction15 = genoperandoperand(CmpCqR, quickConstant6, instSpecReg); + /* begin JumpNonZero: */ + jumpFailCuzFixed = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant7 = (((usqInt)maxSlots << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction16 = genoperandoperand(CmpCqR, quickConstant7, Arg0Reg); + /* begin JumpAbove: */ + jumpLongTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, 0); + /* begin Jump: */ + jumpLongPrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpByteFormat, gCmpCqR((((usqInt)(maxSlots * BytesPerWord) << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpByteTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, BytesPerWord, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, instSpecReg, TempReg); + /* begin AndCq:R: */ + anInstruction17 = genoperandoperand(AndCqR, BytesPerWord - 1, TempReg); + /* begin LogicalShiftLeftCq:R: */ + quickConstant2 = formatShift(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant2, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, halfHeaderReg); + /* begin AddCq:R: */ + anInstruction18 = genoperandoperand(AddCqR, BytesPerWord - 1, instSpecReg); + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, shiftForWord(), instSpecReg); + /* begin PushCq: */ + anInstruction3 = genoperand(PushCq, 0); + /* begin Jump: */ + jumpBytePrepDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpArrayFormat, gCmpCqR((((usqInt)maxSlots << 1) | 1), Arg0Reg)); + /* begin JumpAbove: */ + jumpArrayTooBig = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, instSpecReg); + /* begin PushCw: */ + wordConstant = nilObject(); + /* begin gen:literal: */ + anInstruction4 = genoperand(PushCw, wordConstant); + jmpTarget(jumpBytePrepDone, jmpTarget(jumpLongPrepDone, gLabel())); + /* begin MoveR:Mw:r: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 0, Arg1Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instSpecReg, halfHeaderReg); + /* begin CmpCq:R: */ + anInstruction19 = genoperandoperand(CmpCqR, 0, byteSizeReg); + /* begin JumpNonZero: */ + jumpHasSlots = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction6 = genoperandoperand(MoveCqR, BaseHeaderSize * 2, byteSizeReg); + /* begin Jump: */ + skip = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasSlots, gMoveRR(byteSizeReg, TempReg)); + /* begin AndCq:R: */ + anInstruction20 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, byteSizeReg); + /* begin AddCq:R: */ + anInstruction21 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, byteSizeReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), byteSizeReg); + jmpTarget(skip, gLogicalShiftLeftCqR(numSlotsHalfShift(), halfHeaderReg)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, byteSizeReg); + /* begin CmpCq:R: */ + quickConstant8 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction22 = genoperandoperand(CmpCqR, quickConstant8, byteSizeReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, byteSizeReg, address1); + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, halfHeaderReg, 4, ReceiverResultReg); + /* begin PopR: */ + genoperand(PopR, fillReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction9 = genoperandoperandoperand(LoadEffectiveAddressMwrR, BaseHeaderSize, ReceiverResultReg, Arg1Reg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, fillReg, 0, Arg1Reg); + fillLoop = anInstruction10; + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, fillReg, 4, Arg1Reg); + /* begin AddCq:R: */ + anInstruction23 = genoperandoperand(AddCqR, 8, Arg1Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, byteSizeReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)fillLoop)); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNoSpace, gPopR(TempReg)); + jmpTarget(jumpUnhashed, jmpTarget(jumpFailCuzFixed, jmpTarget(jumpArrayTooBig, jmpTarget(jumpByteTooBig, jmpTarget(jumpLongTooBig, jmpTarget(jumpNElementsNonInt, gLabel())))))); + return 0; +} + + +/* Implement primitiveShallowCopy/primitiveClone for convenient cases: + - the receiver is not a context + - the receiver is not a compiled method + - the result fits in eden (actually below scavengeThreshold) */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveShallowCopy */ +static sqInt +genPrimitiveShallowCopy(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *continuance; + AbstractInstruction *copyLoop; + sqInt formatReg; + AbstractInstruction * jumpEmpty; + AbstractInstruction *jumpImmediate; + AbstractInstruction *jumpIsMethod; + AbstractInstruction *jumpNoSpace; + AbstractInstruction *jumpTooBig; + AbstractInstruction *jumpVariable; + sqInt ptrReg; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + sqInt resultReg; + sqInt slotsReg; + + jumpImmediate = genJumpImmediate(ReceiverResultReg); + resultReg = Arg0Reg; + + /* get freeStart as early as possible so as not to wait later... */ + slotsReg = Arg1Reg; + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, resultReg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (ptrReg = (formatReg = SendNumArgsReg)), NoReg); + /* begin CmpCq:R: */ + quickConstant = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = indexablePointersFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpZero: */ + jumpVariable = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin Label */ + continuance = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + genGetRawSlotSizeOfNonImminto(ReceiverResultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant2 = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction13 = genoperandoperand(CmpCqR, quickConstant2, slotsReg); + /* begin JumpZero: */ + jumpTooBig = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction14 = genoperandoperand(CmpCqR, 0, slotsReg); + /* begin JumpZero: */ + jumpEmpty = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, slotsReg, TempReg); + /* begin AndCq:R: */ + anInstruction15 = genoperandoperand(AndCqR, 1, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, TempReg, slotsReg); + /* begin AddCq:R: */ + anInstruction16 = genoperandoperand(AddCqR, BaseHeaderSize / BytesPerWord, slotsReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), slotsReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, resultReg, slotsReg); + /* begin CmpCq:R: */ + quickConstant3 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction17 = genoperandoperand(CmpCqR, quickConstant3, slotsReg); + /* begin JumpAboveOrEqual: */ + jumpNoSpace = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ptrReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, slotsReg, address1); + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, BytesPerWord * 2, slotsReg); + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + /* begin AndCq:R: */ + quickConstant4 = (((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask()); + /* begin gen:quickConstant:operand: */ + anInstruction18 = genoperandoperand(AndCqR, quickConstant4, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, 0, resultReg); + /* begin MoveMw:r:R: */ + anInstruction5 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + /* begin AndCq:R: */ + quickConstant5 = ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))); + /* begin gen:quickConstant:operand: */ + anInstruction19 = genoperandoperand(AndCqR, quickConstant5, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction6 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, resultReg); + /* begin Label */ + copyLoop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin AddCq:R: */ + anInstruction20 = genoperandoperand(AddCqR, BytesPerWord * 2, ReceiverResultReg); + /* begin AddCq:R: */ + anInstruction21 = genoperandoperand(AddCqR, BytesPerWord * 2, ptrReg); + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, 0, ReceiverResultReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ptrReg); + /* begin MoveMw:r:R: */ + anInstruction9 = genoperandoperandoperand(MoveMwrR, BytesPerWord, ReceiverResultReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, BytesPerWord, ptrReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ptrReg, slotsReg); + /* begin JumpAbove: */ + genConditionalBranchoperand(JumpAbove, ((sqInt)copyLoop)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, resultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpVariable, gLabel()); + genGetClassIndexOfNonImminto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + anInstruction22 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, ClassReg); + /* begin JumpNonZero: */ + genConditionalBranchoperand(JumpNonZero, ((sqInt)continuance)); + jmpTarget(jumpImmediate, jmpTarget(jumpNoSpace, jmpTarget(jumpIsMethod, jmpTarget(jumpTooBig, jmpTarget(jumpEmpty, gLabel()))))); + return 0; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAt */ +static sqInt +genPrimitiveStringAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + AbstractInstruction *done; + sqInt formatReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpWordsDone; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordTooBig; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, Arg1Reg); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genConvertSmallIntegerToIntegerInReg(Arg1Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg1Reg); + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant, formatReg); + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpLess: */ + jumpNotIndexable = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg1Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg1Reg, ReceiverResultReg, TempReg); + jumpWordTooBig = jumpNotCharacterUnsignedValueInRegister(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ReceiverResultReg); + /* begin Jump: */ + jumpWordsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); + /* begin MoveXbr:R:R: */ + genoperandoperandoperand(MoveXbrRR, Arg1Reg, ReceiverResultReg, ReceiverResultReg); + /* begin AndCq:R: */ + anInstruction2 = genoperandoperand(AndCqR, 0xFF, ReceiverResultReg); + + jmpTarget(jumpWordsDone, (done = gLabel())); + genConvertIntegerToCharacterInReg(ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 1) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg1Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg1Reg, ReceiverResultReg); + /* begin MoveM16:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, BaseHeaderSize, ReceiverResultReg, ReceiverResultReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)done)); + jmpTarget(jumpWordTooBig, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, jmpTarget(jumpNotIndexable, jmpTarget(jumpBadIndex, gLabel())))))); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: SpurMemoryManager>>lengthOf:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationFor32BitSpur>>#genPrimitiveStringAtPut */ +static sqInt +genPrimitiveStringAtPut(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt formatReg; + AbstractInstruction *jumpBadArg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBytesOutOfBounds; + AbstractInstruction *jumpBytesOutOfRange; + AbstractInstruction * jumpImmutable; + AbstractInstruction *jumpIsBytes; + AbstractInstruction * jumpIsCompiledMethod; + AbstractInstruction *jumpIsShorts; + AbstractInstruction * jumpNotString; + AbstractInstruction *jumpShortsOutOfBounds; + AbstractInstruction *jumpShortsOutOfRange; + AbstractInstruction *jumpWordsOutOfBounds; + AbstractInstruction *jumpWordsOutOfRange; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + + /* begin genLoadArgAtDepth:into: */ + assert(1 < (numRegArgs())); + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + jumpBadArg = genJumpNotCharacterInScratchReg(TempReg); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, Arg0Reg); + +# if IMMUTABILITY + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), TempReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(TstCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpImmutable = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + +# else /* IMMUTABILITY */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, (formatReg = SendNumArgsReg), NoReg); + +# endif /* IMMUTABILITY */ + + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant1 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, formatReg); + /* begin JumpBelow: */ + jumpNotString = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsCompiledMethod = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(CmpCqR, quickConstant3, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(CmpCqR, quickConstant4, formatReg); + /* begin JumpAboveOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, 0, Arg1Reg); + /* begin JumpLess: */ + jumpWordsOutOfRange = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpWordsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsShorts, gCmpCqR(characterObjectOf(0xFFFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpShortsOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - 1, ClassReg); + /* begin AndCq:R: */ + anInstruction9 = genoperandoperand(AndCqR, (BytesPerWord / 2) - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpShortsOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin MoveR:M16:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM16r, TempReg, BaseHeaderSize, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpIsBytes, gCmpCqR(characterObjectOf(0xFF), Arg1Reg)); + /* begin JumpAbove: */ + jumpBytesOutOfRange = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), ClassReg); + /* begin AndCq:R: */ + anInstruction10 = genoperandoperand(AndCqR, BytesPerWord - 1, formatReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, formatReg, ClassReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ClassReg); + /* begin JumpBelowOrEqual: */ + jumpBytesOutOfBounds = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, TempReg); + genConvertCharacterToCodeInReg(TempReg); + /* begin AddCq:R: */ + anInstruction11 = genoperandoperand(AddCqR, BaseHeaderSize, Arg0Reg); + /* begin MoveR:Xbr:R: */ + genoperandoperandoperand(MoveRXbrR, TempReg, Arg0Reg, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotString, jmpTarget(jumpBytesOutOfRange, jmpTarget(jumpShortsOutOfRange, jmpTarget(jumpWordsOutOfRange, jmpTarget(jumpIsCompiledMethod, jmpTarget(jumpBytesOutOfBounds, jmpTarget(jumpShortsOutOfBounds, jmpTarget(jumpWordsOutOfBounds, gLabel())))))))); + +# if IMMUTABILITY + jmpTarget(jumpImmutable, getJmpTarget(jumpNotString)); + +# endif /* IMMUTABILITY */ + + /* begin AddCq:R: */ + anInstruction12 = genoperandoperand(AddCqR, 1, Arg0Reg); + genConvertIntegerToSmallIntegerInReg(Arg0Reg); + jmpTarget(jumpBadArg, jmpTarget(jumpBadIndex, gLabel())); + return CompletePrimitive; +} + + /* CogObjectRepresentationFor32BitSpur>>#genRemoveSmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 1, scratchReg); + return 0; +} + + /* CogObjectRepresentationFor32BitSpur>>#genShiftAwaySmallIntegerTagsInScratchReg: */ +static sqInt NoDbgRegParms +genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg) +{ + /* begin ArithmeticShiftRightCq:R: */ + genoperandoperand(ArithmeticShiftRightCqR, 1, scratchReg); + return 0; +} + + +/* Get the literal count of a CompiledMethod into headerReg, plus one if + requested. If inBytes is true, scale the count by the word size. Deal with + the possibility of + the method being cogged. */ + + /* CogObjectRepresentationFor32BitSpur>>#getLiteralCountOf:plusOne:inBytes:into:scratch: */ +static sqInt NoDbgRegParms +getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + genGetMethodHeaderOfintoscratch(methodReg, litCountReg, scratchReg); + if (inBytes) { + /* begin AndCq:R: */ + quickConstant = ((sqInt)((usqInt)((alternateHeaderNumLiteralsMask())) << 1)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, litCountReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, litCountReg); + } + else { + /* begin LogicalShiftRightCq:R: */ + genoperandoperand(LogicalShiftRightCqR, 1, litCountReg); + /* begin AndCq:R: */ + quickConstant1 = alternateHeaderNumLiteralsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant1, litCountReg); + } + if (plusOne) { + /* begin AddCq:R: */ + quickConstant2 = (inBytes + ? BytesPerWord + : 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, litCountReg); + } + return 0; +} + + +/* Answer the relevant inline cache tag for an instance. + c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */ + + /* CogObjectRepresentationFor32BitSpur>>#inlineCacheTagForInstance: */ +static sqInt NoDbgRegParms +inlineCacheTagForInstance(sqInt oop) +{ + return (isImmediate(oop) + ? oop & 1 + : classIndexOf(oop)); +} + + /* CogObjectRepresentationFor32BitSpur>>#jumpNotSmallIntegerUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + + /* begin CmpCq:R: */ + anInstruction = genoperandoperand(CmpCqR, 0x3FFFFFFF, reg); + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in an inline cache preceding address in + cogMethodOrNil. Answer if code was modified. */ + + /* CogObjectRepresentationFor32BitSpur>>#markAndTraceCacheTagLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + rewriteInlineCacheTagat(backEnd(), objOop, address); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + /* CogObjectRepresentationFor32BitSpur>>#numSmallIntegerBits */ +static sqInt +numSmallIntegerBits(void) +{ + return 0x1F; +} + + +/* The two valid tag patterns are 0 (Character) and 1 (SmallInteger) */ + + /* CogObjectRepresentationFor32BitSpur>>#validInlineCacheTag: */ +static sqInt NoDbgRegParms +validInlineCacheTag(usqInt classIndexOrTagPattern) +{ + return (classIndexOrTagPattern <= 1) + || ((classAtIndex(classIndexOrTagPattern)) != null); +} + + +/* Answer if the cacheTag is not unmarked, i.e. answer true for compact class + indices and immediates; only answer false for unmarked objects. In Spur + linked send cache tags are class indices so effectively they're always + marked. */ + + /* CogObjectRepresentationForSpur>>#cacheTagIsMarked: */ +static sqInt NoDbgRegParms +cacheTagIsMarked(sqInt cacheTag) +{ + return 1; +} + + /* CogObjectRepresentationForSpur>>#checkValidOopReference: */ +static sqInt NoDbgRegParms +checkValidOopReference(sqInt anOop) +{ + return (isImmediate(anOop)) + || ((heapMapAtWord(pointerForOop(anOop))) != 0); +} + + /* CogObjectRepresentationForSpur>>#couldBeObject: */ +static sqInt NoDbgRegParms +couldBeObject(sqInt literal) +{ + return (isNonImmediate(literal)) + && (oopisGreaterThanOrEqualTo(literal, startOfMemory())); +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genActiveContextTrampolineLarge:inBlock:called: */ +static sqInt NoDbgRegParms +genActiveContextTrampolineLargeinBlockcalled(sqInt isLarge, sqInt isInBlock, char *aString) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genGetActiveContextLargeinBlock(isLarge, isInBlock); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress(aString, startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Check the remembered bit of the object in objReg; answer the jump taken if + the bit is already set. + Only need to fetch the byte containing it, which reduces the size of the + mask constant. + */ + + /* CogObjectRepresentationForSpur>>#genCheckRememberedBitOf:scratch: */ +static AbstractInstruction * NoDbgRegParms +genCheckRememberedBitOfscratch(sqInt objReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + int mask; + sqInt rememberedBitByteOffset; + + rememberedBitByteOffset = (rememberedBitShift()) / 8; + mask = 1U << ((rememberedBitShift()) % 8); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, rememberedBitByteOffset, objReg, scratchReg); + /* begin TstCq:R: */ + anInstruction1 = genoperandoperand(TstCqR, mask, scratchReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genConvertCharacterToCodeInReg: */ +static sqInt NoDbgRegParms +genConvertCharacterToCodeInReg(sqInt reg) +{ + sqInt quickConstant; + + /* begin LogicalShiftRightCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, reg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genConvertIntegerToCharacterInReg: */ +static sqInt NoDbgRegParms +genConvertIntegerToCharacterInReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin LogicalShiftLeftCq:R: */ + quickConstant = numTagBits(); + genoperandoperand(LogicalShiftLeftCqR, quickConstant, reg); + /* begin AddCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AddCqR, quickConstant1, reg); + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. If numCopied > 0 pop those values off the stack. */ + + /* CogObjectRepresentationForSpur>>#genCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *anInstruction; + sqInt i; + + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(bcpc, numArgs, numCopied, ctxtNumArgs, isLargeCtxt, isInBlock); + for (i = 1; i <= numCopied; i += 1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (((numCopied - i) + ClosureFirstCopiedValueIndex) * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + } + return 0; +} + + +/* Create a full closure with the given values. */ + + /* CogObjectRepresentationForSpur>>#genCreateFullClosure:numArgs:numCopied:ignoreContext:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(sqInt compiledBlock, sqInt numArgs, sqInt numCopied, sqInt ignoreContext, sqInt contextNumArgs, sqInt contextIsLarge, sqInt contextIsBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + sqInt constant; + usqLong header; + sqInt numSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultReg and thence in ClassReg. */ + if (ignoreContext) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ClassReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction11 = genoperandoperand(MoveCqR, constant, ClassReg); + } + } + else { + genGetActiveContextNumArgslargeinBlock(contextNumArgs, contextIsLarge, contextIsBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + } + numSlots = FullClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + assert(ClassFullBlockClosureCompactIndex != 0); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassFullBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant2 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant2, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(compiledBlock)) { + annotateobjRef(gMoveCwR(compiledBlock, TempReg), compiledBlock); + } + else { + /* begin MoveCq:R: */ + anInstruction13 = genoperandoperand(MoveCqR, compiledBlock, TempReg); + } + /* begin MoveR:Mw:r: */ + anInstruction8 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction9 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + return 0; +} + + +/* Make sure that the object in reg is not forwarded. This routine assumes + the object will + never be forwarded to an immediate, as it is used to unforward literal + variables (associations). + Use the fact that isForwardedObjectClassIndexPun is a power of two to save + an instruction. */ + + /* CogObjectRepresentationForSpur>>#genEnsureObjInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *loop; + AbstractInstruction *ok; + sqInt quickConstant; + + assert(reg != scratch); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, gLabel()); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch) +{ + return genEnsureOopInRegNotForwardedscratchRegjumpBackTo(reg, scratch, gLabel()); +} + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:jumpBackTo: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegjumpBackTo(sqInt reg, sqInt scratch, AbstractInstruction *instruction) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *finished; + AbstractInstruction *imm; + AbstractInstruction *ok; + sqInt quickConstant; + + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(reg != scratch); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) instruction)))); + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + jmpTarget(imm, jmpTarget(ok, finished)); + return 0; +} + + +/* Make sure that the oop in reg is not forwarded, updating the slot in + objReg with the value. + */ + + /* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg:updatingSlot:in: */ +static sqInt NoDbgRegParms +genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *imm; + AbstractInstruction *loop; + AbstractInstruction *ok; + sqInt quickConstant; + + + /* Open-code + self genEnsureOopInRegNotForwarded: reg + scratchReg: scratch + updatingMw: index * objectMemory wordSize + objectMemory baseHeaderSize + r: objReg. + to avoid calling the store check unless the receiver is forwarded. */ + assert((reg != scratch) + && (objReg != scratch)); + /* begin Label */ + loop = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(reg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, reg, scratch); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, scratch); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, reg, reg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, reg, (index * BytesPerWord) + BaseHeaderSize, objReg); + assert((reg == Arg0Reg) + && ((scratch == TempReg) + && (objReg == ReceiverResultReg))); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckContextReceiverTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(ok, jmpTarget(imm, gLabel())); + return 0; +} + + +/* Do the store check. Answer the argument for the benefit of the code + generator; ReceiverResultReg may be caller-saved and hence smashed by this + call. Answering + it allows the code generator to reload ReceiverResultReg cheaply. + In Spur the only thing we leave to the run-time is adding the receiver to + the remembered set and setting its isRemembered bit. */ + + /* CogObjectRepresentationForSpur>>#generateObjectRepresentationTrampolines */ +static void +generateObjectRepresentationTrampolines(void) +{ + sqInt instVarIndex; + AbstractInstruction *jumpSC; + + +# if IMMUTABILITY + for (instVarIndex = 0; instVarIndex < NumStoreTrampolines; instVarIndex += 1) { + ceStoreTrampolines[instVarIndex] = (genStoreTrampolineCalledinstVarIndex(trampolineNamenumArgslimit("ceStoreTrampoline", instVarIndex, NumStoreTrampolines - 2), instVarIndex)); + } + +# endif /* IMMUTABILITY */ + + /* begin genStoreCheckTrampoline */ + if (CheckRememberedInTrampoline) { + zeroOpcodeIndex(); + jumpSC = genCheckRememberedBitOfscratch(ReceiverResultReg, V0); + assert(((jumpSC->opcode)) == JumpNonZero); + (jumpSC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSC, gLabel()); + } + ceStoreCheckTrampoline = genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, "ceStoreCheckTrampoline", 1, ReceiverResultReg, null, null, null, ((CallerSavedRegisterMask | (1U << ReceiverResultReg)) - (1U << ReceiverResultReg)), 1, (CallerSavedRegisterMask & (1U << ReceiverResultReg) + ? ReceiverResultReg + : (/* begin cResultRegister */ + V0)), CheckRememberedInTrampoline); + ceStoreCheckContextReceiverTrampoline = genStoreCheckContextReceiverTrampoline(); + ceScheduleScavengeTrampoline = genTrampolineForcalledregsToSave(ceScheduleScavenge, "ceScheduleScavengeTrampoline", CallerSavedRegisterMask); + ceSmallActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, 0, "ceSmallMethodContext"); + ceSmallActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InVanillaBlock, "ceSmallBlockContext"); + ceSmallActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, InFullBlock, "ceSmallFullBlockContext"); + + ceLargeActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, 0, "ceLargeMethodContext"); + ceLargeActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InVanillaBlock, "ceLargeBlockContext"); + ceLargeActiveContextInFullBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, InFullBlock, "ceLargeFullBlockContext"); + + generateLowcodeObjectTrampolines(); + +} + + +/* Create a trampoline to answer the active context that will + answer it if a frame is already married, and create it otherwise. + Assume numArgs is in SendNumArgsReg and ClassReg is free. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextLarge:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextLargeinBlock(sqInt isLarge, sqInt isInBlock) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction22; + AbstractInstruction *anInstruction23; + AbstractInstruction *anInstruction24; + AbstractInstruction *anInstruction25; + AbstractInstruction *anInstruction26; + AbstractInstruction *anInstruction27; + AbstractInstruction *anInstruction28; + AbstractInstruction *anInstruction29; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction30; + AbstractInstruction *anInstruction31; + AbstractInstruction *anInstruction32; + AbstractInstruction *anInstruction33; + AbstractInstruction *anInstruction34; + AbstractInstruction *anInstruction35; + AbstractInstruction *anInstruction36; + AbstractInstruction *anInstruction37; + AbstractInstruction *anInstruction38; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt constant; + AbstractInstruction *continuation; + AbstractInstruction *exit; + usqLong header; + AbstractInstruction * inst; + AbstractInstruction *jumpNeedScavenge; + AbstractInstruction *jumpSingle; + AbstractInstruction *loopHead; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + AbstractInstruction * self_in_saveAndRestoreLinkRegAround; + sqInt slotSize; + + + /* load the flag; stash it in both TempReg & ClassReg; do the compare (a prime candidated for use of AndCq:R:R:) */ + /* begin MoveMw:r:R: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, FoxMethod, FPReg, ClassReg); + gAndCqRR(MFMethodFlagHasContextFlag, ClassReg, TempReg); + /* begin JumpZero: */ + jumpSingle = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction7 = genoperandoperandoperand(MoveMwrR, FoxThisContext, FPReg, ReceiverResultReg); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpSingle, gLabel()); + /* begin OrCq:R: */ + anInstruction8 = genoperandoperand(OrCqR, MFMethodFlagHasContextFlag, ClassReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, ClassReg, FoxMethod, FPReg); + + switch (isInBlock) { + case InFullBlock: + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, 3, ClassReg); + break; + case InVanillaBlock: + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 3, ClassReg); + /* begin MoveM16:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveM16rR, 0, ClassReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, TempReg, ClassReg); + break; + case 0: + /* begin SubCq:R: */ + anInstruction3 = genoperandoperand(SubCqR, 1, ClassReg); + break; + default: + error("Case not found and no otherwise clause"); + } + slotSize = (isLarge + ? LargeContextSlots + : SmallContextSlots); + header = headerForSlotsformatclassIndex(slotSize, indexablePointersFormat(), ClassMethodContextCompactIndex); + flag("endianness"); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction10 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant2 = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction21 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction31 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + /* begin AddCq:R: */ + quickConstant4 = smallObjectBytesForSlots(slotSize); + /* begin gen:quickConstant:operand: */ + anInstruction32 = genoperandoperand(AddCqR, quickConstant4, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction13 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant5 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction33 = genoperandoperand(CmpCqR, quickConstant5, TempReg); + /* begin JumpAboveOrEqual: */ + jumpNeedScavenge = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveR:R: */ + continuation = genoperandoperand(MoveRR, FPReg, TempReg); + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction14 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (SenderIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + anInstruction15 = genoperandoperandoperand(MoveMwrR, FoxSavedFP, FPReg, TempReg); + genSetSmallIntegerTagsIn(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction16 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (InstructionPointerIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction18 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (MethodIndex * BytesPerWord), ReceiverResultReg); + /* begin MoveR:Mw:r: */ + anInstruction19 = genoperandoperandoperand(MoveRMwr, ReceiverResultReg, FoxThisContext, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SPReg, TempReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = 2; + genoperandoperand(LogicalShiftRightCqR, quickConstant, TempReg); + /* begin SubCq:R: */ + quickConstant3 = 3; + /* begin gen:quickConstant:operand: */ + anInstruction20 = genoperandoperand(SubCqR, quickConstant3, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, SendNumArgsReg, TempReg); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:Mw:r: */ + anInstruction22 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (StackPointerIndex * BytesPerOop), ReceiverResultReg); + if (isInBlock > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin AddCq:R: */ + anInstruction29 = genoperandoperand(AddCqR, 2, TempReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + } + else { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction30 = genoperandoperand(MoveCqR, constant, TempReg); + } + } + /* begin MoveR:Mw:r: */ + anInstruction23 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ClosureIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveMw:r:R: */ + anInstruction24 = genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction25 = genoperandoperandoperand(MoveRMwr, TempReg, BaseHeaderSize + (ReceiverIndex * BytesPerOop), ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction26 = genoperandoperand(MoveCqR, 1, ClassReg); + /* begin CmpR:R: */ + loopHead = genoperandoperand(CmpRR, SendNumArgsReg, ClassReg); + /* begin JumpGreater: */ + exit = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, ClassReg, TempReg); + /* begin AddCq:R: */ + anInstruction34 = genoperandoperand(AddCqR, 2, TempReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, TempReg, FPReg, TempReg); + /* begin AddCq:R: */ + anInstruction35 = genoperandoperand(AddCqR, ReceiverIndex + (BaseHeaderSize / BytesPerWord), ClassReg); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, ClassReg, ReceiverResultReg); + /* begin SubCq:R: */ + anInstruction27 = genoperandoperand(SubCqR, (ReceiverIndex + (BaseHeaderSize / BytesPerWord)) - 1, ClassReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin MoveCq:R: */ + quickConstant1 = nilObject(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, ClassReg); + /* begin AddCq:R: */ + anInstruction36 = genoperandoperand(AddCqR, FoxMFReceiver, ClassReg); + /* begin AddCq:R: */ + anInstruction37 = genoperandoperand(AddCqR, (ReceiverIndex + 1) + (BaseHeaderSize / BytesPerWord), SendNumArgsReg); + /* begin SubCq:R: */ + anInstruction28 = genoperandoperand(SubCqR, BytesPerWord, ClassReg); + loopHead = anInstruction28; + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SPReg, ClassReg); + /* begin JumpBelow: */ + exit = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, SendNumArgsReg, ReceiverResultReg); + /* begin AddCq:R: */ + anInstruction38 = genoperandoperand(AddCqR, 1, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loopHead)); + jmpTarget(exit, gLabel()); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNeedScavenge, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + self_in_saveAndRestoreLinkRegAround = ((AbstractInstruction *) (backEnd())); + /* begin PushR: */ + inst = genoperand(PushR, LinkReg); + CallRTregistersToBeSavedMask(ceScheduleScavengeTrampoline, ((1U << ReceiverResultReg) | (1U << SendNumArgsReg)) | (1U << ClassReg)); + + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuation)); + return 0; +} + + +/* Get the active context into ReceiverResultReg, creating it if necessary. */ + + /* CogObjectRepresentationForSpur>>#genGetActiveContextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genGetActiveContextNumArgslargeinBlock(sqInt numArgs, sqInt isLargeContext, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt routine; + + if (isLargeContext) { + + switch (isInBlock) { + case 0: + routine = ceLargeActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceLargeActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceLargeActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + else { + + switch (isInBlock) { + case 0: + routine = ceSmallActiveContextInMethodTrampoline; + + break; + case InVanillaBlock: + routine = ceSmallActiveContextInBlockTrampoline; + + break; + case InFullBlock: + routine = ceSmallActiveContextInFullBlockTrampoline; + + break; + default: + error("Case not found and no otherwise clause"); + routine = -1; + } + } + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, routine); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetBits:ofFormatByteOf:into: */ +static sqInt NoDbgRegParms +genGetBitsofFormatByteOfinto(sqInt mask, sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + /* begin AndCq:R: */ + anInstruction1 = genoperandoperand(AndCqR, mask, destReg); + return 0; +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetClassIndexOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin AndCq:R: */ + quickConstant = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, destReg); + return 0; +} + + +/* Fetch the class object whose index is in instReg into destReg. + It is non-obvious, but the Cogit assumes loading a class does not involve + a runtime call, so do not call classAtIndex: */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOfClassIndex:into:scratchReg: */ +static sqInt NoDbgRegParms +genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant2; + + assert(instReg != destReg); + assert(instReg != scratchReg); + assert(destReg != scratchReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin LogicalShiftRightCq:R: */ + quickConstant = classTableMajorIndexShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, scratchReg); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, shiftForWord(), scratchReg); + assert(!(shouldAnnotateObjectReference(classTableRootObj()))); + /* begin MoveMw:r:R: */ + offset = (classTableRootObj()) + BaseHeaderSize; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, scratchReg, destReg); + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant2 = classTableMinorIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + /* begin AddCq:R: */ + anInstruction4 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), scratchReg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, scratchReg, destReg, destReg); + return 0; +} + + +/* Fetch the instance's class into destReg. If the instance is not the + receiver and is forwarded, follow forwarding. */ + + /* CogObjectRepresentationForSpur>>#genGetClassObjectOf:into:scratchReg:instRegIsReceiver: */ +static sqInt NoDbgRegParms +genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpIsImm; + AbstractInstruction *jumpNotForwarded; + AbstractInstruction *loop; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + if ((instReg == destReg) + || ((instReg == scratchReg) + || (destReg == scratchReg))) { + return BadRegisterSet; + } + /* begin MoveR:R: */ + loop = genoperandoperand(MoveRR, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant1 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(AndCqR, quickConstant1, scratchReg); + /* begin JumpNonZero: */ + jumpIsImm = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + flag("endianness"); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, instReg, scratchReg); + /* begin AndCq:R: */ + quickConstant2 = classIndexMask(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(AndCqR, quickConstant2, scratchReg); + if (!instRegIsReceiver) { + + /* if it is forwarded... */ + /* begin CmpCq:R: */ + quickConstant = isForwardedObjectClassIndexPun(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, scratchReg); + /* begin JumpNonZero: */ + jumpNotForwarded = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, BaseHeaderSize, instReg, instReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)loop)); + jmpTarget(jumpNotForwarded, gLabel()); + } + jmpTarget(jumpIsImm, gMoveRR(scratchReg, destReg)); + if (scratchReg == TempReg) { + /* begin PushR: */ + genoperand(PushR, instReg); + genGetClassObjectOfClassIndexintoscratchReg(destReg, instReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, instReg, destReg); + /* begin PopR: */ + genoperand(PopR, instReg); + } + else { + genGetClassObjectOfClassIndexintoscratchReg(destReg, scratchReg, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, scratchReg, destReg); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */ +static AbstractInstruction * NoDbgRegParms +genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) +{ + return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1); +} + + +/* Fetch the instance's class index into destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetCompactClassIndexNonImmOf:into: */ +static sqInt NoDbgRegParms +genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg) +{ + return genGetClassIndexOfNonImminto(instReg, destReg); +} + + /* CogObjectRepresentationForSpur>>#genGetDoubleValueOf:into: */ +static sqInt NoDbgRegParms +genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, BaseHeaderSize, srcReg, destFPReg); + return 0; +} + + +/* Get the format field of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into: */ +static sqInt NoDbgRegParms +genGetFormatOfinto(sqInt srcReg, sqInt destReg) +{ + return genGetBitsofFormatByteOfinto(formatMask(), srcReg, destReg); +} + + +/* Get the format of the object in sourceReg into destReg. If + scratchRegOrNone is not NoReg, load at least the least significant 32-bits + (64-bits in 64-bits) of the + header word, which contains the format, into scratchRegOrNone. */ + + /* CogObjectRepresentationForSpur>>#genGetFormatOf:into:leastSignificantHalfOfBaseHeaderIntoScratch: */ +static sqInt NoDbgRegParms +genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, sqInt destReg, sqInt scratchRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt quickConstant; + sqInt quickConstant1; + + if (scratchRegOrNone == NoReg) { + flag("endianness"); + /* begin MoveMb:r:R: */ + anInstruction = genoperandoperandoperand(MoveMbrR, 3, sourceReg, destReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, destReg, scratchRegOrNone); + /* begin LogicalShiftRightCq:R: */ + quickConstant = formatShift(); + genoperandoperand(LogicalShiftRightCqR, quickConstant, destReg); + } + /* begin AndCq:R: */ + quickConstant1 = formatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant1, destReg); + return 0; +} + + +/* Get the size in word-sized slots of the object in srcReg into destReg. + srcReg may equal destReg. */ + + /* CogObjectRepresentationForSpur>>#genGetNumSlotsOf:into: */ +static sqInt NoDbgRegParms +genGetNumSlotsOfinto(sqInt srcReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jmp; + sqInt quickConstant; + + assert(srcReg != destReg); + genGetRawSlotSizeOfNonImminto(srcReg, destReg); + /* begin CmpCq:R: */ + quickConstant = numSlotsMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, destReg); + /* begin JumpLess: */ + jmp = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genGetOverflowSlotsOfinto(srcReg, destReg); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* The raw numSlots field is the most significant byte of the 64-bit header + word. MoveMbrR zero-extends. */ + + /* CogObjectRepresentationForSpur>>#genGetRawSlotSizeOfNonImm:into: */ +static sqInt NoDbgRegParms +genGetRawSlotSizeOfNonImminto(sqInt sourceReg, sqInt destReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, destReg); + + /* begin MoveMb:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMbrR, 7, sourceReg, destReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genJumpImmediate: */ +static AbstractInstruction * NoDbgRegParms +genJumpImmediate(sqInt aRegister) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin TstCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(TstCqR, quickConstant, aRegister); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genJumpImmutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpImmutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + /* begin genJumpBaseHeaderImmutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpMutable:scratchReg: */ +#if IMMUTABILITY +static AbstractInstruction * NoDbgRegParms +genJumpMutablescratchReg(sqInt sourceReg, sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, sourceReg, scratchReg); + /* begin genJumpBaseHeaderMutable: */ + quickConstant = immutableBitMask(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(TstCqR, quickConstant, scratchReg); + /* begin JumpZero: */ + return genConditionalBranchoperand(JumpZero, ((sqInt)0)); +} +#endif /* IMMUTABILITY */ + + /* CogObjectRepresentationForSpur>>#genJumpNotCharacterInScratchReg: */ +static AbstractInstruction * NoDbgRegParms +genJumpNotCharacterInScratchReg(sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(AndCqR, quickConstant, reg); + /* begin CmpCq:R: */ + quickConstant1 = characterTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, reg); + /* begin JumpNonZero: */ + return genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); +} + + /* CogObjectRepresentationForSpur>>#genLcFirstFieldPointer: */ +static void NoDbgRegParms +genLcFirstFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + ssPushNativeRegister(objectReg); +} + + +/* TODO: Retrieve the number of fixed fields. */ + + /* CogObjectRepresentationForSpur>>#genLcFirstIndexableFieldPointer: */ +static void NoDbgRegParms +genLcFirstIndexableFieldPointer(sqInt objectReg) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, objectReg); + ssPushNativeRegister(objectReg); +} + + +/* Check for integer */ + + /* CogObjectRepresentationForSpur>>#genLcIsBytes:to: */ +static void NoDbgRegParms +genLcIsBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBytes; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant1 = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, valueReg); + /* begin JumpLess: */ + isNotBytes = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBytes, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsFloatObject:to: */ +static void NoDbgRegParms +genLcIsFloatObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + ssPushNativeRegister(valueReg); +} + + +/* TODO: Implement this one */ + + /* CogObjectRepresentationForSpur>>#genLcIsIndexable:to: */ +static void NoDbgRegParms +genLcIsIndexableto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + ssPushNativeRegister(valueReg); +} + + +/* Check for the immediate case */ + + /* CogObjectRepresentationForSpur>>#genLcIsIntegerObject:to: */ +static void NoDbgRegParms +genLcIsIntegerObjectto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseResult; + AbstractInstruction * isImmediate; + AbstractInstruction * isLargeNegativeInteger; + AbstractInstruction * isLargePositiveInteger; + sqInt quickConstant; + AbstractInstruction * trueResult; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = smallIntegerTag(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetClassIndexOfNonImminto(objectReg, TempReg); + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, ClassLargePositiveInteger, TempReg); + /* begin JumpNonZero: */ + isLargePositiveInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, ClassLargeNegativeInteger, TempReg); + /* begin JumpNonZero: */ + isLargeNegativeInteger = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin XorR:R: */ + genoperandoperand(XorRR, valueReg, valueReg); + /* begin Jump: */ + falseResult = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + trueResult = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isLargePositiveInteger, trueResult); + jmpTarget(isLargeNegativeInteger, trueResult); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Label */ + cont = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(falseResult, cont); + jmpTarget(isImmediate, cont); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsPointers:to: */ +static void NoDbgRegParms +genLcIsPointersto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotPointers; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + /* begin JumpGreaterOrEqual: */ + isNotPointers = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotPointers, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWordsOrBytes:to: */ +static void NoDbgRegParms +genLcIsWordsOrBytesto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isCompiledMethod; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotBits; + sqInt quickConstant; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AndCqR, quickConstant, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 9, valueReg); + /* begin JumpLess: */ + isNotBits = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, 24, valueReg); + /* begin JumpGreaterOrEqual: */ + isCompiledMethod = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotBits, falseTarget); + jmpTarget(isCompiledMethod, falseTarget); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + +/* Check for immediate */ + + /* CogObjectRepresentationForSpur>>#genLcIsWords:to: */ +static void NoDbgRegParms +genLcIsWordsto(sqInt objectReg, sqInt valueReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction * cont; + AbstractInstruction * falseTarget; + AbstractInstruction * isImmediate; + AbstractInstruction * isNotWords; + sqInt quickConstant2; + sqInt quickConstant3; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, objectReg, valueReg); + /* begin AndCq:R: */ + quickConstant3 = tagMask(); + /* begin gen:quickConstant:operand: */ + anInstruction5 = genoperandoperand(AndCqR, quickConstant3, valueReg); + /* begin JumpNonZero: */ + isImmediate = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genGetFormatOfinto(objectReg, valueReg); + /* begin CmpCq:R: */ + quickConstant2 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant2, valueReg); + /* begin JumpNonZero: */ + isNotWords = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, valueReg); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin Label */ + falseTarget = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + jmpTarget(isImmediate, falseTarget); + jmpTarget(isNotWords, falseTarget); + + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, valueReg); + jmpTarget(cont, gLabel()); + ssPushNativeRegister(valueReg); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:at: */ +static void NoDbgRegParms +genLcLoadObjectat(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, fieldIndex, object, object); + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcLoadObject:field: */ +static void NoDbgRegParms +genLcLoadObjectfield(sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 8 + (BytesPerOop * fieldIndex), object, object); + ssPushRegister(object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:at: */ +static void NoDbgRegParms +genLcStoreobjectat(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 8, object); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, value, fieldIndex, object); +} + + /* CogObjectRepresentationForSpur>>#genLcStore:object:field: */ +static void NoDbgRegParms +genLcStoreobjectfield(sqInt value, sqInt object, sqInt fieldIndex) +{ + AbstractInstruction *anInstruction; + + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, value, 8 + (fieldIndex * BytesPerOop), object); +} + + +/* Generate a call to code that allocates a new Array of size. + The Array should be initialized with nils iff initialized is true. + The size arg is passed in SendNumArgsReg, the result + must come back in ReceiverResultReg. */ + + /* CogObjectRepresentationForSpur>>#genNewArrayOfSize:initialized: */ +static sqInt NoDbgRegParms +genNewArrayOfSizeinitialized(sqInt size, sqInt initialized) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt constant; + usqLong header; + sqInt i; + sqInt offset; + sqInt quickConstant; + sqInt quickConstant1; + AbstractInstruction *skip; + + assert(size < (numSlotsMask())); + header = headerForSlotsformatclassIndex(size, arrayFormat(), ClassArrayCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + if (initialized + && (size > 0)) { + /* begin genMoveConstant:R: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction7 = genoperandoperand(MoveCqR, constant, TempReg); + } + for (i = 0; i < size; i += 1) { + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, (i * BytesPerWord) + BaseHeaderSize, ReceiverResultReg); + } + } + /* begin LoadEffectiveAddressMw:r:R: */ + offset = smallObjectBytesForSlots(size); + /* begin gen:quickConstant:operand:operand: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, offset, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant1 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + return 0; +} + + +/* Create a closure with the given startpc, numArgs and numCopied + within a context with ctxtNumArgs, large if isLargeCtxt that is in a + block if isInBlock. Do /not/ initialize the copied values. */ + + /* CogObjectRepresentationForSpur>>#genNoPopCreateClosureAt:numArgs:numCopied:contextNumArgs:large:inBlock: */ +static sqInt NoDbgRegParms +genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + usqInt byteSize; + usqLong header; + sqInt numSlots; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + AbstractInstruction *skip; + + + /* First get thisContext into ReceiverResultRega and thence in ClassReg. */ + genGetActiveContextNumArgslargeinBlock(ctxtNumArgs, isLargeCtxt, isInBlock); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + numSlots = ClosureFirstCopiedValueIndex + numCopied; + byteSize = smallObjectBytesForSlots(numSlots); + header = headerForSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassBlockClosureCompactIndex); + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ReceiverResultReg); + /* begin genStoreHeader:intoNewInstance:using: */ + quickConstant = ((usqInt) header); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(MoveCqR, quickConstant, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, ReceiverResultReg); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, header >> 32, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction3 = genoperandoperandoperand(MoveRMwr, TempReg, 4, ReceiverResultReg); + /* begin LoadEffectiveAddressMw:r:R: */ + anInstruction5 = genoperandoperandoperand(LoadEffectiveAddressMwrR, byteSize, ReceiverResultReg, TempReg); + /* begin MoveR:Aw: */ + address1 = freeStartAddress(); + /* begin gen:operand:literal: */ + anInstruction6 = genoperandoperand(MoveRAw, TempReg, address1); + /* begin CmpCq:R: */ + quickConstant3 = getScavengeThreshold(); + /* begin gen:quickConstant:operand: */ + anInstruction12 = genoperandoperand(CmpCqR, quickConstant3, TempReg); + /* begin JumpBelow: */ + skip = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceScheduleScavengeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + jmpTarget(skip, gLabel()); + /* begin MoveR:Mw:r: */ + anInstruction7 = genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant1 = (((usqInt)bcpc << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(MoveCqR, quickConstant1, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureStartPCIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + /* begin MoveCq:R: */ + quickConstant2 = (((usqInt)numArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction10 = genoperandoperand(MoveCqR, quickConstant2, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction11 = genoperandoperandoperand(MoveRMwr, TempReg, (ClosureNumArgsIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveAsCharacter */ +static sqInt +genPrimitiveAsCharacter(void) +{ + AbstractInstruction *jumpNotInt; + AbstractInstruction *jumpOutOfRange; + sqInt reg; + + if (methodOrBlockNumArgs == 0) { + reg = ReceiverResultReg; + } + else { + if (methodOrBlockNumArgs > 1) { + return UnimplementedPrimitive; + } + reg = Arg0Reg; + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpNotInt = genJumpNotSmallInteger(reg); + } + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, TempReg); + genConvertSmallIntegerToIntegerInReg(TempReg); + jumpOutOfRange = jumpNotCharacterUnsignedValueInRegister(TempReg); + genConvertSmallIntegerToCharacterInReg(reg); + if (reg != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, reg, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpOutOfRange, gLabel()); + if (reg != ReceiverResultReg) { + jmpTarget(jumpNotInt, getJmpTarget(jumpOutOfRange)); + } + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genPrimitiveIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *comp; + sqInt constant; + sqInt constant1; + AbstractInstruction *jumpCmp; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin CmpR:R: */ + comp = genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + if (orNot) { + /* begin JumpZero: */ + jumpCmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + else { + /* begin JumpNonZero: */ + jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpCmp, gLabel()); + if (!orNot) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(Arg0Reg, TempReg, comp); + } + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, ReceiverResultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, ReceiverResultReg); + } + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + return UnfailingPrimitive; +} + + /* CogObjectRepresentationForSpur>>#genPrimitiveObjectAt */ +static sqInt +genPrimitiveObjectAt(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt headerReg; + AbstractInstruction *jumpBadIndex; + AbstractInstruction *jumpBounds; + AbstractInstruction *jumpNotHeaderIndex; + sqInt quickConstant; + sqInt quickConstant1; + + /* begin genLoadArgAtDepth:into: */ + assert(0 < (numRegArgs())); + /* begin genJumpNotSmallInteger:scratchReg: */ + jumpBadIndex = genJumpNotSmallInteger(Arg0Reg); + genGetMethodHeaderOfintoscratch(ReceiverResultReg, (headerReg = Arg1Reg), TempReg); + /* begin CmpCq:R: */ + quickConstant1 = (((usqInt)1 << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, Arg0Reg); + /* begin JumpNonZero: */ + jumpNotHeaderIndex = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, headerReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpNotHeaderIndex, gAndCqR((((usqInt)(alternateHeaderNumLiteralsMask()) << 1) | 1), headerReg)); + /* begin SubCq:R: */ + quickConstant = ((((usqInt)1 << 1) | 1)) - (smallIntegerTag()); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(SubCqR, quickConstant, Arg0Reg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, headerReg, Arg0Reg); + /* begin JumpAbove: */ + jumpBounds = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + genConvertSmallIntegerToIntegerInReg(Arg0Reg); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, ((usqInt) BaseHeaderSize) >> (shiftForWord()), Arg0Reg); + /* begin MoveXwr:R:R: */ + genoperandoperandoperand(MoveXwrRR, Arg0Reg, ReceiverResultReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpBounds, gAddCqR(((((usqInt)1 << 1) | 1)) - (smallIntegerTag()), Arg0Reg)); + jmpTarget(jumpBadIndex, gLabel()); + return CompletePrimitive; +} + + +/* c.f. StackInterpreter>>stSizeOf: lengthOf:baseHeader:format: + fixedFieldsOf:format:length: + */ + + /* CogObjectRepresentationForSpur>>#genPrimitiveSize */ +static sqInt +genPrimitiveSize(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt jic; + sqInt jnx; + AbstractInstruction *jump32BitLongsDone; + AbstractInstruction *jumpArrayDone; + AbstractInstruction * jumpBytesDone; + AbstractInstruction *jumpHasFixedFields; + AbstractInstruction *jumpImm; + AbstractInstruction *jumpIsBytes; + AbstractInstruction *jumpIsContext; + AbstractInstruction *jumpIsContext1; + AbstractInstruction *jumpIsShorts; + AbstractInstruction *jumpNotIndexable; + AbstractInstruction *jumpNotIndexable1; + AbstractInstruction * jumpShortsDone; + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt quickConstant3; + sqInt quickConstant4; + sqInt quickConstant5; + + jumpImm = genJumpImmediate(ReceiverResultReg); + /* begin genGetSizeOf:into:formatReg:scratchReg:abortJumpsInto: */ + genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(ReceiverResultReg, SendNumArgsReg, TempReg); + genGetNumSlotsOfinto(ReceiverResultReg, ClassReg); + /* begin CmpCq:R: */ + quickConstant = firstByteFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jumpIsBytes = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant1 = arrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, SendNumArgsReg); + /* begin JumpZero: */ + jumpArrayDone = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin JumpLess: */ + jumpNotIndexable1 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant2 = weakArrayFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant2, SendNumArgsReg); + /* begin JumpLessOrEqual: */ + jumpHasFixedFields = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant3 = firstShortFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant3, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jumpIsShorts = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin CmpCq:R: */ + quickConstant4 = firstLongFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant4, SendNumArgsReg); + /* begin JumpGreaterOrEqual: */ + jump32BitLongsDone = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + jmpTarget(jumpNotIndexable1, gLabel()); + /* begin Jump: */ + jumpNotIndexable1 = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsBytes, gLogicalShiftLeftCqR(shiftForWord(), ClassReg)); + /* begin AndCq:R: */ + anInstruction5 = genoperandoperand(AndCqR, BytesPerWord - 1, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpBytesDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpIsShorts, gLogicalShiftLeftCqR((shiftForWord()) - 1, ClassReg)); + /* begin AndCq:R: */ + anInstruction6 = genoperandoperand(AndCqR, 1, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + /* begin Jump: */ + jumpShortsDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpHasFixedFields, gAndCqR(classIndexMask(), TempReg)); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, SendNumArgsReg); + /* begin CmpCq:R: */ + anInstruction7 = genoperandoperand(CmpCqR, ClassMethodContextCompactIndex, TempReg); + /* begin JumpZero: */ + jumpIsContext1 = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin PushR: */ + genoperand(PushR, ClassReg); + genGetClassObjectOfClassIndexintoscratchReg(SendNumArgsReg, ClassReg, TempReg); + genLoadSlotsourceRegdestReg(InstanceSpecificationIndex, ClassReg, SendNumArgsReg); + genConvertSmallIntegerToIntegerInReg(SendNumArgsReg); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin AndCq:R: */ + quickConstant5 = fixedFieldsOfClassFormatMask(); + /* begin gen:quickConstant:operand: */ + anInstruction8 = genoperandoperand(AndCqR, quickConstant5, SendNumArgsReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, SendNumArgsReg, ClassReg); + jmpTarget(jumpArrayDone, jmpTarget(jump32BitLongsDone, jmpTarget(jumpShortsDone, jmpTarget(jumpBytesDone, gLabel())))); + jumpNotIndexable = jumpNotIndexable1; + jumpIsContext = jumpIsContext1; + + genConvertIntegerToSmallIntegerInReg(ClassReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, ReceiverResultReg); + /* begin genPrimReturn */ + assert(methodOrBlockNumArgs <= (numRegArgs())); + /* begin RetN: */ + genoperand(RetN, 0); + jmpTarget(jumpImm, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, gLabel()))); + return CompletePrimitive; +} + + /* CogObjectRepresentationForSpur>>#genSetSmallIntegerTagsIn: */ +static sqInt NoDbgRegParms +genSetSmallIntegerTagsIn(sqInt scratchReg) +{ + AbstractInstruction *anInstruction; + + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, scratchReg); + return 0; +} + + +/* Create a trampoline to store-check the update of the receiver in a + closure's outerContext in compileBlockFrameBuild:. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckContextReceiverTrampoline */ +static sqInt +genStoreCheckContextReceiverTrampoline(void) +{ + sqInt startAddress; + + startAddress = methodZoneBase(); + zeroOpcodeIndex(); + genStoreCheckReceiverRegvalueRegscratchReginFrame(ReceiverResultReg, Arg0Reg, TempReg, 0); + /* begin RetN: */ + genoperand(RetN, 0); + outputInstructionsForGeneratedRuntimeAt(startAddress); + recordGeneratedRunTimeaddress("ceStoreCheckContextReceiver", startAddress); + recordRunTimeObjectReferences(); + return startAddress; +} + + +/* Generate the code for a store check of valueReg into destReg. */ + + /* CogObjectRepresentationForSpur>>#genStoreCheckReceiverReg:valueReg:scratchReg:inFrame: */ +static sqInt NoDbgRegParms +genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, sqInt scratchReg, sqInt inFrame) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + AbstractInstruction * inst; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt wordConstant; + + + /* Is value stored an immediate? If so we're done */ + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(valueReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, scratchReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, valueReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + assert(destReg == ReceiverResultReg); + /* begin evaluateTrampolineCallBlock:protectLinkRegIfNot: */ + if (inFrame) { + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + } + else { + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceStoreCheckTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + + + /* begin PopR: */ + genoperand(PopR, LinkReg); + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:destReg:scratchReg:inFrame:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + if (needsStoreCheck) { + return genStoreCheckReceiverRegvalueRegscratchReginFrame(destReg, sourceReg, scratchReg, inFrame); + } + return 0; +} + + +/* This method is used for unchecked stores in objects after their creation + (typically, inlined creation of Array, closures and some temp vectors). + Currently there is no need to do the immutability check here + */ + + /* CogObjectRepresentationForSpur>>#genStoreSourceReg:slotIndex:intoNewObjectInDestReg: */ +static sqInt NoDbgRegParms +genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg) +{ + AbstractInstruction *anInstruction; + + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + return 0; +} + + +/* Convention: + - RcvrResultReg holds the object mutated. + If immutability failure: + - TempReg holds the instance variable index mutated + if instVarIndex > numDedicatedStoreTrampoline + - ClassReg holds the value to store + Registers are not lived across this trampoline as the + immutability failure may need new stack frames. */ + + /* CogObjectRepresentationForSpur>>#genStoreTrampolineCalled:instVarIndex: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreTrampolineCalledinstVarIndex(char *trampolineName, sqInt instVarIndex) +{ + AbstractInstruction *jumpRC; + AbstractInstruction *jumpSC; + + zeroOpcodeIndex(); + jumpSC = genJumpMutablescratchReg(ReceiverResultReg, SendNumArgsReg); + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceCannotAssignTowithIndexvalueToAssign, 3, ReceiverResultReg, (instVarIndex < (NumStoreTrampolines - 1) + ? (/* begin trampolineArgConstant: */ + assert(instVarIndex >= 0), + -2 - instVarIndex) + : TempReg), ClassReg, null, 0, 1, NoReg); + jmpTarget(jumpSC, gLabel()); + if (CheckRememberedInTrampoline) { + jumpRC = genCheckRememberedBitOfscratch(ReceiverResultReg, SendNumArgsReg); + assert(((jumpRC->opcode)) == JumpNonZero); + (jumpRC->opcode = JumpZero); + /* begin RetN: */ + genoperand(RetN, 0); + + jmpTarget(jumpRC, gLabel()); + } + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(remember, trampolineName, 1, ReceiverResultReg, null, null, null, 0, 1, NoReg, 1); +} +#endif /* IMMUTABILITY */ + + +/* Store check code is duplicated to use a single trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityAndStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *immutableJump; + AbstractInstruction *jmpAlreadyRemembered; + AbstractInstruction *jmpDestYoung; + AbstractInstruction *jmpImmediate; + AbstractInstruction *jmpSourceOld; + sqInt wordConstant; + + immutableJump = genJumpImmutablescratchReg(destReg, scratchReg); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + + /* Get the old/new boundary in scratchReg */ + jmpImmediate = genJumpImmediate(sourceReg); + /* begin MoveCw:R: */ + wordConstant = storeCheckBoundary(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveCwR, wordConstant, scratchReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, destReg); + /* begin JumpBelow: */ + jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, scratchReg, sourceReg); + /* begin JumpAboveOrEqual: */ + jmpSourceOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + if (!CheckRememberedInTrampoline) { + jmpAlreadyRemembered = genCheckRememberedBitOfscratch(destReg, scratchReg); + } + jmpTarget(immutableJump, gLabel()); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, index, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, gLabel()))); + if (!CheckRememberedInTrampoline) { + jmpTarget(jmpAlreadyRemembered, getJmpTarget(jmpSourceOld)); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Gen an immutability check with no store check (e.g. assigning an immediate + literal) + */ +/* imm check has its own trampoline */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityButNoStoreCheckSourceReg:slotIndex:destReg:scratchReg:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needRestoreRcvr) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + mutableJump = genJumpMutablescratchReg(destReg, scratchReg); + /* begin genStoreTrampolineCall: */ + if (index >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, index, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[index]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + if (needRestoreRcvr) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + /* begin genTraceStores */ + if (traceStores > 0) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ClassReg, TempReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceTraceStoreTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + } + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, sourceReg, (index * BytesPerWord) + BaseHeaderSize, destReg); + jmpTarget(immutabilityFailure, gLabel()); + return 0; +} +#endif /* IMMUTABILITY */ + + +/* We know there is a frame as immutability check requires a frame */ +/* needRestoreRcvr has to be true to keep RcvrResultReg live with the + receiver in it across the trampoline + */ +/* Trampoline convention... */ + + /* CogObjectRepresentationForSpur>>#genStoreWithImmutabilityCheckSourceReg:slotIndex:destReg:scratchReg:needsStoreCheck:needRestoreRcvr: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt needsStoreCheck, sqInt needRestoreRcvr) +{ + assert(destReg == ReceiverResultReg); + assert(scratchReg == TempReg); + assert(sourceReg == ClassReg); + if (needsStoreCheck) { + genStoreWithImmutabilityAndStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + else { + genStoreWithImmutabilityButNoStoreCheckSourceRegslotIndexdestRegscratchRegneedRestoreRcvr(sourceReg, index, destReg, scratchReg, needRestoreRcvr); + } + return 0; +} +#endif /* IMMUTABILITY */ + + +/* Make sure SendNumArgsReg and ClassReg are available in addition to + ReceiverResultReg and TempReg in + genGetActiveContextNumArgs:large:inBlock:. + */ + + /* CogObjectRepresentationForSpur>>#getActiveContextAllocatesInMachineCode */ +static sqInt +getActiveContextAllocatesInMachineCode(void) +{ + return 1; +} + + +/* Since all cache tags in Spur are class indices none of + them are young or have to be updated in a scavenge. */ + + /* CogObjectRepresentationForSpur>>#inlineCacheTagIsYoung: */ +static sqInt NoDbgRegParms +inlineCacheTagIsYoung(sqInt cacheTag) +{ + return 0; +} + + /* CogObjectRepresentationForSpur>>#jumpNotCharacterUnsignedValueInRegister: */ +static AbstractInstruction * NoDbgRegParms +jumpNotCharacterUnsignedValueInRegister(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt quickConstant; + + /* begin CmpCq:R: */ + quickConstant = (1U << (numCharacterBits())) - 1; + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, reg); + /* begin JumpAbove: */ + return genConditionalBranchoperand(JumpAbove, ((sqInt)0)); +} + + +/* Mark and trace a literal in a machine code instruction preceding address + in cogMethodOrNil. + Answer if code was modified. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:atpc: */ +static sqInt NoDbgRegParms +markAndTraceLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return 0; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return 0; + } + objOop = followForwarded(literal); + storeLiteralbeforeFollowingAddress(backEnd(), objOop, address); + markAndTraceUpdatedLiteralin(objOop, cogMethodOrNil); + return 1; +} + + +/* Mark and trace a literal in a sqInt variable of cogMethod. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceLiteral:in:at: */ +static void NoDbgRegParms +markAndTraceLiteralinat(sqInt literal, CogMethod *cogMethod, sqInt *address) +{ + sqInt objOop; + + if (!(couldBeObject(literal))) { + return; + } + assert(addressCouldBeObj(literal)); + if (!(isForwarded(literal))) { + markAndTrace(literal); + return; + } + objOop = followForwarded(literal); + address[0] = objOop; + markAndTraceUpdatedLiteralin(objOop, cogMethod); +} + + +/* Common code to mark a literal in cogMethod and add + the cogMethod to youngReferrers if the literal is young. */ + + /* CogObjectRepresentationForSpur>>#markAndTraceUpdatedLiteral:in: */ +static void NoDbgRegParms +markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil) +{ + if (isNonImmediate(objOop)) { + if ((cogMethodOrNil != null) + && (isYoungObject(objOop))) { + ensureInYoungReferrers(cogMethodOrNil); + } + markAndTrace(objOop); + } +} + + +/* If primIndex has an accessorDepth and fails, or it is external and fails + with PrimErrNoMemory, + call ceCheckAndMaybeRetryPrimitive if so If ceCheck.... answers true, + retry the primitive. */ + + /* CogObjectRepresentationForSpur>>#maybeCompileRetryOnPrimitiveFail: */ +static sqInt NoDbgRegParms +maybeCompileRetryOnPrimitiveFail(sqInt primIndex) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jmp; + + if ((accessorDepthForPrimitiveIndex(primIndex)) >= 0) { + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpCq:R: */ + anInstruction2 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpZero: */ + jmp = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + } + else { + if ((primNumberExternalCall()) != primIndex) { + return 0; + } + /* begin MoveAw:R: */ + address1 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, TempReg); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, PrimErrNoMemory, TempReg); + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + } + compileCallFornumArgsargargargargresultRegregsToSave(ceCheckAndMaybeRetryPrimitive, 1, trampolineArgConstant(primIndex), null, null, null, TempReg, 0); + jmpTarget(jmp, gLabel()); + return 0; +} + + +/* Generate a shift of the register containing the class tag in a method + cache probe. + c.f. SpurMemoryManager>>methodCacheHashOf:with: */ + + /* CogObjectRepresentationForSpur>>#maybeShiftClassTagRegisterForMethodCacheProbe: */ +static sqInt NoDbgRegParms +maybeShiftClassTagRegisterForMethodCacheProbe(sqInt classTagReg) +{ + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 2, classTagReg); + return 0; +} + + /* CogObjectRepresentationForSpur>>#numCharacterBits */ +static sqInt +numCharacterBits(void) +{ + return 30; +} + + +/* Define how many register arguments a StackToRegisterMappingCogit can + and should use with the receiver. The value must be 0, 1 or 2. Note that a + SimpleStackBasedCogit always has 0 register args (although the receiver is + passed in a register). The Spur object representation is simple enough + that implementing at:put: is straight-forward and hence 2 register args + are worth + while. The method must be inlined in CoInterpreter, and dead code + eliminated so that the register-popping enilopmarts such as + enterRegisterArgCogMethod:- at:receiver: do not have to be implemented in + SimpleStackBasedCogit. */ + + /* CogObjectRepresentationForSpur>>#numRegArgs */ +sqInt +numRegArgs(void) +{ + return 2; +} + + /* CogObjectRepresentationForSpur>>#remapObject: */ +static sqInt NoDbgRegParms +remapObject(sqInt objOop) +{ + assert(addressCouldBeObj(objOop)); + return (shouldRemapObj(objOop) + ? remapObj(objOop) + : objOop); +} + + /* CogObjectRepresentationForSpur>>#remapOop: */ +static sqInt NoDbgRegParms +remapOop(sqInt objOop) +{ + return (shouldRemapOop(objOop) + ? remapObj(objOop) + : objOop); +} + + +/* Objects in newSpace or oldSpace except nil, true, false & + classTableRootObj need to be annotated. + */ + + /* CogObjectRepresentationForSpur>>#shouldAnnotateObjectReference: */ +static sqInt NoDbgRegParms +shouldAnnotateObjectReference(sqInt anOop) +{ + return (isNonImmediate(anOop)) + && ((oopisGreaterThan(anOop, classTableRootObj())) + || (oopisLessThan(anOop, nilObject()))); +} + + /* CogObjectRepresentationForSpur>>#slotOffsetOfInstVarIndex: */ +static sqInt NoDbgRegParms +slotOffsetOfInstVarIndex(sqInt index) +{ + return (index * BytesPerWord) + BaseHeaderSize; +} + + /* CogSimStackEntry>>#ensureSpilledAt:from: */ +static SimStackEntry * NoDbgRegParms +ensureSpilledAtfrom(SimStackEntry * self_in_ensureSpilledAtfrom, sqInt baseOffset, sqInt baseRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg; + + if ((self_in_ensureSpilledAtfrom->spilled)) { + if (((self_in_ensureSpilledAtfrom->type)) == SSSpill) { + assert((((self_in_ensureSpilledAtfrom->offset)) == baseOffset) + && (((self_in_ensureSpilledAtfrom->registerr)) == baseRegister)); + return self_in_ensureSpilledAtfrom; + } + } + assert(((self_in_ensureSpilledAtfrom->type)) != SSSpill); + traceSpill(self_in_ensureSpilledAtfrom); + if (((self_in_ensureSpilledAtfrom->type)) == SSConstant) { + /* begin genPushConstant: */ + constant = (self_in_ensureSpilledAtfrom->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gPushCw(constant), constant); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant); + inst = anInstruction1; + } + } + else { + if (((self_in_ensureSpilledAtfrom->type)) == SSBaseOffset) { + /* begin MoveMw:r:R: */ + offset = (self_in_ensureSpilledAtfrom->offset); + baseReg = (self_in_ensureSpilledAtfrom->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, TempReg); + /* begin PushR: */ + inst = genoperand(PushR, TempReg); + } + else { + assert(((self_in_ensureSpilledAtfrom->type)) == SSRegister); + /* begin PushR: */ + reg = (self_in_ensureSpilledAtfrom->registerr); + inst = genoperand(PushR, reg); + } + (self_in_ensureSpilledAtfrom->type) = SSSpill; + (self_in_ensureSpilledAtfrom->offset) = baseOffset; + (self_in_ensureSpilledAtfrom->registerr) = baseRegister; + } + (self_in_ensureSpilledAtfrom->spilled) = 1; + return self_in_ensureSpilledAtfrom; +} + + /* CogSimStackEntry>>#popToReg: */ +static SimStackEntry * NoDbgRegParms +popToReg(SimStackEntry * self_in_popToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + if ((self_in_popToReg->spilled)) { + /* begin PopR: */ + inst = genoperand(PopR, reg); + } + else { + + switch ((self_in_popToReg->type)) { + case SSBaseOffset: + /* begin MoveMw:r:R: */ + offset = (self_in_popToReg->offset); + baseReg = (self_in_popToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_popToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_popToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_popToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_popToReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackEntry>>#registerMask */ +static sqInt NoDbgRegParms +registerMask(SimStackEntry * self_in_registerMask) +{ + sqInt reg; + + return ((((self_in_registerMask->type)) == SSBaseOffset) + || (((self_in_registerMask->type)) == SSRegister) + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerMaskOrNone */ +static sqInt NoDbgRegParms +registerMaskOrNone(SimStackEntry * self_in_registerMaskOrNone) +{ + sqInt reg; + + return (((self_in_registerMaskOrNone->type)) == SSRegister + ? (/* begin registerMaskFor: */ + (reg = (self_in_registerMaskOrNone->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackEntry>>#registerOrNone */ +static sqInt NoDbgRegParms +registerOrNone(SimStackEntry * self_in_registerOrNone) +{ + return (((self_in_registerOrNone->type)) == SSRegister + ? (self_in_registerOrNone->registerr) + : NoReg); +} + + /* CogSimStackEntry>>#storeToReg: */ +static SimStackEntry * NoDbgRegParms +storeToReg(SimStackEntry * self_in_storeToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseReg; + sqInt constant; + AbstractInstruction *inst; + sqInt offset; + sqInt reg1; + + + switch ((self_in_storeToReg->type)) { + case SSBaseOffset: + case SSSpill: + /* begin MoveMw:r:R: */ + offset = (self_in_storeToReg->offset); + baseReg = (self_in_storeToReg->registerr); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, baseReg, reg); + inst = anInstruction; + break; + case SSConstant: + /* begin genMoveConstant:R: */ + constant = (self_in_storeToReg->constant); + if (shouldAnnotateObjectReference(constant)) { + inst = annotateobjRef(gMoveCwR(constant, reg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant, reg); + inst = anInstruction1; + } + break; + case SSRegister: + if (reg != ((self_in_storeToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_storeToReg->registerr); + inst = genoperandoperand(MoveRR, reg1, reg); + } + else { + /* begin Label */ + inst = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_storeToReg; +} + + /* CogSimStackNativeEntry>>#ensureIsMarkedAsSpilled */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureIsMarkedAsSpilled(CogSimStackNativeEntry * self_in_ensureIsMarkedAsSpilled) +{ + if (!((self_in_ensureIsMarkedAsSpilled->spilled))) { + + switch ((self_in_ensureIsMarkedAsSpilled->type)) { + case SSNativeRegister: + case SSConstantInt32: + case SSConstantNativePointer: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + case SSConstantFloat32: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + case SSConstantFloat64: + (self_in_ensureIsMarkedAsSpilled->type) = SSSpillFloat64; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureIsMarkedAsSpilled->spilled) = 1; + return self_in_ensureIsMarkedAsSpilled; +} + + /* CogSimStackNativeEntry>>#ensureSpilledSP:scratchRegister: */ +static CogSimStackNativeEntry * NoDbgRegParms +ensureSpilledSPscratchRegister(CogSimStackNativeEntry * self_in_ensureSpilledSPscratchRegister, sqInt spRegister, sqInt scratchRegister) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt offset4; + sqInt offset5; + sqInt offset6; + sqInt offset7; + sqInt offset8; + sqInt quickConstant; + sqInt sourceDPReg; + sqInt sourceDPReg1; + sqInt sourceReg; + sqInt wordConstant; + sqInt wordConstant1; + sqInt wordConstant2; + sqInt wordConstant3; + sqInt wordConstant4; + + if (!((self_in_ensureSpilledSPscratchRegister->spilled))) { + + switch ((self_in_ensureSpilledSPscratchRegister->type)) { + case SSNativeRegister: + /* begin MoveR:Mw:r: */ + sourceReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, sourceReg, offset, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSRegisterSingleFloat: + /* begin MoveRs:M32:r: */ + sourceDPReg = (self_in_ensureSpilledSPscratchRegister->registerr); + offset1 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction1 = genoperandoperandoperand(MoveRsM32r, sourceDPReg, offset1, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSRegisterDoubleFloat: + /* begin MoveRd:M64:r: */ + sourceDPReg1 = (self_in_ensureSpilledSPscratchRegister->registerr); + offset2 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRdM64r, sourceDPReg1, offset2, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantFloat32: + /* begin MoveCw:R: */ + wordConstant = asIEEE32BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveCwR, wordConstant, scratchRegister); + /* begin MoveR:M32:r: */ + offset3 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset3, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat32; + break; + case SSConstantFloat64: + if (BytesPerWord == 4) { + /* begin MoveCw:R: */ + wordConstant1 = (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) & 0xFFFFFFFFU; + /* begin gen:literal:operand: */ + anInstruction5 = genoperandoperand(MoveCwR, wordConstant1, scratchRegister); + /* begin MoveR:M32:r: */ + offset4 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction6 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset4, spRegister); + /* begin MoveCw:R: */ + wordConstant2 = (((((sqLong) -32)) < 0) ? ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) >> -(((sqLong) -32))) : ((usqInt) (asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat64))) << (((sqLong) -32)))); + /* begin gen:literal:operand: */ + anInstruction7 = genoperandoperand(MoveCwR, wordConstant2, scratchRegister); + /* begin MoveR:M32:r: */ + offset5 = ((-((self_in_ensureSpilledSPscratchRegister->offset))) - 1) + 4; + /* begin gen:operand:quickConstant:operand: */ + anInstruction8 = genoperandoperandoperand(MoveRM32r, scratchRegister, offset5, spRegister); + } + else { + /* begin MoveCw:R: */ + wordConstant3 = asIEEE64BitWord((self_in_ensureSpilledSPscratchRegister->constantFloat32)); + /* begin gen:literal:operand: */ + anInstruction9 = genoperandoperand(MoveCwR, wordConstant3, scratchRegister); + /* begin MoveR:Mw:r: */ + offset6 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction10 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset6, spRegister); + } + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillFloat64; + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_ensureSpilledSPscratchRegister->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(MoveCqR, quickConstant, scratchRegister); + /* begin MoveR:Mw:r: */ + offset7 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction12 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset7, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant4 = (self_in_ensureSpilledSPscratchRegister->constantNativePointer); + /* begin gen:literal:operand: */ + anInstruction13 = genoperandoperand(MoveCwR, wordConstant4, scratchRegister); + /* begin MoveR:Mw:r: */ + offset8 = (-((self_in_ensureSpilledSPscratchRegister->offset))) - 1; + /* begin gen:operand:quickConstant:operand: */ + anInstruction14 = genoperandoperandoperand(MoveRMwr, scratchRegister, offset8, spRegister); + (self_in_ensureSpilledSPscratchRegister->type) = SSSpillNative; + break; + default: + error("Case not found and no otherwise clause"); + } + } + (self_in_ensureSpilledSPscratchRegister->spilled) = 1; + return self_in_ensureSpilledSPscratchRegister; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeFloatRegisterMask */ +static sqInt NoDbgRegParms +nativeFloatRegisterMask(CogSimStackNativeEntry * self_in_nativeFloatRegisterMask) +{ + sqInt reg; + + return ((((self_in_nativeFloatRegisterMask->type)) == SSRegisterSingleFloat) + || (((self_in_nativeFloatRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeFloatRegisterMask->registerr)), + 1U << reg) + : 0); +} + + /* CogSimStackNativeEntry>>#nativePopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToReg(CogSimStackNativeEntry * self_in_nativePopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + float constantFloat32; + double constantFloat64; + sqInt dpreg1; + sqInt dpreg11; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt quickConstant; + sqInt reg1; + sqInt wordConstant; + + if ((self_in_nativePopToReg->spilled)) { + loadNativeFramePointerInto(TempReg); + + switch ((self_in_nativePopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, TempReg, reg); + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, TempReg, reg); + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = (-((self_in_nativePopToReg->offset))) - 1; + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, TempReg, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + } + else { + + switch ((self_in_nativePopToReg->type)) { + case SSNativeRegister: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRR, reg1, reg); + } + break; + case SSRegisterSingleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRs:Rs: */ + dpreg1 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRsRs, dpreg1, reg); + } + break; + case SSRegisterDoubleFloat: + if (reg != ((self_in_nativePopToReg->registerr))) { + /* begin MoveRd:Rd: */ + dpreg11 = (self_in_nativePopToReg->registerr); + genoperandoperand(MoveRdRd, dpreg11, reg); + } + break; + case SSConstantInt32: + /* begin MoveCq:R: */ + quickConstant = (self_in_nativePopToReg->constantInt32); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(MoveCqR, quickConstant, reg); + break; + case SSConstantNativePointer: + /* begin MoveCw:R: */ + wordConstant = (self_in_nativePopToReg->constantNativePointer); + /* begin gen:literal:operand: */ + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, reg); + break; + case SSConstantFloat32: + /* begin MoveCf32:Rs: */ + constantFloat32 = (self_in_nativePopToReg->constantFloat32); + genMoveCf32Rs(backEnd, constantFloat32, reg); + break; + case SSConstantFloat64: + /* begin MoveCf64:Rd: */ + constantFloat64 = (self_in_nativePopToReg->constantFloat64); + genMoveCf64Rd(backEnd, constantFloat64, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToReg; +} + + /* CogSimStackNativeEntry>>#nativePopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativePopToRegsecondReg(CogSimStackNativeEntry * self_in_nativePopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt quickConstant; + sqInt quickConstant1; + sqInt reg1; + sqInt reg11; + sqInt reg12; + + assert(BytesPerWord == 4); + if ((self_in_nativePopToRegsecondReg->spilled)) { + /* begin PopR: */ + genoperand(PopR, reg); + /* begin PopR: */ + genoperand(PopR, secondReg); + } + else { + + switch ((self_in_nativePopToRegsecondReg->type)) { + case SSConstantInt64: + /* begin MoveCq:R: */ + quickConstant = ((sqInt) (((self_in_nativePopToRegsecondReg->constantInt64)) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, reg); + /* begin MoveCq:R: */ + quickConstant1 = ((sqInt) ((((usqInt) ((self_in_nativePopToRegsecondReg->constantInt64))) >> 32) & 0xFFFFFFFFU)); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, secondReg); + break; + case SSRegisterPair: + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + if (reg != ((self_in_nativePopToRegsecondReg->registerr))) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + reg1 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg1, TempReg); + } + /* begin MoveR:R: */ + reg11 = (self_in_nativePopToRegsecondReg->registerr); + genoperandoperand(MoveRR, reg11, reg); + } + if (((self_in_nativePopToRegsecondReg->registerSecond)) != secondReg) { + if (((self_in_nativePopToRegsecondReg->registerSecond)) == reg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, secondReg); + } + else { + /* begin MoveR:R: */ + reg12 = (self_in_nativePopToRegsecondReg->registerSecond); + genoperandoperand(MoveRR, reg12, secondReg); + } + } + break; + default: + error("Case not found and no otherwise clause"); + } + } + return self_in_nativePopToRegsecondReg; +} + + +/* Answer a bit mask for the receiver's register, if any. */ + + /* CogSimStackNativeEntry>>#nativeRegisterMask */ +static sqInt NoDbgRegParms +nativeRegisterMask(CogSimStackNativeEntry * self_in_nativeRegisterMask) +{ + sqInt reg; + + return ((((((self_in_nativeRegisterMask->type)) == SSBaseOffset) + || (((self_in_nativeRegisterMask->type)) == SSNativeRegister)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterSingleFloat)) + || (((self_in_nativeRegisterMask->type)) == SSRegisterDoubleFloat) + ? (/* begin registerMaskFor: */ + (reg = (self_in_nativeRegisterMask->registerr)), + 1U << reg) + : (((self_in_nativeRegisterMask->type)) == SSRegisterPair + ? (registerMaskFor((self_in_nativeRegisterMask->registerr))) | (registerMaskFor((self_in_nativeRegisterMask->registerSecond))) + : 0)); +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToReg(CogSimStackNativeEntry * self_in_nativeStackPopToReg, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + sqInt offset1; + sqInt offset2; + + assert((self_in_nativeStackPopToReg->spilled)); + + switch ((self_in_nativeStackPopToReg->type)) { + case SSSpillNative: + /* begin MoveMw:r:R: */ + offset = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + break; + case SSSpillFloat32: + /* begin MoveM32:r:Rs: */ + offset1 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM32rRs, offset1, FPReg, reg); + break; + case SSSpillFloat64: + /* begin MoveM64:r:Rd: */ + offset2 = -((self_in_nativeStackPopToReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveM64rRd, offset2, FPReg, reg); + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToReg; +} + + /* CogSimStackNativeEntry>>#nativeStackPopToReg:secondReg: */ +static CogSimStackNativeEntry * NoDbgRegParms +nativeStackPopToRegsecondReg(CogSimStackNativeEntry * self_in_nativeStackPopToRegsecondReg, sqInt reg, sqInt secondReg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + sqInt offset1; + + assert((self_in_nativeStackPopToRegsecondReg->spilled)); + + switch ((self_in_nativeStackPopToRegsecondReg->type)) { + case SSSpillInt64: + /* begin MoveMw:r:R: */ + offset = (-((self_in_nativeStackPopToRegsecondReg->offset))) + 4; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin MoveMw:r:R: */ + offset1 = -((self_in_nativeStackPopToRegsecondReg->offset)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset1, FPReg, secondReg); + break; + default: + error("Case not found and no otherwise clause"); + } + return self_in_nativeStackPopToRegsecondReg; +} + + /* CogSimStackNativeEntry>>#spillingNeedsScratchRegister */ +static sqInt NoDbgRegParms +spillingNeedsScratchRegister(CogSimStackNativeEntry * self_in_spillingNeedsScratchRegister) +{ + if (!((self_in_spillingNeedsScratchRegister->spilled))) { + + switch ((self_in_spillingNeedsScratchRegister->type)) { + case SSConstantInt32: + case SSConstantInt64: + case SSConstantFloat32: + case SSConstantFloat64: + case SSConstantNativePointer: + return 1; + + default: + return 0; + + } + } + return 0; +} + + /* CogSimStackNativeEntry>>#stackSpillSize */ +static sqInt NoDbgRegParms +stackSpillSize(CogSimStackNativeEntry * self_in_stackSpillSize) +{ + + switch ((self_in_stackSpillSize->type)) { + case SSConstantInt64: + case SSConstantFloat64: + case SSRegisterDoubleFloat: + case SSRegisterPair: + case SSSpillFloat64: + case SSSpillInt64: + return 8; + + default: + return BytesPerOop; + + } + return 0; +} + + /* CogSSBytecodeFixup>>#isMergeFixup */ +static sqInt NoDbgRegParms +isMergeFixup(BytecodeFixup * self_in_isMergeFixup) +{ + return (((usqInt)((self_in_isMergeFixup->targetInstruction)))) == NeedsMergeFixupFlag; +} + + +/* Compile the jump instruction(s) at the end of the method that dispatch to + each block body. + */ + + /* SimpleStackBasedCogit>>#compileBlockDispatch */ +static sqInt +compileBlockDispatch(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *jumpSkip; + + assert(blockCount > 0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + blockEntryNoContextSwitch = anInstruction; + /* begin Jump: */ + jumpSkip = genoperand(Jump, ((sqInt)0)); + /* begin MoveR:R: */ + blockEntryLabel = genoperandoperand(MoveRR, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jumpSkip, gLabel()); + if (blockCount > 1) { + genLoadSlotsourceRegdestReg(ClosureStartPCIndex, ReceiverResultReg, TempReg); + } + compileBlockDispatchFromto(0, blockCount - 1); + return 0; +} + + +/* After pushing the temporaries but before the stack limit check a primitive + method needs to fetch the error code, if any, and replace the last temp + with it. */ + + /* SimpleStackBasedCogit>>#compileGetErrorCode */ +static void +compileGetErrorCode(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jmpGotError; + AbstractInstruction *jmpIntError; + AbstractInstruction *jmpNoError; + sqInt primErrorTable; + sqInt primErrorTableSize; + + /* begin MoveAw:R: */ + address = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction3 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpZero: */ + jmpNoError = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + primErrorTable = primErrTable(); + primErrorTableSize = lengthOf(primErrorTable); + flag("use CmpCqR if pc mapping means stable contexts never contain native pcs"); + /* begin CmpCw:R: */ + anInstruction4 = genoperandoperand(CmpCwR, primErrorTableSize, TempReg); + /* begin JumpAboveOrEqual: */ + jmpIntError = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + genFetchIndexRegisterfrominto(TempReg, primErrorTable, ClassReg); + /* begin Jump: */ + jmpGotError = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpIntError, gLabel()); + genConvertIntegerToSmallIntegerInReg(TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, ClassReg); + jmpTarget(jmpGotError, gMoveRMwr(ClassReg, 0, SPReg)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address1); + jmpTarget(jmpNoError, gLabel()); +} + + +/* Compile a call to an interpreter primitive. Call the C routine with the + usual stack-switching dance, test the primFailCode and then either + return on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compileInterpreterPrimitive: */ +static sqInt NoDbgRegParms +compileInterpreterPrimitive(void (*primitiveRoutine)(void)) +{ + sqInt address; + sqInt address1; + sqInt address10; + sqInt address11; + sqInt address12; + sqInt address13; + sqInt address3; + sqInt address4; + sqInt address5; + sqInt address6; + sqInt address8; + sqInt address9; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction110; + AbstractInstruction *anInstruction111; + AbstractInstruction *anInstruction112; + AbstractInstruction *anInstruction113; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction17; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction19; + AbstractInstruction *anInstruction20; + AbstractInstruction *anInstruction21; + AbstractInstruction *anInstruction25; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt callTarget; + sqInt callTarget1; + AbstractInstruction *continuePostSampleNonPrim; + AbstractInstruction *continuePostSamplePrim; + sqInt flags; + AbstractInstruction *jmp; + AbstractInstruction *jmpSampleNonPrim; + AbstractInstruction *jmpSamplePrim; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt reg; + sqInt retpc; + + + /* Save processor fp, sp and return pc in the interpreter's frame stack and instruction pointers */ + genExternalizePointersForPrimitiveCall(); + genLoadCStackPointersForPrimCall(); + flags = primitivePropertyFlags(primitiveIndex); + if (flags & PrimCallDoNotJIT) { + return ShouldNotJIT; + } + if (flags & PrimCallCollectsProfileSamples) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick if so */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address1, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSampleNonPrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSampleNonPrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + if (recordPrimTrace()) { + genFastPrimTraceUsingand(ClassReg, SendNumArgsReg); + } + /* begin MoveCq:R: */ + anInstruction18 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address11 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction19 = genoperandoperand(MoveRAw, TempReg, address11); + if (methodOrBlockNumArgs != 0) { + /* begin MoveCq:R: */ + anInstruction3 = genoperandoperand(MoveCqR, methodOrBlockNumArgs, TempReg); + } + /* begin MoveR:Aw: */ + address12 = argumentCountAddress(); + /* begin gen:operand:literal: */ + anInstruction20 = genoperandoperand(MoveRAw, TempReg, address12); + if (flags & PrimCallNeedsPrimitiveFunction) { + /* begin MoveCw:R: */ + anInstruction4 = genoperandoperand(MoveCwR, ((sqInt)primitiveRoutine), TempReg); + /* begin MoveR:Aw: */ + address3 = primitiveFunctionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction5 = genoperandoperand(MoveRAw, TempReg, address3); + primSetFunctionLabel = anInstruction5; + } + if (flags & (PrimCallNeedsNewMethod + PrimCallMayCallBack)) { + + /* The ceActivateFailingPrimitiveMethod: machinery can't handle framelessness. */ + if (flags & PrimCallMayCallBack) { + needsFrame = 1; + } + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), ClassReg))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, methodObject); + /* begin gen:quickConstant:operand:operand: */ + anInstruction6 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + /* begin MoveR:Aw: */ + address4 = newMethodAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address4); + } + /* begin PrefetchAw: */ + address13 = primFailCodeAddress(); + /* begin gen:literal: */ + anInstruction21 = genoperand(PrefetchAw, address13); + if (flags & PrimCallMayCallBack) { + + /* Sideways call the C primitive routine so that we return through cePrimReturnEnterCogCode. */ + /* On Spur ceActivateFailingPrimitiveMethod: would like to retry if forwarders + are found. So insist on PrimCallNeedsPrimitiveFunction being set too. */ + assert(flags & PrimCallNeedsPrimitiveFunction); + /* begin genSubstituteReturnAddress: */ + retpc = (flags & PrimCallCollectsProfileSamples + ? cePrimReturnEnterCogCodeProfiling + : cePrimReturnEnterCogCode); + /* begin MoveCw:R: */ + anInstruction8 = genoperandoperand(MoveCwR, retpc, RA); + /* begin JumpFullRT: */ + /* begin JumpFull: */ + anInstruction110 = genoperand(JumpFull, ((sqInt)(((sqInt)primitiveRoutine)))); + primInvokeInstruction = anInstruction110; + + jmp = (jmpSamplePrim = (continuePostSamplePrim = null)); + } + else { + + /* Call the C primitive routine. */ + /* begin CallFullRT: */ + /* begin CallFull: */ + anInstruction111 = genoperand(CallFull, ((sqInt)primitiveRoutine)); + primInvokeInstruction = anInstruction111; + + if (flags & PrimCallCollectsProfileSamples) { + assert(flags & PrimCallNeedsNewMethod); + /* begin MoveAw:R: */ + address5 = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction9 = genoperandoperand(MoveAwR, address5, TempReg); + /* begin MoveAw:R: */ + address6 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction10 = genoperandoperand(MoveAwR, address6, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSamplePrim = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSamplePrim = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileRetryOnPrimitiveFail(primitiveIndex); + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = LinkReg; + /* begin gen:literal:operand: */ + anInstruction12 = genoperandoperand(MoveAwR, address8, reg); + genLoadStackPointers(backEnd); + /* begin MoveAw:R: */ + address9 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction13 = genoperandoperand(MoveAwR, address9, TempReg); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction25 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpNonZero: */ + jmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset1 = 0; + /* begin gen:quickConstant:operand:operand: */ + anInstruction14 = genoperandoperandoperand(MoveMwrR, offset1, SPReg, ReceiverResultReg); + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + } + if (flags & PrimCallCollectsProfileSamples) { + + /* The sample is collected by cePrimReturnEnterCogCode for external calls */ + if (!(jmpSamplePrim == null)) { + + /* Call ceCheckProfileTick: to record sample and then continue. */ + jmpTarget(jmpSamplePrim, gLabel()); + assert(flags & PrimCallNeedsNewMethod); + /* begin CallFullRT: */ + callTarget = ((usqIntptr_t)ceCheckProfileTick); + /* begin CallFull: */ + anInstruction112 = genoperand(CallFull, callTarget); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSamplePrim)); + } + jmpTarget(jmpSampleNonPrim, gLabel()); + /* begin MoveCq:R: */ + anInstruction15 = genoperandoperand(MoveCqR, 0, TempReg); + /* begin MoveR:Aw: */ + address10 = newMethodAddress(); + /* begin gen:operand:literal: */ + anInstruction16 = genoperandoperand(MoveRAw, TempReg, address10); + /* begin CallFullRT: */ + callTarget1 = ((usqIntptr_t)ceCheckProfileTick); + /* begin CallFull: */ + anInstruction113 = genoperand(CallFull, callTarget1); + + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSampleNonPrim)); + } + if (!(jmp == null)) { + + /* Jump to restore of receiver reg and proceed to frame build for failure. */ + jmpTarget(jmp, gLabel()); + /* begin MoveMw:r:R: */ + offset2 = BytesPerWord * (methodOrBlockNumArgs + (0)); + /* begin gen:quickConstant:operand:operand: */ + anInstruction17 = genoperandoperandoperand(MoveMwrR, offset2, SPReg, ReceiverResultReg); + } + return 0; +} + + +/* Compile one method cache probe in an OpenPIC's lookup of selector. + Answer the jump taken if the selector probe fails. + The class tag of the receiver must be in SendNumArgsReg. ClassReg and + TempReg are used as scratch registers. + On a hit, the offset of the entry is in ClassReg. */ + + /* SimpleStackBasedCogit>>#compileOpenPICMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + annotateobjRef(gXorCwR(selector, ClassReg), selector); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + } + annotateobjRef(gCmpCwR(selector, TempReg), selector); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile the code for an open PIC. Perform a probe of the first-level + method lookup cache followed by a call of ceSendFromInLineCacheMiss: if + the probe fails. */ + + /* SimpleStackBasedCogit>>#compileOpenPIC:numArgs: */ +static void NoDbgRegParms +compileOpenPICnumArgs(sqInt selector, sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compilePICAbort(numArgs); + entry = genGetClassTagOfintoscratchReg(ReceiverResultReg, SendNumArgsReg, TempReg); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + jmpTarget(jumpBCMethod, picInterpretAbort); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(selector, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + + genSmalltalkToCStackSwitch(1); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); + compileCallFornumArgsargargargargresultRegregsToSave(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, NoReg, 0); +} + + +/* Compile one method cache probe in a perform: primitive's lookup of + selector. Answer the jump taken if the selector probe fails. */ + + /* SimpleStackBasedCogit>>#compilePerformMethodCacheProbeFor:withShift:baseRegOrNone: */ +static AbstractInstruction * NoDbgRegParms +compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt shift, sqInt baseRegOrNone) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + sqInt offset1; + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SendNumArgsReg, ClassReg); + maybeShiftClassTagRegisterForMethodCacheProbe(ClassReg); + /* begin XorR:R: */ + genoperandoperand(XorRR, selectorReg, ClassReg); + assert(shift <= (shiftForWord())); + if (shift < (shiftForWord())) { + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, (shiftForWord()) - shift, ClassReg); + } + /* begin AndCq:R: */ + anInstruction4 = genoperandoperand(AndCqR, ((int)((usqInt)(MethodCacheMask) << (shiftForWord()))), ClassReg); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheSelector) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, ClassReg, TempReg); + } + else { + /* begin AddR:R: */ + genoperandoperand(AddRR, baseRegOrNone, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheSelector) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, selectorReg, TempReg); + /* begin JumpNonZero: */ + jumpSelectorMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + if (baseRegOrNone == NoReg) { + /* begin MoveMw:r:R: */ + offset1 = (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheClass) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, offset1, ClassReg, TempReg); + } + else { + /* begin MoveMw:r:R: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, ((int)((usqInt)(MethodCacheClass) << (shiftForWord()))), ClassReg, TempReg); + } + /* begin CmpR:R: */ + genoperandoperand(CmpRR, SendNumArgsReg, TempReg); + return jumpSelectorMiss; +} + + +/* Compile a primitive. If possible, performance-critical primtiives will + be generated by their own routines (primitiveGenerator). Otherwise, + if there is a primitive at all, we call the C routine with the usual + stack-switching dance, test the primFailCode and then either return + on success or continue to the method body. */ + + /* SimpleStackBasedCogit>>#compilePrimitive */ +static sqInt +compilePrimitive(void) +{ + sqInt code; + sqInt opcodeIndexAtPrimitive; + PrimitiveDescriptor *primitiveDescriptor; + void (*primitiveRoutine)(void); + + if (primitiveIndex == 0) { + return 0; + } + + /* Note opcodeIndex so that compileFallbackToInterpreterPrimitive: + can discard arg load instructions for unimplemented primitives. */ + code = 0; + + /* If a descriptor specifies an argument count (by numArgs >= 0) then it must match + for the generated code to be correct. For example for speed many primitives use + ResultReceiverReg instead of accessing the stack, so the receiver better be at + numArgs down the stack. Use the interpreter version if not. */ + opcodeIndexAtPrimitive = opcodeIndex; + if ((((primitiveDescriptor = primitiveGeneratorOrNil())) != null) + && ((((primitiveDescriptor->primitiveGenerator)) != null) + && ((((primitiveDescriptor->primNumArgs)) < 0) + || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj)))))) { + code = ((primitiveDescriptor->primitiveGenerator))(); + } + if ((code < 0) + && (code != UnimplementedPrimitive)) { + + /* Generator failed, so no point continuing... */ + return code; + } + if (code == UnfailingPrimitive) { + return 0; + } + if ((code == CompletePrimitive) + && (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) { + return 0; + } + if (code == UnimplementedPrimitive) { + opcodeIndex = opcodeIndexAtPrimitive; + } + if ((((primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex))) == null) + || (primitiveRoutine == (functionPointerForinClass(0, null)))) { + return genFastPrimFail(); + } + minValidCallAddress = ((minValidCallAddress < (((usqInt)primitiveRoutine))) ? minValidCallAddress : (((usqInt)primitiveRoutine))); + return compileInterpreterPrimitive(primitiveRoutine); +} + + /* SimpleStackBasedCogit>>#extendedPushBytecode */ +static sqInt +extendedPushBytecode(void) +{ + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genPushReceiverVariable(variableIndex); + } + if (variableType == 1) { + return genPushTemporaryVariable(variableIndex); + } + if (variableType == 2) { + return genPushLiteralIndex(variableIndex); + } + return genPushLiteralVariable(variableIndex); +} + + /* SimpleStackBasedCogit>>#extendedStoreAndPopBytecode */ +static sqInt +extendedStoreAndPopBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(1, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#extendedStoreBytecode */ +static sqInt +extendedStoreBytecode(void) +{ + AbstractInstruction *abstractInstruction; + sqInt variableIndex; + sqInt variableType; + + variableType = (((usqInt) byte1) >> 6) & 3; + variableIndex = byte1 & 0x3F; + if (variableType == 0) { + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + if (variableType == 1) { + genStorePopTemporaryVariable(0, variableIndex); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + return 0; + } + if (variableType == 3) { + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, variableIndex, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFrameMark */ +static sqInt +frameOffsetOfNativeFrameMark(void) +{ + return FoxMFReceiver - BytesPerWord; +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeFramePointer */ +static sqInt +frameOffsetOfNativeFramePointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 3); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfNativeStackPointer */ +static sqInt +frameOffsetOfNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 4); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfPreviousNativeStackPointer */ +static sqInt +frameOffsetOfPreviousNativeStackPointer(void) +{ + return FoxMFReceiver - (BytesPerWord * 2); +} + + /* SimpleStackBasedCogit>>#frameOffsetOfTemporary: */ +static sqInt NoDbgRegParms +frameOffsetOfTemporary(sqInt index) +{ + return (index < methodOrBlockNumArgs + ? FoxCallerSavedIP + ((methodOrBlockNumArgs - index) * BytesPerWord) + : (FoxMFReceiver - BytesPerWord) + ((methodOrBlockNumArgs - index) * BytesPerWord)); +} + + +/* Can use any of the first 32 literals for the selector and pass up to 7 + arguments. + */ + + /* SimpleStackBasedCogit>>#genExtendedSendBytecode */ +static sqInt +genExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + /* SimpleStackBasedCogit>>#genExtendedSuperBytecode */ +static sqInt +genExtendedSuperBytecode(void) +{ + return genSendSupernumArgs(byte1 & 0x1F, ((usqInt) byte1) >> 5); +} + + +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfFalse */ +static sqInt +genExtJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + +/* SistaV1: * 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ +/* Non supported in non Sista VMs */ + + /* SimpleStackBasedCogit>>#genExtJumpIfNotInstanceOfBehaviorsBytecode */ +static sqInt +genExtJumpIfNotInstanceOfBehaviorsBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#genExtJumpIfTrue */ +static sqInt +genExtJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongForwardBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* NewspeakV4: 221 11011101 Nop */ +/* SistaV1: 91 01011011' Nop */ + + /* SimpleStackBasedCogit>>#genExtNopBytecode */ +static sqInt +genExtNopBytecode(void) +{ + extA = (numExtB = (extB = 0)); + return 0; +} + + +/* SistaV1: 233 11101001 iiiiiiii Push Character #iiiiiiii (+ Extend B * + 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushCharacterBytecode */ +static sqInt +genExtPushCharacterBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral(characterObjectOf(value)); +} + + +/* NewsqueakV4: 229 11100101 iiiiiiii Push Integer #iiiiiiii (+ Extend B * + 256, where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + SistaV1: 232 11101000 iiiiiiii Push Integer #iiiiiiii (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtPushIntegerBytecode */ +static sqInt +genExtPushIntegerBytecode(void) +{ + sqInt value; + + value = byte1 + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + return genPushLiteral((((usqInt)value << 1) | 1)); +} + + +/* 228 11100100 i i i i i i i i Push Literal #iiiiiiii (+ Extend A * 256) */ + + /* SimpleStackBasedCogit>>#genExtPushLiteralBytecode */ +static sqInt +genExtPushLiteralBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralIndex(index); +} + + +/* 227 11100011 i i i i i i i i Push Literal Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushLitVarDirSupBytecode */ +static sqInt +genExtPushLitVarDirSupBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return genPushLiteralVariableGivenDirectedSuper(index); +} + + +/* SistaV1: * 82 01010010 Push thisContext, (then Extend B = 1 => push + thisProcess) + */ + + /* SimpleStackBasedCogit>>#genExtPushPseudoVariable */ +static sqInt +genExtPushPseudoVariable(void) +{ + sqInt ext; + + ext = extB; + extB = 0; + numExtB = 0; + + switch (ext) { + case 0: + return genPushActiveContextBytecode(); + + default: + return unknownBytecode(); + + } + return 0; +} + + +/* 226 11100010 i i i i i i i i Push Receiver Variable #iiiiiiii (+ Extend A + * 256) + */ + + /* SimpleStackBasedCogit>>#genExtPushReceiverVariableBytecode */ +static sqInt +genExtPushReceiverVariableBytecode(void) +{ + sqInt index; + + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return (isReadMediatedContextInstVarIndex(index) + ? genPushMaybeContextReceiverVariable(index) + : genPushReceiverVariable(index)); +} + + +/* 238 11101110 i i i i i j j j Send Literal Selector #iiiii (+ Extend A * + 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendBytecode */ +static sqInt +genExtSendBytecode(void) +{ + sqInt litIndex; + sqInt nArgs; + + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return genSendnumArgs(litIndex, nArgs); +} + + +/* 239 11101111 i i i i i j j j Send To Superclass Literal Selector #iiiii + (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments + */ + + /* SimpleStackBasedCogit>>#genExtSendSuperBytecode */ +static sqInt +genExtSendSuperBytecode(void) +{ + int isDirected; + sqInt litIndex; + sqInt nArgs; + + if ((isDirected = extB >= 64)) { + extB = extB & 0x3F; + } + litIndex = (((usqInt) byte1) >> 3) + (((sqInt)((usqInt)(extA) << 5))); + extA = 0; + nArgs = (byte1 & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + return (isDirected + ? genSendDirectedSupernumArgs(litIndex, nArgs) + : genSendSupernumArgs(litIndex, nArgs)); +} + + /* SimpleStackBasedCogit>>#genExtStoreAndPopRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreAndPopRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(1); +} + + /* SimpleStackBasedCogit>>#genExtStoreRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtStoreRemoteTempOrInstVarLongBytecode(void) +{ + return genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(0); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#genExtUnconditionalJump */ +static sqInt +genExtUnconditionalJump(void) +{ + AbstractInstruction *abstractInstruction; + sqInt distance; + sqInt target; + + distance = byte1 + (((sqInt)((usqInt)(extB) << 8))); + assert(distance == (v4LongBranchDistance(generatorAt(byte0), bytecodePC, ((extA != 0 + ? 1 + : 0)) + ((extB != 0 + ? 1 + : 0)), methodObj))); + extB = 0; + numExtB = 0; + target = (distance + 2) + bytecodePC; + if (distance < 0) { + return genJumpBackTo(target); + } + genJumpTo(target); + /* begin annotateBytecode: */ + abstractInstruction = lastOpcode(); + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* SimpleStackBasedCogit>>#genFastPrimFail */ +static sqInt +genFastPrimFail(void) +{ + primitiveIndex = 0; + return UnfailingPrimitive; +} + + +/* Suport for compileInterpreterPrimitive. Generate inline code so as to + record the primitive + trace as fast as possible. */ + + /* SimpleStackBasedCogit>>#genFastPrimTraceUsing:and: */ +static void NoDbgRegParms +genFastPrimTraceUsingand(sqInt r1, sqInt r2) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + sqInt offset; + sqInt wordConstant; + + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, r2); + + /* begin MoveAb:R: */ + address = primTraceLogIndexAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAbR, address, r2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, r2, r1); + /* begin AddCq:R: */ + anInstruction5 = genoperandoperand(AddCqR, 1, r1); + /* begin MoveR:Ab: */ + address1 = primTraceLogIndexAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAb, r1, address1); + addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), r1))); + /* begin MoveMw:r:R: */ + offset = offsetof(CogMethod, selector); + /* begin gen:quickConstant:operand:operand: */ + anInstruction3 = genoperandoperandoperand(MoveMwrR, offset, r1, TempReg); + /* begin MoveCw:R: */ + wordConstant = ((sqInt)(primTraceLogAddress())); + /* begin gen:literal:operand: */ + anInstruction4 = genoperandoperand(MoveCwR, wordConstant, r1); + /* begin MoveR:Xwr:R: */ + genoperandoperandoperand(MoveRXwrR, TempReg, r2, r1); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfFalse */ +static sqInt +genLongJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genLongJumpIfTrue */ +static sqInt +genLongJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3LongForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 2) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + +/* 230 11100110 i i i i i i i i Push Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongPushTemporaryVariableBytecode */ +static sqInt +genLongPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte1); +} + + +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreAndPopTemporaryVariableBytecode */ +static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + + +/* 234 11101010 i i i i i i i i Store Temporary Variable #iiiiiiii */ + + /* SimpleStackBasedCogit>>#genLongStoreTemporaryVariableBytecode */ +static sqInt +genLongStoreTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(0, byte1); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalBackwardJump */ +static sqInt +genLongUnconditionalBackwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance < 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpBackTo(targetpc); +} + + /* SimpleStackBasedCogit>>#genLongUnconditionalForwardJump */ +static sqInt +genLongUnconditionalForwardJump(void) +{ + sqInt distance; + sqInt targetpc; + + distance = v3LongBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + assert(distance >= 0); + targetpc = (distance + 2) + bytecodePC; + return genJumpTo(targetpc); +} + + +/* Compile the code for a probe of the first-level method cache for a perform + primtiive. The selector is assumed to be in Arg0Reg. Defer to + adjustArgumentsForPerform: to + adjust the arguments before the jump to the method. */ + + /* SimpleStackBasedCogit>>#genLookupForPerformNumArgs: */ +static sqInt NoDbgRegParms +genLookupForPerformNumArgs(sqInt numArgs) +{ + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt cacheBaseReg; + AbstractInstruction *itsAHit; + AbstractInstruction *jumpClassMiss; + AbstractInstruction *jumpInterpret; + AbstractInstruction *jumpSelectorMiss; + sqInt offset; + + + /* N.B. Can't assume TempReg already contains the tag because a method can + of course be invoked via the unchecked entry-point, e.g. as does perform:. */ + genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, SendNumArgsReg, 0); + flag("lookupInMethodCacheSel:classTag:"); + cacheBaseReg = NoReg; + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 0, cacheBaseReg); + /* begin JumpNonZero: */ + jumpClassMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveMw:r:R: */ + offset = (cacheBaseReg == NoReg + ? (((usqInt)(methodCacheAddress()))) + (((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))) + : ((int)((usqInt)(MethodCacheMethod) << (shiftForWord())))); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, offset, ClassReg, SendNumArgsReg); + itsAHit = anInstruction1; + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + + /* Adjust arguments and jump to the method's unchecked entry-point. */ + jumpInterpret = genJumpImmediate(ClassReg); + /* begin AddCq:R: */ + anInstruction2 = genoperandoperand(AddCqR, cmNoCheckEntryOffset, ClassReg); + adjustArgumentsForPerform(numArgs); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpClassMiss, gLabel())); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 1, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, gLabel()); + jumpSelectorMiss = compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(Arg0Reg, 2, cacheBaseReg); + /* begin JumpZero: */ + genConditionalBranchoperand(JumpZero, ((sqInt)itsAHit)); + jmpTarget(jumpSelectorMiss, jmpTarget(jumpInterpret, gLabel())); + return 0; +} + + /* SimpleStackBasedCogit>>#genMoveTrueR: */ +static AbstractInstruction * NoDbgRegParms +genMoveTrueR(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveConstant:R: */ + constant = trueObject(); + return (shouldAnnotateObjectReference(constant) + ? annotateobjRef(gMoveCwR(constant, reg), constant) + : (/* begin MoveCq:R: */ + (anInstruction = genoperandoperand(MoveCqR, constant, reg)), + anInstruction)); +} + + /* SimpleStackBasedCogit>>#genMustBeBooleanTrampolineFor:called: */ +static sqInt NoDbgRegParms +genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName) +{ + AbstractInstruction *anInstruction; + + zeroOpcodeIndex(); + assert(!(shouldAnnotateObjectReference(boolean))); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, boolean, TempReg); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSendMustBeBoolean, trampolineName, 1, TempReg, null, null, null, 0, 1, NoReg, 1); +} + + +/* Generate the substitute return code for an external or FFI primitive call. + On success simply return, extracting numArgs from newMethod. + On primitive failure call ceActivateFailingPrimitiveMethod: newMethod. */ + + /* SimpleStackBasedCogit>>#genPrimReturnEnterCogCodeEnilopmart: */ +static void NoDbgRegParms +genPrimReturnEnterCogCodeEnilopmart(sqInt profiling) +{ + sqInt address; + sqInt address1; + sqInt address4; + sqInt address6; + sqInt address7; + sqInt address8; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction10; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction14; + AbstractInstruction *anInstruction16; + AbstractInstruction *anInstruction18; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqInt callTarget; + AbstractInstruction *continuePostSample; + AbstractInstruction * inst; + AbstractInstruction *jmpFail; + AbstractInstruction *jmpSample; + sqInt quickConstant; + sqInt reg; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + + if (profiling) { + + /* Test nextProfileTick for being non-zero and call checkProfileTick: if so. + N.B. nextProfileTick is 64-bits so 32-bit systems need to test both halves. */ + /* begin MoveAw:R: */ + address = nextProfileTickAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin MoveAw:R: */ + address1 = (nextProfileTickAddress()) + BytesPerWord; + /* begin gen:literal:operand: */ + anInstruction2 = genoperandoperand(MoveAwR, address1, ClassReg); + /* begin OrR:R: */ + genoperandoperand(OrRR, TempReg, ClassReg); + + /* begin JumpNonZero: */ + jmpSample = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin Label */ + continuePostSample = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + maybeCompileAllocFillerCheck(); + /* begin MoveAw:R: */ + address6 = primFailCodeAddress(); + /* begin gen:literal:operand: */ + anInstruction12 = genoperandoperand(MoveAwR, address6, TempReg); + flag("ask concrete code gen if move sets condition codes?"); + /* begin CmpCq:R: */ + anInstruction16 = genoperandoperand(CmpCqR, 0, TempReg); + /* begin JumpNonZero: */ + jmpFail = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadStackPointers(backEnd); + /* begin MoveMw:r:R: */ + anInstruction5 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + /* begin MoveAw:R: */ + address4 = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction6 = genoperandoperand(MoveAwR, address4, LinkReg); + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + + + jmpTarget(jmpFail, gMoveAwR(newMethodAddress(), SendNumArgsReg)); + /* begin MoveAw:R: */ + address7 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction13 = genoperandoperand(MoveAwR, address7, SPReg); + compileCallFornumArgsargargargargresultRegregsToSave(ceActivateFailingPrimitiveMethod, 1, SendNumArgsReg, null, null, null, NoReg, 0); + /* begin MoveAw:R: */ + address8 = instructionPointerAddress(); + reg = LinkReg; + /* begin gen:literal:operand: */ + anInstruction14 = genoperandoperand(MoveAwR, address8, reg); + genLoadStackPointers(backEnd); + /* begin MoveMw:r:R: */ + anInstruction10 = genoperandoperandoperand(MoveMwrR, 0, SPReg, ReceiverResultReg); + + /* begin RetN: */ + genoperand(RetN, BytesPerWord); + if (profiling) { + + /* Call ceCheckProfileTick: to record sample and then continue. newMethod + should be up-to-date. Need to save and restore the link reg around this call. */ + jmpTarget(jmpSample, gLabel()); + /* begin saveAndRestoreLinkRegAround: */ + inst = genoperand(PushR, LinkReg); + /* begin CallFullRT: */ + callTarget = (usqIntptr_t)ceCheckProfileTick; + /* begin CallFull: */ + anInstruction18 = genoperand(CallFull, callTarget); + + + /* begin PopR: */ + genoperand(PopR, LinkReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)continuePostSample)); + } +} + + +/* SistaV1: 230 11100110 iiiiiiii PushNClosureTemps iiiiiiii */ + + /* SimpleStackBasedCogit>>#genPushClosureTempsBytecode */ +static sqInt +genPushClosureTempsBytecode(void) +{ + sqInt i; + + for (i = 1; i <= byte1; i += 1) { + genPushLiteral(nilObject()); + } + return 0; +} + + /* SimpleStackBasedCogit>>#genPushConstantFalseBytecode */ +static sqInt +genPushConstantFalseBytecode(void) +{ + return genPushLiteral(falseObject()); +} + + /* SimpleStackBasedCogit>>#genPushConstantNilBytecode */ +static sqInt +genPushConstantNilBytecode(void) +{ + return genPushLiteral(nilObject()); +} + + +/* 79 01001111 Push 1 */ + + /* SimpleStackBasedCogit>>#genPushConstantOneBytecode */ +static sqInt +genPushConstantOneBytecode(void) +{ + return genPushLiteral((((usqInt)1 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushConstantTrueBytecode */ +static sqInt +genPushConstantTrueBytecode(void) +{ + return genPushLiteral(trueObject()); +} + + +/* 78 01001110 Push 0 */ + + /* SimpleStackBasedCogit>>#genPushConstantZeroBytecode */ +static sqInt +genPushConstantZeroBytecode(void) +{ + return genPushLiteral((((usqInt)0 << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushLiteralConstantBytecode */ +static sqInt +genPushLiteralConstantBytecode(void) +{ + return genPushLiteralIndex(byte0 & 0x1F); +} + + +/* */ + + /* SimpleStackBasedCogit>>#genPushLiteralIndex: */ +static sqInt NoDbgRegParms +genPushLiteralIndex(sqInt literalIndex) +{ + sqInt literal; + + literal = getLiteral(literalIndex); + return genPushLiteral(literal); +} + + /* SimpleStackBasedCogit>>#genPushLiteralVariableBytecode */ +static sqInt +genPushLiteralVariableBytecode(void) +{ + return genPushLiteralVariable(byte0 & 0x1F); +} + + +/* e.g. SistaV1: 16-31 0001 iiii Push Literal Variable #iiii */ + + /* SimpleStackBasedCogit>>#genPushLitVarDirSup16CasesBytecode */ +static sqInt +genPushLitVarDirSup16CasesBytecode(void) +{ + return genPushLiteralVariableGivenDirectedSuper(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushQuickIntegerConstantBytecode */ +static sqInt +genPushQuickIntegerConstantBytecode(void) +{ + return genPushLiteral((((usqInt)(byte0 - 117) << 1) | 1)); +} + + /* SimpleStackBasedCogit>>#genPushReceiverVariableBytecode */ +static sqInt +genPushReceiverVariableBytecode(void) +{ + return genPushReceiverVariable(byte0 & 15); +} + + /* SimpleStackBasedCogit>>#genPushTemporaryVariableBytecode */ +static sqInt +genPushTemporaryVariableBytecode(void) +{ + return genPushTemporaryVariable(byte0 & 15); +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnConst */ +sqInt +genQuickReturnConst(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + constant = quickPrimitiveConstantFor(primitiveIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnInstVar */ +sqInt +genQuickReturnInstVar(void) +{ + sqInt index; + + index = quickPrimitiveInstVarIndexFor(primitiveIndex); + genLoadSlotsourceRegdestReg(index, ReceiverResultReg, ReceiverResultReg); + genUpArrowReturn(); + return UnfailingPrimitive; +} + + +/* because selected by CoInterpreter>>quickPrimitiveGeneratorFor: */ + + /* SimpleStackBasedCogit>>#genQuickReturnSelf */ +sqInt +genQuickReturnSelf(void) +{ + genUpArrowReturn(); + return UnfailingPrimitive; +} + + /* SimpleStackBasedCogit>>#genReturnFalse */ +static sqInt +genReturnFalse(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveFalseR: */ + constant = falseObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNil */ +static sqInt +genReturnNil(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnNilFromBlock */ +static sqInt +genReturnNilFromBlock(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + assert(inBlock > 0); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genBlockReturn(); +} + + /* SimpleStackBasedCogit>>#genReturnTrue */ +static sqInt +genReturnTrue(void) +{ + AbstractInstruction *anInstruction; + sqInt constant; + + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, ReceiverResultReg); + } + return genUpArrowReturn(); +} + + +/* Can use any of the first 64 literals for the selector and pass up to 3 + arguments. + */ + + /* SimpleStackBasedCogit>>#genSecondExtendedSendBytecode */ +static sqInt +genSecondExtendedSendBytecode(void) +{ + return genSendnumArgs(byte1 & 0x3F, ((usqInt) byte1) >> 6); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector0ArgsBytecode */ +static sqInt +genSendLiteralSelector0ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 0); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector1ArgBytecode */ +static sqInt +genSendLiteralSelector1ArgBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 1); +} + + /* SimpleStackBasedCogit>>#genSendLiteralSelector2ArgsBytecode */ +static sqInt +genSendLiteralSelector2ArgsBytecode(void) +{ + return genSendnumArgs(byte0 & 15, 2); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfFalse */ +static sqInt +genShortJumpIfFalse(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(falseObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortJumpIfTrue */ +static sqInt +genShortJumpIfTrue(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpIfto(trueObject(), target); +} + + /* SimpleStackBasedCogit>>#genShortUnconditionalJump */ +static sqInt +genShortUnconditionalJump(void) +{ + sqInt distance; + sqInt target; + + distance = v3ShortForwardBranchDistance(generatorAt(byte0), bytecodePC, 0, methodObj); + target = (distance + 1) + bytecodePC; + return genJumpTo(target); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopLiteralVariableBytecode */ +static sqInt +genSistaExtStoreAndPopLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreAndPopReceiverVariableBytecode */ +static sqInt +genSistaExtStoreAndPopReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = 1; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreLiteralVariableBytecode */ +static sqInt +genSistaExtStoreLiteralVariableBytecode(void) +{ + sqInt index; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreLiteralVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + return genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck); +} + + /* SimpleStackBasedCogit>>#genSistaExtStoreReceiverVariableBytecode */ +static sqInt +genSistaExtStoreReceiverVariableBytecode(void) +{ + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + /* begin genSistaExtStoreAndPopReceiverVariableBytecodePopBoolean: */ + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + maybeContext = extB & 2; + extB = 0; + numExtB = 0; + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + return ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck) + : genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(0, index, needsStoreCheck, needsImmCheck)); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorEqualsEquals */ +static sqInt +genSpecialSelectorEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(0); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorNotEqualsEquals */ +static sqInt +genSpecialSelectorNotEqualsEquals(void) +{ + return genInlinedIdenticalOrNotIf(1); +} + + /* SimpleStackBasedCogit>>#genSpecialSelectorSend */ +static sqInt +genSpecialSelectorSend(void) +{ + sqInt index; + sqInt numArgs; + + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + numArgs = specialSelectorNumArgs(index); + return genSendnumArgs((-index) - 1, numArgs); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopReceiverVariableBytecode */ +static sqInt +genStoreAndPopReceiverVariableBytecode(void) +{ + return genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(1, byte0 & 7, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopRemoteTempLongBytecode */ +static sqInt +genStoreAndPopRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(1, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + /* SimpleStackBasedCogit>>#genStoreAndPopTemporaryVariableBytecode */ +static sqInt +genStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte0 & 7); +} + + /* SimpleStackBasedCogit>>#genStoreRemoteTempLongBytecode */ +static sqInt +genStoreRemoteTempLongBytecode(void) +{ + return genStorePopRemoteTempAtneedsStoreCheck(0, byte1, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))); +} + + +/* SistaV1: * 217 Trap */ + + /* SimpleStackBasedCogit>>#genUnconditionalTrapBytecode */ +static sqInt +genUnconditionalTrapBytecode(void) +{ + return EncounteredUnknownBytecode; +} + + /* SimpleStackBasedCogit>>#loadNativeArgumentAddress:to: */ +static void NoDbgRegParms +loadNativeArgumentAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); +} + + /* SimpleStackBasedCogit>>#loadNativeFramePointerInto: */ +static void NoDbgRegParms +loadNativeFramePointerInto(sqInt reg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); +} + + /* SimpleStackBasedCogit>>#loadNativeLocalAddress:to: */ +static void NoDbgRegParms +loadNativeLocalAddressto(sqInt baseOffset, sqInt reg) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt offset; + + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, reg); + /* begin AddCq:R: */ + anInstruction1 = genoperandoperand(AddCqR, baseOffset - 1, reg); +} + + +/* Collect the branch and send data for cogMethod, storing it into arrayObj. */ + + /* SimpleStackBasedCogit>>#mapPCDataFor:into: */ +sqInt +mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj) +{ + sqInt aMethodHeader; + sqInt aMethodHeader1; + sqInt aMethodObj; + sqInt annotation; + sqInt bcpc; + sqInt bsOffset; + sqInt byte; + CogBlockMethod *cogMethod1; + BytecodeDescriptor *descriptor; + sqInt distance; + usqInt endbcpc; + sqInt errCode; + CogMethod *homeMethod; + sqInt isBackwardBranch; + sqInt isInBlock; + sqInt latestContinuation; + usqInt map; + sqInt mapByte; + usqInt mcpc; + sqInt nExts; + sqInt nextBcpc; + sqInt result; + sqInt startbcpc; + sqInt targetPC; + + latestContinuation = 0; + introspectionDataIndex = 0; + introspectionData = arrayObj; + if (((cogMethod->stackCheckOffset)) == 0) { + assert(introspectionDataIndex == 0); + if ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(0, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + return 4; + } + /* begin mapFor:bcpc:performUntil:arg: */ + cogMethod1 = ((CogBlockMethod *) cogMethod); + startbcpc = startPCOfMethod((cogMethod->methodObject)); + assert(((cogMethod1->stackCheckOffset)) > 0); + + /* The stack check maps to the start of the first bytecode, + the first bytecode being effectively after frame build. */ + mcpc = (((usqInt)cogMethod1)) + ((cogMethod1->stackCheckOffset)); + result = pcDataForAnnotationMcpcBcpcMethod(null, (0 + (((int)((usqInt)(HasBytecodePC) << 1)))), (((char *) mcpc)), startbcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + + /* In both CMMethod and CMBlock cases find the start of the map and + skip forward to the bytecode pc map entry for the stack check. */ + bcpc = startbcpc; + if (((cogMethod1->cmType)) == CMMethod) { + /* begin cmIsFullBlock */ + isInBlock = (cogMethod1->cpicHasMNUCaseOrCMIsFullBlock); + homeMethod = ((CogMethod *) cogMethod1); + assert(startbcpc == (startPCOfMethodHeader((homeMethod->methodHeader)))); + map = ((((usqInt)homeMethod)) + ((homeMethod->blockSize))) - 1; + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert((annotation == IsAbsPCReference) + || ((annotation == IsObjectReference) + || ((annotation == IsRelativeCall) + || (annotation == IsDisplacementX2N)))); + latestContinuation = startbcpc; + aMethodObj = (homeMethod->methodObject); + endbcpc = (numBytesOf(aMethodObj)) - 1; + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) + ? 256 + : 0); + bcpc += deltaToSkipPrimAndErrorStoreInheader(aMethodObj, (homeMethod->methodHeader)); + } + else { + isInBlock = 1; + assert(bcpc == ((cogMethod1->startpc))); + homeMethod = cmHomeMethod(cogMethod1); + map = findMapLocationForMcpcinMethod((((usqInt)cogMethod1)) + (sizeof(CogBlockMethod)), homeMethod); + assert(map != 0); + annotation = ((usqInt) (byteAt(map))) >> AnnotationShift; + assert(((((usqInt) annotation) >> AnnotationShift) == HasBytecodePC) + || ((((usqInt) annotation) >> AnnotationShift) == IsDisplacementX2N)); + while (((annotation = ((usqInt) (byteAt(map))) >> AnnotationShift)) != HasBytecodePC) { + map -= 1; + } + + /* skip fiducial; i.e. the map entry for the pc immediately following the method header. */ + map -= 1; + aMethodObj = (homeMethod->methodObject); + bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); + /* begin bytecodeSetOffsetForHeader: */ + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) + ? 256 + : 0); + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + endbcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, -1, aMethodObj)) + : 0)); + bcpc = startbcpc; + } + nExts = 0; + while ((((usqInt) (byteAt(map))) >> AnnotationShift) != HasBytecodePC) { + map -= 1; + } + map -= 1; + while (((mapByte = byteAt(map))) != MapEnd) { + + /* defensive; we exit on bcpc */ + if (mapByte >= FirstAnnotation) { + annotation = ((usqInt) mapByte) >> AnnotationShift; + mcpc += (mapByte & DisplacementMask) * 4; + if (annotation >= HasBytecodePC) { + if ((annotation == IsSendCall) + && ((((usqInt) ((mapByte = byteAt(map - 1)))) >> AnnotationShift) == IsAnnotationExtension)) { + annotation += mapByte & DisplacementMask; + map -= 1; + } + while (1) { + byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; + descriptor = generatorAt(byte); + if (isInBlock) { + if (bcpc >= endbcpc) { + errCode = 0; + goto l7; + } + } + else { + if (((descriptor->isReturn)) + && (bcpc >= latestContinuation)) { + errCode = 0; + goto l7; + } + if ((isBranch(descriptor)) + || ((descriptor->isBlockCreation))) { + /* begin latestContinuationPCFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj); + targetPC = (bcpc + ((descriptor->numBytes))) + (((distance < 0) ? 0 : distance)); + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + nextBcpc = (bcpc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? (/* begin spanFor:at:exts:in: */ + ((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) + : 0)); + if (((descriptor->isMapped)) + || (isInBlock + && ((descriptor->isMappedInBlock)))) break; + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + isBackwardBranch = (isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, bcpc, nExts, aMethodObj)) < 0)); + result = pcDataForAnnotationMcpcBcpcMethod(descriptor, ((isBackwardBranch + ? (((sqInt)((usqInt)(annotation) << 1))) + 1 + : ((sqInt)((usqInt)(annotation) << 1)))), (((char *) mcpc)), bcpc, (((void *)cogMethod))); + if (result != 0) { + errCode = result; + goto l7; + } + bcpc = nextBcpc; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + } + else { + assert(((((usqInt) mapByte) >> AnnotationShift) == IsDisplacementX2N) + || ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension)); + if (mapByte < (((int)((usqInt)(IsAnnotationExtension) << AnnotationShift)))) { + mcpc += (((sqInt)((usqInt)((mapByte - DisplacementX2N)) << AnnotationShift))) * 4; + } + } + map -= 1; + } + errCode = 0; +l7: /* end mapFor:bcpc:performUntil:arg: */; + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + if (((cogMethod->blockEntryOffset)) != 0) { + errCode = blockDispatchTargetsForperformarg(cogMethod, pcDataForBlockEntryMethod, ((sqInt)cogMethod)); + if (errCode != 0) { + assert(errCode == PrimErrNoMemory); + return -1; + } + } + return introspectionDataIndex; +} + + +/* If allocCheckFiller is true, words in newSpace from freeStart to + scavengeThreshold are filled with their address, and after each call of a + plugin primitive, the VM checks + that freeStart points to a word containing the value of freeStart. This is + a simple + check for primitives overwriting the ends of an object. */ + + /* SimpleStackBasedCogit>>#maybeCompileAllocFillerCheck */ +static void +maybeCompileAllocFillerCheck(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jmpOk; + + if (getCheckAllocFiller()) { + /* begin MoveAw:R: */ + address = freeStartAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, ClassReg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, 0, ClassReg, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, ClassReg, TempReg); + /* begin JumpZero: */ + jmpOk = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, PrimErrWritePastObject, TempReg); + /* begin MoveR:Aw: */ + address1 = primFailCodeAddress(); + /* begin gen:operand:literal: */ + anInstruction3 = genoperandoperand(MoveRAw, TempReg, address1); + jmpTarget(jmpOk, gLabel()); + } +} + + /* SimpleStackBasedCogit>>#numSpecialSelectors */ +static sqInt +numSpecialSelectors(void) +{ + return (bytecodeSetOffset == 256 + ? AltNumSpecialSelectors + : NumSpecialSelectors); +} + + +/* Collect the branch and send data for the block method starting at + blockEntryMcpc, storing it into picData. + */ + + /* SimpleStackBasedCogit>>#pcDataForBlockEntry:Method: */ +static usqInt NoDbgRegParms +pcDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod) +{ + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)(blockEntryMcpc - blockNoContextSwitchOffset) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)blockEntryMcpc << 1) | 1)); + introspectionDataIndex += 4; + return 0; +} + + /* SimpleStackBasedCogit>>#pcDataFor:Annotation:Mcpc:Bcpc:Method: */ +static sqInt NoDbgRegParms +pcDataForAnnotationMcpcBcpcMethod(BytecodeDescriptor *descriptor, sqInt isBackwardBranchAndAnnotation, char *mcpc, sqInt bcpc, void *cogMethodArg) +{ + sqInt actualBcpc; + usqInt actualMcpc; + + if (!(descriptor)) { + + /* this is the stackCheck offset */ + assert(introspectionDataIndex == 0); + if (((((CogMethod *) cogMethodArg))->cpicHasMNUCaseOrCMIsFullBlock)) { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cbNoSwitchEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cbEntryOffset << 1) | 1)); + } + else { + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, (((usqInt)cmEntryOffset << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 2, introspectionData, nilObject()); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 3, introspectionData, (((usqInt)cmNoCheckEntryOffset << 1) | 1)); + } + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 4, introspectionData, (((usqInt)(bcpc + 1) << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 5, introspectionData, (((((((CogMethod *) cogMethodArg))->stackCheckOffset)) << 1) | 1)); + introspectionDataIndex += 6; + return 0; + } + if ((((usqInt) isBackwardBranchAndAnnotation) >> 1) >= HasBytecodePC) { + actualBcpc = (isBackwardBranchAndAnnotation & 1 + ? bcpc + 1 + : (bcpc + ((descriptor->numBytes))) + 1); + actualMcpc = (((usqInt)mcpc)) - (((usqInt)cogMethodArg)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex, introspectionData, (((usqInt)actualBcpc << 1) | 1)); + storePointerUncheckedofObjectwithValue(introspectionDataIndex + 1, introspectionData, ((actualMcpc << 1) | 1)); + introspectionDataIndex += 2; + } + return 0; +} + + +/* If there is a generator for the current primitive then answer it; + otherwise answer nil. */ + + /* SimpleStackBasedCogit>>#primitiveGeneratorOrNil */ +static PrimitiveDescriptor * +primitiveGeneratorOrNil(void) +{ + PrimitiveDescriptor *primitiveDescriptor; + static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = { + { 0, -1 }, + { genPrimitiveAdd, 1 }, + { genPrimitiveSubtract, 1 }, + { genPrimitiveLessThan, 1 }, + { genPrimitiveGreaterThan, 1 }, + { genPrimitiveLessOrEqual, 1 }, + { genPrimitiveGreaterOrEqual, 1 }, + { genPrimitiveEqual, 1 }, + { genPrimitiveNotEqual, 1 }, + { genPrimitiveMultiply, 1 }, + { genPrimitiveDivide, 1 }, + { genPrimitiveMod, 1 }, + { genPrimitiveDiv, 1 }, + { genPrimitiveQuo, 1 }, + { genPrimitiveBitAnd, 1 }, + { genPrimitiveBitOr, 1 }, + { genPrimitiveBitXor, 1 }, + { genPrimitiveBitShift, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveAt, 1 }, + { genPrimitiveAtPut, 2 }, + { genPrimitiveSize, 0 }, + { genPrimitiveStringAt, 1 }, + { genPrimitiveStringAtPut, 2 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { genPrimitiveObjectAt, 1 }, + { 0, -1 }, + { genPrimitiveNew, 0 }, + { genPrimitiveNewWithArg, 1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNewMethod, 2 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitivePerform, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentical, 1 }, + { genPrimitiveClass, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveShallowCopy, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveNotIdentical, 1 }, + { genPrimitiveAsCharacter, -1 }, + { genPrimitiveImmediateAsInteger, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveIdentityHash, 0 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genFastPrimFail, -1 }, + { genFastPrimFail, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 }, + { genPrimitiveClosureValue, 2 }, + { genPrimitiveClosureValue, 3 }, + { genPrimitiveClosureValue, 4 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { genPrimitiveFullClosureValue, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { 0, -1 }, + { genPrimitiveClosureValue, 0 }, + { genPrimitiveClosureValue, 1 } +}; + + if (isQuickPrimitiveIndex(primitiveIndex)) { + + /* an unused one */ + primitiveDescriptor = (&(primitiveGeneratorTable[0])); + (primitiveDescriptor->primitiveGenerator = quickPrimitiveGeneratorFor(primitiveIndex)); + return primitiveDescriptor; + } + if (((primitiveIndex >= 1) && (primitiveIndex <= MaxCompiledPrimitiveIndex))) { + return (&(primitiveGeneratorTable[primitiveIndex])); + } + return null; +} + + /* SimpleStackBasedCogit>>#recordCallOffsetIn: */ +void +recordCallOffsetIn(CogMethod *cogMethod) +{ + usqIntptr_t offset; + sqInt *offsetTable; + + offset = ((primSetFunctionLabel->address)) - (((sqInt)cogMethod)); + if ((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == null) { + externalSetPrimOffsets[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((externalSetPrimOffsets[(cogMethod->cmNumArgs)]) == offset); + } + offsetTable = (isJump(primInvokeInstruction) + ? externalPrimJumpOffsets + : externalPrimCallOffsets); + offset = (((primInvokeInstruction->address)) + ((primInvokeInstruction->machineCodeSize))) - (((sqInt)cogMethod)); + if ((offsetTable[(cogMethod->cmNumArgs)]) == null) { + offsetTable[(cogMethod->cmNumArgs)] = offset; + } + else { + assert((offsetTable[(cogMethod->cmNumArgs)]) == offset); + } +} + + /* SimpleStackBasedCogit>>#rewritePrimInvocationIn:to: */ +void +rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void)) +{ + usqInt address; + sqInt extent; + sqInt flags; + sqInt primIndex; + + assert(((cogMethod->cmType)) == CMMethod); + primIndex = primitiveIndexOfMethodheader((cogMethod->methodObject), (cogMethod->methodHeader)); + flags = primitivePropertyFlags(primIndex); + if (flags & PrimCallNeedsPrimitiveFunction) { + storeLiteralbeforeFollowingAddress(backEnd, ((usqInt)primFunctionPointer), (((usqInt)cogMethod)) + (externalSetPrimOffsets[(cogMethod->cmNumArgs)])); + } + if (flags & PrimCallMayCallBack) { + address = (((usqInt)cogMethod)) + (externalPrimJumpOffsets[(cogMethod->cmNumArgs)]); + extent = rewriteJumpFullAttarget(backEnd, address, ((usqInt)primFunctionPointer)); + } + else { + address = (((usqInt)cogMethod)) + (externalPrimCallOffsets[(cogMethod->cmNumArgs)]); + extent = rewriteCallFullAttarget(backEnd, address, ((usqInt)primFunctionPointer)); + } + flushICacheFromto(processor, (((usqInt)cogMethod)) + cmNoCheckEntryOffset, (((usqInt)address)) + extent); +} + + /* SimpleStackBasedCogit>>#v3:Block:Code:Size: */ +static sqInt NoDbgRegParms +v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts <= 0); + return (((sqInt)((usqInt)((fetchByteofObject(pc + 2, aMethodObj))) << 8))) + (fetchByteofObject(pc + 3, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)(((fetchByteofObject(pc, aMethodObj)) & 3)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* Answer the distance of a two byte forward long jump. */ + + /* SimpleStackBasedCogit>>#v3:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return (((sqInt)((usqInt)((((fetchByteofObject(pc, aMethodObj)) & 7) - 4)) << 8))) + (fetchByteofObject(pc + 1, aMethodObj)); +} + + +/* N.B. This serves for both BlueBook/V3 and V4 short jumps. */ + + /* SimpleStackBasedCogit>>#v3:ShortForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v3ShortForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + assert(nExts == 0); + return ((fetchByteofObject(pc, aMethodObj)) & 7) + 1; +} + + +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* SimpleStackBasedCogit>>#v4:Block:Code:Size: */ +static sqInt NoDbgRegParms +v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt byteOne; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + + /* If nExts < 0 it isn't known and we rely on the number of extensions encoded in the eeiiikkk byte. */ + byteOne = fetchByteofObject(pc + 1, aMethodObj); + assert((nExts < 0) + || (nExts == (((usqInt) byteOne) >> 6))); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - (((usqInt) byteOne) >> 6)) - (((usqInt) byteOne) >> 6); + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ +/* 243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ + Extend A * 256) + */ +/* 244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ + Extend A * 256) + */ + + /* SimpleStackBasedCogit>>#v4:LongForward:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* ** 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of + Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= + 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0) + */ + + /* SimpleStackBasedCogit>>#v4:Long:BranchIfNotInstanceOf:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchIfNotInstanceOfDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 2, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + +/* 242 11110010 i i i i i i i i Jump i i i i i i i i (+ Extend B * 256, + where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1) + */ + + /* SimpleStackBasedCogit>>#v4:Long:Branch:Distance: */ +static sqInt NoDbgRegParms +v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + sqInt byte; + sqInt ea; + sqInt eb; + sqInt extAValue; + sqInt extBValue; + sqInt extBValue1; + sqInt extByte; + sqInt pc1; + + assert(nExts >= 0); + /* begin parseV4Exts:priorTo:in:into: */ + extAValue = (extBValue1 = 0); + pc1 = (pc - nExts) - nExts; + while (pc1 < pc) { + byte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + extByte = fetchByteofObject(pc1, aMethodObj); + pc1 += 1; + assert((byte == 224) + || (byte == 225)); + if (byte == 224) { + extAValue = (((usqInt) extAValue << 8)) + extByte; + } + else { + extBValue1 = ((extBValue1 == 0) + && (extByte > 0x7F) + ? extByte - 256 + : (((usqInt) extBValue1 << 8)) + extByte); + } + } + extBValue = extBValue1; + + return (fetchByteofObject(pc + 1, aMethodObj)) + (((sqInt)((usqInt)(extBValue) << 8))); +} + + /* SimpleStackBasedCogit>>#voidCogCompiledCode */ +void +voidCogCompiledCode(void) +{ + sqInt i; + + clearCogCompiledCode(); + for (i = 0; i <= MaxNumArgs; i += 1) { + externalPrimJumpOffsets[i] = null; + externalPrimCallOffsets[i] = null; + externalSetPrimOffsets[i] = null; + } +} + + +/* Add a blockStart for an embedded block. For a binary tree walk block + dispatch blocks must be compiled in pc/depth-first order but are scanned + in breadth-first + order, so do an insertion sort (which of course is really a bubble sort + because we + have to move everything higher to make room). */ + + /* StackToRegisterMappingCogit>>#addBlockStartAt:numArgs:numCopied:span: */ +static BlockStart * NoDbgRegParms +addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span) +{ + BlockStart *blockStart; + sqInt i; + sqInt j; + + + /* Transcript ensureCr; nextPutAll: 'addBlockStartAt: '; print: bytecodepc; cr; flush. */ + if (blockCount > 0) { + i = blockCount - 1; + while (1) { + + /* check for repeat addition during recompilation due to initialNil miscount. */ + blockStart = (&(blockStarts[i])); + if (((blockStart->startpc)) == bytecodepc) { + return blockStart; + } + if (!((((blockStart->startpc)) > bytecodepc) + && (i > 0))) break; + i -= 1; + } + for (j = blockCount; j >= (i + 1); j += -1) { + blockStarts[j] = (blockStarts[j - 1]); + } + blockStart = (&(blockStarts[i + 1])); + } + else { + blockStart = (&(blockStarts[blockCount])); + } + blockCount += 1; + (blockStart->startpc = bytecodepc); + (blockStart->numArgs = numArgs); + (blockStart->numCopied = numCopied); + (blockStart->numInitialNils = 0); + (blockStart->stackCheckLabel = null); + (blockStart->hasInstVarRef = 0); + (blockStart->span = span); + return blockStart; +} + + +/* e.g. Receiver Receiver or Receiver Receiver (RISC) + Selector/Arg0 => Arg1 Selector/Arg0 => Arg1 + Arg1 Arg2 Arg1 Arg2 + Arg2 Arg3 Arg2 sp-> Arg3 + Arg3 sp-> retpc sp-> Arg3 + sp-> retpc */ +/* Generate code to adjust the possibly stacked arguments immediately + before jumping to a method looked up by a perform primitive. */ + + /* StackToRegisterMappingCogit>>#adjustArgumentsForPerform: */ +static void NoDbgRegParms +adjustArgumentsForPerform(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction13; + AbstractInstruction *anInstruction15; + AbstractInstruction *anInstruction8; + AbstractInstruction *anInstruction9; + sqInt index; + + assert((numRegArgs()) <= 2); + assert(numArgs >= 1); + if (numArgs <= 2) { + if (numArgs == 2) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg1Reg, Arg0Reg); + } + return; + } + if ((2 + 1) == numArgs) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, SPReg, Arg1Reg); + /* begin MoveMw:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveMwrR, BytesPerWord, SPReg, Arg0Reg); + + /* begin AddCq:R: */ + anInstruction13 = genoperandoperand(AddCqR, (numArgs + 1) * BytesPerWord, SPReg); + + return; + } + for (index = (numArgs - 2); index >= 0; index += -1) { + /* begin MoveMw:r:R: */ + anInstruction8 = genoperandoperandoperand(MoveMwrR, index * BytesPerWord, SPReg, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction9 = genoperandoperandoperand(MoveRMwr, TempReg, (index + 1) * BytesPerWord, SPReg); + } + /* begin AddCq:R: */ + anInstruction15 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + +} + + +/* If the stack entry is already in a register not conflicting with regMask, + answers it, + else allocate a new register not conflicting with reg mask + */ + + /* StackToRegisterMappingCogit>>#allocateRegForStackEntryAt:notConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask) +{ + sqInt mask; + CogSimStackEntry *stackEntry; + + stackEntry = ssValue(index); + mask = registerMaskOrNone(stackEntry); + if ((mask != 0) + && ((mask & regMask) == 0)) { + return registerOrNone(stackEntry); + } + return allocateRegNotConflictingWith(regMask); +} + + +/* if there's a free register, use it */ + + /* StackToRegisterMappingCogit>>#allocateRegNotConflictingWith: */ +static sqInt NoDbgRegParms +allocateRegNotConflictingWith(sqInt regMask) +{ + sqInt reg; + + reg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (reg == NoReg) { + + /* No free register, choose one that does not conflict with regMask */ + reg = freeAnyRegNotConflictingWith(regMask); + } + if (reg == ReceiverResultReg) { + + /* If we've allocated RcvrResultReg, it's not live anymore */ + voidReceiverResultRegContainsSelf(); + } + return reg; +} + + /* StackToRegisterMappingCogit>>#anyReferencesToRegister:inTopNItems: */ +static sqInt NoDbgRegParms +anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n) +{ + sqInt i; + sqInt regMask; + + /* begin registerMaskFor: */ + regMask = 1U << reg; + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((registerMask(simStackAt(i))) & regMask) { + return 1; + } + } + return 0; +} + + +/* Store the smalltalk pointers */ + + /* StackToRegisterMappingCogit>>#beginHighLevelCall: */ +static void NoDbgRegParms +beginHighLevelCall(sqInt alignment) +{ + sqInt actualAlignment; + sqInt address; + sqInt address1; + sqInt address2; + sqInt address3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + sqInt mask; + sqInt offset; + + ssFlushAll(); + /* begin MoveR:Aw: */ + address1 = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, SPReg, address1); + /* begin MoveR:Aw: */ + address2 = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, FPReg, address2); + /* begin MoveAw:R: */ + address = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, LinkReg); + + /* begin MoveAw:R: */ + address3 = cStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address3, SPReg); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction4 = genoperandoperandoperand(MoveMwrR, offset, FPReg, FPReg); + /* begin SubCq:R: */ + anInstruction5 = genoperandoperand(SubCqR, 1, FPReg); + actualAlignment = ((alignment < BytesPerWord) ? BytesPerWord : alignment); + if (actualAlignment > BytesPerWord) { + mask = -actualAlignment; + /* begin AndCq:R: */ + anInstruction6 = genoperandoperand(AndCqR, mask, SPReg); + } + currentCallCleanUpSize = 0; +} + + +/* This is a static version of ceCallCogCodePopReceiverArg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg0Regs */ +void +callCogCodePopReceiverArg0Regs(void) +{ + realCECallCogCodePopReceiverArg0Regs(); +} + + +/* This is a static version of ceCallCogCodePopReceiverArg1Arg0Regs + for break-pointing when debugging in C. */ +/* This exists only for break-pointing. */ + + /* StackToRegisterMappingCogit>>#callCogCodePopReceiverArg1Arg0Regs */ +void +callCogCodePopReceiverArg1Arg0Regs(void) +{ + realCECallCogCodePopReceiverArg1Arg0Regs(); +} + + /* StackToRegisterMappingCogit>>#callSwitchToCStack */ +static sqInt +callSwitchToCStack(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + + /* begin MoveAw:R: */ + address = cFramePointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, FPReg); + return 0; +} + + +/* Restore the link register */ + + /* StackToRegisterMappingCogit>>#callSwitchToSmalltalkStack */ +static void +callSwitchToSmalltalkStack(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + + /* begin MoveAw:R: */ + address = instructionPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, LinkReg); + + genLoadStackPointers(backEnd); +} + + +/* Loop over bytecodes, dispatching to the generator for each bytecode, + handling fixups in due course. + */ + + /* StackToRegisterMappingCogit>>#compileAbstractInstructionsFrom:through: */ +static sqInt NoDbgRegParms +compileAbstractInstructionsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + BytecodeFixup *fixup; + sqInt generateBranchAround; + sqInt nExts; + sqInt nextOpcodeIndex; + sqInt result; + + traceSimStack(); + bytecodePC = start; + nExts = (result = 0); + descriptor = null; + deadCode = 0; + while (1) { + fixup = fixupAt(bytecodePC - initialPC); + mergeWithFixupIfRequired(fixup); + /* begin assertCorrectSimStackPtr */ + descriptor = loadBytesAndGetDescriptor(); + nextOpcodeIndex = opcodeIndex; + result = (deadCode + ? mapDeadDescriptorIfNeeded(descriptor) + : ((descriptor->generator))()); + /* begin assertExtsAreConsumed: */ + if (!((descriptor->isExtension))) { + assert((extA == 0) + && ((extB == 0) + && (numExtB == 0))); + } + traceDescriptor(descriptor); + traceSimStack(); + /* begin patchFixupTargetIfNeeded:nextOpcodeIndex: */ + if ((((((usqInt)((fixup->targetInstruction)))) >= NeedsNonMergeFixupFlag) && ((((usqInt)((fixup->targetInstruction)))) <= NeedsMergeFixupFlag))) { + + /* There is a fixup for this bytecode. It must point to the first generated + instruction for this bytecode. If there isn't one we need to add a label. */ + if (opcodeIndex == nextOpcodeIndex) { + /* begin Label */ + genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (fixup->targetInstruction = abstractInstructionAt(nextOpcodeIndex)); + } + /* begin maybeDumpLiterals: */ + if ((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn))) { + /* begin dumpLiterals: */ + generateBranchAround = !((isUnconditionalBranch(descriptor)) + || ((descriptor->isReturn))); + } + /* begin nextBytecodePCFor:exts: */ + bytecodePC = (bytecodePC + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, bytecodePC, nExts, methodObj) + : 0)); + if (!((result == 0) + && (bytecodePC <= end))) break; + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } + /* begin checkEnoughOpcodes */ + if (opcodeIndex > numAbstractOpcodes) { + error("Cog JIT internal error. Too many abstract opcodes. Num opcodes heuristic is too optimistic."); + } + return result; +} + + /* StackToRegisterMappingCogit>>#compileBlockBodies */ +static sqInt +compileBlockBodies(void) +{ + BlockStart *blockStart; + sqInt compiledBlocksCount; + sqInt i; + sqInt initialCounterIndex; + sqInt initialOpcodeIndex; + sqInt initialStackPtr; + sqInt result; + sqInt savedNeedsFrame; + sqInt savedNumArgs; + sqInt savedNumTemps; + + assert(blockCount > 0); + savedNeedsFrame = needsFrame; + savedNumArgs = methodOrBlockNumArgs; + savedNumTemps = methodOrBlockNumTemps; + inBlock = InVanillaBlock; + compiledBlocksCount = 0; + while (compiledBlocksCount < blockCount) { + blockPass = 1; + blockStart = blockStartAt(compiledBlocksCount); + if (((result = scanBlock(blockStart))) < 0) { + return result; + } + initialOpcodeIndex = opcodeIndex; + + /* for SistaCogit */ + initialCounterIndex = 0; + while (1) { + compileBlockEntry(blockStart); + initialStackPtr = simStackPtr; + if (((result = compileAbstractInstructionsFromthrough(((blockStart->startpc)) + (pushNilSizenumInitialNils(methodObj, (blockStart->numInitialNils))), (((blockStart->startpc)) + ((blockStart->span))) - 1))) < 0) { + return result; + } + if (initialStackPtr == simStackPtr) break; + assert(initialStackPtr > simStackPtr); + + /* for asserts :-( */ + blockPass += 1; + (blockStart->numInitialNils = (((blockStart->numInitialNils)) + simStackPtr) - initialStackPtr); + (((blockStart->fakeHeader))->dependent = null); + reinitializeFixupsFromthrough(((blockStart->startpc)) + ((blockStart->numInitialNils)), (((blockStart->startpc)) + ((blockStart->span))) - 1); + bzero(abstractOpcodes + initialOpcodeIndex, + (opcodeIndex - initialOpcodeIndex) * sizeof(AbstractInstruction)); + opcodeIndex = initialOpcodeIndex; + } + compiledBlocksCount += 1; + } + needsFrame = savedNeedsFrame; + methodOrBlockNumArgs = savedNumArgs; + methodOrBlockNumTemps = savedNumTemps; + return 0; +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any, and to correctly + initialize the explicitly nilled/pushed temp entries (they are /not/ of + type constant nil). */ + + /* StackToRegisterMappingCogit>>#compileBlockFrameBuild: */ +static void NoDbgRegParms +compileBlockFrameBuild(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction * cascade0; + sqInt constant; + sqInt constant1; + sqInt i; + sqInt ign; + + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + cascade0 = (blockStart->fakeHeader); + addDependent(cascade0, annotateAbsolutePCRef(gPushCw(((sqInt)((blockStart->fakeHeader)))))); + /* begin setLabelOffset: */ + ((cascade0->operands))[1] = MFMethodFlagIsBlockFlag; + annotateobjRef(gPushCw(nilObject()), nilObject()); + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ClassReg, Arg0Reg); + genLoadSlotsourceRegdestReg(ReceiverIndex, Arg0Reg, ReceiverResultReg); + } + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < ((blockStart->numCopied)); i += 1) { + genLoadSlotsourceRegdestReg(i + ClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction2 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + (blockStart->stackCheckLabel = annotateBytecode(gLabel())); + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramefulMethod((blockStart->startpc)); + if (((blockStart->numInitialNils)) > 0) { + if (((blockStart->numInitialNils)) > 1) { + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, TempReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, TempReg); + } + for (ign = 1; ign <= ((blockStart->numInitialNils)); ign += 1) { + /* begin PushR: */ + genoperand(PushR, TempReg); + } + } + else { + /* begin genPushConstant: */ + constant1 = nilObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gPushCw(constant1), constant1); + } + else { + /* begin PushCq: */ + anInstruction1 = genoperand(PushCq, constant1); + } + } + } +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. We must annotate the + first instruction in vanilla blocks so that + findMethodForStartBcpc:inHomeMethod: can function. We need two annotations + because the first is a fiducial. */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileBlockFramelessEntry: */ +static void NoDbgRegParms +compileBlockFramelessEntry(BlockStart *blockStart) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + + methodOrBlockNumTemps = (((blockStart->numArgs)) + ((blockStart->numCopied))) + ((blockStart->numInitialNils)); + initSimStackForFramelessBlock((blockStart->startpc)); + if (!(((blockStart->entryLabel)) == null)) { + /* begin annotateBytecode: */ + abstractInstruction = (blockStart->entryLabel); + (abstractInstruction->annotation = HasBytecodePC); + /* begin annotateBytecode: */ + abstractInstruction1 = (blockStart->entryLabel); + (abstractInstruction1->annotation = HasBytecodePC); + } + if ((blockStart->hasInstVarRef)) { + + /* Use ReceiverResultReg for Context to agree with store check trampoline */ + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + } + else { + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, TempReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, TempReg, ReceiverResultReg); + } +} + + /* StackToRegisterMappingCogit>>#compileCogFullBlockMethod: */ +static CogMethod * NoDbgRegParms +compileCogFullBlockMethod(sqInt numCopied) +{ + usqIntptr_t allocBytes; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = isYoungObject(methodObj); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = InFullBlock; + postCompileHook = null; + maxLitIndex = -1; + assert((primitiveIndexOf(methodObj)) == 0); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = numBytesOf(methodObj); + numBytecodes = (endPC - initialPC) + 1; + primitiveIndex = 0; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + 10) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + flag("TODO"); + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + assert(numBlocks == 0); + numCleanBlocks = scanForCleanBlocks(); + assert(numCleanBlocks == 0); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireFullBlockMethod(numCopied))) < 0) { + return ((CogMethod *) result); + } + return generateCogFullBlock(); +} + + /* StackToRegisterMappingCogit>>#compileCogMethod: */ +static CogMethod * NoDbgRegParms +compileCogMethod(sqInt selector) +{ + usqIntptr_t allocBytes; + int extra; + usqIntptr_t fixupBytes; + sqInt numBlocks; + sqInt numBytecodes; + sqInt numberOfAbstractOpcodes; + sqInt numCleanBlocks; + usqIntptr_t opcodeBytes; + sqInt result; + + methodOrBlockNumTemps = tempCountOf(methodObj); + hasYoungReferent = (isYoungObject(methodObj)) + || (isYoung(selector)); + methodOrBlockNumArgs = argumentCountOf(methodObj); + inBlock = 0; + postCompileHook = null; + maxLitIndex = -1; + extra = ((((primitiveIndex = primitiveIndexOf(methodObj))) > 0) + && (!(isQuickPrimitiveIndex(primitiveIndex))) + ? 30 + : 10); + + /* initial estimate. Actual endPC is determined in scanMethod. */ + initialPC = startPCOfMethod(methodObj); + endPC = (isQuickPrimitiveIndex(primitiveIndex) + ? initialPC - 1 + : numBytesOf(methodObj)); + numBytecodes = (endPC - initialPC) + 1; + /* begin allocateOpcodes:bytecodes:ifFail: */ + numberOfAbstractOpcodes = (numBytecodes + extra) * 10; + numAbstractOpcodes = numberOfAbstractOpcodes; + opcodeBytes = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes; + fixupBytes = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes; + allocBytes = opcodeBytes + fixupBytes; + if (allocBytes > MaxStackAllocSize) { + return ((CogMethod *) MethodTooBig); + + goto l1; + } + abstractOpcodes = alloca(allocBytes); + bzero(abstractOpcodes, allocBytes); + fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeBytes)); + zeroOpcodeIndexForNewOpcodes(); + labelCounter = 0; +l1: /* end allocateOpcodes:bytecodes:ifFail: */; + if (((numBlocks = scanMethod())) < 0) { + return ((CogMethod *) numBlocks); + } + numCleanBlocks = scanForCleanBlocks(); + allocateBlockStarts(numBlocks + numCleanBlocks); + blockCount = 0; + if (numCleanBlocks > 0) { + addCleanBlockStarts(); + } + if (!(maybeAllocAndInitIRCs())) { + + /* Inaccurate error code, but it'll do. This will likely never fail. */ + return ((CogMethod *) InsufficientCodeSpace); + } + blockEntryLabel = null; + (methodLabel->dependent = null); + if (((result = compileEntireMethod())) < 0) { + return ((CogMethod *) result); + } + return generateCogMethod(selector); +} + + +/* Compile the abstract instructions for the entire method, including blocks. */ +/* Compile the abstract instructions for the entire method, including blocks. */ + + /* StackToRegisterMappingCogit>>#compileEntireMethod */ +static sqInt +compileEntireMethod(void) +{ + sqInt result; + + regArgsHaveBeenPushed = 0; + /* begin preenMethodLabel */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = 0; + compileAbort(); + compileEntry(); + if (((result = compilePrimitive())) < 0) { + return result; + } + compileFrameBuild(); + if (((result = compileMethodBody())) < 0) { + return result; + } + if (blockCount == 0) { + return 0; + } + if (((result = compileBlockBodies())) < 0) { + return result; + } + return compileBlockDispatch(); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. Override to push the register receiver and + register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#compileFrameBuild */ +static void +compileFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction *jumpSkip; + + +# if IMMUTABILITY + if (useTwoPaths) { + compileTwoPathFrameBuild(); + return; + } + +# endif /* IMMUTABILITY */ + + if (!needsFrame) { + if (useTwoPaths) { + compileTwoPathFramelessInit(); + } + initSimStackForFramelessMethod(initialPC); + return; + } + assert(!(useTwoPaths)); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} + + +/* Make sure ReceiverResultReg holds the receiver, loaded from the closure, + which is what is initially in ReceiverResultReg. */ +/* Use ReceiverResultReg for Context to agree with store check trampoline */ +/* Make sure ReceiverResultReg holds the receiver, loaded from + the closure, which is what is initially in ReceiverResultReg */ + + /* StackToRegisterMappingCogit>>#compileFullBlockFramelessEntry: */ +static void NoDbgRegParms +compileFullBlockFramelessEntry(sqInt numCopied) +{ + initSimStackForFramelessBlock(initialPC); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ReceiverResultReg); + genLoadSlotsourceRegdestReg(ReceiverIndex, ReceiverResultReg, Arg0Reg); + flag("TODO"); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, ReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); +} + + +/* Build a frame for a block activation. See CoInterpreter + class>>initializeFrameIndices. closure (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + Avoid use of SendNumArgsReg which is the flag determining whether + context switch is allowed on stack-overflow. */ + + /* StackToRegisterMappingCogit>>#compileFullBlockMethodFrameBuild: */ +static void NoDbgRegParms +compileFullBlockMethodFrameBuild(sqInt numCopied) +{ + AbstractInstruction *abstractInstruction; + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt constant; + sqInt i; + sqInt iLimiT; + + if (useTwoPaths) { + + /* method with only inst var store, we compile only slow path for now */ + useTwoPaths = 0; + +# if IMMUTABILITY + needsFrame = 1; + +# endif /* IMMUTABILITY */ + + } + if (!needsFrame) { + assert(numCopied == 0); + compileFullBlockFramelessEntry(numCopied); + initSimStackForFramelessBlock(initialPC); + return; + } + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, ClassReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin setLabelOffset: */ + (((((AbstractInstruction *) methodLabel))->operands))[1] = MFMethodFlagIsBlockFlag; + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + flag("TODO"); + genLoadSlotsourceRegdestReg(FullClosureReceiverIndex, ClassReg, Arg0Reg); + genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(Arg0Reg, TempReg, FullClosureReceiverIndex, ReceiverResultReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, ReceiverResultReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = 0; i < numCopied; i += 1) { + genLoadSlotsourceRegdestReg(i + FullClosureFirstCopiedValueIndex, ClassReg, TempReg); + /* begin PushR: */ + genoperand(PushR, TempReg); + } + for (i = ((methodOrBlockNumArgs + numCopied) + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + stackCheckLabel = abstractInstruction; + initSimStackForFramefulMethod(initialPC); +} + + +/* Build a frame for a CogMethod activation. See CoInterpreter + class>>initializeFrameIndices. receiver (in ReceiverResultReg) + arg0 + ... + argN + caller's saved ip/this stackPage (for a base frame) + fp-> saved fp + method + context (uninitialized?) + receiver + first temp + ... + sp-> Nth temp + If there is a primitive and an error code the Nth temp is the error code. + Ensure SendNumArgsReg is set early on (incidentally to nilObj) because + it is the flag determining whether context switch is allowed on + stack-overflow. */ +/* We are in a method where the frame is needed *only* for instance variable + store, typically a setter method. + This case has 20% overhead with Immutability compared to setter without + immutability because of the stack + frame creation. We compile two path, one where the object is immutable, + one where it isn't. At the beginning + of the frame build, we take one path or the other depending on the + receiver mutability. + + Note: this specific case happens only where there are only instance + variabel stores. We could do something + similar for literal variable stores, but we don't as it's too uncommon. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFrameBuild */ +#if IMMUTABILITY +static void +compileTwoPathFrameBuild(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt constant; + sqInt i; + sqInt iLimiT; + AbstractInstruction * jumpImmutable; + AbstractInstruction * jumpOld; + AbstractInstruction *jumpSkip; + sqInt quickConstant; + + assert(useTwoPaths); + assert(blockCount == 0); + jumpImmutable = genJumpImmutablescratchReg(ReceiverResultReg, TempReg); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction4 = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + assert(!needsFrame); + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l7; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l7: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + needsFrame = 1; + jmpTarget(jumpOld, jmpTarget(jumpImmutable, gLabel())); + genPushRegisterArgs(); + if (!needsFrame) { + return; + } + /* begin PushR: */ + genoperand(PushR, LinkReg); + + /* begin PushR: */ + genoperand(PushR, FPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, FPReg); + addDependent(methodLabel, annotateAbsolutePCRef(gPushCw(((sqInt)methodLabel)))); + /* begin genMoveNilR: */ + constant = nilObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, SendNumArgsReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction2 = genoperandoperand(MoveCqR, constant, SendNumArgsReg); + } + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + for (i = (methodOrBlockNumArgs + 1), iLimiT = (temporaryCountOfMethodHeader(methodHeader)); i <= iLimiT; i += 1) { + /* begin PushR: */ + genoperand(PushR, SendNumArgsReg); + } + if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) + && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) { + compileGetErrorCode(); + } + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction3 = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + if (canContextSwitchIfActivatingheader(methodObj, methodHeader)) { + /* begin JumpBelow: */ + genConditionalBranchoperand(JumpBelow, ((sqInt)stackOverflowCall)); + /* begin Label */ + stackCheckLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + /* begin JumpAboveOrEqual: */ + jumpSkip = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, SendNumArgsReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)stackOverflowCall)); + jmpTarget(jumpSkip, (stackCheckLabel = gLabel())); + } + /* begin annotateBytecode: */ + (stackCheckLabel->annotation = HasBytecodePC); + initSimStackForFramefulMethod(initialPC); +} +#endif /* IMMUTABILITY */ + + +/* We are in a frameless method with at least two inst var stores. We compile + two paths, + one where the object is in new space, and one where it isn't. At the + beginning + of the method, we take one path or the other depending on the receiver + being in newSpace. + */ + + /* StackToRegisterMappingCogit>>#compileTwoPathFramelessInit */ +static void +compileTwoPathFramelessInit(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * jumpOld; + sqInt quickConstant; + + assert(!(IMMUTABILITY)); + assert(!(needsFrame)); + assert(useTwoPaths); + /* begin genJumpInOldSpace: */ + + /* N.B. FLAGS := destReg - scratchReg */ + /* begin CmpCq:R: */ + quickConstant = storeCheckBoundary(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, ReceiverResultReg); + /* begin JumpAboveOrEqual: */ + jumpOld = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + + initSimStackForFramelessMethod(initialPC); + /* begin compileMethodBody */ + if (endPC < initialPC) { + goto l1; + } + compileAbstractInstructionsFromthrough(initialPC + (deltaToSkipPrimAndErrorStoreInheader(methodObj, methodHeader)), endPC); +l1: /* end compileMethodBody */; + + /* reset because it impacts inst var store compilation */ + useTwoPaths = 0; + jmpTarget(jumpOld, gLabel()); +} + + /* StackToRegisterMappingCogit>>#cPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +cPICMissTrampolineFor(sqInt numArgs) +{ + return picMissTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + +/* Replaces the Blue Book double-extended send [132], in which the first byte + was wasted on 8 bits of argument count. + Here we use 3 bits for the operation sub-type (opType), and the remaining + 5 bits for argument count where needed. + The last byte give access to 256 instVars or literals. + See also secondExtendedSendBytecode + */ + + /* StackToRegisterMappingCogit>>#doubleExtendedDoAnythingBytecode */ +static sqInt +doubleExtendedDoAnythingBytecode(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + sqInt opType; + + opType = ((usqInt) byte1) >> 5; + if (opType == 0) { + return genSendnumArgs(byte2, byte1 & 0x1F); + } + if (opType == 1) { + return genSendSupernumArgs(byte2, byte1 & 0x1F); + } + + switch (opType) { + case 2: + if (isReadMediatedContextInstVarIndex(byte2)) { + genPushMaybeContextReceiverVariable(byte2); + } + else { + genPushReceiverVariable(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + break; + case 3: + genPushLiteralIndex(byte2); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction1 = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + + case 4: + genPushLiteralVariable(byte2); + break; + case 7: + genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(0, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + + break; + default: + + /* 5 & 6 */ + if (isWriteMediatedContextInstVarIndex(byte2)) { + genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + else { + genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(opType == 6, byte2, ((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant)))), 1); + } + +# if IMMUTABILITY + + /* genStorePop:LiteralVariable: annotates; don't annotate twice */ + return 0; + +# endif /* IMMUTABILITY */ + +; + } + assert(needsFrame); + assert(!(prevInstIsPCAnnotated())); + /* begin annotateBytecode: */ + abstractInstruction2 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction2->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#duplicateTopBytecode */ +static sqInt +duplicateTopBytecode(void) +{ + SimStackEntry desc; + + desc = ssTopDescriptor(); + return ssPushDesc(desc); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithCleanup */ +static void +endHighLevelCallWithCleanup(void) +{ + AbstractInstruction *anInstruction; + + if (currentCallCleanUpSize > 0) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, currentCallCleanUpSize, SPReg); + } + callSwitchToSmalltalkStack(); +} + + /* StackToRegisterMappingCogit>>#endHighLevelCallWithoutCleanup */ +static void +endHighLevelCallWithoutCleanup(void) +{ + callSwitchToSmalltalkStack(); +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + traceFixup(fixup); + if ((((usqInt)((fixup->targetInstruction)))) <= NeedsNonMergeFixupFlag) { + + /* convert a non-merge into a merge */ + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + + /* this is the target of a backward branch and + so doesn't have a simStackPtr assigned yet. */ + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + else { + assert(((fixup->simStackPtr)) == simStackPtr); + assert(((fixup->simNativeStackPtr)) == simNativeStackPtr); + assert(((fixup->simNativeStackSize)) == simNativeStackSize); + + } + } + /* begin recordBcpc: */ + return fixup; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#ensureNonMergeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +ensureNonMergeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + if (((fixup->targetInstruction)) == 0) { + /* begin becomeNonMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsNonMergeFixupFlag); + } + /* begin recordBcpc: */ + return fixup; +} + + /* StackToRegisterMappingCogit>>#ensureReceiverResultRegContainsSelf */ +static void +ensureReceiverResultRegContainsSelf(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + ssAllocateRequiredReg(ReceiverResultReg); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + (optStatus.isReceiverResultRegLive = 1); + } + else { + assert((((simSelf.type)) == SSRegister) + && (((simSelf.registerr)) == ReceiverResultReg)); + assert(((optStatus.isReceiverResultRegLive)) + && (((optStatus.ssEntry)) == ((&simSelf)))); + } +} + + /* StackToRegisterMappingCogit>>#evaluate:at: */ +static void NoDbgRegParms +evaluateat(BytecodeDescriptor *descriptor, sqInt pc) +{ + byte0 = fetchByteofObject(pc, methodObj); + assert(descriptor == (generatorAt(bytecodeSetOffset + byte0))); + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); +} + + +/* Spill the closest register on stack not conflicting with regMask. + Assertion Failure if regMask has already all the registers */ + + /* StackToRegisterMappingCogit>>#freeAnyRegNotConflictingWith: */ +static sqInt NoDbgRegParms +freeAnyRegNotConflictingWith(sqInt regMask) +{ + CogSimStackEntry *desc; + sqInt index; + sqInt reg; + + assert(needsFrame); + reg = NoReg; + index = ((simSpillBase < 0) ? 0 : simSpillBase); + while ((reg == NoReg) + && (index < simStackPtr)) { + desc = simStackAt(index); + if (((desc->type)) == SSRegister) { + if (!(regMask & (registerMaskFor((desc->registerr))))) { + reg = (desc->registerr); + } + } + index += 1; + } + assert(!((reg == NoReg))); + ssAllocateRequiredReg(reg); + return reg; +} + + +/* Return from block, assuming result already loaded into ReceiverResultReg. */ +/* Return from block, assuming result already loaded into ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#genBlockReturn */ +static sqInt +genBlockReturn(void) +{ + if (needsFrame) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + + } + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + + /* can't fall through */ + deadCode = 1; + return 0; +} + + +/* Generate special versions of the ceCallCogCodePopReceiverAndClassRegs + enilopmart that also pop register args from the stack to undo the pushing + of register args in the abort/miss trampolines. */ + + /* StackToRegisterMappingCogit>>#genCallPICEnilopmartNumArgs: */ +static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) + +{ + AbstractInstruction *anInstruction; + sqInt endAddress; + sqInt enilopmart; + sqInt quickConstant; + sqInt reg; + sqInt size; + + zeroOpcodeIndex(); + /* begin MoveCq:R: */ + quickConstant = varBaseAddress(); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg); + + genLoadStackPointers(backEnd); + /* begin PopR: */ + genoperand(PopR, ClassReg); + /* begin PopR: */ + genoperand(PopR, TempReg); + /* begin PopR: */ + reg = LinkReg; + genoperand(PopR, reg); + if (numArgs > 0) { + if (numArgs > 1) { + /* begin PopR: */ + genoperand(PopR, Arg1Reg); + assert((numRegArgs()) == 2); + } + /* begin PopR: */ + genoperand(PopR, Arg0Reg); + } + /* begin PopR: */ + genoperand(PopR, ReceiverResultReg); + /* begin JumpR: */ + genoperand(JumpR, TempReg); + computeMaximumSizes(); + size = generateInstructionsAt(methodZoneBase); + endAddress = outputInstructionsAt(methodZoneBase); + assert((methodZoneBase + size) == endAddress); + enilopmart = methodZoneBase; + methodZoneBase = alignUptoRoutineBoundary(endAddress); + stopsFromto(backEnd, endAddress, methodZoneBase - 1); + recordGeneratedRunTimeaddress(trampolineNamenumRegArgs("ceCallPIC", numArgs), enilopmart); + return ((void (*)(void)) enilopmart); +} + + +/* SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after + execution. See EncoderForSistaV1's class comment and + StackInterpreter>>#inlinePrimitiveBytecode: + */ + + /* StackToRegisterMappingCogit>>#genCallPrimitiveBytecode */ +static sqInt +genCallPrimitiveBytecode(void) +{ + sqInt prim; + sqInt primSet; + + if (byte2 < 128) { + return (bytecodePC == initialPC + ? 0 + : EncounteredUnknownBytecode); + } + prim = (((sqInt)((usqInt)((byte2 - 128)) << 8))) + byte1; + primSet = (((usqInt) prim) >> 13) & 3; + prim = prim & 0x1FFF; + if (primSet == 1) { + if (prim < 1000) { + return genLowcodeNullaryInlinePrimitive(prim); + } + if (prim < 2000) { + return genLowcodeUnaryInlinePrimitive(prim - 1000); + } + if (prim < 3000) { + return genLowcodeBinaryInlinePrimitive(prim - 2000); + } + if (prim < 4000) { + return genLowcodeTrinaryInlinePrimitive(prim - 3000); + } + } + + return EncounteredUnknownBytecode; +} + + +/* Override to push the register receiver and register arguments, if any. */ + + /* StackToRegisterMappingCogit>>#genExternalizePointersForPrimitiveCall */ +static sqInt +genExternalizePointersForPrimitiveCall(void) +{ + sqInt address; + sqInt address1; + sqInt address4; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction4; + + genPushRegisterArgs(); + /* begin MoveR:Aw: */ + address4 = framePointerAddress(); + /* begin gen:operand:literal: */ + anInstruction4 = genoperandoperand(MoveRAw, FPReg, address4); + + /* Set coInterpreter stackPointer to the topmost argument, skipping the return address. */ + /* begin MoveR:Aw: */ + address = stackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction = genoperandoperand(MoveRAw, SPReg, address); + /* begin MoveR:Aw: */ + address1 = instructionPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, LinkReg, address1); + + return 0; +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 253 11111101 eei i i kkk jjjjjjjj Push Closure Num Copied iii (+ Ext A + // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * + 256). ee = num extensions + */ + + /* StackToRegisterMappingCogit>>#genExtPushClosureBytecode */ +static sqInt +genExtPushClosureBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = (byte1 & 7) + ((extA % 16) * 8)), (numCopied = ((((usqInt) byte1) >> 3) & 7) + ((extA / 16) * 8)), byte2 + (((sqInt)((usqInt)(extB) << 8)))); + extA = (numExtB = (extB = 0)); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* Full Block creation compilation. The block's actual code will be compiled + separatedly. + */ +/* * 255 11111111 xxxxxxxx siyyyyyy push Closure Compiled block literal + index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 + ignoreOuterContext: i = 1 + */ + + /* StackToRegisterMappingCogit>>#genExtPushFullClosureBytecode */ +static sqInt +genExtPushFullClosureBytecode(void) +{ + sqInt compiledBlock; + sqInt i; + int ignoreContext; + sqInt numCopied; + int receiverIsOnStack; + sqInt reg; + + assert(needsFrame); + compiledBlock = getLiteral(byte1 + (((sqInt)((usqInt)(extA) << 8)))); + extA = 0; + numCopied = byte2 & ((1U << 6) - 1); + receiverIsOnStack = byte2 & (1U << 7); + ignoreContext = byte2 & (1U << 6); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genCreateFullClosurenumArgsnumCopiedignoreContextcontextNumArgslargeinBlock(compiledBlock, argumentCountOf(compiledBlock), numCopied, ignoreContext, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (FullClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + if (receiverIsOnStack) { + reg = ssStorePoptoPreferredReg(1, TempReg); + } + else { + storeToReg((&simSelf), (reg = TempReg)); + } + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, FullClosureReceiverIndex, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genExtPushRemoteTempOrInstVarLongBytecode */ +static sqInt +genExtPushRemoteTempOrInstVarLongBytecode(void) +{ + sqInt index; + sqInt maybeContext; + + return ((byte2 & (remoteIsInstVarAccess())) == 0 + ? genPushRemoteTempLongBytecode() + : (/* begin extBSpecifiesMaybeContext */ + (maybeContext = extB & 2), + (index = byte1 + (((sqInt)((usqInt)(extA) << 8)))), + (extA = 0), + (extB = 0), + (numExtB = 0), + ((isReadMediatedContextInstVarIndex(index)) + && (maybeContext) + ? genPushMaybeContextRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess())) + : genPushRemoteInstVarinObjectAt(index, byte2 - (remoteIsInstVarAccess()))))); +} + + /* StackToRegisterMappingCogit>>#genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean: */ +static sqInt NoDbgRegParms +genExtStorePopRemoteTempOrInstVarLongBytecodePopBoolean(sqInt boolean) +{ + AbstractInstruction *abstractInstruction; + sqInt index; + sqInt maybeContext; + sqInt needsImmCheck; + sqInt needsStoreCheck; + + needsStoreCheck = (((((ssTop())->type)) != SSConstant) + || ((isNonImmediate(((ssTop())->constant))) + && (shouldAnnotateObjectReference(((ssTop())->constant))))) + && ((extB & 1) == 0); + /* begin extBSpecifiesMaybeContext */ + maybeContext = extB & 2; + /* begin extBSpecifiesImmCheck */ + needsImmCheck = (extB & 4) == 0; + extB = 0; + numExtB = 0; + if ((byte2 & (remoteIsInstVarAccess())) == 0) { + genStorePopRemoteTempAtneedsStoreCheck(boolean, byte1, byte2, needsStoreCheck); + +# if IMMUTABILITY + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + +# endif /* IMMUTABILITY */ + + } + else { + index = byte1 + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + if ((isWriteMediatedContextInstVarIndex(index)) + && (maybeContext)) { + genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + else { + genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(boolean, index, byte2 - (remoteIsInstVarAccess()), needsStoreCheck, needsImmCheck); + } + } + return 0; +} + + +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). + */ +/* Enilopmarts transfer control from C into machine code (backwards + trampolines). Override to add version for generic and PIC-specific entry + with reg args. */ + + /* StackToRegisterMappingCogit>>#generateEnilopmarts */ +static void +generateEnilopmarts(void) +{ + +# if Debug + /* begin genEnilopmartFor:forCall:called: */ + realCEEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "realCEEnterCogCodePopReceiverReg"); + ceEnterCogCodePopReceiverReg = enterCogCodePopReceiver; + /* begin genEnilopmartFor:forCall:called: */ + realCECallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "realCEEnterCogCodePopReceiverReg"); + ceCallCogCodePopReceiverReg = callCogCodePopReceiver; + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "realCECallCogCodePopReceiverAndClassRegs"); + ceCallCogCodePopReceiverAndClassRegs = callCogCodePopReceiverAndClassRegs; + +# else /* Debug */ + /* begin genEnilopmartFor:forCall:called: */ + ceEnterCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 0, "ceEnterCogCodePopReceiverReg"); + /* begin genEnilopmartFor:forCall:called: */ + ceCallCogCodePopReceiverReg = genEnilopmartForandandforCallcalled(ReceiverResultReg, NoReg, NoReg, 1, "ceCallCogCodePopReceiverReg"); + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverAndClassRegs = genEnilopmartForandandforCallcalled(ReceiverResultReg, ClassReg, NoReg, 1, "ceCallCogCodePopReceiverAndClassRegs"); + +# endif /* Debug */ + + genPrimReturnEnterCogCodeEnilopmart(0); + cePrimReturnEnterCogCode = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCode); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCode", cePrimReturnEnterCogCode); + genPrimReturnEnterCogCodeEnilopmart(1); + cePrimReturnEnterCogCodeProfiling = methodZoneBase; + outputInstructionsForGeneratedRuntimeAt(cePrimReturnEnterCogCodeProfiling); + recordGeneratedRunTimeaddress("cePrimReturnEnterCogCodeProfiling", cePrimReturnEnterCogCodeProfiling); + +# if Debug + /* begin genEnilopmartFor:and:forCall:called: */ + realCECallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "realCECallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg0Regs = callCogCodePopReceiverArg0Regs; + realCECallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "realCECallCogCodePopReceiverArg1Arg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = callCogCodePopReceiverArg1Arg0Regs; + +# else /* Debug */ + /* begin genEnilopmartFor:and:forCall:called: */ + ceCallCogCodePopReceiverArg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, NoReg, 1, "ceCallCogCodePopReceiverArg0Regs"); + ceCallCogCodePopReceiverArg1Arg0Regs = genEnilopmartForandandforCallcalled(ReceiverResultReg, Arg0Reg, Arg1Reg, 1, "ceCallCogCodePopReceiverArg1Arg0Regs"); + +# endif /* Debug */ + + ceCall0ArgsPIC = genCallPICEnilopmartNumArgs(0); + ceCall1ArgsPIC = genCallPICEnilopmartNumArgs(1); + ceCall2ArgsPIC = genCallPICEnilopmartNumArgs(2); + assert((numRegArgs()) == 2); + + +} + + +/* Generate the run-time entries for the various method and PIC entry misses + and aborts. + Read the class-side method trampolines for documentation on the various + trampolines + */ + + /* StackToRegisterMappingCogit>>#generateMissAbortTrampolines */ +static void +generateMissAbortTrampolines(void) +{ + sqInt numArgs; + sqInt numArgsLimiT; + + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + methodAbortTrampolines[numArgs] = (genMethodAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picAbortTrampolines[numArgs] = (genPICAbortTrampolineFor(numArgs)); + } + for (numArgs = 0, numArgsLimiT = (2 + 1); numArgs <= numArgsLimiT; numArgs += 1) { + picMissTrampolines[numArgs] = (genPICMissTrampolineFor(numArgs)); + } +} + + +/* Override to generate code to push the register arg(s) for <= numRegArg + arity sends. + */ + + /* StackToRegisterMappingCogit>>#generateSendTrampolines */ +static void +generateSendTrampolines(void) +{ + sqInt numArgs; + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + ordinarySendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSend", numArgs), ClassReg, trampolineArgConstant(0), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + directedSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + + for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { + superSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSuperSend", numArgs), ClassReg, trampolineArgConstant(1), ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) + ? (/* begin trampolineArgConstant: */ + assert(numArgs >= 0), + -2 - numArgs) + : SendNumArgsReg))); + } + firstSend = ordinarySendTrampolines[0]; + lastSend = superSendTrampolines[NumSendTrampolines - 1]; +} + + +/* Generate trampolines for tracing. In the simulator we can save a lot of + time and avoid noise instructions in the lastNInstructions log by + short-cutting these + trampolines, but we need them in the real vm. */ + + /* StackToRegisterMappingCogit>>#generateTracingTrampolines */ +static void +generateTracingTrampolines(void) +{ + ceTraceLinkedSendTrampoline = genTrampolineForcalledargregsToSave(ceTraceLinkedSend, "ceTraceLinkedSendTrampoline", ReceiverResultReg, CallerSavedRegisterMask); + ceTraceBlockActivationTrampoline = genTrampolineForcalledregsToSave(ceTraceBlockActivation, "ceTraceBlockActivationTrampoline", CallerSavedRegisterMask); + ceTraceStoreTrampoline = genTrampolineForcalledargargregsToSave(ceTraceStoreOfinto, "ceTraceStoreTrampoline", TempReg, ReceiverResultReg, CallerSavedRegisterMask); +} + + /* StackToRegisterMappingCogit>>#genForwardersInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genForwardersInlinedIdenticalOrNotIf(sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction12; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt arg; + sqInt argReg; + sqInt argReg1; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt constant; + sqInt constant1; + sqInt descr; + AbstractInstruction *finished; + AbstractInstruction *finished1; + usqInt fixup; + AbstractInstruction *imm; + AbstractInstruction *imm1; + void *jumpTarget; + void *jumpTarget1; + void *jumpTarget2; + void *jumpTarget3; + AbstractInstruction *label; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + AbstractInstruction *ok; + AbstractInstruction *ok1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + sqInt quickConstant; + sqInt quickConstant1; + sqInt rcvr; + sqInt rcvrReg; + sqInt rcvrReg1; + sqInt reg; + sqInt rNext; + sqInt rNext1; + sqInt rTop; + sqInt rTop1; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + sqInt topRegistersMask; + int unforwardArg; + int unforwardRcvr; + + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + unforwardRcvr = !(isUnannotatableConstant(ssValue(1))); + unforwardArg = !(isUnannotatableConstant(ssTop())); + /* begin allocateEqualsEqualsRegistersArgNeedsReg:rcvrNeedsReg:into: */ + assert(unforwardArg + || (unforwardRcvr)); + argReg1 = (rcvrReg1 = NoReg); + if (unforwardArg) { + if (unforwardRcvr) { + /* begin allocateRegForStackTopTwoEntriesInto: */ + topRegistersMask = 0; + rTop1 = (rNext1 = NoReg); + if ((registerOrNone(ssTop())) != NoReg) { + rTop1 = registerOrNone(ssTop()); + } + if ((registerOrNone(ssValue(1))) != NoReg) { + /* begin registerMaskFor: */ + reg = (rNext1 = registerOrNone(ssValue(1))); + topRegistersMask = 1U << reg; + } + if (rTop1 == NoReg) { + rTop1 = allocateRegNotConflictingWith(topRegistersMask); + } + if (rNext1 == NoReg) { + rNext1 = allocateRegNotConflictingWith(1U << rTop1); + } + assert(!(((rTop1 == NoReg) + || (rNext1 == NoReg)))); + argReg1 = rTop1; + rcvrReg1 = rNext1; + + popToReg(ssTop(), argReg1); + popToReg(ssValue(1), rcvrReg1); + } + else { + argReg1 = allocateRegForStackEntryAtnotConflictingWith(0, 0); + popToReg(ssTop(), argReg1); + if (((ssValue(1))->spilled)) { + /* begin AddCq:R: */ + anInstruction3 = genoperandoperand(AddCqR, BytesPerWord, SPReg); + } + } + } + else { + assert(unforwardRcvr); + assert(!((((ssTop())->spilled)))); + rcvrReg1 = allocateRegForStackEntryAtnotConflictingWith(1, 0); + popToReg(ssValue(1), rcvrReg1); + } + assert(!((unforwardArg + && (argReg1 == NoReg)))); + assert(!((unforwardRcvr + && (rcvrReg1 == NoReg)))); + rcvrReg = rcvrReg1; + argReg = argReg1; + + if (!(((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)))) { + return genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(!unforwardArg, !unforwardRcvr, argReg, rcvrReg, orNot); + } + ssFlushTo(simStackPtr - 2); + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrReg != NoReg)); + if (!unforwardArg) { + /* begin genCmpConstant:R: */ + constant = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gCmpCwR(constant, rcvrReg), constant); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant, rcvrReg); + } + } + else { + if (!unforwardRcvr) { + /* begin genCmpConstant:R: */ + constant1 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gCmpCwR(constant1, argReg), constant1); + } + else { + /* begin CmpCq:R: */ + anInstruction12 = genoperandoperand(CmpCqR, constant1, argReg); + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrReg); + } + } + ssPop(2); + if ((((fixupAt(nextPC - initialPC))->targetInstruction)) == 0) { + + /* The next instruction is dead. we can skip it. */ + deadCode = 1; + ensureFixupAt(targetBytecodePC - initialPC); + ensureFixupAt(postBranchPC - initialPC); + } + else { + assert(!(deadCode)); + } + assert(unforwardArg + || (unforwardRcvr)); + if (orNot) { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget1 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget1)); + } + } + else { + if ((branchDescriptor->isBranchTrue)) { + fixup = ((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))); + /* begin JumpZero: */ + jumpTarget2 = ((void *) (((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget2)); + } + else { + + /* branchDescriptor is branchFalse */ + fixup = ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC))); + /* begin JumpZero: */ + jumpTarget3 = ((void *) (((usqInt)(ensureNonMergeFixupAt(postBranchPC - initialPC))))); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget3)); + } + } + if (!deadCode) { + ssPushConstant(trueObject()); + } + if (unforwardArg) { + if (unforwardRcvr) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + else { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(argReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm = genJumpImmediate(argReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, argReg, TempReg); + /* begin AndCq:R: */ + quickConstant = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(AndCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + ok = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, argReg, argReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished = ((AbstractInstruction *) fixup); + } + jmpTarget(imm, jmpTarget(ok, finished)); + } + } + if (unforwardRcvr) { + /* begin genEnsureOopInRegNotForwarded:scratchReg:ifForwarder:ifNotForwarder: */ + assert(rcvrReg != TempReg); + + /* notionally + self genGetClassIndexOfNonImm: reg into: scratch. + cogit CmpCq: objectMemory isForwardedObjectClassIndexPun R: TempReg. + but the following is an instruction shorter: */ + imm1 = genJumpImmediate(rcvrReg); + /* begin MoveMw:r:R: */ + anInstruction2 = genoperandoperandoperand(MoveMwrR, 0, rcvrReg, TempReg); + /* begin AndCq:R: */ + quickConstant1 = (classIndexMask()) - (isForwardedObjectClassIndexPun()); + /* begin gen:quickConstant:operand: */ + anInstruction11 = genoperandoperand(AndCqR, quickConstant1, TempReg); + /* begin JumpNonZero: */ + ok1 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(0, rcvrReg, rcvrReg); + /* begin Jump: */ + genoperand(Jump, ((sqInt)(((void *) label)))); + if (fixup == 0) { + /* begin Label */ + finished1 = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + else { + finished1 = ((AbstractInstruction *) fixup); + } + jmpTarget(imm1, jmpTarget(ok1, finished1)); + } + return 0; +} + + +/* Generates the machine code for #== in the case where the instruction is + not followed by a branch + */ + + /* StackToRegisterMappingCogit>>#genIdenticalNoBranchArgIsConstant:rcvrIsConstant:argReg:rcvrReg:orNotIf: */ +static sqInt NoDbgRegParms +genIdenticalNoBranchArgIsConstantrcvrIsConstantargRegrcvrRegorNotIf(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone, sqInt orNot) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction11; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + sqInt constant; + sqInt constant1; + sqInt constant11; + sqInt constant2; + sqInt constant3; + sqInt constant4; + AbstractInstruction *jumpEqual; + AbstractInstruction *jumpNotEqual; + AbstractInstruction *label; + sqInt resultReg; + + /* begin Label */ + label = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + /* begin genCmpArgIsConstant:rcvrIsConstant:argReg:rcvrReg: */ + assert((argReg != NoReg) + || (rcvrRegOrNone != NoReg)); + if (argIsConstant) { + /* begin genCmpConstant:R: */ + constant4 = ((ssTop())->constant); + if (shouldAnnotateObjectReference(constant4)) { + annotateobjRef(gCmpCwR(constant4, rcvrRegOrNone), constant4); + } + else { + /* begin CmpCq:R: */ + anInstruction4 = genoperandoperand(CmpCqR, constant4, rcvrRegOrNone); + } + } + else { + if (rcvrIsConstant) { + /* begin genCmpConstant:R: */ + constant11 = ((ssValue(1))->constant); + if (shouldAnnotateObjectReference(constant11)) { + annotateobjRef(gCmpCwR(constant11, argReg), constant11); + } + else { + /* begin CmpCq:R: */ + anInstruction11 = genoperandoperand(CmpCqR, constant11, argReg); + } + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, argReg, rcvrRegOrNone); + } + } + ssPop(2); + resultReg = (rcvrRegOrNone == NoReg + ? argReg + : rcvrRegOrNone); + /* begin JumpZero: */ + jumpEqual = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + if (!argIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(argReg, TempReg, label); + } + if (!rcvrIsConstant) { + genEnsureOopInRegNotForwardedscratchRegjumpBackTo(rcvrRegOrNone, TempReg, label); + } + if (orNot) { + /* begin genMoveTrueR: */ + constant = trueObject(); + if (shouldAnnotateObjectReference(constant)) { + annotateobjRef(gMoveCwR(constant, resultReg), constant); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, constant, resultReg); + } + } + else { + /* begin genMoveFalseR: */ + constant1 = falseObject(); + if (shouldAnnotateObjectReference(constant1)) { + annotateobjRef(gMoveCwR(constant1, resultReg), constant1); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, constant1, resultReg); + } + } + /* begin Jump: */ + jumpNotEqual = genoperand(Jump, ((sqInt)0)); + jmpTarget(jumpEqual, (orNot + ? (/* begin genMoveFalseR: */ + (constant2 = falseObject()), + (shouldAnnotateObjectReference(constant2) + ? annotateobjRef(gMoveCwR(constant2, resultReg), constant2) + : (/* begin MoveCq:R: */ + (anInstruction2 = genoperandoperand(MoveCqR, constant2, resultReg)), + anInstruction2))) + : (/* begin genMoveTrueR: */ + (constant3 = trueObject()), + (shouldAnnotateObjectReference(constant3) + ? annotateobjRef(gMoveCwR(constant3, resultReg), constant3) + : (/* begin MoveCq:R: */ + (anInstruction3 = genoperandoperand(MoveCqR, constant3, resultReg)), + anInstruction3))))); + jmpTarget(jumpNotEqual, gLabel()); + ssPushRegister(resultReg); + return 0; +} + + +/* Decompose code generation for #== into a common constant-folding version, + followed by a double dispatch throguh the objectRepresentation to a + version that doesn't deal with forwarders and a version that does. */ + + /* StackToRegisterMappingCogit>>#genInlinedIdenticalOrNotIf: */ +static sqInt NoDbgRegParms +genInlinedIdenticalOrNotIf(sqInt orNot) +{ + BytecodeDescriptor *primDescriptor; + sqInt result; + + primDescriptor = generatorAt(byte0); + if ((isUnannotatableConstant(ssTop())) + && (isUnannotatableConstant(ssValue(1)))) { + assert(!((primDescriptor->isMapped))); + result = ((orNot + ? (((ssTop())->constant)) != (((ssValue(1))->constant)) + : (((ssTop())->constant)) == (((ssValue(1))->constant))) + ? trueObject() + : falseObject()); + ssPop(2); + return ssPushConstant(result); + } + /* begin genInlinedIdenticalOrNotIfGuts: */ + return genForwardersInlinedIdenticalOrNotIf(orNot); +} + + /* StackToRegisterMappingCogit>>#genJumpBackTo: */ +static sqInt NoDbgRegParms +genJumpBackTo(sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt address; + AbstractInstruction *anInstruction; + void *jumpTarget; + void *jumpTarget1; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin MoveAw:R: */ + address = stackLimitAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, TempReg, SPReg); + /* begin JumpAboveOrEqual: */ + jumpTarget = fixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)jumpTarget)); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceCheckForInterruptTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + jumpTarget1 = fixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget1)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpIf:to: */ +static sqInt NoDbgRegParms +genJumpIfto(sqInt boolean, sqInt targetBytecodePC) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + CogSimStackEntry *desc; + BytecodeFixup *fixup; + void *jumpTarget; + AbstractInstruction *ok; + sqInt quickConstant; + + ssFlushTo(simStackPtr - 1); + desc = ssTop(); + ssPop(1); + if ((((desc->type)) == SSConstant) + && ((((desc->constant)) == (trueObject())) + || (((desc->constant)) == (falseObject())))) { + + /* Must arrange there's a fixup at the target whether it is jumped to or + not so that the simStackPtr can be kept correct. */ + + /* Must annotate the bytecode for correct pc mapping. */ + fixup = ensureFixupAt(targetBytecodePC - initialPC); + /* begin annotateBytecode: */ + if (((desc->constant)) == boolean) { + /* begin Jump: */ + abstractInstruction = genoperand(Jump, ((sqInt)fixup)); + } + else { + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + } + (abstractInstruction->annotation = HasBytecodePC); + extA = 0; + return 0; + } + popToReg(desc, TempReg); + assert((objectAfter(falseObject())) == (trueObject())); + /* begin genSubConstant:R: */ + if (shouldAnnotateObjectReference(boolean)) { + annotateobjRef(gSubCwR(boolean, TempReg), TempReg); + } + else { + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, boolean, TempReg); + } + /* begin JumpZero: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genConditionalBranchoperand(JumpZero, ((sqInt)jumpTarget)); + if (extA & 1) { + extA = 0; + /* begin annotateBytecode: */ + abstractInstruction1 = lastOpcode(); + (abstractInstruction1->annotation = HasBytecodePC); + return 0; + } + extA = 0; + /* begin CmpCq:R: */ + quickConstant = (boolean == (falseObject()) + ? (trueObject()) - (falseObject()) + : (falseObject()) - (trueObject())); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpZero: */ + ok = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + genCallMustBeBooleanFor(boolean); + jmpTarget(ok, annotateBytecode(gLabel())); + return 0; +} + + /* StackToRegisterMappingCogit>>#genJumpTo: */ +static sqInt NoDbgRegParms +genJumpTo(sqInt targetBytecodePC) +{ + void *jumpTarget; + + ssFlushTo(simStackPtr); + + /* can't fall through */ + deadCode = 1; + /* begin Jump: */ + jumpTarget = ensureFixupAt(targetBytecodePC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + return 0; +} + + /* StackToRegisterMappingCogit>>#genLoadTemp:in: */ +static void NoDbgRegParms +genLoadTempin(sqInt objectIndex, sqInt destReg) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (destReg == ReceiverResultReg) { + voidReceiverResultRegContainsSelf(); + } + ssAllocateRequiredReg(destReg); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(objectIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, destReg); +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd32 */ +static sqInt +genLowcodeAdd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAdd64 */ +static sqInt +genLowcodeAdd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, secondLow, firstLow); + /* begin AddcR:R: */ + genoperandoperand(AddcRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca32 */ +static sqInt +genLowcodeAlloca32(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (size == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveAwR, address, TempReg); + /* begin SubR:R: */ + genoperandoperand(SubRR, size, TempReg); + /* begin AndCq:R: */ + anInstruction2 = genoperandoperand(AndCqR, -16, TempReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, size); + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction1 = genoperandoperand(MoveRAw, size, address1); + ssPushNativeRegister(size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAlloca64 */ +static sqInt +genLowcodeAlloca64(void) +{ + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if ((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, sizeLow, SPReg); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, SPReg, sizeLow); + ssPushNativeRegister(sizeLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd32 */ +static sqInt +genLowcodeAnd32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeAnd64 */ +static sqInt +genLowcodeAnd64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondLow, firstLow); + /* begin AndR:R: */ + genoperandoperand(AndRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift32 */ +static sqInt +genLowcodeArithmeticRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ArithmeticShiftRightR:R: */ + genoperandoperand(ArithmeticShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeArithmeticRightShift64 */ +static sqInt +genLowcodeArithmeticRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBeginCall */ +static sqInt +genLowcodeBeginCall(void) +{ + sqInt alignment; + + alignment = extA; + beginHighLevelCall(alignment); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeBinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeBinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeByteSizeOf(); + + case 1: + return genLowcodeFirstFieldPointer(); + + case 2: + return genLowcodeFirstIndexableFieldPointer(); + + case 3: + return genLowcodeIsBytes(); + + case 4: + return genLowcodeIsFloatObject(); + + case 5: + return genLowcodeIsIndexable(); + + case 6: + return genLowcodeIsIntegerObject(); + + case 7: + return genLowcodeIsPointers(); + + case 8: + return genLowcodeIsWords(); + + case 9: + return genLowcodeIsWordsOrBytes(); + + case 10: + return genLowcodeOopSmallIntegerToInt32(); + + case 11: + return genLowcodeOopSmallIntegerToInt64(); + + case 12: + return genLowcodeOopToBoolean32(); + + case 13: + return genLowcodeOopToBoolean64(); + + case 14: + return genLowcodeOopToFloat32(); + + case 15: + return genLowcodeOopToFloat64(); + + case 16: + return genLowcodeOopToInt32(); + + case 17: + return genLowcodeOopToInt64(); + + case 18: + return genLowcodeOopToPointer(); + + case 19: + return genLowcodeOopToPointerReinterpret(); + + case 20: + return genLowcodeOopToUInt32(); + + case 21: + return genLowcodeOopToUInt64(); + + case 22: + return genLowcodePin(); + + case 23: + return genLowcodeUnpin(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean32ToOop */ +static sqInt +genLowcodeBoolean32ToOop(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt value; + sqInt wordConstant; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, value); + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), value), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, value); + inst = anInstruction; + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeBoolean64ToOop */ +static sqInt +genLowcodeBoolean64ToOop(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction * cont; + AbstractInstruction * inst; + sqInt object; + AbstractInstruction * trueJump; + sqInt valueHigh; + sqInt valueLow; + sqInt wordConstant; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, valueLow, valueHigh); + /* begin JumpNonZero: */ + trueJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + annotateobjRef(gMoveCwR(falseObject(), valueLow), falseObject()); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + /* begin MoveCw:R: */ + wordConstant = trueObject(); + /* begin gen:literal:operand: */ + anInstruction = genoperandoperand(MoveCwR, wordConstant, valueLow); + inst = anInstruction; + jmpTarget(trueJump, inst); + annotateobjRef(inst, trueObject()); + jmpTarget(cont, gLabel()); + ssPushRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeByteSizeOf */ +static sqInt +genLowcodeByteSizeOf(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcByteSizeOfto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat32 */ +static sqInt +genLowcodeCallArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, DPFPReg0, -BytesPerWord, SPReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, BytesPerWord, SPReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentFloat64 */ +static sqInt +genLowcodeCallArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + + nativeStackPopToReg(ssNativeTop(), DPFPReg0); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, DPFPReg0, -8, SPReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 8, SPReg); + currentCallCleanUpSize += 8; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt32 */ +static sqInt +genLowcodeCallArgumentInt32(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentInt64 */ +static sqInt +genLowcodeCallArgumentInt64(void) +{ + nativeStackPopToRegsecondReg(ssNativeTop(), TempReg, ReceiverResultReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + /* begin PushR: */ + genoperand(PushR, ReceiverResultReg); + currentCallCleanUpSize += 8; + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentPointer */ +static sqInt +genLowcodeCallArgumentPointer(void) +{ + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + currentCallCleanUpSize += BytesPerWord; + return 0; +} + + +/* Lowcode instruction generator */ +/* Allocate space */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentSpace */ +static sqInt +genLowcodeCallArgumentSpace(void) +{ + AbstractInstruction *anInstruction; + + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + currentCallCleanUpSize += extA; + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Fetch the pointer */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallArgumentStructure */ +static sqInt +genLowcodeCallArgumentStructure(void) +{ + AbstractInstruction *anInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, extA, SPReg); + + /* Copy the structure */ + currentCallCleanUpSize += extA; + genMemCopytoconstantSize(backEnd, TempReg, SPReg, extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallInstruction */ +static sqInt +genLowcodeCallInstruction(void) +{ + AbstractInstruction *abstractInstruction; + sqInt function; + + function = extA; + /* begin CallRT: */ + abstractInstruction = genoperand(Call, function); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCallPhysical */ +static sqInt +genLowcodeCallPhysical(void) +{ + sqInt registerID; + + registerID = extA; + /* begin CallR: */ + genoperand(CallR, registerID); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCheckSessionIdentifier */ +static sqInt +genLowcodeCheckSessionIdentifier(void) +{ + sqInt expectedSession; + + expectedSession = extA; + ssPushNativeConstantInt32((expectedSession == (getThisSessionID()) + ? 1 + : 0)); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeCompareAndSwap32 */ +static sqInt +genLowcodeCompareAndSwap32(void) +{ + sqInt check; + sqInt newValue; + sqInt oldValue; + sqInt value; + + if (((newValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((newValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((oldValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << newValue)))) == NoReg) { + ssAllocateRequiredReg((oldValue = Arg1Reg)); + } + if (((check = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << newValue)) | (1U << oldValue)))) == NoReg) { + ssAllocateRequiredReg((check = SendNumArgsReg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << newValue)) | (1U << oldValue)) | (1U << check)))) == NoReg) { + ssAllocateRequiredReg((value = ClassReg)); + } + if ((((newValue == ReceiverResultReg) + || (oldValue == ReceiverResultReg)) + || (check == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), newValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), oldValue); + ssNativePop(1); + nativePopToReg(ssNativeTop(), check); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv32 */ +static sqInt +genLowcodeDiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDiv64 */ +static sqInt +genLowcodeDiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat32 */ +static sqInt +genLowcodeDuplicateFloat32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRs:Rs: */ + genoperandoperand(MoveRsRs, value, dup2); + ssPushNativeRegisterSingleFloat(value); + ssPushNativeRegisterSingleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateFloat64 */ +static sqInt +genLowcodeDuplicateFloat64(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((dup2 = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((dup2 = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveRd:Rd: */ + genoperandoperand(MoveRdRd, value, dup2); + ssPushNativeRegisterDoubleFloat(value); + ssPushNativeRegisterDoubleFloat(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt32 */ +static sqInt +genLowcodeDuplicateInt32(void) +{ + sqInt dup2; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, dup2); + ssPushNativeRegister(value); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicateInt64 */ +static sqInt +genLowcodeDuplicateInt64(void) +{ + sqInt dup2High; + sqInt dup2Low; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((dup2Low = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((dup2Low = SendNumArgsReg)); + } + if (((dup2High = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << dup2Low)))) == NoReg) { + ssAllocateRequiredReg((dup2High = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (dup2Low == ReceiverResultReg)) + || (dup2High == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueLow, dup2Low); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, valueHigh, dup2High); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + ssPushNativeRegistersecondRegister(dup2Low, dup2High); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeDuplicatePointer */ +static sqInt +genLowcodeDuplicatePointer(void) +{ + sqInt dup2; + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dup2 = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointerValue)))) == NoReg) { + ssAllocateRequiredReg((dup2 = Arg1Reg)); + } + if ((pointerValue == ReceiverResultReg) + || (dup2 == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointerValue, dup2); + ssPushNativeRegister(pointerValue); + ssPushNativeRegister(dup2); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress32 */ +static sqInt +genLowcodeEffectiveAddress32(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if ((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, scale, index); + /* begin AddR:R: */ + genoperandoperand(AddRR, index, base); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEffectiveAddress64 */ +static sqInt +genLowcodeEffectiveAddress64(void) +{ + sqInt base; + sqInt index; + sqInt offset; + sqInt result; + sqInt scale; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((scale = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((scale = Arg1Reg)); + } + if (((index = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offset)) | (1U << scale)))) == NoReg) { + ssAllocateRequiredReg((index = SendNumArgsReg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)))) == NoReg) { + ssAllocateRequiredReg((base = ClassReg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((((liveRegisters()) | (1U << offset)) | (1U << scale)) | (1U << index)) | (1U << base)))) == NoReg) { + ssAllocateRequiredReg((result = ReceiverResultReg)); + } + if (((((offset == ReceiverResultReg) + || (scale == ReceiverResultReg)) + || (index == ReceiverResultReg)) + || (base == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), scale); + ssNativePop(1); + nativePopToReg(ssNativeTop(), index); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCall */ +static sqInt +genLowcodeEndCall(void) +{ + endHighLevelCallWithCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeEndCallNoCleanup */ +static sqInt +genLowcodeEndCallNoCleanup(void) +{ + endHighLevelCallWithoutCleanup(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstFieldPointer */ +static sqInt +genLowcodeFirstFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFirstIndexableFieldPointer */ +static sqInt +genLowcodeFirstIndexableFieldPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcFirstIndexableFieldPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Add */ +static sqInt +genLowcodeFloat32Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRs:Rs: */ + genoperandoperand(AddRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Div */ +static sqInt +genLowcodeFloat32Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRs:Rs: */ + genoperandoperand(DivRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Equal */ +static sqInt +genLowcodeFloat32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Great */ +static sqInt +genLowcodeFloat32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32GreatEqual */ +static sqInt +genLowcodeFloat32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Less */ +static sqInt +genLowcodeFloat32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32LessEqual */ +static sqInt +genLowcodeFloat32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Mul */ +static sqInt +genLowcodeFloat32Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRs:Rs: */ + genoperandoperand(MulRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Neg */ +static sqInt +genLowcodeFloat32Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRs:Rs: */ + genoperandoperand(XorRsRs, result, result); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32NotEqual */ +static sqInt +genLowcodeFloat32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRs:Rs: */ + genoperandoperand(CmpRsRs, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sqrt */ +static sqInt +genLowcodeFloat32Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRs: */ + genoperand(SqrtRs, value); + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32Sub */ +static sqInt +genLowcodeFloat32Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRs:Rs: */ + genoperandoperand(SubRsRs, second, first); + ssPushNativeRegisterSingleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToFloat64 */ +static sqInt +genLowcodeFloat32ToFloat64(void) +{ + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + /* begin ConvertRs:Rd: */ + genoperandoperand(ConvertRsRd, singleFloatValue, singleFloatValue); + ssPushNativeRegisterDoubleFloat(singleFloatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt32 */ +static sqInt +genLowcodeFloat32ToInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToInt64 */ +static sqInt +genLowcodeFloat32ToInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToOop */ +static sqInt +genLowcodeFloat32ToOop(void) +{ + sqInt object; + sqInt singleFloatValue; + + if (((singleFloatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((singleFloatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), singleFloatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat32toOop(singleFloatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt32 */ +static sqInt +genLowcodeFloat32ToUInt32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertRs:R: */ + genoperandoperand(ConvertRsR, value, result); + ssPushNativeRegister(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat32ToUInt64 */ +static sqInt +genLowcodeFloat32ToUInt64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Add */ +static sqInt +genLowcodeFloat64Add(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin AddRd:Rd: */ + genoperandoperand(AddRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Div */ +static sqInt +genLowcodeFloat64Div(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin DivRd:Rd: */ + genoperandoperand(DivRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Equal */ +static sqInt +genLowcodeFloat64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPNotEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Great */ +static sqInt +genLowcodeFloat64Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLessOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64GreatEqual */ +static sqInt +genLowcodeFloat64GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPLess(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Less */ +static sqInt +genLowcodeFloat64Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreaterOrEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64LessEqual */ +static sqInt +genLowcodeFloat64LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPGreater(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Mul */ +static sqInt +genLowcodeFloat64Mul(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulRd:Rd: */ + genoperandoperand(MulRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Neg */ +static sqInt +genLowcodeFloat64Neg(void) +{ + sqInt result; + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin XorRd:Rd: */ + genoperandoperand(XorRdRd, result, result); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64NotEqual */ +static sqInt +genLowcodeFloat64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpRd:Rd: */ + genoperandoperand(CmpRdRd, second, first); + + /* True result */ + falseJump = gJumpFPEqual(0); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, value); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, value); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sqrt */ +static sqInt +genLowcodeFloat64Sqrt(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SqrtRd: */ + genoperand(SqrtRd, value); + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64Sub */ +static sqInt +genLowcodeFloat64Sub(void) +{ + sqInt first; + sqInt second; + + if (((second = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((second = DPFPReg0)); + } + if (((first = availableFloatRegisterOrNoneFor(backEnd, (liveFloatRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredFloatReg((first = DPFPReg1)); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubRd:Rd: */ + genoperandoperand(SubRdRd, second, first); + ssPushNativeRegisterDoubleFloat(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToFloat32 */ +static sqInt +genLowcodeFloat64ToFloat32(void) +{ + sqInt floatValue; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:Rs: */ + genoperandoperand(ConvertRdRs, floatValue, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt32 */ +static sqInt +genLowcodeFloat64ToInt32(void) +{ + sqInt floatValue; + sqInt int32Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int32Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int32Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int32Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int32Result); + ssPushNativeRegister(int32Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToInt64 */ +static sqInt +genLowcodeFloat64ToInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToOop */ +static sqInt +genLowcodeFloat64ToOop(void) +{ + sqInt floatValue; + sqInt object; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + ssFlushAll(); + genLcFloat64toOop(floatValue, object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt32 */ +static sqInt +genLowcodeFloat64ToUInt32(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin ConvertRd:R: */ + genoperandoperand(ConvertRdR, floatValue, int64Result); + ssPushNativeRegister(int64Result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFloat64ToUInt64 */ +static sqInt +genLowcodeFloat64ToUInt64(void) +{ + sqInt floatValue; + sqInt int64Result; + + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (((int64Result = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((int64Result = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (int64Result == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeFree */ +static sqInt +genLowcodeFree(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + if (pointer != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFreeTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexable32Oop */ +static sqInt +genLowcodeInstantiateIndexable32Oop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + if (((indexableSize = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((indexableSize = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((classOop = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << indexableSize)))) == NoReg) { + ssAllocateRequiredReg((classOop = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << indexableSize)) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((indexableSize == ReceiverResultReg) + || (classOop == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), indexableSize); + ssNativePop(1); + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopindexableSize(classOop, indexableSize); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateIndexableOop */ +static sqInt +genLowcodeInstantiateIndexableOop(void) +{ + sqInt classOop; + sqInt indexableSize; + sqInt object; + + indexableSize = extA; + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << classOop)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((classOop == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOopconstantIndexableSize(classOop, indexableSize); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInstantiateOop */ +static sqInt +genLowcodeInstantiateOop(void) +{ + sqInt classOop; + + if (((classOop = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((classOop = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (classOop == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), classOop); + ssPop(1); + ssFlushAll(); + genLcInstantiateOop(classOop); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Equal */ +static sqInt +genLowcodeInt32Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Great */ +static sqInt +genLowcodeInt32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLessOrEqual: */ + falseJump = genConditionalBranchoperand(JumpLessOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32GreatEqual */ +static sqInt +genLowcodeInt32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpLess: */ + falseJump = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32Less */ +static sqInt +genLowcodeInt32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreaterOrEqual: */ + falseJump = genConditionalBranchoperand(JumpGreaterOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32LessEqual */ +static sqInt +genLowcodeInt32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpGreater: */ + falseJump = genConditionalBranchoperand(JumpGreater, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32NotEqual */ +static sqInt +genLowcodeInt32NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat32 */ +static sqInt +genLowcodeInt32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToFloat64 */ +static sqInt +genLowcodeInt32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToOop */ +static sqInt +genLowcodeInt32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt32ToPointer */ +static sqInt +genLowcodeInt32ToPointer(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Equal */ +static sqInt +genLowcodeInt64Equal(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, firstLow); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, firstLow); + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Great */ +static sqInt +genLowcodeInt64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64GreatEqual */ +static sqInt +genLowcodeInt64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64Less */ +static sqInt +genLowcodeInt64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64LessEqual */ +static sqInt +genLowcodeInt64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64NotEqual */ +static sqInt +genLowcodeInt64NotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + AbstractInstruction * falseJump2; + AbstractInstruction * falseLabel; + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondHigh, firstHigh); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, secondLow, firstLow); + /* begin JumpNonZero: */ + falseJump2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, firstLow); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 1, firstLow); + falseLabel = anInstruction1; + jmpTarget(falseJump, falseLabel); + jmpTarget(falseJump2, falseLabel); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(firstLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat32 */ +static sqInt +genLowcodeInt64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToFloat64 */ +static sqInt +genLowcodeInt64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToOop */ +static sqInt +genLowcodeInt64ToOop(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeInt64ToPointer */ +static sqInt +genLowcodeInt64ToPointer(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsBytes */ +static sqInt +genLowcodeIsBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsFloatObject */ +static sqInt +genLowcodeIsFloatObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsFloatObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIndexable */ +static sqInt +genLowcodeIsIndexable(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIndexableto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsIntegerObject */ +static sqInt +genLowcodeIsIntegerObject(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsIntegerObjectto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsPointers */ +static sqInt +genLowcodeIsPointers(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsPointersto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWords */ +static sqInt +genLowcodeIsWords(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeIsWordsOrBytes */ +static sqInt +genLowcodeIsWordsOrBytes(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcIsWordsOrBytesto(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift32 */ +static sqInt +genLowcodeLeftShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftR:R: */ + genoperandoperand(LogicalShiftLeftRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLeftShift64 */ +static sqInt +genLowcodeLeftShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentAddress */ +static sqInt +genLowcodeLoadArgumentAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat32 */ +static sqInt +genLowcodeLoadArgumentFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentFloat64 */ +static sqInt +genLowcodeLoadArgumentFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt16 */ +static sqInt +genLowcodeLoadArgumentInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt32 */ +static sqInt +genLowcodeLoadArgumentInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt64 */ +static sqInt +genLowcodeLoadArgumentInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentInt8 */ +static sqInt +genLowcodeLoadArgumentInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentPointer */ +static sqInt +genLowcodeLoadArgumentPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt16 */ +static sqInt +genLowcodeLoadArgumentUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt32 */ +static sqInt +genLowcodeLoadArgumentUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt64 */ +static sqInt +genLowcodeLoadArgumentUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadArgumentUInt8 */ +static sqInt +genLowcodeLoadArgumentUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeArgumentAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat32FromMemory */ +static sqInt +genLowcodeLoadFloat32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, pointer, value); + ssPushNativeRegisterSingleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadFloat64FromMemory */ +static sqInt +genLowcodeLoadFloat64FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, pointer, value); + ssPushNativeRegisterDoubleFloat(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt16FromMemory */ +static sqInt +genLowcodeLoadInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt32FromMemory */ +static sqInt +genLowcodeLoadInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt64FromMemory */ +static sqInt +genLowcodeLoadInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadInt8FromMemory */ +static sqInt +genLowcodeLoadInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalAddress */ +static sqInt +genLowcodeLoadLocalAddress(void) +{ + sqInt baseOffset; + sqInt pointer; + + baseOffset = extA; + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, pointer); + ssPushNativeRegister(pointer); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat32 */ +static sqInt +genLowcodeLoadLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt floatValue; + + baseOffset = extA; + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:Rs: */ + anInstruction = genoperandoperandoperand(MoveM32rRs, 0, TempReg, floatValue); + ssPushNativeRegisterSingleFloat(floatValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalFloat64 */ +static sqInt +genLowcodeLoadLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt doubleValue; + + baseOffset = extA; + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM64:r:Rd: */ + anInstruction = genoperandoperandoperand(MoveM64rRd, 0, TempReg, doubleValue); + ssPushNativeRegisterDoubleFloat(doubleValue); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt16 */ +static sqInt +genLowcodeLoadLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt32 */ +static sqInt +genLowcodeLoadLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt64 */ +static sqInt +genLowcodeLoadLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalInt8 */ +static sqInt +genLowcodeLoadLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalPointer */ +static sqInt +genLowcodeLoadLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerResult; + + baseOffset = extA; + if (((pointerResult = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerResult = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerResult == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, TempReg, pointerResult); + ssPushNativeRegister(pointerResult); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt16 */ +static sqInt +genLowcodeLoadLocalUInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt32 */ +static sqInt +genLowcodeLoadLocalUInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt64 */ +static sqInt +genLowcodeLoadLocalUInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, TempReg, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, TempReg, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadLocalUInt8 */ +static sqInt +genLowcodeLoadLocalUInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, TempReg, value); + ssPushNativeRegister(value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectAt */ +static sqInt +genLowcodeLoadObjectAt(void) +{ + sqInt fieldIndex; + sqInt object; + + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((fieldIndex == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectat(object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadObjectField */ +static sqInt +genLowcodeLoadObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + + fieldIndex = extA; + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcLoadObjectfield(object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadPointerFromMemory */ +static sqInt +genLowcodeLoadPointerFromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt pointerResult; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerResult = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((pointerResult = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (pointerResult == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, pointer, pointerResult); + ssPushNativeRegister(pointerResult); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt16FromMemory */ +static sqInt +genLowcodeLoadUInt16FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM16:r:R: */ + anInstruction = genoperandoperandoperand(MoveM16rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt32FromMemory */ +static sqInt +genLowcodeLoadUInt32FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt64FromMemory */ +static sqInt +genLowcodeLoadUInt64FromMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM32:r:R: */ + anInstruction = genoperandoperandoperand(MoveM32rR, 0, pointer, valueLow); + /* begin MoveM32:r:R: */ + anInstruction1 = genoperandoperandoperand(MoveM32rR, 4, pointer, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLoadUInt8FromMemory */ +static sqInt +genLowcodeLoadUInt8FromMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveM8:r:R: */ + anInstruction = genoperandoperandoperand(MoveM8rR, 0, pointer, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLocalFrameSize */ +static sqInt +genLowcodeLocalFrameSize(void) +{ + sqInt address; + sqInt address1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + AbstractInstruction *anInstruction8; + sqInt offset; + sqInt offset1; + sqInt offset2; + sqInt offset3; + sqInt quickConstant; + sqInt size; + + size = extA; + assert(needsFrame); + + /* Mark the stack frame */ + hasNativeFrame = 1; + annotateobjRef(gMoveCwR(splObj(LowcodeContextMark), TempReg), splObj(LowcodeContextMark)); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfNativeFrameMark(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, TempReg, offset, FPReg); + /* begin MoveAw:R: */ + address = nativeStackPointerAddress(); + /* begin gen:literal:operand: */ + anInstruction1 = genoperandoperand(MoveAwR, address, TempReg); + /* begin AddCq:R: */ + anInstruction8 = genoperandoperand(AddCqR, 1, TempReg); + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + /* begin SubCq:R: */ + anInstruction3 = genoperandoperand(SubCqR, size, TempReg); + /* begin MoveR:Mw:r: */ + offset2 = frameOffsetOfNativeFramePointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction4 = genoperandoperandoperand(MoveRMwr, TempReg, offset2, FPReg); + /* begin MoveR:Mw:r: */ + offset3 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction5 = genoperandoperandoperand(MoveRMwr, TempReg, offset3, FPReg); + /* begin SubCq:R: */ + quickConstant = 1 + (defaultNativeStackFrameSize()); + /* begin gen:quickConstant:operand: */ + anInstruction6 = genoperandoperand(SubCqR, quickConstant, TempReg); + /* begin MoveR:Aw: */ + address1 = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction7 = genoperandoperand(MoveRAw, TempReg, address1); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockRegisters */ +static sqInt +genLowcodeLockRegisters(void) +{ + ssFlushAll(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeLockVM */ +static sqInt +genLowcodeLockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc32 */ +static sqInt +genLowcodeMalloc32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt size; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((size == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + ssFlushAll(); + if (size != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, size, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMalloc64 */ +static sqInt +genLowcodeMalloc64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt pointer; + sqInt sizeHigh; + sqInt sizeLow; + + if (((sizeLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((sizeLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((sizeHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << sizeLow)))) == NoReg) { + ssAllocateRequiredReg((sizeHigh = Arg1Reg)); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << sizeLow)) | (1U << sizeHigh)))) == NoReg) { + ssAllocateRequiredReg((pointer = SendNumArgsReg)); + } + if (((sizeLow == ReceiverResultReg) + || (sizeHigh == ReceiverResultReg)) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), sizeLow, sizeHigh); + ssNativePop(1); + ssFlushAll(); + if (sizeLow != ReceiverResultReg) { + /* begin MoveR:R: */ + genoperandoperand(MoveRR, sizeLow, ReceiverResultReg); + } + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceMallocTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, TempReg, pointer); + ssPushNativeRegister(pointer); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy32 */ +static sqInt +genLowcodeMemcpy32(void) +{ + sqInt dest; + sqInt size; + sqInt source; + + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, size); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpy64 */ +static sqInt +genLowcodeMemcpy64(void) +{ + sqInt dest; + sqInt size; + sqInt sizeLow; + sqInt source; + + sizeLow = 0; + if (((size = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((size = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((source = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << size)))) == NoReg) { + ssAllocateRequiredReg((source = Arg1Reg)); + } + if (((dest = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << size)) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = SendNumArgsReg)); + } + if (((size == ReceiverResultReg) + || (source == ReceiverResultReg)) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), size); + ssNativePop(1); + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + ssFlushAll(); + genMemCopytosize(backEnd, source, dest, sizeLow); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMemcpyFixed */ +static sqInt +genLowcodeMemcpyFixed(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt dest; + sqInt size; + sqInt source; + + size = extA; + if (((source = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((source = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((dest = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << source)))) == NoReg) { + ssAllocateRequiredReg((dest = Arg1Reg)); + } + if ((source == ReceiverResultReg) + || (dest == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), source); + ssNativePop(1); + nativePopToReg(ssNativeTop(), dest); + ssNativePop(1); + if (size == BytesPerWord) { + /* begin MoveMw:r:R: */ + anInstruction = genoperandoperandoperand(MoveMwrR, 0, source, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction1 = genoperandoperandoperand(MoveRMwr, TempReg, 0, dest); + } + else { + ssFlushAll(); + genMemCopytoconstantSize(backEnd, source, dest, size); + } + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat32ToPhysical */ +static sqInt +genLowcodeMoveFloat32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveFloat64ToPhysical */ +static sqInt +genLowcodeMoveFloat64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt32ToPhysical */ +static sqInt +genLowcodeMoveInt32ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMoveInt64ToPhysical */ +static sqInt +genLowcodeMoveInt64ToPhysical(void) +{ + sqInt registerID; + sqInt value; + + registerID = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMovePointerToPhysical */ +static sqInt +genLowcodeMovePointerToPhysical(void) +{ + sqInt pointerValue; + sqInt registerID; + + registerID = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul32 */ +static sqInt +genLowcodeMul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeMul64 */ +static sqInt +genLowcodeMul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg32 */ +static sqInt +genLowcodeNeg32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NegateR: */ + genoperand(NegateR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNeg64 */ +static sqInt +genLowcodeNeg64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, 1, valueLow); + /* begin AddcCq:R: */ + anInstruction1 = genoperandoperand(AddcCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot32 */ +static sqInt +genLowcodeNot32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeNot64 */ +static sqInt +genLowcodeNot64(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin NotR: */ + genoperand(NotR, valueLow); + /* begin NotR: */ + genoperand(NotR, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeNullaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeNullaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeBoolean32ToOop(); + + case 1: + return genLowcodeBoolean64ToOop(); + + case 2: + return genLowcodeFloat32ToOop(); + + case 3: + return genLowcodeFloat64ToOop(); + + case 4: + return genLowcodeInt32ToOop(); + + case 5: + return genLowcodeInt64ToOop(); + + case 6: + return genLowcodePointerToOop(); + + case 7: + return genLowcodePointerToOopReinterprer(); + + case 8: + return genLowcodeSmallInt32ToOop(); + + case 9: + return genLowcodeUint32ToOop(); + + case 10: + return genLowcodeUint64ToOop(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopEqual */ +static sqInt +genLowcodeOopEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopNotEqual */ +static sqInt +genLowcodeOopNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), second); + ssPop(1); + popToReg(ssTop(), first); + ssPop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt32 */ +static sqInt +genLowcodeOopSmallIntegerToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopSmallIntegerToInt64 */ +static sqInt +genLowcodeOopSmallIntegerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genConvertSmallIntegerToIntegerInReg(object); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean32 */ +static sqInt +genLowcodeOopToBoolean32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToBoolean64 */ +static sqInt +genLowcodeOopToBoolean64(void) +{ + AbstractInstruction *anInstruction; + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + annotateobjRef(gSubCwR(falseObject(), object), falseObject()); + ssPushNativeRegistersecondRegister(object, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat32 */ +static sqInt +genLowcodeOopToFloat32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat32(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToFloat64 */ +static sqInt +genLowcodeOopToFloat64(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoFloat64(object, value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt32 */ +static sqInt +genLowcodeOopToInt32(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToInt64 */ +static sqInt +genLowcodeOopToInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointer */ +static sqInt +genLowcodeOopToPointer(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + genLcOopToPointer(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToPointerReinterpret */ +static sqInt +genLowcodeOopToPointerReinterpret(void) +{ + sqInt object; + sqInt pointer; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointer = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((pointer = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (pointer == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssPushNativeRegister(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt32 */ +static sqInt +genLowcodeOopToUInt32(void) +{ + sqInt object; + sqInt value; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((object == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOopToUInt32(object); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOopToUInt64 */ +static sqInt +genLowcodeOopToUInt64(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << object)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << object)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((object == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + ssFlushAll(); + genLcOoptoUInt64highPart(object, valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr32 */ +static sqInt +genLowcodeOr32(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeOr64 */ +static sqInt +genLowcodeOr64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondLow, firstLow); + /* begin OrR:R: */ + genoperandoperand(OrRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat32 */ +static sqInt +genLowcodePerformCallFloat32(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallFloat64 */ +static sqInt +genLowcodePerformCallFloat64(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat32 */ +static sqInt +genLowcodePerformCallIndirectFloat32(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRs(backEnd, DPFPReg0); + ssPushNativeRegisterSingleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectFloat64 */ +static sqInt +genLowcodePerformCallIndirectFloat64(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + cFloatResultToRd(backEnd, DPFPReg0); + ssPushNativeRegisterDoubleFloat(DPFPReg0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt32 */ +static sqInt +genLowcodePerformCallIndirectInt32(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectInt64 */ +static sqInt +genLowcodePerformCallIndirectInt64(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + sqInt reg11; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectPointer */ +static sqInt +genLowcodePerformCallIndirectPointer(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectStructure */ +static sqInt +genLowcodePerformCallIndirectStructure(void) +{ + AbstractInstruction *abstractInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallIndirectVoid */ +static sqInt +genLowcodePerformCallIndirectVoid(void) +{ + AbstractInstruction *abstractInstruction; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + callSwitchToCStack(); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt32 */ +static sqInt +genLowcodePerformCallInt32(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallInt64 */ +static sqInt +genLowcodePerformCallInt64(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + sqInt reg11; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = cResultRegisterLow(backEnd); + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + /* begin MoveR:R: */ + reg11 = cResultRegisterHigh(backEnd); + genoperandoperand(MoveRR, reg11, Arg0Reg); + ssPushNativeRegistersecondRegister(ReceiverResultReg, Arg0Reg); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallPointer */ +static sqInt +genLowcodePerformCallPointer(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ +/* Push the result space */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallStructure */ +static sqInt +genLowcodePerformCallStructure(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + sqInt reg1; + + nativeStackPopToReg(ssNativeTop(), TempReg); + ssNativePop(1); + /* begin PushR: */ + genoperand(PushR, TempReg); + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + /* begin MoveR:R: */ + reg1 = V0; + genoperandoperand(MoveRR, reg1, ReceiverResultReg); + ssPushNativeRegister(ReceiverResultReg); + extA = 0; + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePerformCallVoid */ +static sqInt +genLowcodePerformCallVoid(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *anInstruction; + + callSwitchToCStack(); + /* begin MoveCw:R: */ + anInstruction = genoperandoperand(MoveCwR, extA, TempReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFFICalloutTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePin */ +static sqInt +genLowcodePin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePlaftormCode */ +static sqInt +genLowcodePlaftormCode(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddConstantOffset */ +static sqInt +genLowcodePointerAddConstantOffset(void) +{ + AbstractInstruction *anInstruction; + sqInt base; + sqInt offset; + + offset = extB; + if (((base = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((base = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (base == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, offset, base); + ssPushNativeRegister(base); + extB = 0; + numExtB = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset32 */ +static sqInt +genLowcodePointerAddOffset32(void) +{ + sqInt base; + sqInt offset; + + if (((offset = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offset = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((base = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offset)))) == NoReg) { + ssAllocateRequiredReg((base = Arg1Reg)); + } + if ((offset == ReceiverResultReg) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), offset); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offset, base); + ssPushNativeRegister(base); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerAddOffset64 */ +static sqInt +genLowcodePointerAddOffset64(void) +{ + sqInt base; + sqInt offsetHigh; + sqInt offsetLow; + + if (((offsetLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((offsetLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((offsetHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << offsetLow)))) == NoReg) { + ssAllocateRequiredReg((offsetHigh = Arg1Reg)); + } + if (((base = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << offsetLow)) | (1U << offsetHigh)))) == NoReg) { + ssAllocateRequiredReg((base = SendNumArgsReg)); + } + if (((offsetLow == ReceiverResultReg) + || (offsetHigh == ReceiverResultReg)) + || (base == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), offsetLow, offsetHigh); + ssNativePop(1); + nativePopToReg(ssNativeTop(), base); + ssNativePop(1); + /* begin AddR:R: */ + genoperandoperand(AddRR, offsetLow, base); + ssPushNativeRegister(base); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerEqual */ +static sqInt +genLowcodePointerEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpNonZero: */ + falseJump = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerNotEqual */ +static sqInt +genLowcodePointerNotEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpZero: */ + falseJump = genConditionalBranchoperand(JumpZero, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt32 */ +static sqInt +genLowcodePointerToInt32(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushNativeRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToInt64 */ +static sqInt +genLowcodePointerToInt64(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt resultHigh; + sqInt resultLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, pointer, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOop */ +static sqInt +genLowcodePointerToOop(void) +{ + sqInt pointer; + sqInt pointerClassLiteral; + + pointerClassLiteral = getLiteral(extA); + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssFlushAll(); + genLcPointerToOopclass(pointer, pointerClassLiteral); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePointerToOopReinterprer */ +static sqInt +genLowcodePointerToOopReinterprer(void) +{ + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + ssPushRegister(pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat32 */ +static sqInt +genLowcodePopFloat32(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopFloat64 */ +static sqInt +genLowcodePopFloat64(void) +{ + sqInt value; + + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt32 */ +static sqInt +genLowcodePopInt32(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopInt64 */ +static sqInt +genLowcodePopInt64(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopMultipleNative */ +static sqInt +genLowcodePopMultipleNative(void) +{ + ssPopNativeSize(extA); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePopPointer */ +static sqInt +genLowcodePopPointer(void) +{ + sqInt pointerValue; + + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt32 */ +static sqInt +genLowcodePushConstantUInt32(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt32(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushConstantUInt64 */ +static sqInt +genLowcodePushConstantUInt64(void) +{ + sqInt constant; + + constant = extA; + ssPushNativeConstantInt64(constant); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushNullPointer */ +static sqInt +genLowcodePushNullPointer(void) +{ + ssPushNativeConstantPointer(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne32 */ +static sqInt +genLowcodePushOne32(void) +{ + ssPushNativeConstantInt32(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOne64 */ +static sqInt +genLowcodePushOne64(void) +{ + ssPushNativeConstantInt64(1); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat32 */ +static sqInt +genLowcodePushOneFloat32(void) +{ + ssPushNativeConstantFloat32(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushOneFloat64 */ +static sqInt +genLowcodePushOneFloat64(void) +{ + ssPushNativeConstantFloat64(1.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat32 */ +static sqInt +genLowcodePushPhysicalFloat32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalFloat64 */ +static sqInt +genLowcodePushPhysicalFloat64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt32 */ +static sqInt +genLowcodePushPhysicalInt32(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalInt64 */ +static sqInt +genLowcodePushPhysicalInt64(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushPhysicalPointer */ +static sqInt +genLowcodePushPhysicalPointer(void) +{ + sqInt registerID; + + registerID = extA; + abort(); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushSessionIdentifier */ +static sqInt +genLowcodePushSessionIdentifier(void) +{ + ssPushNativeConstantInt32(getThisSessionID()); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero32 */ +static sqInt +genLowcodePushZero32(void) +{ + ssPushNativeConstantInt32(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZero64 */ +static sqInt +genLowcodePushZero64(void) +{ + ssPushNativeConstantInt64(0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat32 */ +static sqInt +genLowcodePushZeroFloat32(void) +{ + ssPushNativeConstantFloat32(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodePushZeroFloat64 */ +static sqInt +genLowcodePushZeroFloat64(void) +{ + ssPushNativeConstantFloat64(0.0); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem32 */ +static sqInt +genLowcodeRem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRem64 */ +static sqInt +genLowcodeRem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift32 */ +static sqInt +genLowcodeRightShift32(void) +{ + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftRightR:R: */ + genoperandoperand(LogicalShiftRightRR, shiftAmount, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeRightShift64 */ +static sqInt +genLowcodeRightShift64(void) +{ + sqInt result; + sqInt shiftAmount; + sqInt value; + + if (((shiftAmount = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((shiftAmount = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << shiftAmount)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << shiftAmount)) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((shiftAmount == ReceiverResultReg) + || (value == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), shiftAmount); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From16 */ +static sqInt +genLowcodeSignExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend32From8 */ +static sqInt +genLowcodeSignExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From16 */ +static sqInt +genLowcodeSignExtend64From16(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend16R:R: */ + genoperandoperand(SignExtend16RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From32 */ +static sqInt +genLowcodeSignExtend64From32(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, value); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, resultHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSignExtend64From8 */ +static sqInt +genLowcodeSignExtend64From8(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * cont; + AbstractInstruction * isNegative; + sqInt resultHigh; + sqInt resultLow; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((resultLow = SendNumArgsReg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = ClassReg)); + } + if ((((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin SignExtend8R:R: */ + genoperandoperand(SignExtend8RR, valueLow, valueLow); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, valueLow); + /* begin JumpLess: */ + isNegative = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + /* begin Jump: */ + cont = genoperand(Jump, ((sqInt)0)); + jmpTarget(isNegative, gMoveCqR(-1, valueHigh)); + jmpTarget(cont, gLabel()); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSmallInt32ToOop */ +static sqInt +genLowcodeSmallInt32ToOop(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin LogicalShiftLeftCq:R: */ + genoperandoperand(LogicalShiftLeftCqR, 1, value); + /* begin OrCq:R: */ + anInstruction = genoperandoperand(OrCqR, 1, value); + ssPushRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat32ToMemory */ +static sqInt +genLowcodeStoreFloat32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt floatValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((floatValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((floatValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), floatValue); + ssNativePop(1); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, floatValue, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreFloat64ToMemory */ +static sqInt +genLowcodeStoreFloat64ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt doubleValue; + sqInt pointer; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((doubleValue = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((doubleValue = DPFPReg0)); + } + if (pointer == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), doubleValue); + ssNativePop(1); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, doubleValue, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt16ToMemory */ +static sqInt +genLowcodeStoreInt16ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt32ToMemory */ +static sqInt +genLowcodeStoreInt32ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt64ToMemory */ +static sqInt +genLowcodeStoreInt64ToMemory(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt pointer; + sqInt valueHigh; + sqInt valueLow; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((valueLow = Arg1Reg)); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << pointer)) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = SendNumArgsReg)); + } + if (((pointer == ReceiverResultReg) + || (valueLow == ReceiverResultReg)) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, pointer); + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, pointer); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreInt8ToMemory */ +static sqInt +genLowcodeStoreInt8ToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt pointer; + sqInt value; + + if (((pointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((value = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << pointer)))) == NoReg) { + ssAllocateRequiredReg((value = Arg1Reg)); + } + if ((pointer == ReceiverResultReg) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, pointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat32 */ +static sqInt +genLowcodeStoreLocalFloat32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRs:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRsM32r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalFloat64 */ +static sqInt +genLowcodeStoreLocalFloat64(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((value = DPFPReg0)); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveRd:M64:r: */ + anInstruction = genoperandoperandoperand(MoveRdM64r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt16 */ +static sqInt +genLowcodeStoreLocalInt16(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M16:r: */ + anInstruction = genoperandoperandoperand(MoveRM16r, TempReg, 0, value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt32 */ +static sqInt +genLowcodeStoreLocalInt32(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, value, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt64 */ +static sqInt +genLowcodeStoreLocalInt64(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt baseOffset; + sqInt valueHigh; + sqInt valueLow; + + baseOffset = extA; + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:M32:r: */ + anInstruction = genoperandoperandoperand(MoveRM32r, valueLow, 0, TempReg); + /* begin MoveR:M32:r: */ + anInstruction1 = genoperandoperandoperand(MoveRM32r, valueHigh, 4, TempReg); + + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalInt8 */ +static sqInt +genLowcodeStoreLocalInt8(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt value; + + baseOffset = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, TempReg); + loadNativeLocalAddressto(baseOffset, value); + /* begin MoveR:M8:r: */ + anInstruction = genoperandoperandoperand(MoveRM8r, TempReg, 0, value); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreLocalPointer */ +static sqInt +genLowcodeStoreLocalPointer(void) +{ + AbstractInstruction *anInstruction; + sqInt baseOffset; + sqInt pointerValue; + + baseOffset = extA; + if (((pointerValue = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((pointerValue = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (pointerValue == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + loadNativeLocalAddressto(baseOffset, TempReg); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, TempReg); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectField */ +static sqInt +genLowcodeStoreObjectField(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + fieldIndex = extA; + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((object = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((object = Arg1Reg)); + } + if ((value == ReceiverResultReg) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectfield(value, object, fieldIndex); + extA = 0; + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStoreObjectFieldAt */ +static sqInt +genLowcodeStoreObjectFieldAt(void) +{ + sqInt fieldIndex; + sqInt object; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((fieldIndex = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((fieldIndex = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << fieldIndex)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (fieldIndex == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), value); + ssPop(1); + nativePopToReg(ssNativeTop(), fieldIndex); + ssNativePop(1); + popToReg(ssTop(), object); + ssPop(1); + genLcStoreobjectat(value, object, fieldIndex); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeStorePointerToMemory */ +static sqInt +genLowcodeStorePointerToMemory(void) +{ + AbstractInstruction *anInstruction; + sqInt memoryPointer; + sqInt pointerValue; + + if (((memoryPointer = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((memoryPointer = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((pointerValue = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << memoryPointer)))) == NoReg) { + ssAllocateRequiredReg((pointerValue = Arg1Reg)); + } + if ((memoryPointer == ReceiverResultReg) + || (pointerValue == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), memoryPointer); + ssNativePop(1); + nativePopToReg(ssNativeTop(), pointerValue); + ssNativePop(1); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, pointerValue, 0, memoryPointer); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub32 */ +static sqInt +genLowcodeSub32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeSub64 */ +static sqInt +genLowcodeSub64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin SubR:R: */ + genoperandoperand(SubRR, secondLow, firstLow); + /* begin SubbR:R: */ + genoperandoperand(SubbRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeTrinaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeTrinaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeOopEqual(); + + case 1: + return genLowcodeOopNotEqual(); + + case 2: + return genLowcodeStoreObjectField(); + + case 3: + return genLowcodeStoreObjectFieldAt(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To16 */ +static sqInt +genLowcodeTruncate32To16(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate32To8 */ +static sqInt +genLowcodeTruncate32To8(void) +{ + AbstractInstruction *anInstruction; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To16 */ +static sqInt +genLowcodeTruncate64To16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFFFF, valueLow); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To32 */ +static sqInt +genLowcodeTruncate64To32(void) +{ + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeTruncate64To8 */ +static sqInt +genLowcodeTruncate64To8(void) +{ + AbstractInstruction *anInstruction; + sqInt result; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin AndCq:R: */ + anInstruction = genoperandoperand(AndCqR, 0xFF, valueLow); + ssPushNativeRegister(valueLow); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv32 */ +static sqInt +genLowcodeUdiv32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, first, second); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUdiv64 */ +static sqInt +genLowcodeUdiv64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Great */ +static sqInt +genLowcodeUint32Great(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelowOrEqual: */ + falseJump = genConditionalBranchoperand(JumpBelowOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32GreatEqual */ +static sqInt +genLowcodeUint32GreatEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpBelow: */ + falseJump = genConditionalBranchoperand(JumpBelow, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32Less */ +static sqInt +genLowcodeUint32Less(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAboveOrEqual: */ + falseJump = genConditionalBranchoperand(JumpAboveOrEqual, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32LessEqual */ +static sqInt +genLowcodeUint32LessEqual(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction * contJump; + AbstractInstruction * falseJump; + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin CmpR:R: */ + genoperandoperand(CmpRR, second, first); + /* begin JumpAbove: */ + falseJump = genConditionalBranchoperand(JumpAbove, ((sqInt)0)); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 1, first); + /* begin Jump: */ + contJump = genoperand(Jump, ((sqInt)0)); + jmpTarget(falseJump, gLabel()); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, 0, first); + jmpTarget(contJump, gLabel()); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat32 */ +static sqInt +genLowcodeUint32ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rs: */ + genoperandoperand(ConvertRRs, value, result); + ssPushNativeRegisterSingleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToFloat64 */ +static sqInt +genLowcodeUint32ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ConvertR:Rd: */ + genoperandoperand(ConvertRRd, value, result); + ssPushNativeRegisterDoubleFloat(result); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint32ToOop */ +static sqInt +genLowcodeUint32ToOop(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + ssFlushAll(); + genLcUInt32ToOop(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Great */ +static sqInt +genLowcodeUint64Great(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64GreatEqual */ +static sqInt +genLowcodeUint64GreatEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64Less */ +static sqInt +genLowcodeUint64Less(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64LessEqual */ +static sqInt +genLowcodeUint64LessEqual(void) +{ + sqInt first; + sqInt second; + sqInt value; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((value = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((value = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (value == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat32 */ +static sqInt +genLowcodeUint64ToFloat32(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToFloat64 */ +static sqInt +genLowcodeUint64ToFloat64(void) +{ + sqInt result; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((result = availableFloatRegisterOrNoneFor(backEnd, liveFloatRegisters()))) == NoReg) { + ssAllocateRequiredFloatReg((result = DPFPReg0)); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUint64ToOop */ +static sqInt +genLowcodeUint64ToOop(void) +{ + sqInt object; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if (((object = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << valueLow)) | (1U << valueHigh)))) == NoReg) { + ssAllocateRequiredReg((object = SendNumArgsReg)); + } + if (((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) + || (object == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + ssFlushAll(); + genLcUInt64ToOophighPart(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul32 */ +static sqInt +genLowcodeUmul32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin MulR:R: */ + genMulRR(backEnd, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUmul64 */ +static sqInt +genLowcodeUmul64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive2: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive2(sqInt prim) +{ + + switch (prim) { + case 60: + return genLowcodeFloat64ToFloat32(); + + case 61: + return genLowcodeFloat64ToInt32(); + + case 0x3E: + return genLowcodeFloat64ToInt64(); + + case 0x3F: + return genLowcodeFloat64ToUInt32(); + + case 64: + return genLowcodeFloat64ToUInt64(); + + case 65: + return genLowcodeFree(); + + case 66: + return genLowcodeInstantiateIndexable32Oop(); + + case 67: + return genLowcodeInstantiateIndexableOop(); + + case 68: + return genLowcodeInstantiateOop(); + + case 69: + return genLowcodeInt32Equal(); + + case 70: + return genLowcodeInt32Great(); + + case 71: + return genLowcodeInt32GreatEqual(); + + case 72: + return genLowcodeInt32Less(); + + case 73: + return genLowcodeInt32LessEqual(); + + case 74: + return genLowcodeInt32NotEqual(); + + case 75: + return genLowcodeInt32ToFloat32(); + + case 76: + return genLowcodeInt32ToFloat64(); + + case 77: + return genLowcodeInt32ToPointer(); + + case 78: + return genLowcodeInt64Equal(); + + case 79: + return genLowcodeInt64Great(); + + case 80: + return genLowcodeInt64GreatEqual(); + + case 81: + return genLowcodeInt64Less(); + + case 82: + return genLowcodeInt64LessEqual(); + + case 83: + return genLowcodeInt64NotEqual(); + + case 84: + return genLowcodeInt64ToFloat32(); + + case 85: + return genLowcodeInt64ToFloat64(); + + case 86: + return genLowcodeInt64ToPointer(); + + case 87: + return genLowcodeLeftShift32(); + + case 88: + return genLowcodeLeftShift64(); + + case 89: + return genLowcodeLoadArgumentAddress(); + + case 90: + return genLowcodeLoadArgumentFloat32(); + + case 91: + return genLowcodeLoadArgumentFloat64(); + + case 92: + return genLowcodeLoadArgumentInt16(); + + case 93: + return genLowcodeLoadArgumentInt32(); + + case 94: + return genLowcodeLoadArgumentInt64(); + + case 95: + return genLowcodeLoadArgumentInt8(); + + case 96: + return genLowcodeLoadArgumentPointer(); + + case 97: + return genLowcodeLoadArgumentUInt16(); + + case 98: + return genLowcodeLoadArgumentUInt32(); + + case 99: + return genLowcodeLoadArgumentUInt64(); + + case 100: + return genLowcodeLoadArgumentUInt8(); + + case 101: + return genLowcodeLoadFloat32FromMemory(); + + case 102: + return genLowcodeLoadFloat64FromMemory(); + + case 103: + return genLowcodeLoadInt16FromMemory(); + + case 104: + return genLowcodeLoadInt32FromMemory(); + + case 105: + return genLowcodeLoadInt64FromMemory(); + + case 106: + return genLowcodeLoadInt8FromMemory(); + + case 107: + return genLowcodeLoadLocalAddress(); + + case 108: + return genLowcodeLoadLocalFloat32(); + + case 109: + return genLowcodeLoadLocalFloat64(); + + case 110: + return genLowcodeLoadLocalInt16(); + + case 111: + return genLowcodeLoadLocalInt32(); + + case 112: + return genLowcodeLoadLocalInt64(); + + case 113: + return genLowcodeLoadLocalInt8(); + + case 114: + return genLowcodeLoadLocalPointer(); + + case 115: + return genLowcodeLoadLocalUInt16(); + + case 116: + return genLowcodeLoadLocalUInt32(); + + case 117: + return genLowcodeLoadLocalUInt64(); + + case 118: + return genLowcodeLoadLocalUInt8(); + + case 119: + return genLowcodeLoadObjectAt(); + + default: + return genLowcodeUnaryInlinePrimitive3(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive3: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive3(sqInt prim) +{ + + switch (prim) { + case 120: + return genLowcodeLoadObjectField(); + + case 121: + return genLowcodeLoadPointerFromMemory(); + + case 122: + return genLowcodeLoadUInt16FromMemory(); + + case 123: + return genLowcodeLoadUInt32FromMemory(); + + case 0x7C: + return genLowcodeLoadUInt64FromMemory(); + + case 125: + return genLowcodeLoadUInt8FromMemory(); + + case 0x7E: + return genLowcodeLocalFrameSize(); + + case 0x7F: + return genLowcodeLockRegisters(); + + case 128: + return genLowcodeLockVM(); + + case 129: + return genLowcodeMalloc32(); + + case 130: + return genLowcodeMalloc64(); + + case 131: + return genLowcodeMemcpy32(); + + case 132: + return genLowcodeMemcpy64(); + + case 133: + return genLowcodeMemcpyFixed(); + + case 134: + return genLowcodeMoveFloat32ToPhysical(); + + case 135: + return genLowcodeMoveFloat64ToPhysical(); + + case 136: + return genLowcodeMoveInt32ToPhysical(); + + case 137: + return genLowcodeMoveInt64ToPhysical(); + + case 138: + return genLowcodeMovePointerToPhysical(); + + case 139: + return genLowcodeMul32(); + + case 140: + return genLowcodeMul64(); + + case 141: + return genLowcodeNeg32(); + + case 142: + return genLowcodeNeg64(); + + case 143: + return genLowcodeNot32(); + + case 144: + return genLowcodeNot64(); + + case 145: + return genLowcodeOr32(); + + case 146: + return genLowcodeOr64(); + + case 147: + return genLowcodePerformCallFloat32(); + + case 148: + return genLowcodePerformCallFloat64(); + + case 149: + return genLowcodePerformCallIndirectFloat32(); + + case 150: + return genLowcodePerformCallIndirectFloat64(); + + case 151: + return genLowcodePerformCallIndirectInt32(); + + case 152: + return genLowcodePerformCallIndirectInt64(); + + case 153: + return genLowcodePerformCallIndirectPointer(); + + case 154: + return genLowcodePerformCallIndirectStructure(); + + case 155: + return genLowcodePerformCallIndirectVoid(); + + case 156: + return genLowcodePerformCallInt32(); + + case 157: + return genLowcodePerformCallInt64(); + + case 158: + return genLowcodePerformCallPointer(); + + case 159: + return genLowcodePerformCallStructure(); + + case 160: + return genLowcodePerformCallVoid(); + + case 161: + return genLowcodePlaftormCode(); + + case 162: + return genLowcodePointerAddConstantOffset(); + + case 163: + return genLowcodePointerAddOffset32(); + + case 164: + return genLowcodePointerAddOffset64(); + + case 165: + return genLowcodePointerEqual(); + + case 166: + return genLowcodePointerNotEqual(); + + case 167: + return genLowcodePointerToInt32(); + + case 168: + return genLowcodePointerToInt64(); + + case 169: + return genLowcodePopFloat32(); + + case 170: + return genLowcodePopFloat64(); + + case 171: + return genLowcodePopInt32(); + + case 172: + return genLowcodePopInt64(); + + case 173: + return genLowcodePopMultipleNative(); + + case 174: + return genLowcodePopPointer(); + + case 175: + return genLowcodePushConstantUInt32(); + + case 176: + return genLowcodePushConstantUInt64(); + + case 177: + return genLowcodePushNullPointer(); + + case 178: + return genLowcodePushOne32(); + + case 179: + return genLowcodePushOne64(); + + default: + return genLowcodeUnaryInlinePrimitive4(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive4: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive4(sqInt prim) +{ + + switch (prim) { + case 180: + return genLowcodePushOneFloat32(); + + case 181: + return genLowcodePushOneFloat64(); + + case 182: + return genLowcodePushPhysicalFloat32(); + + case 183: + return genLowcodePushPhysicalFloat64(); + + case 184: + return genLowcodePushPhysicalInt32(); + + case 185: + return genLowcodePushPhysicalInt64(); + + case 186: + return genLowcodePushPhysicalPointer(); + + case 187: + return genLowcodePushSessionIdentifier(); + + case 188: + return genLowcodePushZero32(); + + case 189: + return genLowcodePushZero64(); + + case 190: + return genLowcodePushZeroFloat32(); + + case 191: + return genLowcodePushZeroFloat64(); + + case 192: + return genLowcodeRem32(); + + case 193: + return genLowcodeRem64(); + + case 194: + return genLowcodeRightShift32(); + + case 195: + return genLowcodeRightShift64(); + + case 196: + return genLowcodeSignExtend32From16(); + + case 197: + return genLowcodeSignExtend32From8(); + + case 198: + return genLowcodeSignExtend64From16(); + + case 199: + return genLowcodeSignExtend64From32(); + + case 200: + return genLowcodeSignExtend64From8(); + + case 201: + return genLowcodeStoreFloat32ToMemory(); + + case 202: + return genLowcodeStoreFloat64ToMemory(); + + case 203: + return genLowcodeStoreInt16ToMemory(); + + case 204: + return genLowcodeStoreInt32ToMemory(); + + case 205: + return genLowcodeStoreInt64ToMemory(); + + case 206: + return genLowcodeStoreInt8ToMemory(); + + case 207: + return genLowcodeStoreLocalFloat32(); + + case 208: + return genLowcodeStoreLocalFloat64(); + + case 209: + return genLowcodeStoreLocalInt16(); + + case 210: + return genLowcodeStoreLocalInt32(); + + case 211: + return genLowcodeStoreLocalInt64(); + + case 212: + return genLowcodeStoreLocalInt8(); + + case 213: + return genLowcodeStoreLocalPointer(); + + case 214: + return genLowcodeStorePointerToMemory(); + + case 215: + return genLowcodeSub32(); + + case 216: + return genLowcodeSub64(); + + case 217: + return genLowcodeTruncate32To16(); + + case 218: + return genLowcodeTruncate32To8(); + + case 219: + return genLowcodeTruncate64To16(); + + case 220: + return genLowcodeTruncate64To32(); + + case 221: + return genLowcodeTruncate64To8(); + + case 222: + return genLowcodeUdiv32(); + + case 223: + return genLowcodeUdiv64(); + + case 224: + return genLowcodeUint32Great(); + + case 225: + return genLowcodeUint32GreatEqual(); + + case 226: + return genLowcodeUint32Less(); + + case 227: + return genLowcodeUint32LessEqual(); + + case 228: + return genLowcodeUint32ToFloat32(); + + case 229: + return genLowcodeUint32ToFloat64(); + + case 230: + return genLowcodeUint64Great(); + + case 231: + return genLowcodeUint64GreatEqual(); + + case 232: + return genLowcodeUint64Less(); + + case 233: + return genLowcodeUint64LessEqual(); + + case 234: + return genLowcodeUint64ToFloat32(); + + case 235: + return genLowcodeUint64ToFloat64(); + + case 236: + return genLowcodeUmul32(); + + case 237: + return genLowcodeUmul64(); + + case 238: + return 0; + + case 239: + return genLowcodeUnlockVM(); + + default: + return genLowcodeUnaryInlinePrimitive5(prim); + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive5: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive5(sqInt prim) +{ + + switch (prim) { + case 240: + return genLowcodeUrem32(); + + case 241: + return genLowcodeUrem64(); + + case 242: + return genLowcodeXor32(); + + case 243: + return genLowcodeXor64(); + + case 244: + return genLowcodeZeroExtend32From16(); + + case 245: + return genLowcodeZeroExtend32From8(); + + case 246: + return genLowcodeZeroExtend64From16(); + + case 247: + return genLowcodeZeroExtend64From32(); + + case 0xF8: + return genLowcodeZeroExtend64From8(); + + default: + return EncounteredUnknownBytecode; + + } + return 0; +} + + +/* Lowcode instruction generator dispatch */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnaryInlinePrimitive: */ +static sqInt NoDbgRegParms +genLowcodeUnaryInlinePrimitive(sqInt prim) +{ + + switch (prim) { + case 0: + return genLowcodeAdd32(); + + case 1: + return genLowcodeAdd64(); + + case 2: + return genLowcodeAlloca32(); + + case 3: + return genLowcodeAlloca64(); + + case 4: + return genLowcodeAnd32(); + + case 5: + return genLowcodeAnd64(); + + case 6: + return genLowcodeArithmeticRightShift32(); + + case 7: + return genLowcodeArithmeticRightShift64(); + + case 8: + return genLowcodeBeginCall(); + + case 9: + return genLowcodeCallArgumentFloat32(); + + case 10: + return genLowcodeCallArgumentFloat64(); + + case 11: + return genLowcodeCallArgumentInt32(); + + case 12: + return genLowcodeCallArgumentInt64(); + + case 13: + return genLowcodeCallArgumentPointer(); + + case 14: + return genLowcodeCallArgumentSpace(); + + case 15: + return genLowcodeCallArgumentStructure(); + + case 16: + return genLowcodeCallInstruction(); + + case 17: + return genLowcodeCallPhysical(); + + case 18: + return genLowcodeCheckSessionIdentifier(); + + case 19: + return genLowcodeCompareAndSwap32(); + + case 20: + return genLowcodeDiv32(); + + case 21: + return genLowcodeDiv64(); + + case 22: + return genLowcodeDuplicateFloat32(); + + case 23: + return genLowcodeDuplicateFloat64(); + + case 24: + return genLowcodeDuplicateInt32(); + + case 25: + return genLowcodeDuplicateInt64(); + + case 26: + return genLowcodeDuplicatePointer(); + + case 27: + return genLowcodeEffectiveAddress32(); + + case 28: + return genLowcodeEffectiveAddress64(); + + case 29: + return genLowcodeEndCall(); + + case 30: + return genLowcodeEndCallNoCleanup(); + + case 0x1F: + return genLowcodeFloat32Add(); + + case 32: + return genLowcodeFloat32Div(); + + case 33: + return genLowcodeFloat32Equal(); + + case 34: + return genLowcodeFloat32Great(); + + case 35: + return genLowcodeFloat32GreatEqual(); + + case 36: + return genLowcodeFloat32Less(); + + case 37: + return genLowcodeFloat32LessEqual(); + + case 38: + return genLowcodeFloat32Mul(); + + case 39: + return genLowcodeFloat32Neg(); + + case 40: + return genLowcodeFloat32NotEqual(); + + case 41: + return genLowcodeFloat32Sqrt(); + + case 42: + return genLowcodeFloat32Sub(); + + case 43: + return genLowcodeFloat32ToFloat64(); + + case 44: + return genLowcodeFloat32ToInt32(); + + case 45: + return genLowcodeFloat32ToInt64(); + + case 46: + return genLowcodeFloat32ToUInt32(); + + case 47: + return genLowcodeFloat32ToUInt64(); + + case 48: + return genLowcodeFloat64Add(); + + case 49: + return genLowcodeFloat64Div(); + + case 50: + return genLowcodeFloat64Equal(); + + case 51: + return genLowcodeFloat64Great(); + + case 52: + return genLowcodeFloat64GreatEqual(); + + case 53: + return genLowcodeFloat64Less(); + + case 54: + return genLowcodeFloat64LessEqual(); + + case 55: + return genLowcodeFloat64Mul(); + + case 56: + return genLowcodeFloat64Neg(); + + case 57: + return genLowcodeFloat64NotEqual(); + + case 58: + return genLowcodeFloat64Sqrt(); + + case 59: + return genLowcodeFloat64Sub(); + + default: + return genLowcodeUnaryInlinePrimitive2(prim); + + } + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnlockVM */ +static sqInt +genLowcodeUnlockVM(void) +{ + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUnpin */ +static sqInt +genLowcodeUnpin(void) +{ + sqInt object; + + if (((object = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((object = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (object == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + popToReg(ssTop(), object); + ssPop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem32 */ +static sqInt +genLowcodeUrem32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + gDivRRQuoRem(second, first, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeUrem64 */ +static sqInt +genLowcodeUrem64(void) +{ + sqInt first; + sqInt result; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if (((result = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << second)) | (1U << first)))) == NoReg) { + ssAllocateRequiredReg((result = SendNumArgsReg)); + } + if (((second == ReceiverResultReg) + || (first == ReceiverResultReg)) + || (result == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + abort(); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor32 */ +static sqInt +genLowcodeXor32(void) +{ + sqInt first; + sqInt second; + + if (((second = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((second = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((first = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << second)))) == NoReg) { + ssAllocateRequiredReg((first = Arg1Reg)); + } + if ((second == ReceiverResultReg) + || (first == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), second); + ssNativePop(1); + nativePopToReg(ssNativeTop(), first); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, second, first); + ssPushNativeRegister(first); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeXor64 */ +static sqInt +genLowcodeXor64(void) +{ + sqInt firstHigh; + sqInt firstLow; + sqInt secondHigh; + sqInt secondLow; + + if (((secondLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((secondLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((secondHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << secondLow)))) == NoReg) { + ssAllocateRequiredReg((secondHigh = Arg1Reg)); + } + if (((firstLow = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)))) == NoReg) { + ssAllocateRequiredReg((firstLow = SendNumArgsReg)); + } + if (((firstHigh = availableRegisterOrNoneFor(backEnd, (((liveRegisters()) | (1U << secondLow)) | (1U << secondHigh)) | (1U << firstLow)))) == NoReg) { + ssAllocateRequiredReg((firstHigh = ClassReg)); + } + if ((((secondLow == ReceiverResultReg) + || (secondHigh == ReceiverResultReg)) + || (firstLow == ReceiverResultReg)) + || (firstHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), secondLow, secondHigh); + ssNativePop(1); + nativePopToRegsecondReg(ssNativeTop(), firstLow, firstHigh); + ssNativePop(1); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondLow, firstLow); + /* begin XorR:R: */ + genoperandoperand(XorRR, secondHigh, firstHigh); + ssPushNativeRegistersecondRegister(firstLow, firstHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From16 */ +static sqInt +genLowcodeZeroExtend32From16(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend32From8 */ +static sqInt +genLowcodeZeroExtend32From8(void) +{ + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (value == ReceiverResultReg) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, value, value); + ssPushNativeRegister(value); + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From16 */ +static sqInt +genLowcodeZeroExtend64From16(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend16R:R: */ + genoperandoperand(ZeroExtend16RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From32 */ +static sqInt +genLowcodeZeroExtend64From32(void) +{ + AbstractInstruction *anInstruction; + sqInt resultHigh; + sqInt resultLow; + sqInt value; + + if (((value = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((value = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((resultLow = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << value)))) == NoReg) { + ssAllocateRequiredReg((resultLow = Arg1Reg)); + } + if (((resultHigh = availableRegisterOrNoneFor(backEnd, ((liveRegisters()) | (1U << value)) | (1U << resultLow)))) == NoReg) { + ssAllocateRequiredReg((resultHigh = SendNumArgsReg)); + } + if (((value == ReceiverResultReg) + || (resultLow == ReceiverResultReg)) + || (resultHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToReg(ssNativeTop(), value); + ssNativePop(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, value, resultLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, resultHigh); + ssPushNativeRegistersecondRegister(resultLow, resultHigh); + + return 0; +} + + +/* Lowcode instruction generator */ + + /* StackToRegisterMappingCogit>>#genLowcodeZeroExtend64From8 */ +static sqInt +genLowcodeZeroExtend64From8(void) +{ + AbstractInstruction *anInstruction; + sqInt valueHigh; + sqInt valueLow; + + if (((valueLow = availableRegisterOrNoneFor(backEnd, liveRegisters()))) == NoReg) { + ssAllocateRequiredReg((valueLow = ((optStatus.isReceiverResultRegLive) + ? Arg0Reg + : ReceiverResultReg))); + } + if (((valueHigh = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | (1U << valueLow)))) == NoReg) { + ssAllocateRequiredReg((valueHigh = Arg1Reg)); + } + if ((valueLow == ReceiverResultReg) + || (valueHigh == ReceiverResultReg)) { + (optStatus.isReceiverResultRegLive = 0); + } + nativePopToRegsecondReg(ssNativeTop(), valueLow, valueHigh); + ssNativePop(1); + /* begin ZeroExtend8R:R: */ + genoperandoperand(ZeroExtend8RR, valueLow, valueLow); + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, 0, valueHigh); + ssPushNativeRegistersecondRegister(valueLow, valueHigh); + + return 0; +} + + /* StackToRegisterMappingCogit>>#genMarshalledSend:numArgs:sendTable: */ +static sqInt NoDbgRegParms +genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sendTable) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt annotation; + + assert(needsFrame); + /* begin annotationForSendTable: */ + if (sendTable == directedSuperSendTrampolines) { + annotation = IsDirectedSuperSend; + goto l1; + } + if (sendTable == superSendTrampolines) { + annotation = IsSuperSend; + goto l1; + } + assert(sendTable == ordinarySendTrampolines); + annotation = IsSendCall; +l1: /* end annotationForSendTable: */; + if ((annotation == IsSuperSend) + || (annotation == IsDirectedSuperSend)) { + genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + } + if (numArgs >= (NumSendTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, numArgs, SendNumArgsReg); + } + if (annotation == IsDirectedSuperSend) { + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(tempOop)) { + annotateobjRef(gMoveCwR(tempOop, TempReg), tempOop); + } + else { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, tempOop, TempReg); + } + } + genLoadInlineCacheWithSelector(selectorIndex); + ((gCall(sendTable[((numArgs < (NumSendTrampolines - 1)) ? numArgs : (NumSendTrampolines - 1))]))->annotation = annotation); + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + return ssPushRegister(ReceiverResultReg); +} + + +/* Generate the abort for a method. This abort performs either a call of + ceSICMiss: to handle a single-in-line cache miss or a call of + ceStackOverflow: to handle a + stack overflow. It distinguishes the two by testing ResultReceiverReg. If + the register is zero then this is a stack-overflow because a) the receiver + has already + been pushed and so can be set to zero before calling the abort, and b) the + receiver must always contain an object (and hence be non-zero) on SIC + miss. */ + + /* StackToRegisterMappingCogit>>#genMethodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genMethodAbortTrampolineFor(sqInt numArgs) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jumpSICMiss; + + zeroOpcodeIndex(); + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, 0, ReceiverResultReg); + /* begin JumpNonZero: */ + jumpSICMiss = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + /* begin MoveR:Mw:r: */ + anInstruction = genoperandoperandoperand(MoveRMwr, LinkReg, 0, SPReg); + + compileTrampolineFornumArgsargargargargregsToSavepushLinkRegresultReg(ceStackOverflow, 1, SendNumArgsReg, null, null, null, 0, 0, NoReg); + jmpTarget(jumpSICMiss, gLabel()); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceSICMiss, trampolineNamenumRegArgs("ceMethodAbort", numArgs), 1, ReceiverResultReg, null, null, null, 0, 0, NoReg, 1); +} + + +/* Generate the abort for a PIC. This abort performs either a call of + ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged + target or a call of ceMNUFromPICMNUMethod:receiver: to handle an + MNU dispatch in a closed PIC. It distinguishes the two by testing + ClassReg. If the register is zero then this is an MNU. */ + + /* StackToRegisterMappingCogit>>#genPICAbortTrampolineFor: */ +static sqInt NoDbgRegParms +genPICAbortTrampolineFor(sqInt numArgs) +{ + zeroOpcodeIndex(); + genPushRegisterArgsForAbortMissNumArgs(backEnd, numArgs); + return genInnerPICAbortTrampoline(trampolineNamenumRegArgs("cePICAbort", numArgs)); +} + + /* StackToRegisterMappingCogit>>#genPICMissTrampolineFor: */ +static sqInt NoDbgRegParms +genPICMissTrampolineFor(sqInt numArgs) +{ + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumRegArgs("cePICMiss", numArgs), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genPopStackBytecode */ +static sqInt +genPopStackBytecode(void) +{ + AbstractInstruction *anInstruction; + + if (((ssTop())->spilled)) { + /* begin AddCq:R: */ + anInstruction = genoperandoperand(AddCqR, BytesPerWord, SPReg); + } + ssPop(1); + return 0; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. + Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveClosureValue */ +static sqInt +genPrimitiveClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail1; + AbstractInstruction *jumpFail2; + AbstractInstruction *jumpFail3; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailNArgs; + sqInt offset; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(ClosureOuterContextIndex, ReceiverResultReg, ClassReg); + jumpFail1 = genJumpImmediate(ClassReg); + genGetCompactClassIndexNonImmOfinto(ClassReg, TempReg); + genCmpClassMethodContextCompactIndexR(TempReg); + /* begin JumpNonZero: */ + jumpFail2 = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(MethodIndex, ClassReg, SendNumArgsReg); + jumpFail3 = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction3 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + /* begin MoveM16:r:R: */ + offset = offsetof(CogMethod, blockEntryOffset); + /* begin gen:quickConstant:operand:operand: */ + anInstruction1 = genoperandoperandoperand(MoveM16rR, offset, ClassReg, TempReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, ClassReg, TempReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + if (primitiveRoutine == primitiveClosureValueNoContextSwitch) { + if (blockNoContextSwitchOffset == null) { + return NotFullyInitialized; + } + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, blockNoContextSwitchOffset, TempReg); + } + /* begin JumpR: */ + genoperand(JumpR, TempReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFail1, jmpTarget(jumpFail2, jmpTarget(jumpFail3, jmpTarget(jumpFail4, gLabel()))))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Check the argument count. Fail if wrong. + Get the method from the outerContext and see if it is cogged. If so, jump + to the + block entry or the no-context-switch entry, as appropriate, and we're + done. If not, + invoke the interpreter primitive. */ +/* Override to push the register args first. */ + + /* StackToRegisterMappingCogit>>#genPrimitiveFullClosureValue */ +static sqInt +genPrimitiveFullClosureValue(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *jumpBCMethod; + AbstractInstruction *jumpFail4; + AbstractInstruction *jumpFailImmediateMethod; + AbstractInstruction *jumpFailNArgs; + void (*primitiveRoutine)(); + sqInt quickConstant; + sqInt quickConstant1; + sqInt quickConstant2; + sqInt result; + + genPushRegisterArgs(); + genLoadSlotsourceRegdestReg(ClosureNumArgsIndex, ReceiverResultReg, TempReg); + /* begin CmpCq:R: */ + quickConstant = (((usqInt)methodOrBlockNumArgs << 1) | 1); + /* begin gen:quickConstant:operand: */ + anInstruction = genoperandoperand(CmpCqR, quickConstant, TempReg); + /* begin JumpNonZero: */ + jumpFailNArgs = genConditionalBranchoperand(JumpNonZero, ((sqInt)0)); + genLoadSlotsourceRegdestReg(FullClosureCompiledBlockIndex, ReceiverResultReg, SendNumArgsReg); + jumpFailImmediateMethod = genJumpImmediate(SendNumArgsReg); + genGetFormatOfinto(SendNumArgsReg, TempReg); + /* begin CmpCq:R: */ + quickConstant1 = firstCompiledMethodFormat(); + /* begin gen:quickConstant:operand: */ + anInstruction1 = genoperandoperand(CmpCqR, quickConstant1, TempReg); + /* begin JumpLess: */ + jumpFail4 = genConditionalBranchoperand(JumpLess, ((sqInt)0)); + genLoadSlotsourceRegdestReg(HeaderIndex, SendNumArgsReg, ClassReg); + jumpBCMethod = genJumpImmediate(ClassReg); + primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex); + /* begin AddCq:R: */ + quickConstant2 = (primitiveRoutine == primitiveFullClosureValueNoContextSwitch + ? fullBlockNoContextSwitchEntryOffset() + : fullBlockEntryOffset()); + /* begin gen:quickConstant:operand: */ + anInstruction2 = genoperandoperand(AddCqR, quickConstant2, ClassReg); + /* begin JumpR: */ + genoperand(JumpR, ClassReg); + jmpTarget(jumpBCMethod, jmpTarget(jumpFailImmediateMethod, jmpTarget(jumpFail4, gLabel()))); + if (((result = compileInterpreterPrimitive(primitiveRoutine))) < 0) { + return result; + } + jmpTarget(jumpFailNArgs, gLabel()); + return CompletePrimitive; +} + + +/* Generate an in-line perform primitive. The lookup code requires the + selector to be in Arg0Reg. + adjustArgumentsForPerform: adjusts the arguments once + genLookupForPerformNumArgs: has generated the code for the lookup. */ + + /* StackToRegisterMappingCogit>>#genPrimitivePerform */ +static sqInt +genPrimitivePerform(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + + if (methodOrBlockNumArgs > 2) { + /* begin MoveMw:r:R: */ + offset = (methodOrBlockNumArgs - 1) * BytesPerWord; + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, SPReg, Arg0Reg); + } + return genLookupForPerformNumArgs(methodOrBlockNumArgs); +} + + /* StackToRegisterMappingCogit>>#genPushActiveContextBytecode */ +static sqInt +genPushActiveContextBytecode(void) +{ + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + + genGetActiveContextNumArgslargeinBlock(methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + return ssPushRegister(ReceiverResultReg); +} + + +/* Block compilation. At this point in the method create the block. Note its + start and defer generating code for it until after the method and any + other preceding + blocks. The block's actual code will be compiled later. */ +/* 143 10001111 llllkkkk jjjjjjjj iiiiiiii Push Closure Num Copied llll Num + Args kkkk BlockSize jjjjjjjjiiiiiiii */ + + /* StackToRegisterMappingCogit>>#genPushClosureCopyCopiedValuesBytecode */ +static sqInt +genPushClosureCopyCopiedValuesBytecode(void) +{ + sqInt i; + sqInt numArgs; + sqInt numCopied; + sqInt reg; + sqInt startpc; + + assert(needsFrame); + startpc = bytecodePC + (((generatorAt(byte0))->numBytes)); + addBlockStartAtnumArgsnumCopiedspan(startpc, (numArgs = byte1 & 15), (numCopied = ((usqInt) byte1) >> 4), (((sqInt)((usqInt)(byte2) << 8))) + byte3); + /* begin genInlineClosure:numArgs:numCopied: */ + assert(getActiveContextAllocatesInMachineCode()); + voidReceiverResultRegContainsSelf(); + ssAllocateCallRegandand(ReceiverResultReg, SendNumArgsReg, ClassReg); + genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(startpc + 1, numArgs, numCopied, methodOrBlockNumArgs, methodNeedsLargeContext(methodObj), inBlock); + for (i = 1; i <= numCopied; i += 1) { + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, (ClosureFirstCopiedValueIndex + numCopied) - i, ReceiverResultReg); + } + ssPushRegister(ReceiverResultReg); + + return 0; +} + + +/* This is a version of genPushLiteralVariable: that looks ahead for a + directed super send bytecode + and does not generate any code for the dereference yet if followed by a + directed super send. + */ + + /* StackToRegisterMappingCogit>>#genPushLiteralVariableGivenDirectedSuper: */ +static sqInt NoDbgRegParms +genPushLiteralVariableGivenDirectedSuper(sqInt literalIndex) +{ + sqInt bcpc; + sqInt descriptor; + BytecodeDescriptor *descriptor1; + sqInt eA; + sqInt eB; + sqInt exta; + sqInt extb; + sqInt savedB0; + sqInt savedB1; + sqInt savedB2; + sqInt savedB3; + sqInt savedEA; + sqInt savedEB; + sqInt savedNEB; + + /* begin nextDescriptorAndExtensionsInto: */ + descriptor1 = generatorAt(byte0); + savedB0 = byte0; + savedB1 = byte1; + savedB2 = byte2; + savedB3 = byte3; + savedEA = extA; + savedEB = extB; + savedNEB = numExtB; + bcpc = bytecodePC + ((descriptor1->numBytes)); + do { + if (bcpc > endPC) { + goto l1; + } + byte0 = (fetchByteofObject(bcpc, methodObj)) + bytecodeSetOffset; + descriptor1 = generatorAt(byte0); + loadSubsequentBytesForDescriptorat(descriptor1, bcpc); + if (!((descriptor1->isExtension))) { + eA = extA; + eB = extB; + extA = savedEA; + extB = savedEB; + numExtB = savedNEB; + byte0 = savedB0; + byte1 = savedB1; + byte2 = savedB2; + byte3 = savedB3; + if ((descriptor1 != null) + && ((((descriptor1->generator)) == genExtSendSuperBytecode) + && (eB >= 64))) { + ssPushConstant(getLiteral(literalIndex)); + return 0; + } + + goto l1; + } + ((descriptor1->generator))(); + bcpc += (descriptor1->numBytes); + } while(1); +l1: /* end nextDescriptorAndExtensionsInto: */; + return genPushLiteralVariable(literalIndex); +} + + /* StackToRegisterMappingCogit>>#genPushLiteralVariable: */ +static sqInt NoDbgRegParms +genPushLiteralVariable(sqInt literalIndex) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt freeReg; + + freeReg = allocateRegNotConflictingWith(0); + + /* N.B. Do _not_ use ReceiverResultReg to avoid overwriting receiver in assignment in frameless methods. */ + /* So far descriptors are not rich enough to describe the entire dereference so generate the register + load but don't push the result. There is an order-of-evaluation issue if we defer the dereference. */ + association = getLiteral(literalIndex); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, TempReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, TempReg); + } + genEnsureObjInRegNotForwardedscratchReg(TempReg, freeReg); + genLoadSlotsourceRegdestReg(ValueIndex, TempReg, freeReg); + ssPushRegister(freeReg); + return 0; +} + + /* StackToRegisterMappingCogit>>#genPushLiteral: */ +static sqInt NoDbgRegParms +genPushLiteral(sqInt literal) +{ + return ssPushConstant(literal); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextReceiverVariable: */ +static sqInt NoDbgRegParms +genPushMaybeContextReceiverVariable(sqInt slotIndex) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + ensureReceiverResultRegContainsSelf(); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushMaybeContextRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushMaybeContextRemoteInstVarinObjectAt(sqInt slotIndex, sqInt index) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *jmpDone; + AbstractInstruction *jmpSingle; + + ssAllocateCallRegand(ReceiverResultReg, SendNumArgsReg); + genLoadTempin(index, ReceiverResultReg); + /* begin genPushMaybeContextSlotIndex: */ + assert(needsFrame); + if (CallerSavedRegisterMask & (1U << ReceiverResultReg)) { + + /* We have no way of reloading ReceiverResultReg since we need the inst var value as the result. */ + voidReceiverResultRegContainsSelf(); + } + if (slotIndex == InstructionPointerIndex) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction->annotation = IsRelativeCall); + return ssPushRegister(SendNumArgsReg); + } + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + jmpSingle = genJumpNotSmallIntegerInScratchReg(TempReg); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceFetchContextInstVarTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin Jump: */ + jmpDone = genoperand(Jump, ((sqInt)0)); + jmpTarget(jmpSingle, gLabel()); + genLoadSlotsourceRegdestReg(slotIndex, ReceiverResultReg, SendNumArgsReg); + jmpTarget(jmpDone, gLabel()); + return ssPushRegister(SendNumArgsReg); +} + + /* StackToRegisterMappingCogit>>#genPushNewArrayBytecode */ +static sqInt +genPushNewArrayBytecode(void) +{ + sqInt i; + int popValues; + sqInt size; + + assert(needsFrame); + voidReceiverResultRegContainsSelf(); + if ((popValues = byte1 > 0x7F)) { + ssFlushTo(simStackPtr); + } + else { + ssAllocateCallRegand(SendNumArgsReg, ReceiverResultReg); + } + size = byte1 & 0x7F; + if (!popValues) { + if (tryCollapseTempVectorInitializationOfSize(size)) { + return 0; + } + } + genNewArrayOfSizeinitialized(size, !popValues); + if (popValues) { + for (i = (size - 1); i >= 0; i += -1) { + /* begin PopR: */ + genoperand(PopR, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(TempReg, i, ReceiverResultReg); + } + ssPop(size); + } + return ssPushRegister(ReceiverResultReg); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverBytecode */ +static sqInt +genPushReceiverBytecode(void) +{ + if ((optStatus.isReceiverResultRegLive)) { + return ssPushRegister(ReceiverResultReg); + } + assert((registerOrNone(&simSelf)) == NoReg); + return ssPushDesc(simSelf); +} + + /* StackToRegisterMappingCogit>>#genPushReceiverVariable: */ +static sqInt NoDbgRegParms +genPushReceiverVariable(sqInt index) +{ + ensureReceiverResultRegContainsSelf(); + return ssPushBaseoffset(ReceiverResultReg, slotOffsetOfInstVarIndex(index)); +} + + +/* Ensure that the register args are pushed before the retpc for methods with + arity <= self numRegArgs. + */ +/* This won't be as clumsy on a RISC. But putting the receiver and + args above the return address means the CoInterpreter has a + single machine-code frame format which saves us a lot of work. */ + + /* StackToRegisterMappingCogit>>#genPushRegisterArgs */ +static void +genPushRegisterArgs(void) +{ + if (!(regArgsHaveBeenPushed + || (methodOrBlockNumArgs > 2))) { + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); + regArgsHaveBeenPushed = 1; + } +} + + /* StackToRegisterMappingCogit>>#genPushRemoteInstVar:inObjectAt: */ +static sqInt NoDbgRegParms +genPushRemoteInstVarinObjectAt(sqInt index, sqInt objectIndex) +{ + sqInt objectReg; + sqInt regMask; + sqInt resultReg; + + assert(needsFrame); + objectReg = allocateRegNotConflictingWith(0); + genLoadTempin(objectIndex, objectReg); + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << objectReg; + resultReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (resultReg == NoReg) { + resultReg = objectReg; + } + genLoadSlotsourceRegdestReg(byte1, objectReg, resultReg); + return ssPushRegister(resultReg); +} + + /* StackToRegisterMappingCogit>>#genPushRemoteTempLongBytecode */ +static sqInt +genPushRemoteTempLongBytecode(void) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt regMask; + sqInt remoteTempReg; + sqInt tempVectReg; + + tempVectReg = allocateRegNotConflictingWith(0); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(byte2); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, tempVectReg); + /* begin availableRegOrNoneNotConflictingWith: */ + regMask = 1U << tempVectReg; + remoteTempReg = availableRegisterOrNoneFor(backEnd, (liveRegisters()) | regMask); + if (remoteTempReg == NoReg) { + remoteTempReg = tempVectReg; + } + genLoadSlotsourceRegdestReg(byte1, tempVectReg, remoteTempReg); + return ssPushRegister(remoteTempReg); +} + + +/* If a frameless method (not a block), only argument temps can be accessed. + This is assured by the use of needsFrameIfMod16GENumArgs: in pushTemp. */ + + /* StackToRegisterMappingCogit>>#genPushTemporaryVariable: */ +static sqInt NoDbgRegParms +genPushTemporaryVariable(sqInt index) +{ + assert((inBlock > 0) + || (needsFrame + || (index < methodOrBlockNumArgs))); + return ssPushDesc(simStack[index]); +} + + +/* In a frameless method ReceiverResultReg already contains self. + In a frameful method, ReceiverResultReg /may/ contain self. */ + + /* StackToRegisterMappingCogit>>#genReturnReceiver */ +static sqInt +genReturnReceiver(void) +{ + if (needsFrame) { + if (!((optStatus.isReceiverResultRegLive))) { + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + } + } + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromBlock */ +static sqInt +genReturnTopFromBlock(void) +{ + assert(inBlock > 0); + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genBlockReturn(); +} + + /* StackToRegisterMappingCogit>>#genReturnTopFromMethod */ +static sqInt +genReturnTopFromMethod(void) +{ + popToReg(ssTop(), ReceiverResultReg); + ssPop(1); + return genUpArrowReturn(); +} + + /* StackToRegisterMappingCogit>>#genSendDirectedSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendDirectedSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + assert((((ssTop())->type)) == SSConstant); + tempOop = ((ssTop())->constant); + ssPop(1); + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, directedSuperSendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSendSuper:numArgs: */ +static sqInt NoDbgRegParms +genSendSupernumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, superSendTrampolines); +} + + +/* Generate a trampoline with four arguments. + Hack: a negative value indicates an abstract register, a non-negative + value indicates a constant. */ + + /* StackToRegisterMappingCogit>>#genSendTrampolineFor:numArgs:called:arg:arg:arg:arg: */ +static sqInt NoDbgRegParms +genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3) +{ + sqInt routine; + sqInt startAddress; + + startAddress = methodZoneBase; + zeroOpcodeIndex(); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); + /* begin selectorIndexDereferenceRoutine */ + routine = null; + if (!(routine == null)) { + /* begin Call: */ + genoperand(Call, routine); + } + genTrampolineForcallednumArgsargargargargregsToSavepushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, NoReg, 1); + return startAddress; +} + + /* StackToRegisterMappingCogit>>#genSend:numArgs: */ +static sqInt NoDbgRegParms +genSendnumArgs(sqInt selectorIndex, sqInt numArgs) +{ + marshallSendArguments(numArgs); + return genMarshalledSendnumArgssendTable(selectorIndex, numArgs, ordinarySendTrampolines); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorArithmetic */ +static sqInt +genSpecialSelectorArithmetic(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + AbstractInstruction *anInstruction3; + AbstractInstruction *anInstruction4; + AbstractInstruction *anInstruction5; + AbstractInstruction *anInstruction6; + AbstractInstruction *anInstruction7; + sqInt argInt; + int argIsConst; + sqInt argIsInt; + sqInt index; + AbstractInstruction *jumpContinue; + AbstractInstruction *jumpNotSmallInts; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int rcvrIsConst; + sqInt rcvrIsInt; + sqInt result; + + primDescriptor = generatorAt(byte0); + argIsInt = ((argIsConst = (((ssTop())->type)) == SSConstant)) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((rcvrIsConst = (((ssValue(1))->type)) == SSConstant)) + && ((((rcvrInt = ((ssValue(1))->constant))) & 1)); + if (argIsInt + && (rcvrIsInt)) { + rcvrInt = (rcvrInt >> 1); + argInt = (argInt >> 1); + + switch ((primDescriptor->opcode)) { + case AddRR: + result = rcvrInt + argInt; + break; + case SubRR: + result = rcvrInt - argInt; + break; + case AndRR: + result = rcvrInt & argInt; + break; + case OrRR: + result = rcvrInt | argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + if (isIntegerValue(result)) { + + /* Must annotate the bytecode for correct pc mapping. */ + return (ssPop(2), + ssPushAnnotatedConstant((((usqInt)result << 1) | 1))); + } + return genSpecialSelectorSend(); + } + if ((rcvrIsConst + && (!rcvrIsInt)) + || (argIsConst + && (!argIsInt))) { + return genSpecialSelectorSend(); + } + if (!(argIsInt + || (rcvrIsInt))) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + ssFlushTo(simStackPtr - 2); + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + + switch ((primDescriptor->opcode)) { + case AddRR: + if (argIsInt) { + /* begin AddCq:R: */ + anInstruction5 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin SubCq:R: */ + anInstruction = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + } + else { + genRemoveSmallIntegerTagsInScratchReg(ReceiverResultReg); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + if (rcvrIsInt) { + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, rcvrInt, ReceiverResultReg); + } + else { + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(ReceiverResultReg); + } + } + break; + case SubRR: + if (argIsInt) { + /* begin SubCq:R: */ + anInstruction2 = genoperandoperand(SubCqR, argInt - ConstZero, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddCq:R: */ + anInstruction6 = genoperandoperand(AddCqR, argInt - ConstZero, ReceiverResultReg); + } + else { + genRemoveSmallIntegerTagsInScratchReg(Arg0Reg); + /* begin SubR:R: */ + genoperandoperand(SubRR, Arg0Reg, ReceiverResultReg); + /* begin JumpNoOverflow: */ + jumpContinue = genConditionalBranchoperand(JumpNoOverflow, ((sqInt)0)); + /* begin AddR:R: */ + genoperandoperand(AddRR, Arg0Reg, ReceiverResultReg); + genSetSmallIntegerTagsIn(Arg0Reg); + } + break; + case AndRR: + if (argIsInt) { + /* begin AndCq:R: */ + anInstruction7 = genoperandoperand(AndCqR, argInt, ReceiverResultReg); + } + else { + /* begin AndR:R: */ + genoperandoperand(AndRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + case OrRR: + if (argIsInt) { + /* begin OrCq:R: */ + anInstruction3 = genoperandoperand(OrCqR, argInt, ReceiverResultReg); + } + else { + /* begin OrR:R: */ + genoperandoperand(OrRR, Arg0Reg, ReceiverResultReg); + } + /* begin Jump: */ + jumpContinue = genoperand(Jump, ((sqInt)0)); + break; + default: + error("Case not found and no otherwise clause"); + } + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction4 = genoperandoperand(MoveCqR, argInt, Arg0Reg); + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); + jmpTarget(jumpContinue, gLabel()); + return 0; +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorClass */ +static sqInt +genSpecialSelectorClass(void) +{ + sqInt topReg; + + topReg = registerOrNone(ssTop()); + ssPop(1); + if ((topReg == NoReg) + || (topReg == ClassReg)) { + ssAllocateRequiredRegand((topReg = SendNumArgsReg), ClassReg); + } + else { + ssAllocateRequiredReg(ClassReg); + } + ssPush(1); + popToReg(ssTop(), topReg); + genGetClassObjectOfintoscratchReginstRegIsReceiver(topReg, ClassReg, TempReg, 0); + return (ssPop(1), + ssPushRegister(ClassReg)); +} + + /* StackToRegisterMappingCogit>>#genSpecialSelectorComparison */ +static sqInt +genSpecialSelectorComparison(void) +{ + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + sqInt argInt; + sqInt argIsInt; + BytecodeDescriptor *branchDescriptor; + BytecodeDescriptor *branchDescriptor1; + sqInt descr; + sqInt index; + sqInt inlineCAB; + AbstractInstruction *jumpNotSmallInts; + void *jumpTarget; + sqInt nExts; + sqInt next; + sqInt nextPC; + sqInt nextPC1; + sqInt postBranch; + sqInt postBranchPC; + sqInt postBranchPC1; + BytecodeDescriptor *primDescriptor; + BytecodeDescriptor *primDescriptor1; + sqInt rcvrIsInt; + sqInt target; + sqInt targetBytecodePC; + sqInt targetBytecodePC1; + + ssFlushTo(simStackPtr - 2); + primDescriptor = generatorAt(byte0); + argIsInt = ((((ssTop())->type)) == SSConstant) + && ((((argInt = ((ssTop())->constant))) & 1)); + rcvrIsInt = ((((ssValue(1))->type)) == SSConstant) + && (((((ssValue(1))->constant)) & 1)); + if (argIsInt + && (rcvrIsInt)) { + return genStaticallyResolvedSpecialSelectorComparison(); + } + /* begin extractMaybeBranchDescriptorInto: */ + primDescriptor1 = generatorAt(byte0); + nextPC1 = bytecodePC + ((primDescriptor1->numBytes)); + nExts = 0; + while (1) { + branchDescriptor1 = generatorAt((fetchByteofObject(nextPC1, methodObj)) + bytecodeSetOffset); + if (!((branchDescriptor1->isExtension))) break; + nExts += 1; + nextPC1 += (branchDescriptor1->numBytes); + } + targetBytecodePC1 = (postBranchPC1 = 0); + if (((branchDescriptor1->isBranchTrue)) + || ((branchDescriptor1->isBranchFalse))) { + targetBytecodePC1 = (nextPC1 + ((branchDescriptor1->numBytes))) + (((branchDescriptor1->spanFunction))(branchDescriptor1, nextPC1, nExts, methodObj)); + postBranchPC1 = nextPC1 + ((branchDescriptor1->numBytes)); + } + branchDescriptor = branchDescriptor1; + nextPC = nextPC1; + postBranchPC = postBranchPC1; + targetBytecodePC = targetBytecodePC1; + + + /* Further, only interested in inlining = and ~= if there's a SmallInteger constant involved. + The relational operators successfully statically predict SmallIntegers; the equality operators do not. */ + inlineCAB = ((branchDescriptor->isBranchTrue)) + || ((branchDescriptor->isBranchFalse)); + if (inlineCAB + && ((((primDescriptor->opcode)) == JumpZero) + || (((primDescriptor->opcode)) == JumpNonZero))) { + inlineCAB = argIsInt + || (rcvrIsInt); + } + if (!inlineCAB) { + return genSpecialSelectorSend(); + } + if (argIsInt) { + popToReg(ssValue(1), ReceiverResultReg); + ssPop(2); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, ReceiverResultReg, TempReg); + } + else { + marshallSendArguments(1); + /* begin MoveR:R: */ + genoperandoperand(MoveRR, Arg0Reg, TempReg); + } + if (argIsInt + || (rcvrIsInt)) { + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + else { + /* begin genJumpNotSmallIntegersIn:andScratch:scratch: */ + genoperandoperand(AndRR, ReceiverResultReg, TempReg); + jumpNotSmallInts = genJumpNotSmallIntegerInScratchReg(TempReg); + } + if (argIsInt) { + /* begin CmpCq:R: */ + anInstruction1 = genoperandoperand(CmpCqR, argInt, ReceiverResultReg); + } + else { + /* begin CmpR:R: */ + genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg); + } + genConditionalBranchoperand(((branchDescriptor->isBranchTrue) + ? (primDescriptor->opcode) + : inverseBranchFor((primDescriptor->opcode))), ((usqInt)(ensureNonMergeFixupAt(targetBytecodePC - initialPC)))); + /* begin Jump: */ + jumpTarget = ensureNonMergeFixupAt(postBranchPC - initialPC); + genoperand(Jump, ((sqInt)jumpTarget)); + jmpTarget(jumpNotSmallInts, gLabel()); + if (argIsInt) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, argInt, Arg0Reg); + } + index = byte0 - ((bytecodeSetOffset == 256 + ? AltFirstSpecialSelector + 256 + : FirstSpecialSelector)); + return genMarshalledSendnumArgssendTable((-index) - 1, 1, ordinarySendTrampolines); +} + + +/* Assumes both operands are ints */ + + /* StackToRegisterMappingCogit>>#genStaticallyResolvedSpecialSelectorComparison */ +static sqInt +genStaticallyResolvedSpecialSelectorComparison(void) +{ + sqInt argInt; + BytecodeDescriptor *primDescriptor; + sqInt rcvrInt; + int result; + + primDescriptor = generatorAt(byte0); + argInt = ((ssTop())->constant); + rcvrInt = ((ssValue(1))->constant); + + switch ((primDescriptor->opcode)) { + case JumpLess: + result = rcvrInt < argInt; + break; + case JumpLessOrEqual: + result = rcvrInt <= argInt; + break; + case JumpGreater: + result = rcvrInt > argInt; + break; + case JumpGreaterOrEqual: + result = rcvrInt >= argInt; + break; + case JumpZero: + result = rcvrInt == argInt; + break; + case JumpNonZero: + result = rcvrInt != argInt; + break; + default: + error("Case not found and no otherwise clause"); + } + ssPop(2); + return ssPushAnnotatedConstant((result + ? trueObject() + : falseObject())); +} + + +/* We need a frame because the association has to be in ReceiverResultReg for + the various trampolines + and ReceiverResultReg holds only the receiver in frameless methods. + */ + + /* StackToRegisterMappingCogit>>#genStorePop:LiteralVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopLiteralVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt litVarIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *anInstruction; + sqInt association; + sqInt topReg; + + assert(needsFrame); + /* begin genLoadLiteralVariable:in: */ + association = getLiteral(litVarIndex); + voidReceiverResultRegContainsSelf(); + + ssAllocateRequiredReg(ReceiverResultReg); + /* begin genMoveConstant:R: */ + if (shouldAnnotateObjectReference(association)) { + annotateobjRef(gMoveCwR(association, ReceiverResultReg), association); + } + else { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, association, ReceiverResultReg); + } + genEnsureObjInRegNotForwardedscratchReg(ReceiverResultReg, TempReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, ValueIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, ValueIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin putSelfInReceiverResultReg */ + storeToReg((&simSelf), ReceiverResultReg); + + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + +/* The reason we need a frame here is that assigning to an inst var of a + context may + involve wholesale reorganization of stack pages, and the only way to + preserve the + execution state of an activation in that case is if it has a frame. */ + + /* StackToRegisterMappingCogit>>#genStorePop:MaybeContextRemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopMaybeContextRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + AbstractInstruction *abstractInstruction2; + AbstractInstruction *abstractInstruction3; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *immutabilityFailure; + AbstractInstruction *mutableJump; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + assert(needsFrame); + +# if IMMUTABILITY + if (needsImmCheck) { + mutableJump = genJumpMutablescratchReg(ReceiverResultReg, TempReg); + /* begin genStoreTrampolineCall: */ + if (slotIndex >= (NumStoreTrampolines - 1)) { + /* begin MoveCq:R: */ + anInstruction = genoperandoperand(MoveCqR, slotIndex, TempReg); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceStoreTrampolines[NumStoreTrampolines - 1]); + (abstractInstruction1->annotation = IsRelativeCall); + } + else { + /* begin CallRT: */ + abstractInstruction2 = genoperand(Call, ceStoreTrampolines[slotIndex]); + (abstractInstruction2->annotation = IsRelativeCall); + } + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + /* begin Jump: */ + immutabilityFailure = genoperand(Jump, ((sqInt)0)); + jmpTarget(mutableJump, gLabel()); + } + +# endif /* IMMUTABILITY */ + + ssPop(1); + ssAllocateCallRegand(ClassReg, SendNumArgsReg); + ssPush(1); + genLoadSlotsourceRegdestReg(SenderIndex, ReceiverResultReg, TempReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + /* begin MoveCq:R: */ + anInstruction1 = genoperandoperand(MoveCqR, slotIndex, SendNumArgsReg); + /* begin CallRT: */ + abstractInstruction3 = genoperand(Call, ceStoreContextInstVarTrampoline); + (abstractInstruction3->annotation = IsRelativeCall); + +# if IMMUTABILITY + if (needsImmCheck) { + jmpTarget(immutabilityFailure, gLabel()); + } + +# endif /* IMMUTABILITY */ + + return 0; +} + + /* StackToRegisterMappingCogit>>#genStorePop:ReceiverVariable:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopReceiverVariableneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt needsImmCheck1; + sqInt needsStoreCheck1; + sqInt topReg; + + ssFlushUpThroughReceiverVariable(slotIndex); + ensureReceiverResultRegContainsSelf(); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + needsStoreCheck1 = (!useTwoPaths) + && (needsStoreCheck); + needsImmCheck1 = needsImmCheck + && (!useTwoPaths); + +# if IMMUTABILITY + if (needsImmCheck1) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck1, 1); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck1); +} + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteInstVarofObjectAtneedsStoreCheckneedsImmutabilityCheck(sqInt popBoolean, sqInt slotIndex, sqInt objectIndex, sqInt needsStoreCheck, sqInt needsImmCheck) +{ + sqInt topReg; + + assert(needsFrame); + genLoadTempin(objectIndex, ReceiverResultReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + if (needsImmCheck) { + ssAllocateRequiredReg(ClassReg); + ssStoreAndReplacePoptoReg(popBoolean, ClassReg); + ssFlushTo(simStackPtr); + return genStoreWithImmutabilityCheckSourceRegslotIndexdestRegscratchRegneedsStoreCheckneedRestoreRcvr(ClassReg, slotIndex, ReceiverResultReg, TempReg, needsStoreCheck, 0); + } + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + +/* The only reason we assert needsFrame here is that in a frameless method + ReceiverResultReg must and does contain only self, but the ceStoreCheck + trampoline expects the target of the store to be in ReceiverResultReg. So + in a frameless method we would have a conflict between the receiver and + the temote temp store, unless we we smart enough to realise that + ReceiverResultReg was unused after the literal variable store, unlikely + given that methods return self by default. */ + + /* StackToRegisterMappingCogit>>#genStorePop:RemoteTemp:At:needsStoreCheck: */ +static sqInt NoDbgRegParms +genStorePopRemoteTempAtneedsStoreCheck(sqInt popBoolean, sqInt slotIndex, sqInt remoteTempIndex, sqInt needsStoreCheck) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt topReg; + + assert(needsFrame); + ssAllocateRequiredReg(ReceiverResultReg); + voidReceiverResultRegContainsSelf(); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfTemporary(remoteTempIndex); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, ReceiverResultReg); + /* begin genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: */ + +# if IMMUTABILITY + +# endif /* IMMUTABILITY */ + + topReg = allocateRegForStackEntryAtnotConflictingWith(0, 1U << ReceiverResultReg); + ssStorePoptoReg(popBoolean, topReg); + return genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(topReg, slotIndex, ReceiverResultReg, TempReg, needsFrame, needsStoreCheck); +} + + /* StackToRegisterMappingCogit>>#genStorePop:TemporaryVariable: */ +static sqInt NoDbgRegParms +genStorePopTemporaryVariable(sqInt popBoolean, sqInt tempIndex) +{ + AbstractInstruction *anInstruction; + sqInt offset; + sqInt reg; + + ssFlushUpThroughTemporaryVariable(tempIndex); + reg = ssStorePoptoPreferredReg(popBoolean, TempReg); + /* begin MoveR:Mw:r: */ + offset = frameOffsetOfTemporary(tempIndex); + /* begin gen:operand:quickConstant:operand: */ + anInstruction = genoperandoperandoperand(MoveRMwr, reg, offset, FPReg); + return 0; +} + + +/* Generate a method return from within a method or a block. + Frameless method activation looks like + CISCs (x86): + receiver + args + sp-> ret pc. + RISCs (ARM): + receiver + args + ret pc in LR. + A fully framed activation is described in CoInterpreter + class>initializeFrameIndices. Return pops receiver and arguments off the + stack. Callee pushes the result. */ + + /* StackToRegisterMappingCogit>>#genUpArrowReturn */ +static sqInt +genUpArrowReturn(void) +{ + AbstractInstruction *abstractInstruction; + AbstractInstruction *abstractInstruction1; + sqInt framelessReturn; + sqInt offset; + + + /* can't fall through */ + deadCode = 1; + if (inBlock > 0) { + assert(needsFrame); + /* begin CallRT: */ + abstractInstruction1 = genoperand(Call, ceNonLocalReturnTrampoline); + (abstractInstruction1->annotation = IsRelativeCall); + /* begin annotateBytecode: */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + (abstractInstruction->annotation = HasBytecodePC); + return 0; + } + +# if IMMUTABILITY + framelessReturn = needsFrame + && (!useTwoPaths); + +# else /* IMMUTABILITY */ + framelessReturn = needsFrame; + +# endif /* IMMUTABILITY */ + + if (framelessReturn) { + if (hasNativeFrame) { + leaveNativeFrame(); + } + + /* begin MoveR:R: */ + genoperandoperand(MoveRR, FPReg, SPReg); + /* begin PopR: */ + genoperand(PopR, FPReg); + /* begin PopR: */ + genoperand(PopR, LinkReg); + + /* begin RetN: */ + genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord); + } + else { + /* begin RetN: */ + offset = ((methodOrBlockNumArgs > 2) + || (regArgsHaveBeenPushed) + ? (methodOrBlockNumArgs + 1) * BytesPerWord + : 0); + genoperand(RetN, offset); + } + return 0; +} + + +/* Make sure there's a flagged fixup at the targetIndex (pc relative to first + pc) in fixups. + These are the targets of backward branches. A backward branch fixup's + simStackPtr needs to be set when generating the code for the bytecode at + the targetIndex. + Initially a fixup's target is just a flag. Later on it is replaced with a + proper instruction. */ + + /* StackToRegisterMappingCogit>>#initializeFixupAt: */ +static BytecodeFixup * NoDbgRegParms +initializeFixupAt(sqInt targetIndex) +{ + BytecodeFixup *fixup; + + fixup = fixupAt(targetIndex); + /* begin becomeMergeFixup */ + (fixup->targetInstruction) = ((AbstractInstruction *) NeedsMergeFixupFlag); + /* begin setIsBackwardBranchFixup */ + (fixup->simStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackPtr) = UnknownSimStackPtrFlag; + (fixup->simNativeStackSize) = 0; + + return fixup; +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramefulMethod: */ +static void NoDbgRegParms +initSimStackForFramefulMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSBaseOffset); + (simSelf.spilled = 1); + (simSelf.registerr = FPReg); + (simSelf.offset = FoxMFReceiver); + (optStatus.isReceiverResultRegLive = 0); + (optStatus.ssEntry = (&simSelf)); + + /* N.B. Includes num args */ + simSpillBase = methodOrBlockNumTemps; + simStackPtr = simSpillBase - 1; + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxCallerSavedIP + ((methodOrBlockNumArgs - i) * BytesPerWord)); + (desc->bcptr = startpc); + } + for (i = methodOrBlockNumArgs; i <= simStackPtr; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = FPReg); + (desc->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerWord)); + (desc->bcptr = startpc); + } +} + + +/* The register receiver (the closure itself) and args are pushed by the + closure value primitive(s) + and hence a frameless block has all arguments and copied values pushed to + the stack. However, + the method receiver (self) is put in the ReceiverResultRegister by the + block entry. */ + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessBlock: */ +static void NoDbgRegParms +initSimStackForFramelessBlock(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps >= methodOrBlockNumArgs); + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->spilled = 1); + (desc->registerr = SPReg); + (desc->offset = ((methodOrBlockNumArgs - 1) - i) * BytesPerWord); + (desc->bcptr = startpc); + } + simSpillBase = (simStackPtr = methodOrBlockNumTemps - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#initSimStackForFramelessMethod: */ +static void NoDbgRegParms +initSimStackForFramelessMethod(sqInt startpc) +{ + CogSimStackEntry *desc; + sqInt i; + + (simSelf.type = SSRegister); + (simSelf.spilled = 0); + (simSelf.registerr = ReceiverResultReg); + (optStatus.isReceiverResultRegLive = 1); + (optStatus.ssEntry = (&simSelf)); + assert(methodOrBlockNumTemps == methodOrBlockNumArgs); + assert((numRegArgs()) <= 2); + if (((methodOrBlockNumArgs >= 1) && (methodOrBlockNumArgs <= 2))) { + desc = simStackAt(0); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg0Reg); + (desc->bcptr = startpc); + if (methodOrBlockNumArgs > 1) { + desc = simStackAt(1); + (desc->type = SSRegister); + (desc->spilled = 0); + (desc->registerr = Arg1Reg); + (desc->bcptr = startpc); + } + } + else { + for (i = 0; i < methodOrBlockNumArgs; i += 1) { + desc = simStackAt(i); + (desc->type = SSBaseOffset); + (desc->registerr = SPReg); + (desc->spilled = 1); + (desc->offset = ((methodOrBlockNumArgs - 1) - i) * BytesPerWord); + (desc->bcptr = startpc); + } + } + simSpillBase = (simStackPtr = methodOrBlockNumArgs - 1); + simNativeSpillBase = (simNativeStackPtr = -1); + simNativeStackSize = 0; + +} + + /* StackToRegisterMappingCogit>>#leaveNativeFrame */ +static void +leaveNativeFrame(void) +{ + sqInt address; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt offset; + + assert(needsFrame); + /* begin MoveMw:r:R: */ + offset = frameOffsetOfPreviousNativeStackPointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, 1, TempReg); + /* begin MoveR:Aw: */ + address = nativeStackPointerAddress(); + /* begin gen:operand:literal: */ + anInstruction2 = genoperandoperand(MoveRAw, TempReg, address); +} + + /* StackToRegisterMappingCogit>>#liveFloatRegisters */ +static sqInt +liveFloatRegisters(void) +{ + sqInt i; + sqInt regsSet; + + regsSet = 0; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | 0; + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeFloatRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + /* StackToRegisterMappingCogit>>#liveRegisters */ +static sqInt +liveRegisters(void) +{ + sqInt i; + sqInt regsSet; + + if (needsFrame) { + regsSet = 0; + } + else { + /* begin registerMaskFor: */ + regsSet = 1U << ReceiverResultReg; + if ((methodOrBlockNumArgs <= 2) + && (methodOrBlockNumArgs > 0)) { + regsSet = regsSet | (1U << Arg0Reg); + if (methodOrBlockNumArgs > 1) { + regsSet = regsSet | (1U << Arg1Reg); + } + } + } + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= simStackPtr; i += 1) { + regsSet = regsSet | (registerMask(simStackAt(i))); + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= simNativeStackPtr; i += 1) { + regsSet = regsSet | (nativeRegisterMask(simNativeStackAt(i))); + } + + return regsSet; +} + + +/* insert nops for dead code that is mapped so that bc + to mc mapping is not many to one */ + + /* StackToRegisterMappingCogit>>#mapDeadDescriptorIfNeeded: */ +static sqInt NoDbgRegParms +mapDeadDescriptorIfNeeded(BytecodeDescriptor *descriptor) +{ + AbstractInstruction *abstractInstruction; + + flag("annotateInstruction"); + if (((descriptor->isMapped)) + || ((inBlock > 0) + && ((descriptor->isMappedInBlock)))) { + /* begin annotateBytecode: */ + abstractInstruction = gen(Nop); + (abstractInstruction->annotation = HasBytecodePC); + } + return 0; +} + + +/* Spill everything on the simulated stack that needs spilling (that below + receiver and arguments). + Marshall receiver and arguments to stack and/or registers depending on arg + count. If the args don't fit in registers push receiver and args (spill + everything), but still assign + the receiver to ReceiverResultReg. */ + + /* StackToRegisterMappingCogit>>#marshallSendArguments: */ +static void NoDbgRegParms +marshallSendArguments(sqInt numArgs) +{ + sqInt anyRefs; + CogSimStackEntry * cascade0; + sqInt numSpilled; + + ssFlushTo((simStackPtr - numArgs) - 1); + if (numArgs > 2) { + + /* If there are no spills and no references to ReceiverResultReg + the fetch of ReceiverResultReg from the stack can be avoided + by assigning directly to ReceiverResultReg and pushing it. */ + numSpilled = numberOfSpillsInTopNItems(numArgs + 1); + anyRefs = anyReferencesToRegisterinTopNItems(ReceiverResultReg, numArgs + 1); + if ((numSpilled > 0) + || (anyRefs)) { + ssFlushTo(simStackPtr); + storeToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + else { + cascade0 = simStackAt(simStackPtr - numArgs); + storeToReg(cascade0, ReceiverResultReg); + (cascade0->type = SSRegister); + (cascade0->registerr = ReceiverResultReg); + ssFlushTo(simStackPtr); + } + } + else { + + /* Move the args to the register arguments, being careful to do + so last to first so e.g. previous contents don't get overwritten. + Also check for any arg registers in use by other args. */ + if (numArgs > 0) { + if (numArgs > 1) { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 2); + ssAllocateRequiredRegupThrough(Arg1Reg, simStackPtr - 1); + } + else { + ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 1); + } + } + if (numArgs > 1) { + popToReg(simStackAt(simStackPtr), Arg1Reg); + } + if (numArgs > 0) { + popToReg(simStackAt((simStackPtr - numArgs) + 1), Arg0Reg); + } + popToReg(simStackAt(simStackPtr - numArgs), ReceiverResultReg); + } + ssPop(numArgs + 1); +} + + +/* For assert checking; or rather for avoiding assert fails when dealing with + the hack for block temps in the SqueakV3PlusClosures bytecode set. + */ + + /* StackToRegisterMappingCogit>>#maybeCompilingFirstPassOfBlockWithInitialPushNil */ +static sqInt +maybeCompilingFirstPassOfBlockWithInitialPushNil(void) +{ + return (inBlock == InVanillaBlock) + && ((methodOrBlockNumTemps > methodOrBlockNumArgs) + && (blockPass == 1)); +} + + +/* If this bytecode has a fixup, some kind of merge needs to be done. There + are 4 cases: + 1) the bytecode has no fixup (fixup isNotAFixup) + do nothing + 2) the bytecode has a non merge fixup + the fixup has needsNonMergeFixup. + The code generating non merge fixup (currently only special selector code) + is responsible + for the merge so no need to do it. + We set deadCode to false as the instruction can be reached from jumps. + 3) the bytecode has a merge fixup, but execution flow *cannot* fall + through to the merge point. + the fixup has needsMergeFixup and deadCode = true. + ignores the current simStack as it does not mean anything + restores the simStack to the state the jumps to the merge point expects it + to be. + 4) the bytecode has a merge fixup and execution flow *can* fall through to + the merge point. + the fixup has needsMergeFixup and deadCode = false. + flushes the stack to the stack pointer so the fall through execution path + simStack is + in the state the merge point expects it to be. + restores the simStack to the state the jumps to the merge point expects it + to be. + + In addition, if this is a backjump merge point, we patch the fixup to hold + the current simStackPtr + for later assertions. */ +/* case 1 */ + + /* StackToRegisterMappingCogit>>#mergeWithFixupIfRequired: */ +static sqInt NoDbgRegParms +mergeWithFixupIfRequired(BytecodeFixup *fixup) +{ + CogSimStackEntry * cascade0; + sqInt i; + + if (((fixup->targetInstruction)) == 0) { + return 0; + } + if ((((usqInt)((fixup->targetInstruction)))) == NeedsNonMergeFixupFlag) { + deadCode = 0; + return 0; + } + assert(isMergeFixup(fixup)); + traceMerge(fixup); + if (deadCode) { + + /* case 3 */ + simStackPtr = (fixup->simStackPtr); + simNativeStackPtr = (fixup->simNativeStackPtr); + simNativeStackSize = (fixup->simNativeStackSize); + + } + else { + + /* case 4 */ + ssFlushTo(simStackPtr); + } + deadCode = 0; + if (((fixup->simStackPtr)) == UnknownSimStackPtrFlag) { + (fixup->simStackPtr = simStackPtr); + (fixup->simNativeStackPtr = simNativeStackPtr); + (fixup->simNativeStackSize = simNativeStackSize); + + } + (fixup->targetInstruction = gLabel()); + assert(simStackPtr == ((fixup->simStackPtr))); + assert(simNativeStackPtr == ((fixup->simNativeStackPtr))); + assert(simNativeStackSize == ((fixup->simNativeStackSize))); + + /* begin restoreSimStackAtMergePoint: */ + simSpillBase = methodOrBlockNumTemps; + /* begin voidReceiverOptStatus */ + (optStatus.isReceiverResultRegLive = 0); + for (i = methodOrBlockNumTemps; i <= simStackPtr; i += 1) { + cascade0 = simStackAt(i); + (cascade0->type = SSSpill); + (cascade0->offset = FoxMFReceiver - (((i - methodOrBlockNumArgs) + 1) * BytesPerOop)); + (cascade0->registerr = FPReg); + (cascade0->spilled = 1); + } + for (i = 0; i <= simNativeStackPtr; i += 1) { + ensureIsMarkedAsSpilled(simNativeStackAt(i)); + } + simNativeSpillBase = simNativeStackPtr + 1; + + return 0; +} + + /* StackToRegisterMappingCogit>>#methodAbortTrampolineFor: */ +static sqInt NoDbgRegParms +methodAbortTrampolineFor(sqInt numArgs) +{ + return methodAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#needsFrameIfMod16GENumArgs: */ +static sqInt NoDbgRegParms +needsFrameIfMod16GENumArgs(sqInt stackDelta) +{ + return (byte0 % 16) >= methodOrBlockNumArgs; +} + + +/* As of August 2013, the code generator can't deal with spills in frameless + methods (the + issue is to do with the stack offset to get at an argument, which is + changed when there's a spill). + In e.g. TextColor>>#dominates: other ^other class == self class the second + send of class + needs also rto allocate a register that the first one used, but the first + one's register can't be + spilled. So avoid this by only allowing class to be sent if the stack + contains a single element. */ + + /* StackToRegisterMappingCogit>>#needsFrameIfStackGreaterThanOne: */ +static sqInt NoDbgRegParms +needsFrameIfStackGreaterThanOne(sqInt stackDelta) +{ + return stackDelta > 1; +} + + /* StackToRegisterMappingCogit>>#numberOfSpillsInTopNItems: */ +static sqInt NoDbgRegParms +numberOfSpillsInTopNItems(sqInt n) +{ + sqInt i; + + for (i = simStackPtr; i >= ((simStackPtr - n) + 1); i += -1) { + if ((((simStackAt(i))->type)) == SSSpill) { + return n - (simStackPtr - i); + } + } + return 0; +} + + /* StackToRegisterMappingCogit>>#picAbortTrampolineFor: */ +static sqInt NoDbgRegParms +picAbortTrampolineFor(sqInt numArgs) +{ + return picAbortTrampolines[((numArgs < (2 + 1)) ? numArgs : (2 + 1))]; +} + + /* StackToRegisterMappingCogit>>#prevInstIsPCAnnotated */ +static sqInt +prevInstIsPCAnnotated(void) +{ + sqInt prevIndex; + AbstractInstruction *prevInst; + + if (!(opcodeIndex > 0)) { + return 0; + } + prevIndex = opcodeIndex - 1; + while (1) { + if (prevIndex <= 0) { + return 0; + } + prevInst = abstractInstructionAt(prevIndex); + if (isPCMappedAnnotation((!((prevInst->annotation)) + ? 0 + : (prevInst->annotation)))) { + return 1; + } + if (!(((prevInst->opcode)) == Label)) break; + prevIndex -= 1; + } + return 0; +} + + /* StackToRegisterMappingCogit>>#pushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +pushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + sqInt (* const pushNilSizeFunction)(sqInt,sqInt) = squeakV3orSistaV1PushNilSizenumInitialNils; + + return pushNilSizeFunction(aMethodObj, numInitialNils); +} + + +/* When a block must be recompiled due to overestimating the + numInitialNils fixups must be restored, which means rescannning + since backward branches need their targets initialized. */ + + /* StackToRegisterMappingCogit>>#reinitializeFixupsFrom:through: */ +static void NoDbgRegParms +reinitializeFixupsFromthrough(sqInt start, sqInt end) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt nExts; + sqInt pc; + BytecodeFixup * self_in_reinitialize; + sqInt targetPC; + + pc = start; + nExts = 0; + while (pc <= end) { + /* begin reinitialize */ + self_in_reinitialize = fixupAt(pc - initialPC); + (self_in_reinitialize->targetInstruction) = 0; + (self_in_reinitialize->simStackPtr) = 0; + (self_in_reinitialize->simNativeStackPtr) = 0; + + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((isBranch(descriptor)) + && ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0))) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + initializeFixupAt(targetPC - initialPC); + } + if ((descriptor->isBlockCreation)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + pc = (pc + ((descriptor->numBytes))) + distance; + } + else { + pc += (descriptor->numBytes); + } + nExts = ((descriptor->isExtension) + ? nExts + 1 + : 0); + } +} + + +/* Scan the block to determine if the block needs a frame or not */ + + /* StackToRegisterMappingCogit>>#scanBlock: */ +static sqInt NoDbgRegParms +scanBlock(BlockStart *blockStart) +{ + BytecodeDescriptor *descriptor; + sqInt end; + sqInt framelessStackDelta; + sqInt nExts; + sqInt numPushNils; + sqInt (* const numPushNilsFunction)(struct _BytecodeDescriptor *,sqInt,sqInt,sqInt) = squeakV3orSistaV1NumPushNils; + sqInt pc; + sqInt pushingNils; + + needsFrame = 0; + hasNativeFrame = 0; + + prevBCDescriptor = null; + methodOrBlockNumArgs = (blockStart->numArgs); + inBlock = InVanillaBlock; + pc = (blockStart->startpc); + end = ((blockStart->startpc)) + ((blockStart->span)); + framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0)))); + pushingNils = 1; + while (pc < end) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + needsFrame = 1; + } + else { + framelessStackDelta += (descriptor->stackDelta); + } + } + /* begin maybeNoteDescriptor:blockStart: */ + if ((descriptor->isInstVarRef)) { + (blockStart->hasInstVarRef = 1); + } + if (pushingNils + && (!((descriptor->isExtension)))) { + + /* Count the initial number of pushed nils acting as temp initializers. We can't tell + whether an initial pushNil is an operand reference or a temp initializer, except + when the pushNil is a jump target (has a fixup), which never happens: + self systemNavigation browseAllSelect: + [:m| | ebc | + (ebc := m embeddedBlockClosures + select: [:ea| ea decompile statements first isMessage] + thenCollect: [:ea| ea decompile statements first selector]) notEmpty + and: [(#(whileTrue whileFalse whileTrue: whileFalse:) intersection: ebc) notEmpty]] + or if the bytecode set has a push multiple nils bytecode. We simply count initial nils. + Rarely we may end up over-estimating. We will correct by checking the stack depth + at the end of the block in compileBlockBodies. */ + if (((numPushNils = numPushNilsFunction(descriptor, pc, nExts, methodObj))) > 0) { + assert((((descriptor->numBytes)) == 1) + || (((descriptor->generator)) == genPushClosureTempsBytecode)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) + numPushNils); + } + else { + pushingNils = 0; + } + } + /* begin nextBytecodePCFor:at:exts:in: */ + pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation) + ? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj) + : 0)); + if ((descriptor->isExtension)) { + nExts += 1; + } + else { + nExts = (extA = (numExtB = (extB = 0))); + } + prevBCDescriptor = descriptor; + } + if (!needsFrame) { + assert((framelessStackDelta >= 0) + && (((blockStart->numInitialNils)) >= framelessStackDelta)); + (blockStart->numInitialNils = ((blockStart->numInitialNils)) - framelessStackDelta); + } + return 0; +} + + +/* Scan the method (and all embedded blocks) to determine + - what the last bytecode is; extra bytes at the end of a method are used + to encode things like source pointers or temp names + - if the method needs a frame or not + - what are the targets of any backward branches. + - how many blocks it creates + Answer the block count or on error a negative error code */ + + /* StackToRegisterMappingCogit>>#scanMethod */ +static sqInt +scanMethod(void) +{ + BytecodeDescriptor *descriptor; + sqInt distance; + sqInt framelessStackDelta; + sqInt latestContinuation; + sqInt nExts; + sqInt numBlocks; + sqInt pc; + sqInt seenInstVarStore; + sqInt targetPC; + + needsFrame = (useTwoPaths = (seenInstVarStore = 0)); + hasNativeFrame = 0; + + prevBCDescriptor = null; + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { + return 0; + } + pc = (latestContinuation = initialPC); + numBlocks = (framelessStackDelta = (nExts = (extA = (numExtB = (extB = 0))))); + while (pc <= endPC) { + byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset; + descriptor = generatorAt(byte0); + if ((descriptor->isExtension)) { + if (((descriptor->opcode)) == Nop) { + + /* unknown bytecode tag; see Cogit class>>#generatorTableFrom: */ + return EncounteredUnknownBytecode; + } + loadSubsequentBytesForDescriptorat(descriptor, pc); + ((descriptor->generator))(); + } + if (((descriptor->isReturn)) + && (pc >= latestContinuation)) { + endPC = pc; + } + if (!needsFrame) { + if ((((descriptor->needsFrameFunction)) == null) + || (((descriptor->needsFrameFunction))(framelessStackDelta))) { + + /* With immutability we win simply by avoiding a frame build if the receiver is young and not immutable. */ + +# if IMMUTABILITY + if ((descriptor->is1ByteInstVarStore)) { + useTwoPaths = 1; + } + else { + needsFrame = 1; + useTwoPaths = 0; + } + +# else /* IMMUTABILITY */ + needsFrame = 1; + useTwoPaths = 0; + +# endif /* IMMUTABILITY */ + + } + else { + + /* Without immutability we win if there are two or more stores and the receiver is new. */ + framelessStackDelta += (descriptor->stackDelta); + +# if IMMUTABILITY + +# else /* IMMUTABILITY */ + if ((descriptor->is1ByteInstVarStore)) { + if (seenInstVarStore) { + useTwoPaths = 1; + } + else { + seenInstVarStore = 1; + } + } + +# endif /* IMMUTABILITY */ + + } + } + if (isBranch(descriptor)) { + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + if ((assert(((descriptor->spanFunction)) != null), + (((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)) < 0)) { + initializeFixupAt(targetPC - initialPC); + } + else { + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + } + if ((descriptor->isBlockCreation)) { + numBlocks += 1; + /* begin spanFor:at:exts:in: */ + distance = ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj); + targetPC = (pc + ((descriptor->numBytes))) + distance; + latestContinuation = ((latestContinuation < targetPC) ? targetPC : latestContinuation); + } + pc += (descriptor->numBytes); + nExts = ((descriptor->isExtension) + ? nExts + 1 + : (extA = (numExtB = (extB = 0)))); + prevBCDescriptor = descriptor; + } + return numBlocks; +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1PushNilSize:numInitialNils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) +{ + return (methodUsesAlternateBytecodeSet(aMethodObj) + ? (/* begin sistaV1PushNilSize:numInitialNils: */ + numInitialNils) + : numInitialNils); +} + + /* StackToRegisterMappingCogit>>#squeakV3orSistaV1:Num:Push:Nils: */ +static sqInt NoDbgRegParms +squeakV3orSistaV1NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) +{ + return (bytecodeSetOffset == 0 + ? (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0) + : (/* begin sistaV1:Num:Push:Nils: */ + (((descriptor->generator)) == genPushConstantNilBytecode + ? 1 + : 0))); +} + + +/* Allocate a register needed in a run-time call (i.e. flush uses of the + register to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg: */ +static void NoDbgRegParms +ssAllocateCallReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | (1U << requiredReg), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and: */ +static void NoDbgRegParms +ssAllocateCallRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | (1U << requiredReg2)), simStackPtr); +} + + +/* Allocate registers needed in a run-time call (i.e. flush uses of the + registers to the real stack). Since the run-time can smash any and + all caller-saved registers also flush all caller-saved registers. */ + + /* StackToRegisterMappingCogit>>#ssAllocateCallReg:and:and: */ +static void NoDbgRegParms +ssAllocateCallRegandand(sqInt requiredReg1, sqInt requiredReg2, sqInt requiredReg3) +{ + ssAllocateRequiredRegMaskupThrough(CallerSavedRegisterMask | ((1U << requiredReg1) | ((1U << requiredReg2) | (1U << requiredReg3))), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredFloatRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + liveRegs = NoReg; + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if ((0 & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveFloatRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredFloatReg: */ +static void NoDbgRegParms +ssAllocateRequiredFloatReg(sqInt requiredReg) +{ + ssAllocateRequiredFloatRegMaskupThroughupThroughNative(1U << requiredReg, simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThrough(sqInt requiredRegsMask, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThroughupThroughNative(requiredRegsMask, stackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredRegMask:upThrough:upThroughNative: */ +static void NoDbgRegParms +ssAllocateRequiredRegMaskupThroughupThroughNative(sqInt requiredRegsMask, sqInt stackPtr, sqInt nativeStackPtr) +{ + sqInt i; + sqInt lastRequired; + sqInt lastRequiredNative; + sqInt liveRegs; + + lastRequired = -1; + + /* compute live regs while noting the last occurrence of required regs. + If these are not free we must spill from simSpillBase to last occurrence. + Note we are conservative here; we could allocate FPReg in frameless methods. */ + lastRequiredNative = -1; + /* begin registerMaskFor:and: */ + liveRegs = (1U << FPReg) | (1U << SPReg); + for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <= stackPtr; i += 1) { + liveRegs = liveRegs | (registerMask(simStackAt(i))); + if (((registerMask(simStackAt(i))) & requiredRegsMask) != 0) { + lastRequired = i; + } + } + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= nativeStackPtr; i += 1) { + liveRegs = liveRegs | (nativeRegisterMask(simNativeStackAt(i))); + if (((nativeRegisterMask(simNativeStackAt(i))) & requiredRegsMask) != 0) { + lastRequiredNative = i; + } + } + + if (!((liveRegs & requiredRegsMask) == 0)) { + + /* Some live, must spill */ + ssFlushTonativeFlushTo(lastRequired, lastRequiredNative); + assert(((liveRegisters()) & requiredRegsMask) == 0); + } +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg: */ +static void NoDbgRegParms +ssAllocateRequiredReg(sqInt requiredReg) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:and: */ +static void NoDbgRegParms +ssAllocateRequiredRegand(sqInt requiredReg1, sqInt requiredReg2) +{ + ssAllocateRequiredRegMaskupThrough((1U << requiredReg1) | (1U << requiredReg2), simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssAllocateRequiredReg:upThrough: */ +static void NoDbgRegParms +ssAllocateRequiredRegupThrough(sqInt requiredReg, sqInt stackPtr) +{ + ssAllocateRequiredRegMaskupThrough(1U << requiredReg, stackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushAll */ +static void +ssFlushAll(void) +{ + ssFlushTonativeFlushTo(simStackPtr, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo: */ +static void NoDbgRegParms +ssFlushTo(sqInt index) +{ + ssFlushTonativeFlushTo(index, simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssFlushTo:nativeFlushTo: */ +static void NoDbgRegParms +ssFlushTonativeFlushTo(sqInt index, sqInt nativeIndex) +{ + sqInt i; + + ssNativeFlushTo(nativeIndex); + + for (i = 0; i < methodOrBlockNumTemps; i += 1) { + assert(((((simStackAt(i))->type)) == SSBaseOffset) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil())); + } + for (i = methodOrBlockNumTemps; i < simSpillBase; i += 1) { + assert(((simStackAt(i))->spilled)); + } + if (simSpillBase <= index) { + for (i = (((simSpillBase < methodOrBlockNumTemps) ? methodOrBlockNumTemps : simSpillBase)); i <= index; i += 1) { + assert(needsFrame); + ensureSpilledAtfrom(simStackAt(i), frameOffsetOfTemporary(i), FPReg); + } + simSpillBase = index + 1; + } +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughReceiverVariable: */ +static void NoDbgRegParms +ssFlushUpThroughReceiverVariable(sqInt slotIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == ReceiverResultReg) + && ((((simStackAt(index))->offset)) == (slotOffsetOfInstVarIndex(slotIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + +/* Any occurrences on the stack of the value being stored (which is the top + of stack) + must be flushed, and hence any values colder than them stack. */ + + /* StackToRegisterMappingCogit>>#ssFlushUpThroughTemporaryVariable: */ +static void NoDbgRegParms +ssFlushUpThroughTemporaryVariable(sqInt tempIndex) +{ + CogSimStackEntry *desc; + sqInt index; + + ssNativeFlushTo(simNativeStackPtr); + + /* begin ssFlushUpThrough: */ + for (index = (simStackPtr - 1); index >= (((simSpillBase < 0) ? 0 : simSpillBase)); index += -1) { + if (((((simStackAt(index))->type)) == SSBaseOffset) + && (((((simStackAt(index))->registerr)) == FPReg) + && ((((simStackAt(index))->offset)) == (frameOffsetOfTemporary(tempIndex))))) { + ssFlushTo(index); + goto l1; + } + } +l1: /* end ssFlushUpThrough: */; +} + + /* StackToRegisterMappingCogit>>#ssNativeFlushTo: */ +static void NoDbgRegParms +ssNativeFlushTo(sqInt index) +{ + sqInt allocatedScratchRegister; + AbstractInstruction *anInstruction; + AbstractInstruction *anInstruction1; + AbstractInstruction *anInstruction2; + sqInt i; + sqInt loadedPointer; + sqInt offset; + sqInt offset1; + + if (simNativeSpillBase <= index) { + loadedPointer = 0; + allocatedScratchRegister = 0; + for (i = (((simNativeSpillBase < 0) ? 0 : simNativeSpillBase)); i <= index; i += 1) { + if (!loadedPointer) { + /* begin MoveMw:r:R: */ + offset = frameOffsetOfNativeFramePointer(); + /* begin gen:quickConstant:operand:operand: */ + anInstruction = genoperandoperandoperand(MoveMwrR, offset, FPReg, TempReg); + loadedPointer = 1; + } + if ((spillingNeedsScratchRegister(simNativeStackAt(i))) + && (!allocatedScratchRegister)) { + /* begin PushR: */ + genoperand(PushR, FPReg); + allocatedScratchRegister = 1; + } + ensureSpilledSPscratchRegister(simNativeStackAt(i), TempReg, FPReg); + } + simNativeSpillBase = index + 1; + if (allocatedScratchRegister) { + /* begin PopR: */ + genoperand(PopR, FPReg); + } + if (loadedPointer) { + /* begin SubCq:R: */ + anInstruction1 = genoperandoperand(SubCqR, simNativeStackSize, TempReg); + /* begin MoveR:Mw:r: */ + offset1 = frameOffsetOfNativeStackPointer(); + /* begin gen:operand:quickConstant:operand: */ + anInstruction2 = genoperandoperandoperand(MoveRMwr, TempReg, offset1, FPReg); + } + } +} + + /* StackToRegisterMappingCogit>>#ssNativePop: */ +static void NoDbgRegParms +ssNativePop(sqInt n) +{ + assert((simNativeStackPtr - n) >= -1); + simNativeStackPtr -= n; + if (simNativeStackPtr >= 0) { + simNativeStackSize = ((ssNativeTop())->offset); + } + else { + simNativeStackSize = 0; + } +} + + /* StackToRegisterMappingCogit>>#ssNativePush: */ +static void NoDbgRegParms +ssNativePush(sqInt n) +{ + simNativeStackPtr += n; +} + + /* StackToRegisterMappingCogit>>#ssNativeTop */ +static CogSimStackNativeEntry * +ssNativeTop(void) +{ + assert(simNativeStackPtr >= 0); + return simNativeStackAt(simNativeStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssPopNativeSize: */ +static void NoDbgRegParms +ssPopNativeSize(sqInt popSize) +{ + sqInt popCount; + sqInt poppingSize; + sqInt stackPosition; + + poppingSize = 0; + stackPosition = simNativeStackPtr; + while ((poppingSize < popSize) + && (stackPosition >= 0)) { + poppingSize += stackSpillSize(simNativeStackAt(stackPosition)); + stackPosition -= 1; + } + assert(poppingSize == popSize); + popCount = simNativeStackPtr - stackPosition; + ssNativePop(popCount); +} + + /* StackToRegisterMappingCogit>>#ssPop: */ +static void NoDbgRegParms +ssPop(sqInt n) +{ + assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1)) + || (((!needsFrame) + && ((simStackPtr - n) >= -1)) + || (maybeCompilingFirstPassOfBlockWithInitialPushNil()))); + simStackPtr -= n; +} + + /* StackToRegisterMappingCogit>>#ssPushAnnotatedConstant: */ +static sqInt NoDbgRegParms +ssPushAnnotatedConstant(sqInt literal) +{ + AbstractInstruction *abstractInstruction; + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + /* begin annotateInstructionForBytecode */ + if (prevInstIsPCAnnotated()) { + /* begin Nop */ + abstractInstruction = gen(Nop); + } + else { + /* begin Label */ + abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC); + } + (abstractInstruction->annotation = HasBytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushBase:offset: */ +static sqInt NoDbgRegParms +ssPushBaseoffset(sqInt reg, sqInt offset) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSBaseOffset); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->offset = offset); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushConstant: */ +static sqInt NoDbgRegParms +ssPushConstant(sqInt literal) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSConstant); + (cascade0->spilled = 0); + (cascade0->constant = literal); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushDesc: */ +static sqInt NoDbgRegParms +ssPushDesc(SimStackEntry simStackEntry) +{ + if (((simStackEntry.type)) == SSSpill) { + (simStackEntry.type = SSBaseOffset); + } + (simStackEntry.spilled = 0); + (simStackEntry.bcptr = bytecodePC); + simStack[(simStackPtr += 1)] = simStackEntry; + updateSimSpillBase(); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat32(float aFloat32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat32 = aFloat32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantFloat64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantFloat64(double aFloat64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantFloat64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantFloat64 = aFloat64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt32: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt32(sqInt anInt32) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt32); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt32 = anInt32); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantInt64: */ +static sqInt NoDbgRegParms +ssPushNativeConstantInt64(sqLong anInt64) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantInt64); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantInt64 = anInt64); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeConstantPointer: */ +static sqInt NoDbgRegParms +ssPushNativeConstantPointer(sqInt aNativePointer) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSConstantNativePointer); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->constantNativePointer = aNativePointer); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterDoubleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterDoubleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterDoubleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegisterSingleFloat: */ +static sqInt NoDbgRegParms +ssPushNativeRegisterSingleFloat(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterSingleFloat); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegister(sqInt reg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += BytesPerWord; + cascade0 = ssNativeTop(); + (cascade0->type = SSNativeRegister); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushNativeRegister:secondRegister: */ +static sqInt NoDbgRegParms +ssPushNativeRegistersecondRegister(sqInt reg, sqInt secondReg) +{ + CogSimStackNativeEntry * cascade0; + + ssNativePush(1); + if (simNativeSpillBase > simNativeStackPtr) { + simNativeSpillBase = ((simNativeStackPtr < 0) ? 0 : simNativeStackPtr); + } + simNativeStackSize += 8; + cascade0 = ssNativeTop(); + (cascade0->type = SSRegisterPair); + (cascade0->spilled = 0); + (cascade0->offset = simNativeStackSize); + (cascade0->registerr = reg); + (cascade0->registerSecond = secondReg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPushRegister: */ +static sqInt NoDbgRegParms +ssPushRegister(sqInt reg) +{ + CogSimStackEntry * cascade0; + + ssPush(1); + updateSimSpillBase(); + cascade0 = ssTop(); + (cascade0->type = SSRegister); + (cascade0->spilled = 0); + (cascade0->registerr = reg); + (cascade0->bcptr = bytecodePC); + return 0; +} + + /* StackToRegisterMappingCogit>>#ssPush: */ +static void NoDbgRegParms +ssPush(sqInt n) +{ + simStackPtr += n; +} + + +/* In addition to ssStorePop:toReg:, if this is a store and not + a popInto I change the simulated stack to use the register + for the top value */ + + /* StackToRegisterMappingCogit>>#ssStoreAndReplacePop:toReg: */ +static void NoDbgRegParms +ssStoreAndReplacePoptoReg(sqInt popBoolean, sqInt reg) +{ + char topSpilled; + + topSpilled = ((ssTop())->spilled); + ssStorePoptoReg(popBoolean + || (topSpilled), reg); + if (!popBoolean) { + if (!topSpilled) { + ssPop(1); + } + ssPushRegister(reg); + } +} + + +/* Store or pop the top simulated stack entry to a register. + Use preferredReg if the entry is not itself a register. + Answer the actual register the result ends up in. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toPreferredReg: */ +static sqInt NoDbgRegParms +ssStorePoptoPreferredReg(sqInt popBoolean, sqInt preferredReg) +{ + sqInt actualReg; + + actualReg = preferredReg; + if ((((ssTop())->type)) == SSRegister) { + assert(!(((ssTop())->spilled))); + actualReg = ((ssTop())->registerr); + } + ssStorePoptoReg(popBoolean, actualReg); + return actualReg; +} + + +/* Store or pop the top simulated stack entry to a register. + N.B.: popToReg: and storeToReg: does not generate anything if + it moves a register to the same register. */ + + /* StackToRegisterMappingCogit>>#ssStorePop:toReg: */ +static void NoDbgRegParms +ssStorePoptoReg(sqInt popBoolean, sqInt reg) +{ + if (popBoolean) { + popToReg(ssTop(), reg); + ssPop(1); + } + else { + storeToReg(ssTop(), reg); + } +} + + /* StackToRegisterMappingCogit>>#ssTop */ +static CogSimStackEntry * +ssTop(void) +{ + return simStackAt(simStackPtr); +} + + /* StackToRegisterMappingCogit>>#ssTopDescriptor */ +static SimStackEntry +ssTopDescriptor(void) +{ + return simStack[simStackPtr]; +} + + /* StackToRegisterMappingCogit>>#ssValue: */ +static CogSimStackEntry * NoDbgRegParms +ssValue(sqInt n) +{ + return simStackAt(simStackPtr - n); +} + + +/* If the sequence of bytecodes is + push: (Array new: 1) + popIntoTemp: tempIndex + pushConstant: const or pushTemp: n + popIntoTemp: 0 inVectorAt: tempIndex + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. + One might think that we should look for a sequence of more than + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */ + + /* StackToRegisterMappingCogit>>#tryCollapseTempVectorInitializationOfSize: */ +static sqInt NoDbgRegParms +tryCollapseTempVectorInitializationOfSize(sqInt slots) +{ + BytecodeDescriptor *pushArrayDesc; + BytecodeDescriptor *pushValueDesc; + sqInt reg; + sqInt remoteTempIndex; + BytecodeDescriptor *storeArrayDesc; + BytecodeDescriptor *storeValueDesc; + sqInt tempIndex; + + if (slots != 1) { + return 0; + } + pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); + assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); + storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; + } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } + pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { + return 0; + } + storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { + return 0; + } + genNewArrayOfSizeinitialized(1, 0); + evaluateat(pushValueDesc, (bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))); + reg = ssStorePoptoPreferredReg(1, TempReg); + genStoreSourceRegslotIndexintoNewObjectInDestReg(reg, 0, ReceiverResultReg); + ssPushRegister(ReceiverResultReg); + evaluateat(storeArrayDesc, bytecodePC + ((pushArrayDesc->numBytes))); + + /* + pushArrayDesc numBytes this gets added by nextBytecodePCFor:at:exts:in: */ + bytecodePC = ((bytecodePC + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + ((storeValueDesc->numBytes)); + return 1; +} + + /* StackToRegisterMappingCogit>>#updateSimSpillBase */ +static void +updateSimSpillBase(void) +{ + if (simSpillBase > simStackPtr) { + simSpillBase = ((simStackPtr < 0) ? 0 : simStackPtr); + } +} + + +/* Used when ReceiverResultReg is allocated for other than simSelf, and + there may be references to ReceiverResultReg which need to be spilled. */ + + /* StackToRegisterMappingCogit>>#voidReceiverResultRegContainsSelf */ +static void +voidReceiverResultRegContainsSelf(void) +{ + sqInt i; + sqInt spillIndex; + + (optStatus.isReceiverResultRegLive = 0); + spillIndex = -1; + for (i = (((methodOrBlockNumTemps < simSpillBase) ? simSpillBase : methodOrBlockNumTemps)); i <= simStackPtr; i += 1) { + if ((registerOrNone(simStackAt(i))) == ReceiverResultReg) { + spillIndex = i; + } + } + if (spillIndex > 0) { + ssFlushTo(simStackPtr - spillIndex); + } +} diff --git a/spurlowcodesrc/vm/cogmethod.h b/spurlowcodesrc/vm/cogmethod.h new file mode 100644 index 0000000000..53e236de4f --- /dev/null +++ b/spurlowcodesrc/vm/cogmethod.h @@ -0,0 +1,36 @@ +/* Automatically generated by + CCodeGenerator VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ + +typedef struct { + unsigned short homeOffset; + unsigned short startpc; + unsigned int padToWord; + unsigned cmNumArgs : 8; + unsigned cmType : 3; + unsigned cmRefersToYoung : 1; + unsigned cpicHasMNUCaseOrCMIsFullBlock : 1; + unsigned cmUsageCount : 3; + unsigned cmUsesPenultimateLit : 1; + unsigned cbUsesInstVars : 1; + unsigned cmUnusedFlags : 2; + unsigned stackCheckOffset : 12; + } CogBlockMethod; + +typedef struct { + sqLong objectHeader; + unsigned cmNumArgs : 8; + unsigned cmType : 3; + unsigned cmRefersToYoung : 1; + unsigned cpicHasMNUCaseOrCMIsFullBlock : 1; + unsigned cmUsageCount : 3; + unsigned cmUsesPenultimateLit : 1; + unsigned cbUsesInstVars : 1; + unsigned cmUnusedFlags : 2; + unsigned stackCheckOffset : 12; + unsigned short blockSize; + unsigned short blockEntryOffset; + sqInt methodObject; + sqInt methodHeader; + sqInt selector; + } CogMethod; diff --git a/spurlowcodesrc/vm/cointerp.c b/spurlowcodesrc/vm/cointerp.c new file mode 100644 index 0000000000..cdb39682ba --- /dev/null +++ b/spurlowcodesrc/vm/cointerp.c @@ -0,0 +1,97499 @@ +/* Automatically generated by + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + from + CoInterpreter VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a + */ +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2079 uuid: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a " __DATE__ ; +char *__interpBuildInfo = __buildInfo; + + + +#if USE_GLOBAL_STRUCT +# define SQ_USE_GLOBAL_STRUCT 1 +#else +# define SQ_USE_GLOBAL_STRUCT 0 +#endif +#if USE_GLOBAL_STRUCT_REG +# define SQ_USE_GLOBAL_STRUCT_REG 1 +#else +# define SQ_USE_GLOBAL_STRUCT_REG 0 +#endif + +#include /* for e.g. alloca */ +#include +#include /* for wint_t */ +#include "sq.h" +#include "vmCallback.h" +#include "sqMemoryFence.h" +#include "dispdbg.h" +#include "sqLowcodeFFI.h" +#include "sqCogStackAlignment.h" +#include "cogmethod.h" +#include "cointerp.h" +#include "cogit.h" + + +/* StackInterpreter class>>preambleCCode */ +/* Disable Intel compiler inlining of warning which is used for breakpoints */ +#pragma auto_inline(off) +sqInt warnpid, erroronwarn; +void +warning(char *s) { /* Print an error message but don't necessarily exit. */ + if (erroronwarn) error(s); + if (warnpid) + printf("\n%s pid %ld\n", s, (long)warnpid); + else + printf("\n%s\n", s); +} +void +warningat(char *s, int l) { /* ditto with line number. */ + /* use alloca to call warning so one does not have to remember to set two breakpoints... */ + char *sl = alloca(strlen(s) + 16); + sprintf(sl, "%s %d", s, l); + warning(sl); +} +#pragma auto_inline(on) + +void +invalidCompactClassError(char *s) { /* Print a (compact) class index error message and exit. */ +#if SPURVM + printf("\nClass %s does not have the required class index\n", s); +#else + printf("\nClass %s does not have the required compact class index\n", s); +#endif + exit(-1); +} + +/* + * Define sigsetjmp and siglongjmp to be the most minimal setjmp/longjmp available on the platform. + */ +#undef sigsetjmp +#undef siglongjmp +#if WIN32 +# define sigsetjmp(jb,ssmf) setjmp(jb) +# define siglongjmp(jb,v) longjmp(jb,v) +#else +# define sigsetjmp(jb,ssmf) _setjmp(jb) +# define siglongjmp(jb,v) _longjmp(jb,v) +#endif + +#define odd(v) ((int)(v)&1) +#define even(v) (!odd(v)) + +/* end StackInterpreter class>>preambleCCode */ + + +/*** Constants ***/ +#define ActiveProcessIndex 1 +#define AlternateHeaderHasPrimFlag 0x20000 +#define AlternateHeaderIsOptimizedFlag 0x10000 +#define AlternateHeaderNumLiteralsMask 0x7FFF +#define AltLongStoreBytecode 245 +#define BecameActiveClassFlag 8 +#define BecameCompiledMethodFlag 2 +#define BecamePointerObjectFlag 1 +#define BytecodeSetHasDirectedSuperSend 1 +#define BytecodeSetHasExtensions 1 +#define CacheProbeMax 3 +#define CharacterTable null +#define CharacterValueIndex 0 +#define CheckAllocationFillerAfterPrimCall 16 +#define ClassAlien 52 +#define ClassArray 7 +#define ClassArrayCompactIndex 51 +#define ClassBitmap 4 +#define ClassBitmapCompactIndex 53 +#define ClassBlockClosure 36 +#define ClassBlockClosureCompactIndex 37 +#define ClassByteArray 26 +#define ClassByteString 6 +#define ClassByteStringCompactIndex 52 +#define ClassCharacter 19 +#define ClassExternalAddress 43 +#define ClassExternalData 45 +#define ClassExternalFunction 46 +#define ClassExternalLibrary 47 +#define ClassExternalStructure 44 +#define ClassFloat 9 +#define ClassFloatCompactIndex 34 +#define ClassFullBlockClosure 37 +#define ClassFullBlockClosureCompactIndex 38 +#define ClassLargeNegativeInteger 42 +#define ClassLargeNegativeIntegerCompactIndex 32 +#define ClassLargePositiveInteger 13 +#define ClassLargePositiveIntegerCompactIndex 33 +#define ClassMessage 15 +#define ClassMessageCompactIndex 35 +#define ClassMethodContext 10 +#define ClassMethodContextCompactIndex 36 +#define ClassMutex 39 +#define ClassPoint 12 +#define ClassSemaphore 18 +#define ClassSmallInteger 5 +#define ClassUnsafeAlien 54 +#define ClosureFirstCopiedValueIndex 3 +#define ClosureIndex 4 +#define ClosureNumArgsIndex 2 +#define ClosureOuterContextIndex 0 +#define ClosureStartPCIndex 1 +#define CMBlock 3 +#define CMClosedPIC 4 +#define CMMethod 2 +#define CMOpenPIC 5 +#define CompactionPassesForGC 2 +#define CompactionPassesForSnapshot 3 +#define ConstMinusOne 0xFFFFFFFFU +#define ConstOne 3 +#define ConstTwo 5 +#define ConstZero 1 +#define CrossedX 258 +#define CSCallbackLeave 4 +#define CSEnterCriticalSection 5 +#define CSExitCriticalSection 6 +#define CSResume 7 +#define CSSignal 8 +#define CSSuspend 9 +#define CSWait 10 +#define CSYield 11 +#define CtxtTempFrameStart 6 +#define DumpStackOnLowSpace 0 +#define EncounteredUnknownBytecode -6 +#define EndOfRun 0x101 +#define ExcessSignalsIndex 2 +#define ExternalObjectsArray 38 +#define ExtraRootsSize 2048 +#define FailImbalancedPrimitives 1 +#define FalseObject 1 +#define FirstLinkIndex 0 +#define FoxCallerSavedIP 4 +#define FoxIFReceiver -20 +#define FoxIFrameFlags -12 +#define FoxIFSavedIP -16 +#define FoxMethod -4 +#define FoxMFReceiver -12 +#define FoxSavedFP 0 +#define FoxThisContext -8 +#define FullClosureCompiledBlockIndex 1 +#define FullClosureFirstCopiedValueIndex 4 +#define FullClosureReceiverIndex 3 +#define GCCheckPrimCall 64 +#define GCModeBecome 8 +#define GCModeFreeSpace 32 +#define GCModeFull 1 +#define GCModeImageSegment 16 +#define GCModeIncremental 4 +#define GCModeNewSpace 2 +#define HasBeenReturnedFromMCPC -1 +#define HasBeenReturnedFromMCPCOop 0xFFFFFFFFU +#define HeaderIndex 0 +#define IFrameSlots 7 +#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */ +# define IMMUTABILITY 0 +#endif +#define InstanceSpecificationIndex 2 +#define InstructionPointerIndex 1 +#define KeyIndex 0 +#define LargeContextBit 0x40000 +#define LargeContextSlots 62 +#define LastLinkIndex 1 +#define LiteralStart 1 +#define LongStoreBytecode 129 +#define LookupRuleMNU 259 +#define LowcodeContextMark 60 +#define LowcodeVM 1 +#define MarkObjectsForEnumerationPrimitives 0 +#define MarkOnTenure 5 +#define MarkStackRootIndex 0x1000 +#define MaxExternalPrimitiveTableSize 4096 +#define MaxJumpBuf 32 +#define MaxLiteralCountForCompile 60 +#define MaxNegativeErrorCode -8 +#define MaxPrimitiveIndex 575 +#define MaxQuickPrimitiveIndex 519 +#define MaxRTRefCount 7 +#define MessageArgumentsIndex 1 +#define MessageLookupClassIndex 2 +#define MessageSelectorIndex 0 +#define MethodArrayIndex 1 +#define MethodCacheClass 2 +#define MethodCacheEntries 0x400 +#define MethodCacheEntrySize 4 +#define MethodCacheMask 0xFFC +#define MethodCacheMethod 3 +#define MethodCachePrimFunction 4 +#define MethodCacheSelector 1 +#define MethodCacheSize 4096 +#define MethodDictionaryIndex 1 +#define MethodHeaderArgCountShift 25 +#define MethodHeaderFlagBitPosition 29 +#define MethodHeaderTempCountShift 19 +#define MethodIndex 3 +#define MethodTooBig -4 +#define MFMethodFlagHasContextFlag 1 +#define MFMethodFlagIsBlockFlag 2 +#define MFMethodFlagsMask 0x7 +#define MFMethodMask -0x8 +#define MFrameSlots 5 +#define MillisecondClockMask 0x1FFFFFFF +#define MinBackwardJumpCountForCompile 40 +#define MournQueueRootIndex 4098 +#define MULTIPLEBYTECODESETS 1 +#define MyListIndex 3 +#define NewspeakVM 0 +#define NextLinkIndex 0 +#define NilObject 0 +#define NotFullyInitialized -1 +#define NSMethodCacheActualReceiver 7 +#define NSMethodCacheCallingMethod 3 +#define NSMethodCacheClassTag 2 +#define NSMethodCacheDepthOrLookupRule 4 +#define NSMethodCacheMask 0xFF8 +#define NSMethodCachePrimFunction 6 +#define NSMethodCacheSelector 1 +#define NSMethodCacheSize 4096 +#define NSMethodCacheTargetMethod 5 +#define ObjStackFixedSlots 4 +#define ObjStackFreex 2 +#define ObjStackLimit 0xFF8 +#define ObjStackMyx 1 +#define ObjStackNextx 3 +#define ObjStackPageSlots 0xFFC +#define ObjStackTopx 0 +#define OldBecameNewFlag 4 +#define PrimCallCollectsProfileSamples 8 +#define PrimCallMayCallBack 4 +#define PrimCallNeedsNewMethod 1 +#define PrimCallNeedsPrimitiveFunction 2 +#define PrimErrBadArgument 3 +#define PrimErrBadIndex 4 +#define PrimErrBadMethod 12 +#define PrimErrBadNumArgs 5 +#define PrimErrBadReceiver 2 +#define PrimErrGenericFailure 1 +#define PrimErrInappropriate 6 +#define PrimErrLimitExceeded 15 +#define PrimErrNamedInternal 13 +#define PrimErrNoCMemory 10 +#define PrimErrNoMemory 9 +#define PrimErrNoModification 8 +#define PrimErrNotFound 11 +#define PrimErrObjectIsPinned 16 +#define PrimErrTableIndex 51 +#define PrimErrUnsupported 7 +#define PrimErrWritePastObject 17 +#define PrimitiveExternalCallIndex 117 +#define PrimNoErr 0 +#define PrimNumberDoExternalCall 218 +#define PrimNumberExternalCall 117 +#define PrimNumberFFICall 120 +#define PrimTraceLogSize 256 +#define PriorityIndex 2 +#define ProcessListsIndex 0 +#define ProcessSignalingLowSpace 22 +#define ReceiverIndex 5 +#define RemapBufferSize 25 +#define RememberedSetRootIndex 4099 +#define ReturnToInterpreter 1 +#define ScavengeInProgress 1 +#define SchedulerAssociation 3 +#define SelectorAboutToReturn 48 +#define SelectorAttemptToAssign 50 +#define SelectorCannotInterpret 34 +#define SelectorCannotReturn 21 +#define SelectorDoesNotUnderstand 20 +#define SelectorInvokeCallback 53 +#define SelectorMustBeBoolean 25 +#define SelectorRunWithIn 49 +#define SelectorSistaTrap 59 +#define SelectorStart 2 +#define SelectorUnknownBytecode 57 +#define SenderIndex 0 +#define ShouldNotJIT -8 +#define SistaV1BytecodeSet 1 +#define SistaVM 1 +#define SlidingCompactionInProgress 2 +#define SmallContextSlots 22 +#define SPURVM 1 +#define SpecialSelectors 23 +#define StackPageReachedButUntraced 1 +#define StackPageTraced 2 +#define StackPageTraceInvalid -1 +#define StackPageUnreached 0 +#define StackPointerIndex 2 +#define SuperclassIndex 0 +#define SuspendedContextIndex 1 +#define TenureByAge 1 +#define TenureByClass 2 +#define TenureToShrinkRT 3 +#define TheDisplay 14 +#define TheFinalizationSemaphore 41 +#define TheInputSemaphore null +#define TheInterruptSemaphore 30 +#define TheLowSpaceSemaphore 17 +#define TheTimerSemaphore 29 +#define TopHashBit 0x200000 +#define TopOopBit 0x80000000U +#define TraceBlockActivation 5 +#define TraceBlockCreation 7 +#define TraceBufferSize 768 +#define TraceCodeCompaction 13 +#define TraceContextSwitch 3 +#define TraceFullGC 11 +#define TraceIncrementalGC 9 +#define TraceIsFromInterpreter 2 +#define TraceIsFromMachineCode 1 +#define TracePrimitiveFailure 29 +#define TracePrimitiveRetry 31 +#define TraceStackOverflow 27 +#define TraceVMCallback 23 +#define TraceVMCallbackReturn 25 +#define TrueObject 2 +#define V3PrimitiveBitsMask 0x200003FE +#define ValueIndex 1 +#if !defined(VMBIGENDIAN) /* Allow this to be overridden on the compiler command line */ +# define VMBIGENDIAN 0 +#endif +#define WeaklingStackRootIndex 0x1001 +#define XIndex 0 +#define YIndex 1 + +typedef struct { + usqInt segStart; + usqInt segSize; + sqInt swizzle; + usqInt containsPinned; + usqInt savedSegSize; + usqInt lastFreeObject; + } SpurSegmentInfo; + + +typedef struct { + usqInt start; + usqInt limit; + } SpurNewSpaceSpace; + + +typedef struct { + usqInt start; + usqInt limit; + usqInt top; + } SpurContiguousObjStack; + + +typedef struct _StackPage { + char *stackLimit; + char *headSP; + char *headFP; + char *baseFP; + char *baseAddress; + char *realStackLimit; + char *lastAddress; + int trace; + struct _StackPage *nextPage; + struct _StackPage *prevPage; + } StackPage; + +#define CogStackPage StackPage + + + +/*** Function Prototypes ***/ + + +#if !PRODUCTION && defined(PlatformNoDbgRegParms) +# define NoDbgRegParms PlatformNoDbgRegParms +#endif + +#if !defined(NoDbgRegParms) +# define NoDbgRegParms /*empty*/ +#endif + + + +#if !defined(NeverInline) +# define NeverInline /*empty*/ +#endif + +extern sqInt interpret(void); +static CogMethod * NoDbgRegParms cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod); +static sqInt NoDbgRegParms addressIsInPage(StackPage * self_in_addressIsInPage, char *address); +static sqInt NoDbgRegParms isFree(StackPage * self_in_isFree); +static void NoDbgRegParms freeStackPageNoAssert(StackPage *aPage); +static sqInt NoDbgRegParms freeStackPage(StackPage *aPage); +static void NoDbgRegParms markStackPageMostRecentlyUsed(StackPage *page); +static void NoDbgRegParms markStackPageNextMostRecentlyUsed(StackPage *page); +static StackPage * newStackPage(void); +static sqInt pageListIsWellFormed(void); +static StackPage * NoDbgRegParms stackPageAt(sqInt index); +static StackPage * NoDbgRegParms stackPageFor(void *pointer); +static double statAverageLivePagesWhenMapping(void); +extern signed char accessorDepthForPrimitiveIndex(sqInt primIndex); +static void NoDbgRegParms activateCoggedNewMethod(sqInt inInterpreter); +static void activateNewMethod(void); +static void NoDbgRegParms addNewMethodToCache(sqInt classObj); +extern usqInt argumentCountAddress(void); +static CogMethod * NoDbgRegParms asCogHomeMethod(CogBlockMethod *aCogMethod); +static void NoDbgRegParms assertValidExecutionPointersimbarline(usqInt lip, char *lifp, char *lisp, sqInt inInterpreter, sqInt ln); +extern void assertValidMachineCodeFrame(sqInt instrPtr); +static sqInt NoDbgRegParms assertValidStackedInstructionPointersInline(StackPage *aStackPage, sqInt ln); +static void NoDbgRegParms assertValidStackedInstructionPointers(sqInt ln); +static void NoDbgRegParms attemptToSwitchToMachineCode(sqInt bcpc); +EXPORT(sqInt) callbackEnter(sqInt *callbackID); +extern void callForCogCompiledCodeCompaction(void); +static void NoDbgRegParms callRegisterArgCogMethodatreceiver(CogMethod *cogMethod, sqInt entryOffset, sqInt rcvr); +extern void ceActivateFailingPrimitiveMethod(sqInt aPrimitiveMethod); +extern sqInt ceBaseFrameReturn(sqInt returnValue); +#if IMMUTABILITY +extern sqInt ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign); +#endif /* IMMUTABILITY */ +extern sqInt ceCannotResume(void); +extern void ceCheckAndMaybeRetryPrimitive(sqInt primIndex); +extern void ceCheckForInterrupts(void); +extern void ceCheckProfileTick(void); +extern sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex); +extern sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop); +extern sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr); +extern sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr); +extern sqInt ceNonLocalReturn(sqInt returnValue); +extern sqInt ceReturnToInterpreter(sqInt anOop); +extern sqInt ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs); +extern sqInt ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC); +extern void ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize); +extern sqInt ceSendMustBeBoolean(sqInt anObject); +extern sqInt ceSendabovetonumArgs(sqInt selector, sqInt startAssociationArg, sqInt rcvr, sqInt numArgs); +extern sqInt ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs); +extern sqInt ceSistaTrap(void); +extern void ceStackOverflow(sqInt contextSwitchIfNotNil); +extern void ceTraceBlockActivation(void); +extern void ceTraceLinkedSend(sqInt theReceiver); +extern void ceTraceStoreOfinto(sqInt aValue, sqInt anObject); +extern void checkAssertsEnabledInCoInterpreter(void); +static sqInt NoDbgRegParms checkCodeIntegrity(sqInt gcModes); +static sqInt checkLogIntegrity(void); +static sqInt NoDbgRegParms checkOkayFields(sqInt oop); +static sqInt checkStackIntegrity(void); +extern void clearTraceLog(void); +extern CogMethod * cogMethodOf(sqInt aMethodOop); +static void commenceCogCompiledCodeCompaction(void); +extern void compilationBreakpointFor(sqInt selectorOop); +static sqInt NoDbgRegParms contextInstructionPointerframe(sqInt theIP, char *theFP); +extern sqInt defaultNativeStackFrameSize(void); +static sqInt NoDbgRegParms deferStackLimitSmashAroundwith(void (*functionSymbol)(sqInt), sqInt arg); +static sqInt NoDbgRegParms divorceAMachineCodeFrameWithCogMethodin(CogMethod *cogMethod, StackPage *aStackPage); +extern void dumpPrimTraceLog(void); +extern void dumpTraceLog(void); +static void NoDbgRegParms ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext); +static sqInt enterSmalltalkExecutiveImplementation(void); +extern void executeCogMethodfromLinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr); +static void NoDbgRegParms executeCogMethodfromUnlinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr); +extern void executeCogPICfromLinkedSendWithReceiverandCacheTag(CogMethod *cogPIC, sqInt rcvr, sqInt cacheTag); +static sqInt executeNewMethod(void); +static sqInt NoDbgRegParms externalInstVarofContext(sqInt offset, sqInt aContext); +static void NoDbgRegParms findNewMethodInClassTag(sqInt classTagArg); +extern void flushExternalPrimitiveOf(sqInt methodObj); +static void flushMethodCache(void); +static void followForwardedFieldsInCurrentMethod(void); +static void NoDbgRegParms followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags); +extern void forceInterruptCheckFromHeartbeat(void); +static sqInt NoDbgRegParms frameCallerContext(char *theFP); +static sqInt NoDbgRegParms frameCallerContextput(char *theFP, sqInt aValue); +static sqInt NoDbgRegParms frameHasContext(char *theFP); +static sqInt NoDbgRegParms frameIsBlockActivation(char *theFP); +static sqInt NoDbgRegParms frameMethodObject(char *theFP); +static sqInt NoDbgRegParms frameNumArgs(char *theFP); +extern usqInt framePointerAddress(void); +static sqInt NoDbgRegParms frameReceiver(char *theFP); +extern void (*functionPointerForCompiledMethodprimitiveIndex(sqInt methodObj, sqInt primIndex))(void) ; +extern sqInt getCheckAllocFiller(void); +extern sqInt getCurrentBytecode(void); +static sqInt NoDbgRegParms handleForwardedSendFaultForReceiverstackDelta(sqInt forwardedReceiver, sqInt stackDelta); +static sqInt NoDbgRegParms handleMNUInMachineCodeToclassForMessage(sqInt selectorIndex, sqInt rcvr, sqInt classForMessage); +static sqInt NoDbgRegParms iframeIsBlockActivation(char *theFP); +static sqInt NoDbgRegParms iframeReceiver(char *theFP); +static sqInt NoDbgRegParms iframeSavedIP(char *theFP); +extern void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP); +extern usqInt instructionPointerAddress(void); +static sqInt NoDbgRegParms instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr); +extern usqInt interpretAddress(void); +static sqInt NeverInline interpreterAllocationReserveBytes(void); +static sqInt interpretMethodFromMachineCode(void); +extern sqInt isCogMethodReference(sqInt methodHeader); +static sqInt NoDbgRegParms isMachineCodeFrame(char *theFP); +extern sqInt lookupMNUreceiver(sqInt selector, sqInt rcvr); +extern sqInt lookupOrdinaryreceiver(sqInt selector, sqInt rcvr); +static StackPage * NoDbgRegParms makeBaseFrameFor(sqInt aContext); +static void mapPrimTraceLog(void); +static void NeverInline mapStackPages(void); +static void mapTraceLog(void); +extern void markActiveMethodsAndReferents(void); +static void markAndTracePrimTraceLog(void); +static void NoDbgRegParms markAndTraceStackPage(StackPage *thePage); +static void markAndTraceTraceLog(void); +static void NoDbgRegParms markCogMethodsAndReferentsOnPage(StackPage *thePage); +extern sqInt marryFrameCopiesTemps(void); +extern sqInt maxLookupNoMNUErrorCode(void); +static void NoDbgRegParms maybeFlagMethodAsInterpreted(sqInt aMethod); +extern void * methodCacheAddress(void); +extern sqInt methodHasCogMethod(sqInt aMethodOop); +extern sqInt methodNeedsLargeContext(sqInt methodObj); +extern sqInt methodShouldBeCogged(sqInt aMethodObj); +static sqInt NoDbgRegParms methodWithHeaderShouldBeCogged(sqInt methodHeader); +static CogBlockMethod * NoDbgRegParms mframeCogMethod(char *theFP); +extern CogMethod * mframeHomeMethodExport(void); +extern CogMethod * mframeHomeMethod(char *theFP); +static sqInt NoDbgRegParms mframeIsBlockActivation(char *theFP); +static sqInt NoDbgRegParms mframeReceiver(char *theFP); +static sqInt minimumUnusedHeadroom(void); +extern sqInt mMethodClass(void); +extern void mnuCompilationBreakpointFor(sqInt selectorOop); +static sqInt NoDbgRegParms mnuMethodOrNilFor(sqInt rcvr); +static char * NoDbgRegParms moveFramesInthroughtoPage(StackPage *oldPage, char *theFP, StackPage *newPage); +static sqInt NoDbgRegParms mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext); +static char* NoDbgRegParms nativeFramePointerIn(char *theFP); +static char* NoDbgRegParms nativePreviousStackPointerIn(char *theFP); +extern usqInt nativeStackPointerAddress(void); +static char* NoDbgRegParms nativeStackPointerIn(char *theFP); +extern usqInt newMethodAddress(void); +static sqInt NoDbgRegParms newMethodInLookupCacheAtand(sqInt selector, sqInt classTag); +extern usqInt nextProfileTickAddress(void); +extern sqInt noAssertHeaderOf(sqInt methodPointer); +extern sqInt positive32BitIntegerFor(unsigned int integerValue); +extern unsigned int positive32BitValueOf(sqInt oop); +extern sqInt positive64BitIntegerFor(usqLong integerValue); +extern usqLong positive64BitValueOf(sqInt oop); +static void NoDbgRegParms postGCAction(sqInt gcModeArg); +static void NoDbgRegParms preGCAction(sqInt gcModeArg); +extern sqInt primErrTable(void); +extern usqInt primFailCodeAddress(void); +extern usqInt primitiveFailAddress(void); +extern sqInt primitivePropertyFlags(sqInt primIndex); +extern void * primTraceLogAddress(void); +extern usqInt primTraceLogIndexAddress(void); +extern void printCogMethod(CogMethod *cogMethod); +static void NoDbgRegParms printFrameFlagsForFP(char *theFP); +static void NoDbgRegParms printFrameMethodFor(char *theFP); +static void NoDbgRegParms printFrameThingatextraString(char *name, char *address, char *extraStringOrNil); +static void NoDbgRegParms printFrameThingatextra(char *name, char *address, sqInt extraValue); +extern sqInt printFrameWithSP(char *theFP, char *theSP); +static void NoDbgRegParms printLogEntryAt(sqInt i); +extern void printMethodCacheFor(sqInt thing); +static sqInt NoDbgRegParms printPrimLogEntryAt(sqInt i); +extern sqInt quickPrimitiveConstantFor(sqInt aQuickPrimitiveIndex); +extern sqInt (*quickPrimitiveGeneratorFor(sqInt aQuickPrimitiveIndex))(void) ; +extern sqInt quickPrimitiveInstVarIndexFor(sqInt primIndex); +extern sqInt rawHeaderOf(sqInt methodPointer); +extern void rawHeaderOfput(sqInt methodOop, sqInt cogMethodOrMethodHeader); +extern size_t readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset); +extern void reportMinimumUnusedHeadroom(void); +static sqInt NoDbgRegParms resumepreemptedYieldingIffrom(sqInt aProcess, sqInt yieldImplicitly, sqInt sourceCode); +static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterpreter, sqInt switchedContext); +static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter); +static void NoDbgRegParms rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void)); +static sqInt NoDbgRegParms roomToPushNArgs(sqInt n); +static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex); +EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext); +EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr); +extern usqInt shadowCallStackAddress(void); +static char* NoDbgRegParms shadowCallStackPointerIn(char *theFP); +static sqInt NoDbgRegParms shortPrintFrame(char *theFP); +extern sqInt signed32BitIntegerFor(sqInt integerValue); +extern int signed32BitValueOf(sqInt oop); +extern sqInt signed64BitIntegerFor(sqLong integerValue); +extern sqLong signed64BitValueOf(sqInt oop); +static sqInt slowPrimitiveResponse(void); +extern sqInt specialSelectorNumArgs(sqInt index); +extern usqInt stackLimitAddress(void); +static sqInt stackLimitOffset(void); +static sqInt stackPageHeadroom(void); +extern usqInt stackPointerAddress(void); +extern sqInt startPCOfMethodHeader(sqInt aCompiledMethodHeader); +extern sqInt startPCOrNilOfLiteralin(sqInt lit, sqInt aMethodObj); +static sqInt NoDbgRegParms synchronousSignal(sqInt aSemaphore); +static void NoDbgRegParms tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(sqInt contextToReturnFrom, sqInt contextToReturnTo, sqInt returnValue); +static void NoDbgRegParms transferTofrom(sqInt newProc, sqInt sourceCode); +extern void updateStackZoneReferencesToCompiledCodePreCompaction(void); +static void NoDbgRegParms updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP); +extern sqInt validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp); +static sqInt NoDbgRegParms validStackPageBaseFrame(StackPage *aPage); +extern usqInt varBaseAddress(void); +static sqInt NoDbgRegParms voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims); +extern char * whereIs(sqInt anOop); +static void NoDbgRegParms NeverInline widowOrForceToBytecodePC(sqInt ctxt); +static sqInt NoDbgRegParms frameIsMarked(sqInt theFPInt); +static void primitiveClosureCopyWithCopiedValues(void); +static void primitiveCollectCogCodeConstituents(void); +static void primitiveContextXray(void); +static void primitiveEnterCriticalSection(void); +static void primitiveExitCriticalSection(void); +static void primitiveFlushCacheByMethod(void); +static void primitiveFlushCacheBySelector(void); +extern usqInt primitiveFunctionPointerAddress(void); +EXPORT(sqInt) primitiveLongRunningPrimitiveSemaphore(void); +EXPORT(sqInt) primitiveMethodPCData(void); +static void primitiveMethodXray(void); +EXPORT(void) primitiveMinimumUnusedHeadroom(void); +static void primitiveObjectAt(void); +static void primitiveObjectAtPut(void); +EXPORT(sqInt) primitiveProfileSemaphore(void); +static void primitiveResume(void); +static void primitiveSignal(void); +static void primitiveSnapshot(void); +static void primitiveSnapshotEmbedded(void); +static void primitiveSuspend(void); +static void primitiveTerminateTo(void); +static void primitiveVoidVMState(void); +static void primitiveVoidVMStateForMethod(void); +static void primitiveWait(void); +static void primitiveYield(void); +static void unmarkAllFrames(void); +static void NoDbgRegParms initializeStacknumSlotspageSize(char *theStackPages, sqInt stackSlots, sqInt slotsPerPage); +static sqInt NoDbgRegParms pageIndexFor(void *pointer); +#if IMMUTABILITY +static sqInt NoDbgRegParms canBeImmutable(sqInt oop); +#endif /* IMMUTABILITY */ +extern char * cStringOrNullFor(sqInt oop); +extern sqInt failed(void); +static sqInt NoDbgRegParms isNegativeIntegerValueOf(sqInt oop); +static sqInt NoDbgRegParms magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative); +static usqLong NoDbgRegParms magnitude64BitValueOf(sqInt oop); +static int NoDbgRegParms noInlineSigned32BitValueGutsOf(sqInt oop); +extern usqIntptr_t positiveMachineIntegerValueOf(sqInt oop); +static void primitiveAdd(void); +EXPORT(void) primitiveAddLargeIntegers(void); +static void primitiveAdoptInstance(void); +EXPORT(void) primitiveAllInstances(void); +EXPORT(void) primitiveAllObjects(void); +static void primitiveArctan(void); +static void primitiveArrayBecome(void); +static void primitiveArrayBecomeOneWay(void); +static void primitiveArrayBecomeOneWayCopyHash(void); +static void primitiveAsCharacter(void); +static void primitiveAsFloat(void); +static void primitiveAt(void); +static void primitiveAtPut(void); +static void primitiveBeCursor(void); +static void primitiveBeDisplay(void); +static void primitiveBeep(void); +static void primitiveBehaviorHash(void); +static void primitiveBitAnd(void); +EXPORT(void) primitiveBitAndLargeIntegers(void); +static void primitiveBitOr(void); +EXPORT(void) primitiveBitOrLargeIntegers(void); +static void primitiveBitShift(void); +EXPORT(void) primitiveBitShiftLargeIntegers(void); +static void primitiveBitXor(void); +EXPORT(void) primitiveBitXorLargeIntegers(void); +static void primitiveBytesLeft(void); +static void primitiveCalloutToFFI(void); +static void primitiveChangeClass(void); +static void primitiveClass(void); +static void primitiveClearVMProfile(void); +static void primitiveClipboardText(void); +EXPORT(sqInt) primitiveClockLogAddresses(void); +static void primitiveClosureValue(void); +extern void primitiveClosureValueNoContextSwitch(void); +static void primitiveClosureValueWithArgs(void); +EXPORT(void) primitiveCompareBytes(void); +static void primitiveConstantFill(void); +static void primitiveControlVMProfiling(void); +static void primitiveCopyObject(void); +EXPORT(sqInt) primitiveCrashVM(void); +EXPORT(sqInt) primitiveDisablePowerManager(void); +static void primitiveDiv(void); +static void primitiveDivide(void); +EXPORT(void) primitiveDivideLargeIntegers(void); +EXPORT(void) primitiveDivLargeIntegers(void); +static void primitiveEqual(void); +EXPORT(void) primitiveEqualLargeIntegers(void); +static void primitiveExitToDebugger(void); +static void primitiveExp(void); +static void primitiveExponent(void); +extern sqInt primitiveFail(void); +extern sqInt primitiveFailFor(sqInt reasonCode); +extern sqInt primitiveFailureCode(void); +static void primitiveFetchNextMourner(void); +static void primitiveFloatAdd(void); +static void primitiveFloatAt(void); +static void primitiveFloatAtPut(void); +static void primitiveFloatDivide(void); +static void primitiveFloatEqual(void); +static void primitiveFloatGreaterOrEqual(void); +static void primitiveFloatGreaterThan(void); +static void primitiveFloatLessOrEqual(void); +static void primitiveFloatLessThan(void); +static void primitiveFloatMultiply(void); +static void primitiveFloatNotEqual(void); +static void primitiveFloatSubtract(void); +static void primitiveFlushCache(void); +static void primitiveFlushExternalPrimitives(void); +static void primitiveForceDisplayUpdate(void); +static void primitiveFormPrint(void); +static void primitiveFractionalPart(void); +static void primitiveFullClosureValue(void); +extern void primitiveFullClosureValueNoContextSwitch(void); +static void primitiveFullClosureValueWithArgs(void); +static void primitiveGetAttribute(void); +#if IMMUTABILITY +static void primitiveGetImmutability(void); +#else +# define primitiveGetImmutability (void (*)(void))0 +#endif /* IMMUTABILITY */ +EXPORT(sqInt) primitiveGetLogDirectory(void); +static void primitiveGetNextEvent(void); +EXPORT(sqInt) primitiveGetWindowLabel(void); +EXPORT(sqInt) primitiveGetWindowSize(void); +static void primitiveGreaterOrEqual(void); +EXPORT(void) primitiveGreaterOrEqualLargeIntegers(void); +static void primitiveGreaterThan(void); +EXPORT(void) primitiveGreaterThanLargeIntegers(void); +static void primitiveGrowMemoryByAtLeast(void); +EXPORT(sqInt) primitiveHeartbeatFrequency(void); +EXPORT(sqInt) primitiveHighResClock(void); +static void primitiveIdentical(void); +static void primitiveIdentityHash(void); +EXPORT(sqInt) primitiveImageFormatVersion(void); +static void primitiveImageName(void); +static void primitiveImmediateAsInteger(void); +static void primitiveInputSemaphore(void); +static void primitiveInputWord(void); +static void primitiveIntegerAt(void); +static void primitiveIntegerAtPut(void); +EXPORT(sqInt) primitiveInterruptChecksPerMSec(void); +static void primitiveInterruptSemaphore(void); +static void primitiveInvokeObjectAsMethod(void); +EXPORT(sqInt) primitiveIsBigEnder(void); +static void primitiveIsPinned(void); +EXPORT(sqInt) primitiveIsWindowObscured(void); +static void primitiveKbdNext(void); +static void primitiveKbdPeek(void); +static void primitiveLessOrEqual(void); +EXPORT(void) primitiveLessOrEqualLargeIntegers(void); +static void primitiveLessThan(void); +EXPORT(void) primitiveLessThanLargeIntegers(void); +static void primitiveListBuiltinModule(void); +static void primitiveListExternalModule(void); +static void primitiveLoadImageSegment(void); +static void primitiveLocalMicrosecondClock(void); +static void primitiveLogN(void); +static void primitiveLowSpaceSemaphore(void); +static void primitiveMakePoint(void); +static void primitiveMaxIdentityHash(void); +extern usqInt primitiveMethod(void); +static void primitiveMillisecondClock(void); +EXPORT(sqInt) primitiveMillisecondClockMask(void); +static void primitiveMod(void); +EXPORT(void) primitiveModLargeIntegers(void); +static void primitiveMouseButtons(void); +static void primitiveMousePoint(void); +static void primitiveMultiply(void); +EXPORT(void) primitiveMultiplyLargeIntegers(void); +static void primitiveNew(void); +static void primitiveNewMethod(void); +static void primitiveNewWithArg(void); +static void primitiveNextInstance(void); +static void primitiveNextObject(void); +static void primitiveNoop(void); +static void primitiveNotEqual(void); +EXPORT(void) primitiveNotEqualLargeIntegers(void); +static void primitiveNotIdentical(void); +EXPORT(sqInt) primitivePathToUsing(void); +static void primitivePerformInSuperclass(void); +static void primitivePerformWithArgs(void); +EXPORT(sqInt) primitiveProfilePrimitive(void); +EXPORT(sqInt) primitiveProfileSample(void); +EXPORT(sqInt) primitiveProfileStart(void); +static void primitiveQuit(void); +static void primitiveQuo(void); +EXPORT(void) primitiveQuoLargeIntegers(void); +static void primitiveRelinquishProcessor(void); +EXPORT(void) primitiveRemLargeIntegers(void); +static void primitiveScanCharacters(void); +EXPORT(sqInt) primitiveScreenDepth(void); +EXPORT(sqInt) primitiveScreenScaleFactor(void); +static void primitiveScreenSize(void); +static void primitiveSecondsClock(void); +static void primitiveSetDisplayMode(void); +static void primitiveSetFullScreen(void); +#if IMMUTABILITY +static void primitiveSetImmutability(void); +#else +# define primitiveSetImmutability (void (*)(void))0 +#endif /* IMMUTABILITY */ +static void primitiveSetInterruptKey(void); +EXPORT(sqInt) primitiveSetLogDirectory(void); +static void primitiveSetOrHasIdentityHash(void); +EXPORT(sqInt) primitiveSetWindowLabel(void); +EXPORT(sqInt) primitiveSetWindowSize(void); +static void primitiveShortAt(void); +static void primitiveShortAtPut(void); +static void primitiveShowDisplayRect(void); +static void primitiveSignalAtBytesLeft(void); +static void primitiveSine(void); +static void primitiveSize(void); +static void primitiveSizeInBytes(void); +static void primitiveSizeInBytesOfInstance(void); +static void primitiveSomeInstance(void); +static void primitiveSomeObject(void); +static void primitiveSpecialObjectsOop(void); +static void primitiveSquareRoot(void); +static void primitiveStoreImageSegment(void); +static void primitiveStringAt(void); +static void primitiveStringAtPut(void); +static void primitiveStringReplace(void); +static void primitiveSubtract(void); +EXPORT(void) primitiveSubtractLargeIntegers(void); +static void primitiveTestAndSetOwnershipOfCriticalSection(void); +static void primitiveTestDisplayDepth(void); +static void primitiveTimesTwoPower(void); +static void primitiveTruncated(void); +static void primitiveUnloadModule(void); +static void primitiveUpdateTimezone(void); +static void primitiveUTCMicrosecondClock(void); +static void primitiveUtcAndTimezoneOffset(void); +EXPORT(sqInt) primitiveUtcWithOffset(void); +static void primitiveVMPath(void); +static void primitiveVMProfileSamplesInto(void); +extern sqInt signalNoResume(sqInt aSemaphore); +extern sqIntptr_t signedMachineIntegerValueOf(sqInt oop); +extern usqInt sizeOfAlienData(sqInt oop); +extern void * startOfAlienData(sqInt oop); +extern sqInt success(sqInt successBoolean); +extern void ceScheduleScavenge(void); +static void clearLeakMapAndMapAccessibleObjects(void); +extern void ensureNoForwardedLiteralsIn(sqInt aMethodObj); +extern usqInt freeStartAddress(void); +extern usqInt getScavengeThreshold(void); +static sqLong NoDbgRegParms headerWhileForwardingOf(sqInt aCompiledMethodObjOop); +extern sqInt isForwardedClassIndex(sqInt maybeClassIndex); +extern sqInt isImmediateClass(sqInt classObj); +extern sqInt isReallyYoungObject(sqInt objOop); +extern sqInt methodHeaderOf(sqInt methodObj); +extern sqLong nullHeaderForMachineCodeMethod(void); +extern usqInt scavengeThresholdAddress(void); +extern sqInt withoutForwardingOnandwithsendToCogit(sqInt obj1, sqInt obj2, sqInt aBool, sqInt (*selector)(sqInt,sqInt,sqInt)); +static usqInt NoDbgRegParms addressAfter(sqInt objOop); +static sqInt NoDbgRegParms allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex); +static sqInt NoDbgRegParms allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex); +extern sqInt byteSwapped(sqInt w); +static usqInt NoDbgRegParms bytesInObject(sqInt objOop); +static sqInt NoDbgRegParms changeClassOfto(sqInt rcvr, sqInt argClass); +static double NoDbgRegParms dbgFloatValueOf(sqInt oop); +static sqInt defaultEdenBytes(void); +extern sqInt floatObjectOf(double aFloat); +extern double floatValueOf(sqInt oop); +static sqInt hasSixtyFourBitImmediates(void); +extern sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader); +static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt address); +static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); +extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt integerObjectOf(sqInt value); +extern sqInt integerValueOf(sqInt oop); +extern sqInt isIntegerObject(sqInt oop); +extern sqInt isIntegerValue(sqInt intValue); +extern sqInt isMarked(sqInt objOop); +static sqInt NoDbgRegParms lengthOfformat(sqInt objOop, sqInt fmt); +static sqInt maxSlotsForAlloc(void); +static sqInt numFreeLists(void); +static sqInt NoDbgRegParms objectAfterlimit(sqInt objOop, sqInt limit); +static void NoDbgRegParms setIsMarkedOfto(sqInt objOop, sqInt aBoolean); +extern usqInt smallObjectBytesForSlots(sqInt numSlots); +static sqInt wordIndexableFormat(void); +static void NoDbgRegParms NeverInline addToEphemeronList(sqInt ephemeronCorpse); +static void NoDbgRegParms NeverInline addToWeakList(sqInt weakCorpse); +static sqInt allNewSpaceObjectsHaveZeroRTRefCount(void); +static sqInt allWeakSurvivorsOnWeakList(void); +static void NeverInline computeRefCountToShrinkRT(void); +static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner); +static sqInt NoDbgRegParms copyAndForward(sqInt survivor); +static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor); +static void fireEphemeronsInRememberedSet(void); +static void fireEphemeronsOnEphemeronList(void); +static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList); +static void growRememberedSet(void); +static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop); +static sqInt NoDbgRegParms isMaybeOldScavengeSurvivor(sqInt oop); +static sqInt NoDbgRegParms isScavengeSurvivor(sqInt oop); +static sqInt NoDbgRegParms isonWeaklingList(sqInt oop, sqInt listHead); +static usqInt newSpaceCapacity(void); +static sqInt noUnfiredEphemeronsAtEndOfRememberedSet(void); +extern void printRememberedSet(void); +static void processEphemerons(void); +static void processWeaklings(void); +static sqInt NoDbgRegParms processWeakSurvivor(sqInt weakObj); +extern sqInt remember(sqInt objOop); +static void NoDbgRegParms scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress); +static void scavengeLoop(void); +static sqInt NoDbgRegParms scavengeReferentsOf(sqInt referrer); +static void NoDbgRegParms scavengeRememberedSetStartingAt(sqInt n); +static float scavengerTenuringThreshold(void); +static sqInt scavengeUnfiredEphemeronsOnEphemeronList(void); +static sqInt NoDbgRegParms accessibleObjectAfter(sqInt objOop); +static sqInt NoDbgRegParms NeverInline activeAndDeferredScan(sqInt anEphemeron); +static void NoDbgRegParms addFreeSubTree(sqInt freeTree); +extern sqInt addGCRoot(sqInt *varLoc); +extern sqInt addressCouldBeObj(sqInt address); +extern sqInt addressCouldBeOop(sqInt address); +static sqInt NoDbgRegParms addToFreeListbytes(sqInt freeChunk, sqInt chunkBytes); +static sqInt NoDbgRegParms addToFreeTreebytes(sqInt freeChunk, sqInt chunkBytes); +static sqInt NoDbgRegParms allInstancesOf(sqInt aClass); +static sqInt allObjects(void); +static sqInt allObjectsUnmarked(void); +static sqInt allOldMarkedWeakObjectsOnWeaklingStack(void); +static sqInt allocateLargestFreeChunk(void); +static sqInt NoDbgRegParms allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex); +static sqInt NoDbgRegParms allocateOldSpaceChunkOfBytes(usqInt chunkBytes); +extern sqInt allocatePinnedSlots(sqInt nSlots); +static sqInt allocationUnit(void); +static sqInt NoDbgRegParms allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling); +static sqInt allUnscannedEphemeronsAreActive(void); +extern sqInt arrayFormat(void); +static sqInt NoDbgRegParms becomeEffectFlagsFor(sqInt objOop); +extern sqInt becomewith(sqInt array1, sqInt array2); +static sqInt NoDbgRegParms becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag); +extern void beRootIfOld(sqInt oop); +static sqInt bitsSetInFreeSpaceMaskForAllFreeLists(void); +static sqInt bridgeSize(void); +static sqInt byteFormatMask(void); +extern sqInt byteSizeOf(sqInt oop); +extern sqInt characterObjectOf(sqInt characterCode); +extern void characterTable(void); +extern usqInt characterValueOf(sqInt oop); +static sqInt NoDbgRegParms cheapAddressCouldBeInHeap(sqInt address); +extern sqInt checkedLongAt(sqInt byteAddress); +static sqInt checkHeapFreeSpaceIntegrity(void); +static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); +extern sqInt checkOkayOop(usqInt oop); +extern sqInt checkOopHasOkayClass(usqInt obj); +static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name); +static sqInt NoDbgRegParms checkOopIntegritynamedindex(sqInt obj, char *name, sqInt i); +extern sqInt classAlien(void); +extern sqInt classArray(void); +extern sqInt classAtIndex(sqInt classIndex); +static sqInt NoDbgRegParms classAtIndexput(sqInt classIndex, sqInt objOop); +extern sqInt classBitmap(void); +extern sqInt classByteArray(void); +extern sqInt classCharacter(void); +extern sqInt classExternalAddress(void); +extern sqInt classExternalData(void); +extern sqInt classExternalFunction(void); +extern sqInt classExternalLibrary(void); +extern sqInt classExternalStructure(void); +extern sqInt classFloat(void); +static sqInt classIndexFieldWidth(void); +extern sqInt classIndexOf(sqInt objOop); +extern sqInt classLargeNegativeInteger(void); +extern sqInt classLargePositiveInteger(void); +extern sqInt classOrNilAtIndex(sqInt classIndex); +extern sqInt classPoint(void); +extern sqInt classSemaphore(void); +extern sqInt classSmallInteger(void); +extern sqInt classString(void); +extern sqInt classTableMinorIndexMask(void); +extern sqInt classTablePageSize(void); +extern sqInt classTableRootObj(void); +static sqInt classTableRootSlots(void); +extern sqInt classTagForClass(sqInt classObj); +extern sqInt classUnsafeAlien(void); +static void clearLeakMapAndMapAccessibleFreeSpace(void); +static sqInt NoDbgRegParms cloneInOldSpaceForPinning(sqInt objOop); +extern sqInt clone(sqInt objOop); +extern sqInt compactClassIndexOf(sqInt objOop); +static sqInt NoDbgRegParms copyObjtoAddrstartAtstopAt(sqInt objOop, sqInt segAddr, sqInt segStart, sqInt endSeg); +extern void countMarkedAndUnmarkdObjects(sqInt printFlags); +static void NoDbgRegParms detachFreeObject(sqInt freeChunk); +extern sqInt displayObject(void); +static void NoDbgRegParms doScavenge(sqInt tenuringCriterion); +extern sqInt eeInstantiateClassIndexformatnumSlots(sqInt knownClassIndex, sqInt objFormat, sqInt numSlots); +static void NoDbgRegParms emptyObjStack(sqInt objStack); +static sqInt NoDbgRegParms ensureRoomOnObjStackAt(sqInt objStackRootIndex); +static sqInt NoDbgRegParms enterIntoClassTable(sqInt aBehavior); +static sqInt ephemeronFormat(void); +static sqInt NoDbgRegParms existInstancesInNewSpaceOf(sqInt classObj); +static void NoDbgRegParms expungeFromClassTable(sqInt aBehavior); +extern sqInt falseObject(void); +extern sqInt fetchByteofObject(sqInt byteIndex, sqInt objOop); +static sqInt NoDbgRegParms NeverInline fetchClassOfNonImm(sqInt objOop); +extern sqInt fetchClassOf(sqInt oop); +static sqInt NoDbgRegParms fetchClassTagOfNonImm(sqInt obj); +extern sqInt fetchLong32ofObject(sqInt fieldIndex, sqInt oop); +static sqInt NoDbgRegParms fetchPointerofFreeChunk(sqInt fieldIndex, sqInt objOop); +extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop); +static sqInt findLargestFreeChunk(void); +extern void findStringBeginningWith(char *aCString); +extern void findString(char *aCString); +static void fireAllUnscannedEphemerons(void); +static sqInt firstAccessibleObject(void); +static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop); +extern void * firstFixedField(sqInt objOop); +extern void * firstIndexableField(sqInt objOop); +extern sqInt fixedFieldsOfClassFormatMask(void); +extern sqInt fixedFieldsOfClassFormat(sqInt classFormat); +static sqInt NoDbgRegParms fixedFieldsOfClass(sqInt objOop); +static sqInt NoDbgRegParms fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength); +static sqInt NoDbgRegParms NeverInline fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue); +static sqInt NoDbgRegParms followFieldofObject(sqInt fieldIndex, sqInt anObject); +static sqInt NoDbgRegParms followForwardedInObjStackatIndex(sqInt objStack, sqInt objStackRootIndex); +extern sqInt followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth); +extern sqInt followForwarded(sqInt objOop); +static sqInt NoDbgRegParms followObjFieldofObject(sqInt fieldIndex, sqInt anObject); +extern sqInt formatOfClass(sqInt classPointer); +static sqInt NoDbgRegParms formatOf(sqInt objOop); +static sqInt forwardedFormat(void); +static sqInt freeChunkNextIndex(void); +static sqInt freeChunkParentIndex(void); +static sqInt NoDbgRegParms freeChunkWithBytesat(sqInt bytes, sqInt address); +static sqInt freeListHeadsEmpty(void); +static sqInt freeListsObj(void); +extern sqInt freeObject(sqInt objOop); +extern usqLong NeverInline fullGC(void); +static float getHeapGrowthToSizeGCRatio(void); +static sqInt NoDbgRegParms goodContextSize(sqInt oop); +static sqInt NoDbgRegParms growOldSpaceByAtLeast(sqInt minAmmount); +extern usqLong headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex); +static usqLong NoDbgRegParms headerForSlotshashformatclassIndex(sqInt numSlots, sqInt hash, sqInt formatField, sqInt classIndex); +static sqInt hiddenRootSlots(void); +static sqInt hiddenRootsObject(void); +static usqInt imageSegmentVersion(void); +#if IMMUTABILITY +extern sqInt immutableBitMask(void); +#endif /* IMMUTABILITY */ +extern void incrementalGC(void); +static void NoDbgRegParms inFreeTreeReplacewith(sqInt treeNode, sqInt newNode); +static sqInt NoDbgRegParms initialInstanceOf(sqInt classObj); +static void NeverInline initializeNewSpaceVariables(void); +static void NoDbgRegParms initializeObjectMemory(sqInt bytesToShift); +extern void inOrderPrintFreeTreeprintList(sqInt freeChunk, sqInt printNextList); +static void NoDbgRegParms NeverInline inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); +extern sqInt instanceSizeOf(sqInt classObj); +extern sqInt instSpecOfClassFormat(sqInt classFormat); +static sqInt NoDbgRegParms instSpecOfClass(sqInt classPointer); +static sqInt NoDbgRegParms isAnyPointerFormat(sqInt format); +extern sqInt isArrayNonImm(sqInt oop); +extern sqInt isArray(sqInt oop); +extern sqInt isBytes(sqInt oop); +extern sqInt isCharacterObject(sqInt oop); +extern sqInt isCharacterValue(sqInt anInteger); +static sqInt NoDbgRegParms isClassAtUniqueIndex(sqInt aClass); +static sqInt NoDbgRegParms isCompiledMethodFormat(sqInt format); +static sqInt NoDbgRegParms isCompiledMethodHeader(sqInt objHeader); +extern sqInt isCompiledMethod(sqInt objOop); +static sqInt NoDbgRegParms isContextHeader(sqInt aHeader); +static sqInt NoDbgRegParms isContext(sqInt oop); +static sqInt NoDbgRegParms isEmptyObjStack(sqInt objStack); +static sqInt NoDbgRegParms isEnumerableObjectNoAssert(sqInt objOop); +static sqInt NoDbgRegParms isEnumerableObject(sqInt objOop); +static sqInt NoDbgRegParms isEphemeronFormat(sqInt format); +static sqInt NoDbgRegParms isEphemeron(sqInt objOop); +extern sqInt isFixedSizePointerFormat(sqInt format); +static sqInt NoDbgRegParms isForwardedClassTag(sqInt classIndex); +extern sqInt isForwarded(sqInt objOop); +static sqInt NoDbgRegParms isFreeObject(sqInt objOop); +extern sqInt isImmediate(sqInt oop); +static sqInt NoDbgRegParms isInClassTable(sqInt objOop); +extern sqInt isIndexable(sqInt objOop); +static sqInt NoDbgRegParms isInEden(sqInt objOop); +static sqInt NoDbgRegParms isInFutureSpace(sqInt address); +extern sqInt isInMemory(sqInt address); +static sqInt NoDbgRegParms isInNewSpace(sqInt objOop); +extern sqInt isInOldSpace(sqInt address); +static sqInt NoDbgRegParms isInPastSpace(sqInt address); +static sqInt NoDbgRegParms isMaybeFiredEphemeron(sqInt objOop); +extern sqInt isNonImmediate(sqInt oop); +static sqInt NoDbgRegParms isObjEphemeron(sqInt objOop); +static sqInt NoDbgRegParms isObjImmutable(sqInt anOop); +extern sqInt isOldObject(sqInt objOop); +extern sqInt isOopCompiledMethod(sqInt oop); +extern sqInt isOopForwarded(sqInt oop); +extern sqInt isOopImmutable(sqInt oop); +extern sqInt isOopMutable(sqInt oop); +extern sqInt isPinned(sqInt objOop); +extern sqInt isPointers(sqInt oop); +static sqInt NoDbgRegParms isPureBitsFormat(sqInt format); +extern sqInt isReallyYoung(sqInt oop); +static sqInt NoDbgRegParms isRemembered(sqInt objOop); +static sqInt NoDbgRegParms isSegmentBridge(sqInt objOop); +static sqInt NoDbgRegParms isSemaphoreOop(sqInt anOop); +extern sqInt isUnambiguouslyForwarder(sqInt objOop); +extern sqInt isValidClassTag(sqInt classIndex); +static sqInt NoDbgRegParms isValidFreeObject(sqInt objOop); +static sqInt NoDbgRegParms isValidObjStackAt(sqInt objStackRootIndex); +static sqInt NoDbgRegParms isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx); +static sqInt NoDbgRegParms isValidObjStackPagemyIndexfirstPage(sqInt objStackPage, sqInt myx, sqInt isFirstPage); +static sqInt NoDbgRegParms isValidObjStack(sqInt objStack); +static sqInt NoDbgRegParms isWeakFormat(sqInt format); +static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop); +extern sqInt isWeak(sqInt oop); +extern sqInt isWordsOrBytes(sqInt oop); +extern sqInt isWords(sqInt oop); +extern sqInt isYoungObject(sqInt objOop); +extern sqInt isYoung(sqInt oop); +static sqInt NoDbgRegParms isinstanceOfcompactClassIndex(sqInt oop, sqInt classOop, sqInt compactClassIndex); +static sqInt NoDbgRegParms isonObjStack(sqInt oop, sqInt objStack); +static sqInt NoDbgRegParms keyOfEphemeron(sqInt objOop); +static sqInt NoDbgRegParms knownClassAtIndex(sqInt classIndex); +extern sqInt lastPointerOfWhileSwizzling(sqInt objOop); +extern sqInt lastPointerOf(sqInt objOop); +extern sqInt leakCheckBecome(void); +extern sqInt leakCheckFullGC(void); +extern sqInt leakCheckIncremental(void); +extern sqInt leakCheckNewSpaceGC(void); +static sqInt NoDbgRegParms lengthOfMaybeImmediate(sqInt oop); +extern sqInt lengthOf(sqInt objOop); +extern sqInt literalCountOfMethodHeader(sqInt header); +extern sqInt literalCountOf(sqInt methodPointer); +static sqInt NoDbgRegParms loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray); +extern void longPrintInstancesOf(sqInt aClassOop); +extern void longPrintInstancesWithClassIndex(sqInt classIndex); +extern void longPrintReferencesTo(sqInt anOop); +static void NeverInline mapMournQueue(void); +static sqInt NoDbgRegParms mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointerArray, sqInt savedOutHashes); +static void NoDbgRegParms markAndTraceClassOf(sqInt objOop); +static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents); +extern void NeverInline markAndTrace(sqInt objOop); +static sqInt markInactiveEphemerons(void); +static void NoDbgRegParms markLoopFrom(sqInt objOop); +static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged); +static void markWeaklingsAndMarkAndFireEphemerons(void); +extern sqInt maybeSplObj(sqInt index); +static sqInt newObjectHash(void); +static sqInt newSpaceIsEmpty(void); +extern sqInt nilObject(void); +static void NeverInline nilUnmarkedWeaklingSlots(void); +static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex); +static sqInt NoDbgRegParms noCheckPushonObjStack(sqInt objOop, sqInt objStack); +static sqInt NoDbgRegParms noFixupFollowFieldofObject(sqInt fieldIndex, sqInt anObject); +static sqInt NoDbgRegParms noInlineFollowForwarded(sqInt objOop); +static sqInt NoDbgRegParms noInlineObjectAfterlimit(sqInt objOop, sqInt limit); +extern sqInt nonIndexablePointerFormat(void); +static sqInt noUnscannedEphemerons(void); +static usqInt NoDbgRegParms numBytesOfBytes(sqInt objOop); +extern usqInt numBytesOf(sqInt objOop); +static sqInt numberOfForwarders(void); +extern sqInt numPointerSlotsOf(sqInt objOop); +static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop); +extern usqInt numSlotsOf(sqInt objOop); +static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop); +extern sqInt numStrongSlotsOfWeakling(sqInt objOop); +extern sqInt objectAfter(sqInt objOop); +extern sqInt objectBefore(sqInt objOop); +static sqInt NoDbgRegParms objectStartingAt(sqInt address); +static sqInt NoDbgRegParms objectsReachableFromRoots(sqInt arrayOfRoots); +extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop); +static sqInt NoDbgRegParms okayOop(sqInt signedOop); +static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag); +extern sqInt pinObject(sqInt objOop); +static sqInt NoDbgRegParms popObjStack(sqInt objStack); +extern sqInt popRemappableOop(void); +static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags); +extern sqInt primitiveErrorTable(void); +extern void printActivationsOf(sqInt aMethodObj); +extern void printContextReferencesTo(sqInt anOop); +extern void printEntity(sqInt oop); +extern void printForwarders(void); +extern void printFreeChunks(void); +extern void printFreeChunk(sqInt freeChunk); +static void NoDbgRegParms printFreeChunkprintAsTreeNode(sqInt freeChunk, sqInt printAsTreeNode); +extern void printFreeListHeads(void); +extern sqInt printFreeList(sqInt chunkOrIndex); +extern void printFreeTree(void); +static void NoDbgRegParms printFreeTreeChunk(sqInt chunkOrZero); +extern void printHeaderOf(sqInt objOop); +static void NoDbgRegParms printHeaderTypeOf(sqInt objOop); +extern void printInstancesOf(sqInt aClassOop); +extern void printInstancesWithClassIndex(sqInt classIndex); +extern void printInvalidClassTableEntries(void); +extern void printMethodImplementorsOf(sqInt anOop); +extern void printMethodReferencesTo(sqInt anOop); +extern void printObjectsFromto(sqInt startAddress, sqInt endAddress); +extern void printObjectsWithHash(sqInt hash); +static void NoDbgRegParms printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType); +static void NoDbgRegParms printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType); +extern void printObjStack(sqInt objStack); +extern void printOopsFromto(sqInt startAddress, sqInt endAddress); +extern void printReferencesTo(sqInt anOop); +static sqInt NoDbgRegParms pushOnUnscannedEphemeronsStack(sqInt anEphemeron); +extern void pushRemappableOop(sqInt oop); +static sqInt NoDbgRegParms pushonObjStack(sqInt objOop, sqInt objStack); +static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray); +static sqInt NoDbgRegParms rawClassTagForClass(sqInt classObj); +extern sqInt rawHashBitsOf(sqInt objOop); +extern sqInt removeGCRoot(sqInt *varLoc); +static void NoDbgRegParms restoreObjectsInsavedHashes(sqInt objArray, sqInt savedHashes); +static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes); +static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes); +static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid); +static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion); +static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd); +static sqInt NoDbgRegParms shortentoIndexableSize(sqInt objOop, sqInt indexableSize); +extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress); +extern sqInt shouldRemapOop(sqInt oop); +static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack); +extern sqInt slotSizeOf(sqInt oop); +extern sqInt splObj(sqInt index); +static sqInt NoDbgRegParms startOfObject(sqInt objOop); +extern usqInt storeCheckBoundary(void); +static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots); +extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); +extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); +extern sqInt stringForCString(const char *aCString); +static sqInt NoDbgRegParms sufficientSpaceAfterGC(sqInt numBytes); +static sqInt NoDbgRegParms swizzleObjStackAt(sqInt objStackRootIndex); +extern void tenuringIncrementalGC(void); +static sqInt NoDbgRegParms topOfObjStack(sqInt objStack); +extern sqInt topRemappableOop(void); +static sqInt totalFreeListBytes(void); +extern sqInt trueObject(void); +static void NoDbgRegParms unlinkSolitaryFreeTreeNode(sqInt freeTreeNode); +extern sqInt unpinObject(sqInt objOop); +static sqInt validClassTableHashes(void); +static sqInt validClassTableRootPages(void); +extern sqInt validFreeTree(void); +static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt parent); +static sqInt validObjStacks(void); +extern sqInt vmEndianness(void); +extern sqInt checkTraversableSortedFreeList(void); +static void NeverInline compact(void); +static void eliminateAndFreeForwardersForPigCompact(void); +static void NeverInline freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact(void); +static sqInt NoDbgRegParms moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit); +static usqInt NoDbgRegParms nextInSortedFreeListLinkgiven(sqInt freeChunk, sqInt prevFree); +extern void printSortedFreeList(void); +static void rebuildFreeListsForPigCompact(void); +extern sqInt remapObj(sqInt objOop); +extern sqInt shouldRemapObj(sqInt objOop); +static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit); +static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount); +static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift); +static sqInt allBridgesMarked(void); +static void allocateOrExtendSegmentInfos(void); +static sqInt NoDbgRegParms bridgeAt(sqInt segIndex); +static sqInt NoDbgRegParms bridgeFor(SpurSegmentInfo *aSegment); +static void NoDbgRegParms bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil); +static void checkSegments(void); +static void collapseSegmentsPostSwizzle(void); +static void * NoDbgRegParms firstGapOfSizeAtLeast(sqInt size); +static sqInt NoDbgRegParms isEmptySegment(SpurSegmentInfo *seg); +static sqInt NoDbgRegParms isInSegments(usqInt address); +static sqInt NoDbgRegParms isValidSegmentBridge(sqInt objOop); +static sqInt lastBridge(void); +static SpurSegmentInfo * NoDbgRegParms nextNonEmptySegmentAfter(sqInt i); +static void postSnapshot(void); +static void NeverInline prepareForSnapshot(void); +static sqInt NoDbgRegParms readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes); +EXPORT(SpurSegmentInfo *) segmentContainingObj(sqInt objOop); +static void NoDbgRegParms shrinkObjectMemory(usqInt delta); +static sqInt someSegmentContainsPinned(void); +static sqInt NoDbgRegParms swizzleObj(sqInt objOop); +static usqInt totalBytesInSegments(void); +static sqInt NoDbgRegParms writeImageSegmentsToFile(sqImageFile aBinaryStream); +static sqInt NoDbgRegParms writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSegment, sqImageFile aBinaryStream); +extern sqInt activeProcess(void); +static void NoDbgRegParms addLastLinktoList(sqInt proc, sqInt aList); +static sqInt NoDbgRegParms addressCouldBeClassObj(sqInt maybeClassObj); +static char * allOnesAsCharStar(void); +extern sqInt argumentCountOfClosure(sqInt closurePointer); +extern sqInt argumentCountOfMethodHeader(sqInt header); +extern sqInt argumentCountOf(sqInt methodPointer); +extern void * arrayValueOf(sqInt arrayOop); +static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj); +extern void assertValidExecutionPointers(usqInt lip, char *lifp, char *lisp); +static void NoDbgRegParms assertValidStackLimits(sqInt ln); +extern sqInt booleanValueOf(sqInt obj); +EXPORT(sqInt) callbackLeave(sqInt cbID); +extern sqInt canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader); +extern sqInt characterForAscii(sqInt ascii); +extern sqInt checkAllAccessibleObjectsOkay(void); +static sqInt checkDeliveryOfLongRunningPrimitiveSignal(void); +extern sqInt checkedIntegerValueOf(sqInt intOop); +static sqInt NoDbgRegParms checkForEventsMayContextSwitch(sqInt mayContextSwitch); +static sqInt NoDbgRegParms checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset); +static sqInt checkInterpreterIntegrity(void); +static sqInt NoDbgRegParms checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP); +extern sqInt checkOkayInterpreterObjects(sqInt writeBack); +static sqInt NoDbgRegParms checkOkayStackPage(StackPage *thePage); +static sqInt NoDbgRegParms checkOkayStackZone(sqInt writeBack); +static void NoDbgRegParms checkProfileTick(sqInt aPrimitiveMethod); +static sqInt NoDbgRegParms checkStackPointerForMaybeMarriedContext(sqInt aContext); +static sqInt NoDbgRegParms checkStackPointerIndexForFrame(char *theFP); +static sqInt NoDbgRegParms classNameOfIs(sqInt aClass, char *className); +static sqInt NoDbgRegParms contexthasSender(sqInt thisCntx, sqInt aContext); +static sqInt NoDbgRegParms contexthasValidInversePCMappingOfin(sqInt aContext, sqInt theIP, char *theFP); +extern usqInt copiedValueCountOfClosure(sqInt closurePointer); +extern usqInt copiedValueCountOfFullClosure(sqInt closurePointer); +extern sqInt copyBits(void); +extern sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y); +static sqInt NoDbgRegParms NeverInline couldBeProcess(sqInt oop); +static void cr(void); +static void NoDbgRegParms createActualMessageTo(sqInt lookupClass); +static sqInt defaultNumStackPages(void); +static sqInt NoDbgRegParms displayBitsOfLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b); +static sqInt divorceAllFrames(void); +static void NoDbgRegParms divorceFramesIn(StackPage *aStackPage); +static sqInt NoDbgRegParms doPrimitiveDivby(sqInt rcvr, sqInt arg); +static sqInt NoDbgRegParms doPrimitiveModby(sqInt rcvr, sqInt arg); +extern sqInt doSignalSemaphoreWithIndex(sqInt index); +static void dummyReferToProxy(void); +static sqInt NoDbgRegParms encodeFrameFieldHasContextisBlocknumArgs(sqInt hasContext, sqInt isBlock, sqInt numArgs); +static sqInt NoDbgRegParms ensureCallerContext(char *theFP); +static void NoDbgRegParms ensureImageFormatIsUpToDate(sqInt swapBytes); +static char * NoDbgRegParms establishFrameForContextToReturnTo(sqInt contextToReturnTo); +static void NoDbgRegParms externalDivorceFrameandContext(char *theFP, sqInt ctxt); +static char * NoDbgRegParms externalEnsureIsBaseFrame(char *aFramePtr); +static sqInt NoDbgRegParms externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop); +static sqInt externalQuickPrimitiveResponse(void); +static void failUnbalancedPrimitive(void); +extern void * fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer); +extern double fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer); +extern sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer); +static sqInt NoDbgRegParms fetchPointerofMarriedContext(sqInt offset, sqInt aContext); +static sqInt NoDbgRegParms fetchStackPointerOf(sqInt aContext); +static sqInt NoDbgRegParms findClassContainingMethodstartingAt(sqInt meth, sqInt classObj); +extern sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr); +static char * NoDbgRegParms findFrameAboveinPage(char *theFP, StackPage *thePage); +static sqInt NoDbgRegParms findHomeForContext(sqInt aContext); +static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderContext, sqInt homeContext); +extern sqInt findSelectorOfMethod(sqInt meth); +static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage); +static sqInt NoDbgRegParms findUnwindThroughContext(sqInt homeContext); +static void NoDbgRegParms fireEphemeron(sqInt ephemeron); +static void NoDbgRegParms fireFinalization(sqInt weakling); +extern double floatArg(sqInt index); +static void NoDbgRegParms followForwardedFrameContentsstackPointer(char *theFP, char *theSP); +extern sqInt forceInterruptCheck(void); +static sqInt NoDbgRegParms frameContext(char *theFP); +static char * NoDbgRegParms frameOfMarriedContext(sqInt aContext); +static char* NoDbgRegParms framePointerOfNativeArgumentin(sqInt offset, char*theFP); +static char* NoDbgRegParms framePointerOfNativeLocalin(sqInt offset, char*theFP); +static sqInt NoDbgRegParms frameStackedReceiverOffsetNumArgs(sqInt numArgs); +static sqInt NoDbgRegParms frameStackedReceiverOffset(char *theFP); +static sqInt NoDbgRegParms frameStackedReceivernumArgs(char *theFP, sqInt numArgs); +static void freeUntracedStackPages(void); +extern sqInt fullDisplayUpdate(void); +extern void (*functionPointerForinClass(sqInt primIdx,sqInt theClass))(void) ; +extern sqInt getFullScreenFlag(void); +extern sqInt getInterruptKeycode(void); +extern sqInt getInterruptPending(void); +extern usqLong getNextWakeupUsecs(void); +extern sqInt getSavedWindowSize(void); +static sqInt NoDbgRegParms getShortFromFileswap(sqImageFile aFile, sqInt swapFlag); +extern sqInt * getStackPointer(void); +extern sqInt getThisSessionID(void); +static sqInt NoDbgRegParms getWord32FromFileswap(sqImageFile aFile, sqInt swapFlag); +static sqInt NoDbgRegParms handleForwardedSelectorFaultFor(sqInt selectorOop); +static sqInt NoDbgRegParms handleForwardedSendFaultForTag(sqInt classTag); +static sqInt NoDbgRegParms handleSpecialSelectorSendFaultForfpsp(sqInt obj, char *theFP, char *theSP); +static void NeverInline handleStackOverflow(void); +static sqInt NoDbgRegParms handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch); +extern usqInt highBit(usqInt anUnsignedValue); +static sqInt NoDbgRegParms ifCurrentStackPageHasValidHeadPointers(StackPage *thePage); +static usqInt NoDbgRegParms iframeMethod(char *theFP); +extern sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass); +extern sqInt integerArg(sqInt index); +extern void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean); +static sqInt NoDbgRegParms isBaseFrame(char *theFP); +extern sqInt isFloatObject(sqInt oop); +static sqInt NoDbgRegParms isFrameonPage(char *aFrame, StackPage *aPage); +extern sqInt isKindOfInteger(sqInt oop); +extern sqInt isLargeIntegerObject(sqInt oop); +extern sqInt isLargeNegativeIntegerObject(sqInt oop); +extern sqInt isLargePositiveIntegerObject(sqInt oop); +static sqInt NoDbgRegParms isLiveContext(sqInt oop); +static sqInt NoDbgRegParms isMarriedOrWidowedContext(sqInt aContext); +static sqInt NoDbgRegParms isNullExternalPrimitiveCall(sqInt aMethodObj); +extern sqInt isOptimizedMethod(sqInt methodObj); +static sqInt isPrimitiveFunctionPointerAnIndex(void); +extern sqInt isQuickPrimitiveIndex(sqInt anInteger); +extern sqInt isReadMediatedContextInstVarIndex(sqInt index); +static sqInt NoDbgRegParms isSingleContext(sqInt aContext); +static sqInt NoDbgRegParms isVanillaBlockClosure(sqInt aClosure); +static sqInt NoDbgRegParms isWidowedContextDuringGC(sqInt aOnceMarriedContext); +static sqInt NoDbgRegParms isWidowedContext(sqInt aOnceMarriedContext); +extern sqInt isWriteMediatedContextInstVarIndex(sqInt index); +extern sqInt isKindOfClass(sqInt oop, sqInt aClass); +extern sqInt isKindOf(sqInt oop, char *className); +extern sqInt isMemberOf(sqInt oop, char *className); +static sqInt NoDbgRegParms lengthOfNameOfClass(sqInt classOop); +extern sqInt literalofMethod(sqInt offset, sqInt methodPointer); +extern sqInt loadBitBltFrom(sqInt bb); +extern void loadInitialContext(void); +extern void longPrintOop(sqInt oop); +extern sqInt longStoreBytecodeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms lookupInMethodCacheSelclassTag(sqInt selector, sqInt classTag); +static sqInt NoDbgRegParms lookupMethodInClass(sqInt class); +static sqInt NoDbgRegParms lookupMNUInClass(sqInt class); +static sqInt NoDbgRegParms lookupOrdinaryNoMNUEtcInClass(sqInt class); +extern sqInt lookupSelectorinClass(sqInt selector, sqInt class); +static void NoDbgRegParms NeverInline lowcodeStoreLocalInt64Workaroundinsp(sqInt baseOffset, char*theFP, char*theSP); +static void NoDbgRegParms makeContextSnapshotSafe(sqInt ctxt); +extern sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue); +static void mapInterpreterOops(void); +static sqInt NoDbgRegParms markAndTraceStackPages(sqInt fullGCFlag); +static void markAndTraceUntracedReachableStackPages(void); +static sqInt NoDbgRegParms marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame); +static void NoDbgRegParms marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext); +static sqInt NoDbgRegParms marryFrameSP(char *theFP, char *theSP); +static sqInt NoDbgRegParms maybeLeakCheckExternalPrimCall(sqInt aMethodObj); +static sqInt NoDbgRegParms maybeSelectorOfMethod(sqInt methodObj); +extern sqInt methodArgumentCount(void); +extern sqInt methodArg(sqInt index); +extern sqInt methodClassAssociationOf(sqInt methodPointer); +extern sqInt methodClassOf(sqInt methodPointer); +static sqInt NoDbgRegParms methodHeaderHasPrimitive(sqInt methodHeader); +static sqInt NoDbgRegParms methodHeaderIndicatesLargeFrame(sqInt methodHeader); +extern sqInt methodPrimitiveIndex(void); +extern sqInt methodReturnValue(sqInt oop); +extern sqInt methodUsesAlternateBytecodeSet(sqInt aMethodObj); +EXPORT(void) moduleUnloaded(char *aModuleName); +static char * NoDbgRegParms nameOfClass(sqInt classOop); +static sqInt NoDbgRegParms NeverInline noInlineSigned32BitIntegerGutsFor(sqInt integerValue); +static sqInt NoDbgRegParms noInlineTemporaryin(sqInt offset, char *theFP); +static sqInt NoDbgRegParms noInlineTemporaryinput(sqInt offset, char *theFP, sqInt valueOop); +static sqInt NoDbgRegParms noMarkedContextsOnPage(StackPage *thePage); +static sqInt NoDbgRegParms numSlotsOfMarriedContext(sqInt aContext); +static sqInt numStkPages(void); +extern sqInt objCouldBeClassObj(sqInt objOop); +extern sqInt objectArg(sqInt index); +extern sqInt penultimateLiteralOf(sqInt aMethodOop); +extern sqInt popStack(void); +extern sqInt pop(sqInt nItems); +extern void popthenPush(sqInt nItems, sqInt oop); +static sqInt NoDbgRegParms positiveMachineIntegerFor(usqIntptr_t value); +EXPORT(void) primitiveEventProcessingControl(void); +extern sqInt primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader); +extern sqInt primitiveIndexOf(sqInt methodPointer); +static void NoDbgRegParms printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass); +static void NoDbgRegParms printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage); +extern void printAllStacks(void); +extern void printCallStack(void); +static sqInt NoDbgRegParms printCallStackFP(char *theFP); +extern sqInt printCallStackOf(sqInt aContextOrProcessOrFrame); +static sqInt NoDbgRegParms printCallStackOfcurrentFP(sqInt aContext, char *currFP); +extern void printChar(sqInt aByte); +static sqInt NoDbgRegParms printContextCallStackOf(sqInt aContext); +extern void printContext(sqInt aContext); +extern void printExternalHeadFrame(void); +static sqInt NoDbgRegParms printFrameAndCallersSPshort(char *theFP, char *theSP, sqInt printShort); +static void NoDbgRegParms printFrameOopat(char *name, char *address); +static void NoDbgRegParms printFrameOopindexat(char *name, sqInt idx, char *address); +EXPORT(void) printFramesInPage(StackPage *thePage); +EXPORT(void) printFramesOnStackPageListInUse(void); +static void NoDbgRegParms printFrameThingandFrameat(char *name, char *theFP, char *address); +static void NoDbgRegParms printFrameThingat(char *name, char *address); +extern sqInt printFrame(char *theFP); +extern void printHexnp(sqInt n); +extern void printHex(sqInt n); +extern void printLikelyImplementorsOfSelector(sqInt selector); +extern void printMethodCache(void); +extern void printMethodDictionaryOf(sqInt behavior); +extern void printMethodDictionary(sqInt dictionary); +static void NoDbgRegParms printNameOfClasscount(sqInt classOop, sqInt cnt); +static void NoDbgRegParms printNum(sqInt n); +static void NoDbgRegParms printOopShort(sqInt oop); +extern sqInt printOop(sqInt oop); +extern void printProcessStack(sqInt aProcess); +extern sqInt printProcsOnList(sqInt procList); +extern sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame); +extern void printStackPageList(void); +extern void printStackPageListInUse(void); +extern void printStackPages(void); +extern void printStackPagesInUse(void); +static void NoDbgRegParms printStackPageuseCount(StackPage *page, sqInt n); +extern void printStackReferencesTo(sqInt oop); +static void NoDbgRegParms printStringOf(sqInt oop); +extern void print(char *s); +extern void pushBool(sqInt trueOrFalse); +static sqInt NoDbgRegParms pushedReceiverOrClosureOfFrame(char *theFP); +extern void pushFloat(double f); +extern sqInt pushInteger(sqInt integerValue); +extern void push(sqInt object); +static void NoDbgRegParms putLongtoFile(sqInt aLong, sqImageFile aFile); +static void NoDbgRegParms putShorttoFile(short aShort, sqImageFile aFile); +static void NoDbgRegParms putToSleepyieldingIf(sqInt aProcess, sqInt yieldImplicitly); +static void NoDbgRegParms putWord32toFile(int aWord32, sqImageFile aFile); +static sqInt NoDbgRegParms quickFetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer); +extern sqInt readableFormat(sqInt imageVersion); +EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext); +static sqInt NoDbgRegParms removeFirstLinkOfList(sqInt aList); +static sqInt retryPrimitiveOnFailure(void); +EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext); +static sqInt NoDbgRegParms reverseDisplayFromto(sqInt startIndex, sqInt endIndex); +static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer); +static sqInt schedulerPointer(void); +extern void setBreakMNUSelector(char *aString); +extern void setBreakSelector(char *aString); +extern void setFullScreenFlag(sqInt value); +EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ; +extern void setInterruptKeycode(sqInt value); +extern void setInterruptPending(sqInt value); +extern void setNextWakeupUsecs(usqLong value); +extern void setSavedWindowSize(sqInt value); +static void setSignalLowSpaceFlagAndSaveProcess(void); +static void NoDbgRegParms setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext); +static void setupNativeStack(void); +static sqInt NoDbgRegParms shortPrintContext(sqInt aContext); +static sqInt NoDbgRegParms shortPrintFrameAndCallers(char *theFP); +EXPORT(void) shortPrintFramesInPage(StackPage *thePage); +EXPORT(void) shortPrintFramesOnStackPageListInUse(void); +extern void shortPrintFrameAndNCallers(char *theFP, sqInt n); +static sqInt NoDbgRegParms shortPrintOop(sqInt oop); +static sqInt NoDbgRegParms shortReversePrintFrameAndCallers(char *aFramePointer); +extern sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b); +static sqInt signalExternalSemaphores(void); +extern sqInt sizeOfCallPrimitiveBytecode(sqInt methodHeader); +extern sqInt sizeOfLongStoreTempBytecode(sqInt methodHeader); +extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr); +static sqInt NoDbgRegParms snapshot(sqInt embedded); +static void space(void); +extern sqInt specialSelector(sqInt index); +static void NoDbgRegParms spurPostBecomeAction(sqInt theBecomeEffectsFlags); +extern double stackFloatValue(sqInt offset); +extern sqInt stackIntegerValue(sqInt offset); +static sqInt stackLimitBytes(void); +extern sqInt stackObjectValue(sqInt offset); +static sqInt stackPageByteSize(void); +static sqInt NoDbgRegParms stackPointerForMaybeMarriedContext(sqInt aContext); +static sqInt NoDbgRegParms stackPointerIndexForFrame(char *theFP); +extern usqIntptr_t stackPositiveMachineIntegerValue(sqInt offset); +extern sqIntptr_t stackSignedMachineIntegerValue(sqInt offset); +extern sqInt stackTop(void); +extern sqInt stackValue(sqInt offset); +extern sqInt startPCOfMethod(sqInt aCompiledMethod); +extern sqInt stObjectat(sqInt array, sqInt index); +extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value); +extern sqInt storeIntegerofObjectwithValue(sqInt fieldIndex, sqInt objectPointer, sqInt integerValue); +static char * NoDbgRegParms storeSenderOfFramewithValue(char *theFP, sqInt anOop); +extern sqInt stSizeOf(sqInt oop); +extern sqInt superclassOf(sqInt classPointer); +extern sqInt tempCountOf(sqInt methodPointer); +extern sqInt temporaryCountOfMethodHeader(sqInt header); +extern sqInt ultimateLiteralOf(sqInt aMethodOop); +static sqInt NoDbgRegParms NeverInline unfollowatIndex(sqInt litVar, sqInt literalIndex); +static sqInt NoDbgRegParms validInstructionPointerinFrame(usqInt anInstrPointer, char *fp); +static sqInt validStackPageBaseFrames(void); +static void NoDbgRegParms voidLongRunningPrimitive(char *reason); +static sqInt wakeHighestPriority(void); +static sqInt NeverInline writeImageFileIO(void); +static sqInt NoDbgRegParms cloneContext(sqInt aContext); +static sqInt NoDbgRegParms fieldOrSenderFPofContext(sqInt index, sqInt contextObj); +static sqInt NoDbgRegParms fieldofFrame(sqInt index, char *theFP); +static sqInt NoDbgRegParms isAppropriateForCopyObject(sqInt oop); +static void primitiveClone(void); +static void primitiveContextAt(void); +static void primitiveContextAtPut(void); +static void primitiveContextSize(void); +static void primitiveDeferDisplayUpdates(void); +static void primitiveDoNamedPrimitiveWithArgs(void); +static void primitiveDoPrimitiveWithArgs(void); +static void primitiveExecuteMethod(void); +static void primitiveExecuteMethodArgsArray(void); +static void primitiveExternalCall(void); +static void primitiveFindHandlerContext(void); +static void primitiveFindNextUnwindContext(void); +static void primitiveFullGC(void); +static void primitiveIncrementalGC(void); +static void primitiveInstVarAt(void); +static void primitiveInstVarAtPut(void); +EXPORT(sqInt) primitiveLongRunningPrimitive(void); +static void primitiveObjectPointsTo(void); +static void primitivePerform(void); +static void primitivePin(void); +EXPORT(void) primitiveSetGCSemaphore(void); +static void primitiveSignalAtMilliseconds(void); +static void primitiveSignalAtUTCMicroseconds(void); +static void primitiveSlotAt(void); +static void primitiveSlotAtPut(void); +static void primitiveStoreStackp(void); +static void primitiveVMParameter(void); +EXPORT(void) primitiveVoidReceiver(void); +static void NoDbgRegParms pruneStackstackp(sqInt stack, sqInt stackp); +static void unmarkAfterPathTo(void); + +/*** Variables ***/ +#if SQ_USE_GLOBAL_STRUCT +# define _iss /* define in-struct static as void */ +static struct foo { +#else +# define _iss static +#endif +_iss char * stackPointer; +_iss sqInt primFailCode; +_iss char * framePointer; +_iss usqInt method; +_iss StackPage * stackPage; +_iss usqInt freeStart; +_iss sqInt nilObj; +_iss usqInt instructionPointer; +_iss sqInt bytecodeSetSelector; +_iss sqInt argumentCount; +_iss sqInt specialObjectsOop; +_iss usqInt newMethod; +_iss usqInt newSpaceLimit; +_iss sqInt messageSelector; +_iss usqInt endOfMemory; +_iss StackPage * pages; +_iss usqInt oldSpaceStart; +_iss char * stackBasePlus1; +_iss char* shadowCallStackPointer; +_iss sqInt needGCFlag; +_iss sqInt trueObj; +_iss sqInt falseObj; +_iss usqInt newSpaceStart; +_iss SpurSegmentInfo * segments; +_iss sqInt hiddenRootsObj; +_iss usqInt totalFreeOldSpace; +_iss usqInt scavengeThreshold; +_iss usqInt pastSpaceStart; +_iss sqInt bytesPerPage; +_iss sqInt numSegments; +_iss sqInt traceLogIndex; +_iss sqInt * freeLists; +_iss char * stackLimit; +_iss sqInt rememberedSetSize; +_iss sqInt * rememberedSet; +_iss unsigned char primTraceLogIndex; +_iss sqInt classTableFirstPage; +_iss usqInt freeListsMask; +_iss StackPage * mostRecentlyUsedPage; +_iss char * nativeStackPointer; +_iss sqInt tempOop; +_iss usqInt firstFreeChunk; +_iss sqInt remapBufferCount; +_iss sqInt markStack; +_iss SpurContiguousObjStack unscannedEphemerons; +_iss sqInt weaklingStack; +_iss sqInt numStackPages; +_iss sqInt profileProcess; +_iss SpurNewSpaceSpace pastSpace; +_iss sqInt profileSemaphore; +_iss sqInt profileMethod; +_iss sqInt lkupClass; +_iss sqInt longRunningPrimitiveCheckSemaphore; +_iss sqInt numClassTablePages; +_iss sqInt futureSurvivorStart; +_iss sqInt classTableIndex; +_iss sqLong nextProfileTick; +_iss sqInt numRememberedEphemerons; +_iss SpurNewSpaceSpace futureSpace; +_iss sqInt jmpDepth; +_iss usqInt lastFreeChunk; +_iss sqInt longRunningPrimitiveCheckMethod; +_iss sqInt mournQueue; +_iss sqInt tempOop2; +_iss sqInt becomeEffectsFlags; +_iss SpurNewSpaceSpace eden; +_iss sqInt lastCoggableInterpretedBlockMethod; +_iss sqInt lastUncoggableInterpretedBlockMethod; +_iss char * objStackInvalidBecause; +_iss sqInt tempOop3; +_iss sqInt ephemeronList; +_iss sqInt tenureThreshold; +_iss usqInt freeOldSpaceStart; +_iss sqInt extraRootCount; +_iss sqInt growHeadroom; +_iss sqInt invalidObjStackPage; +_iss sqInt previousRememberedSetSize; +_iss sqInt tenureCriterion; +_iss sqInt classNameIndex; +_iss sqInt cogCompiledCodeCompactionCalledFor; +_iss sqInt metaclassNumSlots; +_iss sqInt numSegInfos; +_iss sqInt preemptionYields; +_iss sqInt gcMode; +_iss usqLong nextWakeupUsecs; +_iss sqInt cogCodeSize; +_iss sqInt highestRunnableProcessPriority; +_iss usqLong longRunningPrimitiveStartUsecs; +_iss usqLong longRunningPrimitiveStopUsecs; +_iss usqLong statCheckForEvents; +_iss usqLong statGCEndUsecs; +_iss sqInt weakList; +_iss sqInt externalPrimitiveTableFirstFreeIndex; +_iss sqInt flagInterpretedMethods; +_iss sqInt marking; +_iss sqInt newFinalization; +_iss sqInt statSurvivorCount; +_iss sqInt thisClassIndex; +_iss sqInt firstSegmentSize; +_iss sqInt gcPhaseInProgress; +_iss usqLong gcStartUsecs; +_iss usqInt lowSpaceThreshold; +_iss sqInt pendingFinalizationSignals; +_iss sqInt rememberedSetLimit; +_iss sqInt shrinkThreshold; +_iss usqLong statIOProcessEvents; +_iss sqInt sweepIndex; +_iss sqInt edenBytes; +_iss sqInt imageHeaderFlags; +_iss sqInt lastHash; +_iss sqInt lastMethodCacheProbeWrite; +_iss sqInt longRunningPrimitiveCheckSequenceNumber; +_iss usqInt memory; +_iss sqInt numCompactionPasses; +_iss sqInt fullScreenFlag; +_iss float heapGrowthToSizeGCRatio; +_iss usqInt heapSizeAtPreviousGC; +_iss sqInt interruptKeycode; +_iss sqInt interruptPending; +_iss sqInt methodDictLinearSearchLimit; +_iss usqLong nextPollUsecs; +_iss sqInt rememberedSetRedZone; +_iss sqInt savedWindowSize; +_iss sqInt statCompactPassCount; +_iss usqLong statForceInterruptCheck; +_iss usqLong statFullGCUsecs; +_iss sqInt statFullGCs; +_iss sqInt statGrowMemory; +_iss usqLong statProcessSwitch; +_iss usqLong statScavengeGCUsecs; +_iss sqInt statScavenges; +_iss sqInt statShrinkMemory; +_iss usqLong statStackOverflow; +_iss usqLong statStackPageDivorce; +_iss sqInt statTenures; +_iss sqInt canSwizzle; +_iss sqInt deferSmash; +_iss sqInt deferredSmash; +_iss sqInt extraFramesToMoveOnOverflow; +_iss sqInt globalSessionID; +_iss sqInt imageFloatsBigEndian; +_iss sqInt longRunningPrimitiveSignalUndelivered; +_iss sqInt maxExtSemTabSizeSet; +_iss sqInt signalLowSpace; +_iss sqInt statCodeCompactionCount; +_iss usqLong statCodeCompactionUsecs; +_iss sqInt statMarkCount; +_iss sqInt statMaxPageCountWhenMapping; +_iss sqInt statNumMaps; +_iss sqInt statPageCountWhenMappingSum; +_iss sqInt statRootTableCount; +_iss double tenuringProportion; +_iss sqInt classByteArrayCompactIndex; +_iss sqInt gcSemaphoreIndex; +_iss usqLong longRunningPrimitiveGCUsecs; +_iss sqInt overflowLimit; +_iss StackPage * overflowedPage; +_iss sqInt refCountToShrinkRT; +_iss sqInt statCoalesces; +_iss usqLong statIGCDeltaUsecs; +_iss sqInt statPendingFinalizationSignals; +_iss sqInt statRootTableOverflows; +_iss usqLong statSGCDeltaUsecs; +_iss sqInt tenuringClassIndex; +_iss sqInt the2ndUnknownShort; +_iss sqIntptr_t methodCache[MethodCacheSize + 1 /* 4097 */]; +_iss sqInt traceLog[TraceBufferSize /* 768 */]; +_iss sqInt primTraceLog[256]; +_iss sqInt remapBuffer[RemapBufferSize + 1 /* 26 */]; +_iss sqInt *extraRoots[ExtraRootsSize + 1 /* 2049 */]; +_iss usqInt suspendedCallbacks[MaxJumpBuf + 1 /* 33 */]; +_iss usqInt suspendedMethods[MaxJumpBuf + 1 /* 33 */]; +_iss jmp_buf jmpBuf[MaxJumpBuf + 1 /* 33 */]; +_iss usqInt byteCount; +_iss char * nativeFramePointer; +_iss sqInt nsMethodCache; +_iss sqInt preferredPinningSegment; +_iss char * shadowCallStack; +_iss usqLong statFGCDeltaUsecs; +_iss usqLong statIncrGCUsecs; +_iss sqInt statIncrGCs; +_iss sqInt theUnknownShort; +#undef _iss +#if SQ_USE_GLOBAL_STRUCT + } fum; + #if SQ_USE_GLOBAL_STRUCT_REG +# define DECL_MAYBE_SQ_GLOBAL_STRUCT /* using a global reg pointer */ +# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT /* using a global reg pointer */ +#else +# define DECL_MAYBE_SQ_GLOBAL_STRUCT register struct foo * foo = &fum; +# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT volatile register struct foo * foo = &fum; +#endif +# define GIV(interpreterInstVar) (foo->interpreterInstVar) +#else +# define DECL_MAYBE_SQ_GLOBAL_STRUCT /* oh, no mr bill! */ +# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT /* oh no, mr bill! */ +# define GIV(interpreterInstVar) interpreterInstVar +#endif +#if SQ_USE_GLOBAL_STRUCT +#if SQ_USE_GLOBAL_STRUCT_REG +#define fooxstr(s) foostr(s) +#define foostr(s) #s +register struct foo * foo asm(fooxstr(USE_GLOBAL_STRUCT_REG)); +#else +static struct foo * foo = &fum; +#endif +#endif +static void (*primitiveFunctionPointer)(); +sqInt checkForLeaks; +sqInt maxLiteralCountForCompile = MaxLiteralCountForCompile /* 60 */; +jmp_buf reenterInterpreter; /* private export */; +sqInt checkAllocFiller; +sqInt breakSelectorLength = MinSmallInteger; +sqInt desiredEdenBytes; +sqInt desiredNumStackPages; +sqInt extraVMMemory; +sqInt desiredCogCodeSize; +usqInt maxOldSpaceSize; +char * breakSelector; +usqInt heapBase; +sqInt inIOProcessEvents; +void * showSurfaceFn; +sqInt deferDisplayUpdates; +struct VirtualMachine* interpreterProxy; +static void (*interruptCheckChain)(void) = 0; +sqInt suppressHeartbeatFlag; +static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); +static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = { + /* 0 */ (void (*)(void))0, + /* 1 */ primitiveAdd, + /* 2 */ primitiveSubtract, + /* 3 */ primitiveLessThan, + /* 4 */ primitiveGreaterThan, + /* 5 */ primitiveLessOrEqual, + /* 6 */ primitiveGreaterOrEqual, + /* 7 */ primitiveEqual, + /* 8 */ primitiveNotEqual, + /* 9 */ primitiveMultiply, + /* 10 */ primitiveDivide, + /* 11 */ primitiveMod, + /* 12 */ primitiveDiv, + /* 13 */ primitiveQuo, + /* 14 */ primitiveBitAnd, + /* 15 */ primitiveBitOr, + /* 16 */ primitiveBitXor, + /* 17 */ primitiveBitShift, + /* 18 */ primitiveMakePoint, + /* 19 */ (void (*)(void))0, + /* 20 */ primitiveRemLargeIntegers, + /* 21 */ primitiveAddLargeIntegers, + /* 22 */ primitiveSubtractLargeIntegers, + /* 23 */ primitiveLessThanLargeIntegers, + /* 24 */ primitiveGreaterThanLargeIntegers, + /* 25 */ primitiveLessOrEqualLargeIntegers, + /* 26 */ primitiveGreaterOrEqualLargeIntegers, + /* 27 */ primitiveEqualLargeIntegers, + /* 28 */ primitiveNotEqualLargeIntegers, + /* 29 */ primitiveMultiplyLargeIntegers, + /* 30 */ primitiveDivideLargeIntegers, + /* 31 */ primitiveModLargeIntegers, + /* 32 */ primitiveDivLargeIntegers, + /* 33 */ primitiveQuoLargeIntegers, + /* 34 */ primitiveBitAndLargeIntegers, + /* 35 */ primitiveBitOrLargeIntegers, + /* 36 */ primitiveBitXorLargeIntegers, + /* 37 */ primitiveBitShiftLargeIntegers, + /* 38 */ primitiveFloatAt, + /* 39 */ primitiveFloatAtPut, + /* 40 */ primitiveAsFloat, + /* 41 */ primitiveFloatAdd, + /* 42 */ primitiveFloatSubtract, + /* 43 */ primitiveFloatLessThan, + /* 44 */ primitiveFloatGreaterThan, + /* 45 */ primitiveFloatLessOrEqual, + /* 46 */ primitiveFloatGreaterOrEqual, + /* 47 */ primitiveFloatEqual, + /* 48 */ primitiveFloatNotEqual, + /* 49 */ primitiveFloatMultiply, + /* 50 */ primitiveFloatDivide, + /* 51 */ primitiveTruncated, + /* 52 */ primitiveFractionalPart, + /* 53 */ primitiveExponent, + /* 54 */ primitiveTimesTwoPower, + /* 55 */ primitiveSquareRoot, + /* 56 */ primitiveSine, + /* 57 */ primitiveArctan, + /* 58 */ primitiveLogN, + /* 59 */ primitiveExp, + /* 60 */ primitiveAt, + /* 61 */ primitiveAtPut, + /* 62 */ primitiveSize, + /* 63 */ primitiveStringAt, + /* 64 */ primitiveStringAtPut, + /* 65 */ (void (*)(void))0, + /* 66 */ (void (*)(void))0, + /* 67 */ (void (*)(void))0, + /* 68 */ primitiveObjectAt, + /* 69 */ primitiveObjectAtPut, + /* 70 */ primitiveNew, + /* 71 */ primitiveNewWithArg, + /* 72 */ primitiveArrayBecomeOneWay, + /* 73 */ primitiveInstVarAt, + /* 74 */ primitiveInstVarAtPut, + /* 75 */ primitiveIdentityHash, + /* 76 */ primitiveStoreStackp, + /* 77 */ primitiveSomeInstance, + /* 78 */ primitiveNextInstance, + /* 79 */ primitiveNewMethod, + /* 80 */ (void (*)(void))0, + /* 81 */ (void (*)(void))0, + /* 82 */ (void (*)(void))0, + /* 83 */ primitivePerform, + /* 84 */ primitivePerformWithArgs, + /* 85 */ primitiveSignal, + /* 86 */ primitiveWait, + /* 87 */ primitiveResume, + /* 88 */ primitiveSuspend, + /* 89 */ primitiveFlushCache, + /* 90 */ primitiveMousePoint, + /* 91 */ primitiveTestDisplayDepth, + /* 92 */ primitiveSetDisplayMode, + /* 93 */ primitiveInputSemaphore, + /* 94 */ primitiveGetNextEvent, + /* 95 */ primitiveInputWord, + /* 96 */ (void (*)(void))0, + /* 97 */ primitiveSnapshot, + /* 98 */ primitiveStoreImageSegment, + /* 99 */ primitiveLoadImageSegment, + /* 100 */ primitivePerformInSuperclass, + /* 101 */ primitiveBeCursor, + /* 102 */ primitiveBeDisplay, + /* 103 */ primitiveScanCharacters, + /* 104 */ (void (*)(void))0, + /* 105 */ primitiveStringReplace, + /* 106 */ primitiveScreenSize, + /* 107 */ primitiveMouseButtons, + /* 108 */ primitiveKbdNext, + /* 109 */ primitiveKbdPeek, + /* 110 */ primitiveIdentical, + /* 111 */ primitiveClass, + /* 112 */ primitiveBytesLeft, + /* 113 */ primitiveQuit, + /* 114 */ primitiveExitToDebugger, + /* 115 */ primitiveChangeClass, + /* 116 */ primitiveFlushCacheByMethod, + /* 117 */ primitiveExternalCall, + /* 118 */ primitiveDoPrimitiveWithArgs, + /* 119 */ primitiveFlushCacheBySelector, + /* 120 */ primitiveCalloutToFFI, + /* 121 */ primitiveImageName, + /* 122 */ primitiveNoop, + /* 123 */ (void (*)(void))0, + /* 124 */ primitiveLowSpaceSemaphore, + /* 125 */ primitiveSignalAtBytesLeft, + /* 126 */ primitiveDeferDisplayUpdates, + /* 127 */ primitiveShowDisplayRect, + /* 128 */ primitiveArrayBecome, + /* 129 */ primitiveSpecialObjectsOop, + /* 130 */ primitiveFullGC, + /* 131 */ primitiveIncrementalGC, + /* 132 */ primitiveObjectPointsTo, + /* 133 */ primitiveSetInterruptKey, + /* 134 */ primitiveInterruptSemaphore, + /* 135 */ primitiveMillisecondClock, + /* 136 */ primitiveSignalAtMilliseconds, + /* 137 */ primitiveSecondsClock, + /* 138 */ primitiveSomeObject, + /* 139 */ primitiveNextObject, + /* 140 */ primitiveBeep, + /* 141 */ primitiveClipboardText, + /* 142 */ primitiveVMPath, + /* 143 */ primitiveShortAt, + /* 144 */ primitiveShortAtPut, + /* 145 */ primitiveConstantFill, + /* 146 */ (void (*)(void))0, + /* 147 */ (void (*)(void))0, + /* 148 */ primitiveClone, + /* 149 */ primitiveGetAttribute, + /* 150 */ (void (*)(void))0, + /* 151 */ (void (*)(void))0, + /* 152 */ (void (*)(void))0, + /* 153 */ (void (*)(void))0, + /* 154 */ (void (*)(void))0, + /* 155 */ (void (*)(void))0, + /* 156 */ (void (*)(void))0, + /* 157 */ (void (*)(void))0, + /* 158 */ (void (*)(void))0, + /* 159 */ (void (*)(void))0, + /* 160 */ primitiveAdoptInstance, + /* 161 */ primitiveSetOrHasIdentityHash, + /* 162 */ (void (*)(void))0, + /* 163 */ primitiveGetImmutability, + /* 164 */ primitiveSetImmutability, + /* 165 */ primitiveIntegerAt, + /* 166 */ primitiveIntegerAtPut, + /* 167 */ primitiveYield, + /* 168 */ primitiveCopyObject, + /* 169 */ primitiveNotIdentical, + /* 170 */ primitiveAsCharacter, + /* 171 */ primitiveImmediateAsInteger, + /* 172 */ primitiveFetchNextMourner, + /* 173 */ primitiveSlotAt, + /* 174 */ primitiveSlotAtPut, + /* 175 */ primitiveBehaviorHash, + /* 176 */ primitiveMaxIdentityHash, + /* 177 */ primitiveAllInstances, + /* 178 */ primitiveAllObjects, + /* 179 */ (void (*)(void))0, + /* 180 */ primitiveGrowMemoryByAtLeast, + /* 181 */ primitiveSizeInBytesOfInstance, + /* 182 */ primitiveSizeInBytes, + /* 183 */ primitiveIsPinned, + /* 184 */ primitivePin, + /* 185 */ primitiveExitCriticalSection, + /* 186 */ primitiveEnterCriticalSection, + /* 187 */ primitiveTestAndSetOwnershipOfCriticalSection, + /* 188 */ primitiveExecuteMethodArgsArray, + /* 189 */ primitiveExecuteMethod, + /* 190 */ (void (*)(void))0, + /* 191 */ (void (*)(void))0, + /* 192 */ (void (*)(void))0, + /* 193 */ (void (*)(void))0, + /* 194 */ (void (*)(void))0, + /* 195 */ primitiveFindNextUnwindContext, + /* 196 */ primitiveTerminateTo, + /* 197 */ primitiveFindHandlerContext, + /* 198 */ (void (*)(void))0, + /* 199 */ (void (*)(void))0, + /* 200 */ primitiveClosureCopyWithCopiedValues, + /* 201 */ primitiveClosureValue, + /* 202 */ primitiveClosureValue, + /* 203 */ primitiveClosureValue, + /* 204 */ primitiveClosureValue, + /* 205 */ primitiveClosureValue, + /* 206 */ primitiveClosureValueWithArgs, + /* 207 */ primitiveFullClosureValue, + /* 208 */ primitiveFullClosureValueWithArgs, + /* 209 */ primitiveFullClosureValueNoContextSwitch, + /* 210 */ primitiveContextAt, + /* 211 */ primitiveContextAtPut, + /* 212 */ primitiveContextSize, + /* 213 */ primitiveContextXray, + /* 214 */ primitiveVoidVMState, + /* 215 */ primitiveVoidVMStateForMethod, + /* 216 */ primitiveMethodXray, + /* 217 */ (void (*)(void))0, + /* 218 */ primitiveDoNamedPrimitiveWithArgs, + /* 219 */ (void (*)(void))0, + /* 220 */ (void (*)(void))0, + /* 221 */ primitiveClosureValueNoContextSwitch, + /* 222 */ primitiveClosureValueNoContextSwitch, + /* 223 */ (void (*)(void))0, + /* 224 */ (void (*)(void))0, + /* 225 */ (void (*)(void))0, + /* 226 */ (void (*)(void))0, + /* 227 */ (void (*)(void))0, + /* 228 */ (void (*)(void))0, + /* 229 */ (void (*)(void))0, + /* 230 */ primitiveRelinquishProcessor, + /* 231 */ primitiveForceDisplayUpdate, + /* 232 */ primitiveFormPrint, + /* 233 */ primitiveSetFullScreen, + /* 234 */ (void (*)(void))0, + /* 235 */ (void (*)(void))0, + /* 236 */ (void (*)(void))0, + /* 237 */ (void (*)(void))0, + /* 238 */ (void (*)(void))0, + /* 239 */ (void (*)(void))0, + /* 240 */ primitiveUTCMicrosecondClock, + /* 241 */ primitiveLocalMicrosecondClock, + /* 242 */ primitiveSignalAtUTCMicroseconds, + /* 243 */ primitiveUpdateTimezone, + /* 244 */ primitiveUtcAndTimezoneOffset, + /* 245 */ (void (*)(void))0, + /* 246 */ (void (*)(void))0, + /* 247 */ primitiveSnapshotEmbedded, + /* 248 */ (void (*)(void))0, + /* 249 */ primitiveArrayBecomeOneWayCopyHash, + /* 250 */ primitiveClearVMProfile, + /* 251 */ primitiveControlVMProfiling, + /* 252 */ primitiveVMProfileSamplesInto, + /* 253 */ primitiveCollectCogCodeConstituents, + /* 254 */ primitiveVMParameter, + /* 255 */ (void (*)(void))0, + /* 256 */ (void (*)(void))256, + /* 257 */ (void (*)(void))257, + /* 258 */ (void (*)(void))258, + /* 259 */ (void (*)(void))259, + /* 260 */ (void (*)(void))260, + /* 261 */ (void (*)(void))261, + /* 262 */ (void (*)(void))262, + /* 263 */ (void (*)(void))263, + /* 264 */ (void (*)(void))264, + /* 265 */ (void (*)(void))265, + /* 266 */ (void (*)(void))266, + /* 267 */ (void (*)(void))267, + /* 268 */ (void (*)(void))268, + /* 269 */ (void (*)(void))269, + /* 270 */ (void (*)(void))270, + /* 271 */ (void (*)(void))271, + /* 272 */ (void (*)(void))272, + /* 273 */ (void (*)(void))273, + /* 274 */ (void (*)(void))274, + /* 275 */ (void (*)(void))275, + /* 276 */ (void (*)(void))276, + /* 277 */ (void (*)(void))277, + /* 278 */ (void (*)(void))278, + /* 279 */ (void (*)(void))279, + /* 280 */ (void (*)(void))280, + /* 281 */ (void (*)(void))281, + /* 282 */ (void (*)(void))282, + /* 283 */ (void (*)(void))283, + /* 284 */ (void (*)(void))284, + /* 285 */ (void (*)(void))285, + /* 286 */ (void (*)(void))286, + /* 287 */ (void (*)(void))287, + /* 288 */ (void (*)(void))288, + /* 289 */ (void (*)(void))289, + /* 290 */ (void (*)(void))290, + /* 291 */ (void (*)(void))291, + /* 292 */ (void (*)(void))292, + /* 293 */ (void (*)(void))293, + /* 294 */ (void (*)(void))294, + /* 295 */ (void (*)(void))295, + /* 296 */ (void (*)(void))296, + /* 297 */ (void (*)(void))297, + /* 298 */ (void (*)(void))298, + /* 299 */ (void (*)(void))299, + /* 300 */ (void (*)(void))300, + /* 301 */ (void (*)(void))301, + /* 302 */ (void (*)(void))302, + /* 303 */ (void (*)(void))303, + /* 304 */ (void (*)(void))304, + /* 305 */ (void (*)(void))305, + /* 306 */ (void (*)(void))306, + /* 307 */ (void (*)(void))307, + /* 308 */ (void (*)(void))308, + /* 309 */ (void (*)(void))309, + /* 310 */ (void (*)(void))310, + /* 311 */ (void (*)(void))311, + /* 312 */ (void (*)(void))312, + /* 313 */ (void (*)(void))313, + /* 314 */ (void (*)(void))314, + /* 315 */ (void (*)(void))315, + /* 316 */ (void (*)(void))316, + /* 317 */ (void (*)(void))317, + /* 318 */ (void (*)(void))318, + /* 319 */ (void (*)(void))319, + /* 320 */ (void (*)(void))320, + /* 321 */ (void (*)(void))321, + /* 322 */ (void (*)(void))322, + /* 323 */ (void (*)(void))323, + /* 324 */ (void (*)(void))324, + /* 325 */ (void (*)(void))325, + /* 326 */ (void (*)(void))326, + /* 327 */ (void (*)(void))327, + /* 328 */ (void (*)(void))328, + /* 329 */ (void (*)(void))329, + /* 330 */ (void (*)(void))330, + /* 331 */ (void (*)(void))331, + /* 332 */ (void (*)(void))332, + /* 333 */ (void (*)(void))333, + /* 334 */ (void (*)(void))334, + /* 335 */ (void (*)(void))335, + /* 336 */ (void (*)(void))336, + /* 337 */ (void (*)(void))337, + /* 338 */ (void (*)(void))338, + /* 339 */ (void (*)(void))339, + /* 340 */ (void (*)(void))340, + /* 341 */ (void (*)(void))341, + /* 342 */ (void (*)(void))342, + /* 343 */ (void (*)(void))343, + /* 344 */ (void (*)(void))344, + /* 345 */ (void (*)(void))345, + /* 346 */ (void (*)(void))346, + /* 347 */ (void (*)(void))347, + /* 348 */ (void (*)(void))348, + /* 349 */ (void (*)(void))349, + /* 350 */ (void (*)(void))350, + /* 351 */ (void (*)(void))351, + /* 352 */ (void (*)(void))352, + /* 353 */ (void (*)(void))353, + /* 354 */ (void (*)(void))354, + /* 355 */ (void (*)(void))355, + /* 356 */ (void (*)(void))356, + /* 357 */ (void (*)(void))357, + /* 358 */ (void (*)(void))358, + /* 359 */ (void (*)(void))359, + /* 360 */ (void (*)(void))360, + /* 361 */ (void (*)(void))361, + /* 362 */ (void (*)(void))362, + /* 363 */ (void (*)(void))363, + /* 364 */ (void (*)(void))364, + /* 365 */ (void (*)(void))365, + /* 366 */ (void (*)(void))366, + /* 367 */ (void (*)(void))367, + /* 368 */ (void (*)(void))368, + /* 369 */ (void (*)(void))369, + /* 370 */ (void (*)(void))370, + /* 371 */ (void (*)(void))371, + /* 372 */ (void (*)(void))372, + /* 373 */ (void (*)(void))373, + /* 374 */ (void (*)(void))374, + /* 375 */ (void (*)(void))375, + /* 376 */ (void (*)(void))376, + /* 377 */ (void (*)(void))377, + /* 378 */ (void (*)(void))378, + /* 379 */ (void (*)(void))379, + /* 380 */ (void (*)(void))380, + /* 381 */ (void (*)(void))381, + /* 382 */ (void (*)(void))382, + /* 383 */ (void (*)(void))383, + /* 384 */ (void (*)(void))384, + /* 385 */ (void (*)(void))385, + /* 386 */ (void (*)(void))386, + /* 387 */ (void (*)(void))387, + /* 388 */ (void (*)(void))388, + /* 389 */ (void (*)(void))389, + /* 390 */ (void (*)(void))390, + /* 391 */ (void (*)(void))391, + /* 392 */ (void (*)(void))392, + /* 393 */ (void (*)(void))393, + /* 394 */ (void (*)(void))394, + /* 395 */ (void (*)(void))395, + /* 396 */ (void (*)(void))396, + /* 397 */ (void (*)(void))397, + /* 398 */ (void (*)(void))398, + /* 399 */ (void (*)(void))399, + /* 400 */ (void (*)(void))400, + /* 401 */ (void (*)(void))401, + /* 402 */ (void (*)(void))402, + /* 403 */ (void (*)(void))403, + /* 404 */ (void (*)(void))404, + /* 405 */ (void (*)(void))405, + /* 406 */ (void (*)(void))406, + /* 407 */ (void (*)(void))407, + /* 408 */ (void (*)(void))408, + /* 409 */ (void (*)(void))409, + /* 410 */ (void (*)(void))410, + /* 411 */ (void (*)(void))411, + /* 412 */ (void (*)(void))412, + /* 413 */ (void (*)(void))413, + /* 414 */ (void (*)(void))414, + /* 415 */ (void (*)(void))415, + /* 416 */ (void (*)(void))416, + /* 417 */ (void (*)(void))417, + /* 418 */ (void (*)(void))418, + /* 419 */ (void (*)(void))419, + /* 420 */ (void (*)(void))420, + /* 421 */ (void (*)(void))421, + /* 422 */ (void (*)(void))422, + /* 423 */ (void (*)(void))423, + /* 424 */ (void (*)(void))424, + /* 425 */ (void (*)(void))425, + /* 426 */ (void (*)(void))426, + /* 427 */ (void (*)(void))427, + /* 428 */ (void (*)(void))428, + /* 429 */ (void (*)(void))429, + /* 430 */ (void (*)(void))430, + /* 431 */ (void (*)(void))431, + /* 432 */ (void (*)(void))432, + /* 433 */ (void (*)(void))433, + /* 434 */ (void (*)(void))434, + /* 435 */ (void (*)(void))435, + /* 436 */ (void (*)(void))436, + /* 437 */ (void (*)(void))437, + /* 438 */ (void (*)(void))438, + /* 439 */ (void (*)(void))439, + /* 440 */ (void (*)(void))440, + /* 441 */ (void (*)(void))441, + /* 442 */ (void (*)(void))442, + /* 443 */ (void (*)(void))443, + /* 444 */ (void (*)(void))444, + /* 445 */ (void (*)(void))445, + /* 446 */ (void (*)(void))446, + /* 447 */ (void (*)(void))447, + /* 448 */ (void (*)(void))448, + /* 449 */ (void (*)(void))449, + /* 450 */ (void (*)(void))450, + /* 451 */ (void (*)(void))451, + /* 452 */ (void (*)(void))452, + /* 453 */ (void (*)(void))453, + /* 454 */ (void (*)(void))454, + /* 455 */ (void (*)(void))455, + /* 456 */ (void (*)(void))456, + /* 457 */ (void (*)(void))457, + /* 458 */ (void (*)(void))458, + /* 459 */ (void (*)(void))459, + /* 460 */ (void (*)(void))460, + /* 461 */ (void (*)(void))461, + /* 462 */ (void (*)(void))462, + /* 463 */ (void (*)(void))463, + /* 464 */ (void (*)(void))464, + /* 465 */ (void (*)(void))465, + /* 466 */ (void (*)(void))466, + /* 467 */ (void (*)(void))467, + /* 468 */ (void (*)(void))468, + /* 469 */ (void (*)(void))469, + /* 470 */ (void (*)(void))470, + /* 471 */ (void (*)(void))471, + /* 472 */ (void (*)(void))472, + /* 473 */ (void (*)(void))473, + /* 474 */ (void (*)(void))474, + /* 475 */ (void (*)(void))475, + /* 476 */ (void (*)(void))476, + /* 477 */ (void (*)(void))477, + /* 478 */ (void (*)(void))478, + /* 479 */ (void (*)(void))479, + /* 480 */ (void (*)(void))480, + /* 481 */ (void (*)(void))481, + /* 482 */ (void (*)(void))482, + /* 483 */ (void (*)(void))483, + /* 484 */ (void (*)(void))484, + /* 485 */ (void (*)(void))485, + /* 486 */ (void (*)(void))486, + /* 487 */ (void (*)(void))487, + /* 488 */ (void (*)(void))488, + /* 489 */ (void (*)(void))489, + /* 490 */ (void (*)(void))490, + /* 491 */ (void (*)(void))491, + /* 492 */ (void (*)(void))492, + /* 493 */ (void (*)(void))493, + /* 494 */ (void (*)(void))494, + /* 495 */ (void (*)(void))495, + /* 496 */ (void (*)(void))496, + /* 497 */ (void (*)(void))497, + /* 498 */ (void (*)(void))498, + /* 499 */ (void (*)(void))499, + /* 500 */ (void (*)(void))500, + /* 501 */ (void (*)(void))501, + /* 502 */ (void (*)(void))502, + /* 503 */ (void (*)(void))503, + /* 504 */ (void (*)(void))504, + /* 505 */ (void (*)(void))505, + /* 506 */ (void (*)(void))506, + /* 507 */ (void (*)(void))507, + /* 508 */ (void (*)(void))508, + /* 509 */ (void (*)(void))509, + /* 510 */ (void (*)(void))510, + /* 511 */ (void (*)(void))511, + /* 512 */ (void (*)(void))512, + /* 513 */ (void (*)(void))513, + /* 514 */ (void (*)(void))514, + /* 515 */ (void (*)(void))515, + /* 516 */ (void (*)(void))516, + /* 517 */ (void (*)(void))517, + /* 518 */ (void (*)(void))518, + /* 519 */ (void (*)(void))519, + /* 520 */ (void (*)(void))0, + /* 521 */ (void (*)(void))0, + /* 522 */ (void (*)(void))0, + /* 523 */ (void (*)(void))0, + /* 524 */ (void (*)(void))0, + /* 525 */ (void (*)(void))0, + /* 526 */ (void (*)(void))0, + /* 527 */ (void (*)(void))0, + /* 528 */ (void (*)(void))0, + /* 529 */ (void (*)(void))0, + /* 530 */ (void (*)(void))0, + /* 531 */ (void (*)(void))0, + /* 532 */ (void (*)(void))0, + /* 533 */ (void (*)(void))0, + /* 534 */ (void (*)(void))0, + /* 535 */ (void (*)(void))0, + /* 536 */ (void (*)(void))0, + /* 537 */ (void (*)(void))0, + /* 538 */ (void (*)(void))0, + /* 539 */ (void (*)(void))0, + /* 540 */ (void (*)(void))0, + /* 541 */ (void (*)(void))0, + /* 542 */ (void (*)(void))0, + /* 543 */ (void (*)(void))0, + /* 544 */ (void (*)(void))0, + /* 545 */ (void (*)(void))0, + /* 546 */ (void (*)(void))0, + /* 547 */ (void (*)(void))0, + /* 548 */ (void (*)(void))0, + /* 549 */ (void (*)(void))0, + /* 550 */ (void (*)(void))0, + /* 551 */ (void (*)(void))0, + /* 552 */ (void (*)(void))0, + /* 553 */ (void (*)(void))0, + /* 554 */ (void (*)(void))0, + /* 555 */ (void (*)(void))0, + /* 556 */ (void (*)(void))0, + /* 557 */ (void (*)(void))0, + /* 558 */ (void (*)(void))0, + /* 559 */ (void (*)(void))0, + /* 560 */ (void (*)(void))0, + /* 561 */ (void (*)(void))0, + /* 562 */ (void (*)(void))0, + /* 563 */ (void (*)(void))0, + /* 564 */ (void (*)(void))0, + /* 565 */ (void (*)(void))0, + /* 566 */ (void (*)(void))0, + /* 567 */ (void (*)(void))0, + /* 568 */ (void (*)(void))0, + /* 569 */ (void (*)(void))0, + /* 570 */ primitiveFlushExternalPrimitives, + /* 571 */ primitiveUnloadModule, + /* 572 */ primitiveListBuiltinModule, + /* 573 */ primitiveListExternalModule, + /* 574 */ (void (*)(void))0, + /* 575 */ (void (*)(void))0, + 0 }; +static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */] = { +/*0*/ -1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0,-1,-1, 0,-1,-1, 0, 0, 0,-1, +/*20*/ 0, 0, 0,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 0, 0, 0, +/*40*/ 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,-1,-1,-1,-1,-1, +/*60*/ 0, 0, 0,-1,-1,-1,-1,-1, 0, 0,-1,-1, 0, 1, 1, 0, 0, 0, 0, 0, +/*80*/ -1,-1,-1, 0,-1,-1, 0, 0, 1,-1,-1, 0, 0, 0, 0,-1,-1,-1, 0, 0, +/*100*/ 1, 1, 0, 2,-1, 1,-1,-1,-1,-1, 0, 0,-1,-1,-1, 1, 0,-1, 1, 0, +/*120*/ -1, 0,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 1, 0, 0,-1, 0,-1,-1,-1, +/*140*/ -1, 1,-1, 1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*160*/ 0, 0,-1, 0, 0, 1, 1,-1, 1, 0, 0, 1,-1, 1, 1,-1,-1,-1,-1,-1, +/*180*/ 0,-1,-1, 0, 0, 0, 1, 1, 1, 0,-1,-1,-1,-1,-1, 1, 2,-1,-1,-1, +/*200*/ -1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,-1, 0,-1,-1, 3,-1, +/*220*/ -1, 2, 2,-1,-1,-1,-1,-1,-1,-1, 0,-1, 2, 0,-1,-1,-1,-1,-1,-1, +/*240*/ -1,-1, 0,-1, 0,-1,-1,-1,-1,-1,-1, 0, 0,-1, 0,-1,-1,-1,-1,-1, +/*260*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*280*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*300*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*320*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*340*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*360*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*380*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*400*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*420*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*440*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*460*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*480*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*500*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*520*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1 + }; +sqInt checkedPluginName; +char expensiveAsserts = 0; +const char *interpreterVersion = "Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2079]"; +sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; +volatile int sendTrace; + + +/*** Macros ***/ +#define cPICNumCases stackCheckOffset +#define cPICNumCasesHack hack hack hack i.e. the getter macro does all the work +#define nextOpenPIC methodObject +#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work +#define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage) +#define stackPageAtpages(index,pages) ((pages) + (index)) +#define statMaxPageCountWhenMapping() GIV(statMaxPageCountWhenMapping) +#define compilationBreakpointisMNUCase(sel, len, isMNU) do { \ + if ((len) == (isMNU ? -breakSelectorLength : breakSelectorLength) \ + && !strncmp((char *)((sel) + BaseHeaderSize), breakSelector, (isMNU ? -breakSelectorLength : breakSelectorLength))) { \ + suppressHeartbeatFlag = 1; \ + compilationBreakpointFor(sel); \ + } \ +} while (0) +#define enterSmalltalkExecutive() enterSmalltalkExecutiveImplementation() +#define getCodeCompactionCount() integerObjectOf(GIV(statCodeCompactionCount)) +#define getCodeCompactionMSecs() integerObjectOf((GIV(statCodeCompactionUsecs) + 500) / 1000) +#define getCogCodeSize() integerObjectOf(GIV(cogCodeSize)) +#define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize) +#define heapBase() heapBase +#define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation() +#define mnuCompilationBreakpoint(sel, len) do { \ + if ((len) == -breakSelectorLength \ + && !strncmp((char *)((sel) + BaseHeaderSize), breakSelector, -breakSelectorLength)) { \ + suppressHeartbeatFlag = 1; \ + compilationBreakpointFor(sel); \ + } \ +} while (0) +#define primNumberExternalCall() 117 +#define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue)) +#define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs)) +#define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize)) +#define smallIntegerTag() 1 +#define startOfMemory() heapBase +#define numTagBits() 2 +#define shiftForWord() 2 +#define tagMask() 0x3 +#define wordSize() 4 +#define eden() GIV(eden) +#define futureSpace() GIV(futureSpace) +#define futureSurvivorStart() GIV(futureSurvivorStart) +#define pastSpace() GIV(pastSpace) +#define rememberedSetLimit() GIV(rememberedSetLimit) +#define rememberedSetSize() GIV(rememberedSetSize) +#define arrayClassIndexPun() 16 +#define characterTag() 2 +#define classIndexMask() 0x3FFFFF +#define classIsItselfClassIndexPun() 31 +#define classTableFirstPage() classTableFirstPage +#define classTableMajorIndexShift() 10 +#define endOfMemory() GIV(endOfMemory) +#define firstByteFormat() 16 +#define firstClassIndexPun() 16 +#define firstCompiledMethodFormat() 24 +#define firstLongFormat() 10 +#define firstShortFormat() 12 +#define fixedFieldsFieldWidth() 16 +#define formatFieldWidthShift() 5 +#define formatMask() 0x1F +#define formatShift() 24 +#define freeStart() GIV(freeStart) +#define greyBitShift() 31 +#define identityHashFullWordShift() 32 +#define identityHashHalfWordMask() 0x3FFFFF +#define immutableBitShift() 23 +#define indexablePointersFormat() 3 +#define isForwardedObjectClassIndexPun() 8 +#define isFreeObjectClassIndexPun() 0 +#define lastClassIndexPun() 31 +#define markedBitFullShift() 55 +#define markedBitHalfShift() 23 +#define maxOldSpaceSize() maxOldSpaceSize +#define memory() GIV(memory) +#define newSpaceLimit() GIV(newSpaceLimit) +#define numSlotsFullShift() 56 +#define numSlotsHalfShift() 24 +#define numSlotsMask() 0xFF +#define oldSpaceStart() GIV(oldSpaceStart) +#define pinnedBitShift() 30 +#define remapBufferCount() GIV(remapBufferCount) +#define rememberedBitShift() 29 +#define rootTableCapacity() GIV(rememberedSetLimit) +#define rootTableCount() GIV(rememberedSetSize) +#define segmentBridgePun() 3 +#define sixtyFourBitIndexableFormat() 9 +#define sixtyFourBitLongsClassIndexPun() 19 +#define thirtyTwoBitLongsClassIndexPun() 18 +#define weakArrayClassIndexPun() 17 +#define weakArrayFormat() 4 +#define numSegments() GIV(numSegments) +#define alternateHeaderNumLiteralsMask() 0x7FFF +#define checkAllocFiller() GIV(checkAllocFiller) +#define dispatchFunctionPointer(aFunctionPointer) (aFunctionPointer)() +#define flush() fflush(stdout) +#define printFloat(f) printf("%g", f) +#define remoteIsInstVarAccess() 128 +#define stackPageFrameBytes() (256 * BytesPerWord) +#define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType)) +#define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0])) +#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop)) +#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop)) +#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop)) +#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop)) +#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop)) +#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop)) + + + +/* This is the main interpreter loop. It normally loops forever, fetching and + executing bytecodes. When running in the context of a browser plugin VM, + however, it must return control to the browser periodically. This should + done only when the state of the currently running Squeak thread is safely + stored in the object heap. Since this is the case at the moment that a + check for interrupts is performed, that is when we return to the browser + if it is time to do so. Interrupt checks happen quite frequently. + */ +/* If stacklimit is zero then the stack pages have not been initialized. */ + + /* StackInterpreter>>#interpret */ +sqInt +interpret(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt currentBytecode; + sqInt extA; + sqInt extB; + sqInt lkupClassTag; + char * localFP; + char * localIP; + sqInt localReturnValue; + char * localSP; + sqLowcodeCalloutState* lowcodeCalloutState; + char * nativeSP; + sqInt numExtB; + sqInt stackPageBytes; + usqIntptr_t stackPagesBytes; + char *theStackMemory; + + if (GIV(stackLimit) == 0) { + /* begin initStackPagesAndInterpret */ + stackPageBytes = stackPageByteSize(); + /* begin computeStackZoneSize */ + stackPagesBytes = (GIV(numStackPages) * ((sizeof(CogStackPage)) + (stackPageByteSize()))) + BytesPerWord; + theStackMemory = alloca(stackPagesBytes); + memset(theStackMemory, 0, stackPagesBytes); + sqMakeMemoryNotExecutableFromTo(((usqInt)(startOfMemory())), ((usqInt)GIV(endOfMemory))); + sqMakeMemoryNotExecutableFromTo(((usqInt)theStackMemory), (((usqInt)theStackMemory)) + stackPagesBytes); + initializeStacknumSlotspageSize(theStackMemory, stackPagesBytes / BytesPerWord, stackPageBytes / BytesPerWord); + assert((minimumUnusedHeadroom()) == stackPageBytes); + loadInitialContext(); + ioInitHeartbeat(); + initialEnterSmalltalkExecutive(); + return null; + } + browserPluginInitialiseIfNeeded(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin initExtensions */ + extA = (numExtB = (extB = 0)); + + while (1) { + bytecodeDispatchDebugHook(); + + VM_LABEL(bytecodeDispatch); + switch (currentBytecode) { + case 0: + case 256: /*0*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize)); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 1: + case 257: /*1*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode1); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 4 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 2: + case 258: /*2*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode2); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 8 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 3: + case 259: /*3*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode3); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 12 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 4: + case 260: /*4*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode4); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 16 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 5: + case 261: /*5*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode5); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 20 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 6: + case 262: /*6*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode6); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 24 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 7: + case 263: /*7*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode7); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 28 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 8: + case 264: /*8*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode8); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 32 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 9: + case 265: /*9*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode9); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 36 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 10: + case 266: /*10*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode10); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 40 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 11: + case 267: /*11*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode11); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 44 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 12: + case 268: /*12*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode12); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 48 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 13: + case 269: /*13*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode13); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 52 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 14: + case 270: /*14*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode14); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 56 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 15: + case 271: /*15*/ + /* pushReceiverVariableBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverVariableBytecode15); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushReceiverVariable: */ + object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 60 /* (currentBytecode bitAnd: 15) << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 16: + case 320: /*64*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (0 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 17: + case 321: /*65*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode1); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (1 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 18: + case 322: /*66*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode2); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (2 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 19: + case 323: /*67*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode3); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (3 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 20: + case 324: /*68*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode4); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (4 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 21: + case 325: /*69*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode5); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (5 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 22: + case 326: /*70*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode6); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (6 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 23: + case 327: /*71*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode7); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (7 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 24: + case 328: /*72*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode8); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (8 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 8 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 8 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 25: + case 329: /*73*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode9); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (9 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 9 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 9 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 26: + case 330: /*74*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode10); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (10 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 10 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 10 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 27: + case 331: /*75*/ + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode11); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (11 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 11 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 11 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 28: + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode12); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (12 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 12 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 12 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 29: + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode13); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (13 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 13 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 13 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 30: + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode14); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (14 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 14 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 14 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 31: + /* pushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt object; + + VM_LABEL(pushTemporaryVariableBytecode15); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushTemporaryVariable: */ + object = (15 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 15 /* currentBytecode bitAnd: 15 */) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 15 /* currentBytecode bitAnd: 15 */) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 32: + case 288: /*32*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 4 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 33: + case 289: /*33*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode1); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 34: + case 290: /*34*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode2); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 12 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 35: + case 291: /*35*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode3); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 16 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 36: + case 292: /*36*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode4); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 20 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 37: + case 293: /*37*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode5); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 24 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 38: + case 294: /*38*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode6); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 28 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 39: + case 295: /*39*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode7); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 32 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 40: + case 296: /*40*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode8); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 36 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 41: + case 297: /*41*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode9); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 40 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 42: + case 298: /*42*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode10); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 44 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 43: + case 299: /*43*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode11); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 48 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 44: + case 300: /*44*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode12); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 52 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 45: + case 301: /*45*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode13); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 56 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 46: + case 302: /*46*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode14); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 60 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 47: + case 303: /*47*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode15); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 64 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 48: + case 304: /*48*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode16); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 68 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 49: + case 305: /*49*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode17); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 72 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 50: + case 306: /*50*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode18); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 76 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 51: + case 307: /*51*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode19); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 80 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 52: + case 308: /*52*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode20); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 84 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 53: + case 309: /*53*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode21); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 88 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 54: + case 310: /*54*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode22); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 92 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 55: + case 311: /*55*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode23); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 96 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 56: + case 312: /*56*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode24); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 100 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 57: + case 313: /*57*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode25); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 104 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 58: + case 314: /*58*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode26); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 108 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 59: + case 315: /*59*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode27); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 112 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 60: + case 316: /*60*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode28); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 116 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 61: + case 317: /*61*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode29); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 120 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 62: + case 318: /*62*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode30); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 0x7C /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 63: + case 319: /*63*/ + /* pushLiteralConstantBytecode */ + { + sqInt object; + + VM_LABEL(pushLiteralConstantBytecode31); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + 128 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 64: + case 272: /*16*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 4 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 0 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 65: + case 273: /*17*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode1); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 1 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 66: + case 274: /*18*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode2); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 12 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 2 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 67: + case 275: /*19*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode3); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 16 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 3 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 68: + case 276: /*20*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode4); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 20 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 4 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 69: + case 277: /*21*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode5); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 24 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 5 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 70: + case 278: /*22*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode6); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 28 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 6 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 71: + case 279: /*23*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode7); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 32 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 7 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 72: + case 280: /*24*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode8); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 36 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 8 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 73: + case 281: /*25*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode9); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 40 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 9 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 74: + case 282: /*26*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode10); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 44 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 10 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 75: + case 283: /*27*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode11); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 48 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 11 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 76: + case 284: /*28*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode12); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 52 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 12 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 77: + case 285: /*29*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode13); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 56 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 13 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 78: + case 286: /*30*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode14); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 60 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 14 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 79: + case 287: /*31*/ + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode15); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 64 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 15 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 80: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode16); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 68 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 16 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 81: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode17); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 72 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 17 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 82: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode18); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 76 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 18 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 83: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode19); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 80 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 19 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 84: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode20); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 84 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 20 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 85: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode21); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 88 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 21 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 86: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode22); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 92 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 22 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 87: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode23); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 96 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 23 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 88: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode24); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 100 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 24 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 89: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode25); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 104 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 25 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 90: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode26); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 108 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 26 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 91: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode27); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 112 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 27 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 92: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode28); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 116 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 28 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 93: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode29); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 120 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 29 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 94: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode30); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 0x7C /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 30 /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 95: + /* pushLiteralVariableBytecode */ + { + sqInt litVar; + sqInt object; + + VM_LABEL(pushLiteralVariableBytecode31); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + 128 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, 0x1F /* currentBytecode bitAnd: 31 */); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + 4 /* ValueIndex << self shiftForWord */); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 96: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + /* storeAndPopReceiverVariableBytecode */ + { + sqInt instVarIndex; + sqInt rcvr; + sqInt top; + + VM_LABEL(storeAndPopReceiverVariableBytecode); + /* begin receiver */ + rcvr = longAt(localFP + FoxIFReceiver); + /* begin internalStackTop */ + top = longAtPointer(localSP); + instVarIndex = currentBytecode & 7; + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(rcvr)))); + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(instVarIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l12; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(rcvr))); + if ((assert(isNonImmediate(rcvr)), + oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) { + remember(rcvr); + } + } + } + longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); + l12: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 104: + case 464: /*208*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (0 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 105: + case 465: /*209*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode1); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (1 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 106: + case 466: /*210*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode2); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (2 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 107: + case 467: /*211*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode3); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (3 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 108: + case 468: /*212*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode4); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (4 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 109: + case 469: /*213*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode5); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (5 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 110: + case 470: /*214*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode6); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (6 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 111: + case 471: /*215*/ + /* storeAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + + VM_LABEL(storeAndPopTemporaryVariableBytecode7); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (7 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 112: + case 332: /*76*/ + /* pushReceiverBytecode */ + { + sqInt object; + + VM_LABEL(pushReceiverBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = longAt(localFP + FoxIFReceiver); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 113: + case 333: /*77*/ + /* pushConstantTrueBytecode */ + { + sqInt object; + + VM_LABEL(pushConstantTrueBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = GIV(trueObj); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 114: + case 334: /*78*/ + /* pushConstantFalseBytecode */ + { + sqInt object; + + VM_LABEL(pushConstantFalseBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = GIV(falseObj); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 115: + case 335: /*79*/ + /* pushConstantNilBytecode */ + { + sqInt object; + + VM_LABEL(pushConstantNilBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = GIV(nilObj); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 116: + /* pushConstantMinusOneBytecode */ + { + VM_LABEL(pushConstantMinusOneBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ConstMinusOne); + } + break; + case 117: + case 336: /*80*/ + /* pushConstantZeroBytecode */ + { + VM_LABEL(pushConstantZeroBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ConstZero); + } + break; + case 118: + case 337: /*81*/ + /* pushConstantOneBytecode */ + { + VM_LABEL(pushConstantOneBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ConstOne); + } + break; + case 119: + /* pushConstantTwoBytecode */ + { + VM_LABEL(pushConstantTwoBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ConstTwo); + } + break; + case 120: + /* returnReceiver */ + { + VM_LABEL(returnReceiver); + /* begin receiver */ + localReturnValue = longAt(localFP + FoxIFReceiver); + /* goto commonReturn */ + } + + commonReturn: + /* commonReturn */ + { + sqInt aMethodObj; + sqInt callerContextOrNil; + sqInt callerContextOrNil1; + sqInt callerContextOrNil2; + char *callerFP; + sqInt closure; + sqInt contextToReturnTo; + sqInt currentCtx; + char *frameToReturnTo; + sqInt home; + StackPage *newPage; + sqInt nextCntx; + sqInt objOop; + sqInt objOop1; + sqInt ourContext; + sqInt ourContext1; + sqInt ourContext2; + sqInt senderOop; + sqInt senderOop1; + char *theFP; + char *theFP1; + char *theFP2; + StackPage *thePage; + StackPage *thePage1; + StackPage *thePage2; + StackPage *thePage3; + sqInt unwindContextOrNilOrZero; + sqInt valuePointer; + sqInt valuePointer1; + + VM_LABEL(commonReturn); + + /* If this is a method simply return to the sender/caller. */ + frameToReturnTo = 0; + if (!((byteAt((localFP + FoxIFrameFlags) + 3)) != 0)) { + goto commonCallerReturn; + goto l3143; + } + closure = longAt(localFP + (frameStackedReceiverOffset(localFP))); + + /* Walk the closure's lexical chain to find the context or frame to return from (home). */ + home = null; + while (closure != GIV(nilObj)) { + /* begin followField:ofObject: */ + objOop = longAt((closure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(ClosureOuterContextIndex, closure, objOop); + } + home = objOop; + /* begin followField:ofObject: */ + objOop1 = longAt((home + BaseHeaderSize) + (((int)((usqInt)(ClosureIndex) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, home, objOop1); + } + closure = objOop1; + } + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + unwindContextOrNilOrZero = findUnwindThroughContext(home); + if (unwindContextOrNilOrZero == GIV(nilObj)) { + + /* error: can't find home on chain; cannot return */ + /* begin internalCannotReturn: */ + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext = longAt(localFP + FoxThisContext); + goto l3170; + } + ourContext = marryFrameSP(localFP, localSP); + l3170: /* end ensureFrameIsMarried:SP: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + goto l3143; + } + if (unwindContextOrNilOrZero != 0) { + /* begin internalAboutToReturn:through: */ + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext1 = longAt(localFP + FoxThisContext); + goto l3163; + } + ourContext1 = marryFrameSP(localFP, localSP); + l3163: /* end ensureFrameIsMarried:SP: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), unwindContextOrNilOrZero); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l3143; + } + contextToReturnTo = null; + if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + assert(checkIsStillMarriedContextcurrentFP(home, localFP)); + /* begin frameOfMarriedContext: */ + senderOop = longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if ((longAt(theFP + FoxSavedFP)) == 0) { + /* begin frameCallerContext: */ + assert(isBaseFrame(theFP)); + /* begin stackPageFor: */ + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage1->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + contextToReturnTo = callerContextOrNil; + } + else { + frameToReturnTo = pointerForOop(longAt(theFP + FoxSavedFP)); + } + } + else { + /* begin fetchPointer:ofObject: */ + contextToReturnTo = longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + if ((((contextToReturnTo & (tagMask())) == 0) + && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex)) + && (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP)); + /* begin frameOfMarriedContext: */ + senderOop1 = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + frameToReturnTo = pointerForOop(senderOop1 - 1); + + contextToReturnTo = null; + } + } + if (contextToReturnTo != null) { + frameToReturnTo = establishFrameForContextToReturnTo(contextToReturnTo); + if (frameToReturnTo == 0) { + + /* error: home's sender is dead; cannot return */ + /* begin internalCannotReturn: */ + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + ourContext2 = longAt(localFP + FoxThisContext); + goto l3156; + } + ourContext2 = marryFrameSP(localFP, localSP); + l3156: /* end ensureFrameIsMarried:SP: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext2); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + goto l3143; + } + } + assert(pageListIsWellFormed()); + /* begin stackPageFor: */ + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (newPage != GIV(stackPage)) { + /* begin frameCallerContext: */ + theFP2 = (GIV(stackPage)->baseFP); + assert(isBaseFrame(theFP2)); + /* begin stackPageFor: */ + thePage3 = stackPageAtpages((assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil2 = longAt((thePage3->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil2)); + assert((callerContextOrNil2 == (nilObject())) + || (isContext(callerContextOrNil2))); + currentCtx = callerContextOrNil2; + freeStackPage(GIV(stackPage)); + while (1) { + assert(isContext(currentCtx)); + if ((((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; + if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (theFP != ((thePage->headFP))) { + + /* Since we've just deallocated a page we know that newStackPage won't deallocate an existing one. */ + moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFP, thePage), newStackPage()); + } + /* begin frameCallerContext: */ + theFP1 = (thePage->baseFP); + assert(isBaseFrame(theFP1)); + /* begin stackPageFor: */ + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil1 = longAt((thePage2->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil1)); + assert((callerContextOrNil1 == (nilObject())) + || (isContext(callerContextOrNil1))); + currentCtx = callerContextOrNil1; + freeStackPage(thePage); + } + else { + /* begin fetchPointer:ofObject: */ + nextCntx = longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + /* begin markContextAsDead: */ + assert(isContext(currentCtx)); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer1 = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1); + currentCtx = nextCntx; + } + } + /* begin setStackPageAndLimit: */ + assert(newPage != 0); + GIV(stackPage) = newPage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(newPage); + localSP = (GIV(stackPage)->headSP); + localFP = (GIV(stackPage)->headFP); + } + if (localFP == frameToReturnTo) { + + /* pop the saved IP, push the return value and continue. */ + localIP = pointerForOop(longAtPointer(localSP)); + } + else { + do { + callerFP = localFP; + localFP = pointerForOop(longAt(localFP + FoxSavedFP)); + } while(localFP != frameToReturnTo); + localIP = pointerForOop(longAt(callerFP + FoxCallerSavedIP)); + localSP = ((assert(!(isBaseFrame(callerFP))), +(callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord)) - BytesPerWord; + } + /* begin maybeReturnToMachineCodeFrame */ + if ((((usqInt)localIP)) < (startOfMemory())) { + if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) { + + /* localIP in the cog method zone indicates a return to machine code. */ + /* begin returnToMachineCodeFrame */ + assertCStackWellAligned(); + assert((((usqInt)localIP)) < (startOfMemory())); + assert(isMachineCodeFrame(localFP)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__); + longAtPointerput(localSP, localIP); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin externalizeFPandSP */ + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + ceEnterCogCodePopReceiverReg(); + goto l3153; + } + localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); + } + l3153: /* end maybeReturnToMachineCodeFrame */; + /* begin setMethod: */ + aMethodObj = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + longAtPointerput(localSP, localReturnValue); + } + l3143: /* end case */; + break; + case 121: + case 345: /*89*/ + /* returnTrue */ + { + VM_LABEL(returnTrue); + /* begin trueObject */ + localReturnValue = GIV(trueObj); + goto commonReturn; + } + break; + case 122: + case 346: /*90*/ + /* returnFalse */ + { + VM_LABEL(returnFalse); + /* begin falseObject */ + localReturnValue = GIV(falseObj); + goto commonReturn; + } + break; + case 123: + case 347: /*91*/ + /* returnNil */ + { + VM_LABEL(returnNil); + /* begin nilObject */ + localReturnValue = GIV(nilObj); + goto commonReturn; + } + break; + case 124: + case 348: /*92*/ + /* returnTopFromMethod */ + { + VM_LABEL(returnTopFromMethod); + /* begin internalStackTop */ + localReturnValue = longAtPointer(localSP); + goto commonReturn; + } + break; + case 125: + /* returnTopFromBlock */ + { + VM_LABEL(returnTopFromBlock); + /* begin internalStackTop */ + localReturnValue = longAtPointer(localSP); + /* goto commonCallerReturn */ + } + + commonCallerReturn: + /* commonCallerReturn */ + { + sqInt aMethodObj; + sqInt aMethodObj1; + sqInt callerContextOrNil; + char *callerFP; + char *callersFPOrNull; + sqInt contextToReturnFrom; + sqInt contextToReturnTo; + sqInt doWeHaveANativeFrame; + char *fp; + char *frameAbove; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt frameNumArgs11; + sqInt frameNumArgs2; + StackPage *lruOrFree; + sqInt markObject; + StackPage *newPage; + sqInt offset; + sqInt offset1; + sqInt retToContext; + sqInt senderOop; + char *sp; + char *sp1; + char *sp2; + char *theFP; + StackPage *thePage; + StackPage *thePage1; + char *theSP; + + VM_LABEL(commonCallerReturn); + + /* TODO: Store/restore the nativeSP more properly, when it exists */ + /* begin frameHasNativeFrame: */ + offset1 = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(localFP))->cmNumArgs) + : byteAt((localFP + FoxIFrameFlags) + 1)); + markObject = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? (offset1 < ((frameNumArgs2 = ((mframeCogMethod(localFP))->cmNumArgs))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs2 - offset1) * BytesPerWord)) + : longAt(((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs2 - offset1) * BytesPerWord))) + : (offset1 < ((frameNumArgs11 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs11 - offset1) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs11 - offset1) * BytesPerWord)))); + doWeHaveANativeFrame = (markObject != GIV(nilObj)) + && (markObject == (splObj(LowcodeContextMark))); + if (doWeHaveANativeFrame) { + GIV(nativeStackPointer) = (nativePreviousStackPointerIn(localFP)) - 1; + nativeSP = 0; + /* begin setFrameHasNotNativeFrame: */ + offset = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(localFP))->cmNumArgs) + : byteAt((localFP + FoxIFrameFlags) + 1)); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + longAtput((offset < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? (localFP + FoxCallerSavedIP) + ((frameNumArgs - offset) * BytesPerWord) + : ((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - offset) * BytesPerWord)), GIV(nilObj)); + } + else { + if (offset < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - offset) * BytesPerWord), GIV(nilObj)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - offset) * BytesPerWord), GIV(nilObj)); + } + } + } + + callersFPOrNull = pointerForOop(longAt(localFP + FoxSavedFP)); + if (callersFPOrNull == 0) { + + /* baseFrame */ + assert(localFP == ((GIV(stackPage)->baseFP))); + /* begin baseFrameReturn */ + assert(isBaseFrame(localFP)); + /* begin stackPageFor: */ + thePage1 = stackPageAtpages((assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage1->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + contextToReturnTo = callerContextOrNil; + freeStackPageNoAssert(GIV(stackPage)); + retToContext = ((contextToReturnTo & (tagMask())) == 0) + && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex); + if (retToContext + && ((((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(contextToReturnTo))))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (theFP == ((thePage->headFP))) { + theSP = (thePage->headSP); + } + else { + + /* Returning to some interior frame, presumably because of a sender assignment. + Move the frames above to another page (they may be in use, e.g. via coroutining). + Make the interior frame the top frame. */ + /* begin findFrameAbove:inPage: */ + fp = (thePage->headFP); + if (fp == theFP) { + frameAbove = 0; + goto l3176; + } + while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { + if (callerFP == theFP) { + frameAbove = fp; + goto l3176; + } + fp = callerFP; + } + error("did not find theFP in stack page"); + frameAbove = 0; + l3176: /* end findFrameAbove:inPage: */; + /* begin newStackPage */ + lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); + if (((lruOrFree->baseFP)) == 0) { + newPage = lruOrFree; + goto l3184; + } + divorceFramesIn(lruOrFree); + newPage = lruOrFree; + l3184: /* end newStackPage */; + assert(newPage == GIV(stackPage)); + moveFramesInthroughtoPage(thePage, frameAbove, newPage); + markStackPageMostRecentlyUsed(newPage); + theFP = (thePage->headFP); + theSP = (thePage->headSP); + } + } + else { + if (!(retToContext + && (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))) & 1)))) { + contextToReturnFrom = longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord); + tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(contextToReturnFrom, contextToReturnTo, localReturnValue); + /* begin externalCannotReturn:from: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), contextToReturnFrom); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), localReturnValue); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1); + goto l3172; + } + GIV(instructionPointer) = 0; + thePage = makeBaseFrameFor(contextToReturnTo); + theFP = (thePage->headFP); + theSP = (thePage->headSP); + } + /* begin setStackPageAndLimit: */ + assert(thePage != 0); + GIV(stackPage) = thePage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(thePage); + assert((stackPageFor(theFP)) == GIV(stackPage)); + localSP = theSP; + localFP = theFP; + localIP = pointerForOop(longAtPointer(localSP)); + if ((((usqInt)localIP)) < (startOfMemory())) { + if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) { + + /* localIP in the cog method zone indicates a return to machine code. */ + /* begin returnToMachineCodeFrame */ + assertCStackWellAligned(); + assert((((usqInt)localIP)) < (startOfMemory())); + assert(isMachineCodeFrame(localFP)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__); + longAtPointerput(localSP, localIP); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin externalizeFPandSP */ + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + ceEnterCogCodePopReceiverReg(); + goto l3172; + } + localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); + } + assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP)); + /* begin setMethod: */ + aMethodObj = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + longAtPointerput(localSP, localReturnValue); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3172; + } + localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); + localSP = localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(localFP))->cmNumArgs) + : byteAt((localFP + FoxIFrameFlags) + 1)))); + localFP = callersFPOrNull; + if ((((usqInt)localIP)) < (startOfMemory())) { + if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) { + + /* localIP in the cog method zone indicates a return to machine code. */ + /* begin returnToMachineCodeFrame */ + assertCStackWellAligned(); + assert((((usqInt)localIP)) < (startOfMemory())); + assert(isMachineCodeFrame(localFP)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__); + longAtPointerput(localSP, localIP); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localReturnValue); + /* begin externalizeFPandSP */ + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + ceEnterCogCodePopReceiverReg(); + goto l3172; + } + localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); + } + /* begin setMethod: */ + aMethodObj1 = longAt(localFP + FoxMethod); + assert((((usqInt)aMethodObj1)) >= (startOfMemory())); + GIV(method) = aMethodObj1; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + longAtPointerput(localSP, localReturnValue); + } + l3172: /* end case */; + break; + case 126: + case 127: + /* unknownBytecode */ + { + VM_LABEL(unknownBytecode); + /* goto respondToUnknownBytecode */ + } + + respondToUnknownBytecode: + /* respondToUnknownBytecode */ + { + sqInt ourContext; + char *theFP; + char *theSP; + + VM_LABEL(respondToUnknownBytecode); + GIV(messageSelector) = (SelectorUnknownBytecode < (numSlotsOf(GIV(specialObjectsOop))) + ? (/* begin fetchPointer:ofObject: */ + longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorUnknownBytecode) << (shiftForWord())))))) + : 0); + if ((GIV(messageSelector) == null) + || (GIV(messageSelector) == GIV(nilObj))) { + error("Unknown bytecode"); + } + /* begin ensureFrameIsMarried:SP: */ + theFP = localFP; + theSP = localSP; + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + ourContext = longAt(theFP + FoxThisContext); + goto l3185; + } + ourContext = marryFrameSP(theFP, theSP); + l3185: /* end ensureFrameIsMarried:SP: */; + localIP -= 1; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext); + GIV(argumentCount) = 0; + goto normalSend; + } + break; + case 128: + /* extendedPushBytecode */ + { + sqInt descriptor; + sqInt frameNumArgs; + sqInt litVar; + sqInt object; + sqInt object1; + sqInt object2; + sqInt object3; + sqInt variableIndex; + sqInt variableType; + + VM_LABEL(extendedPushBytecode); + descriptor = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + variableType = (((usqInt) descriptor) >> 6) & 3; + variableIndex = descriptor & 0x3F; + if (variableType == 0) { + /* begin pushReceiverVariable: */ + object1 = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object1); + goto l33; + } + if (variableType == 1) { + /* begin pushTemporaryVariable: */ + object = (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + goto l33; + } + if (variableType == 2) { + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + longAtPointerput((localSP -= BytesPerOop), object2); + goto l33; + } + if (variableType == 3) { + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, variableIndex); + } + /* begin internalPush: */ + object3 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object3); + + goto l33; + } + } + l33: /* end case */; + break; + case 129: + /* extendedStoreBytecode */ + { + sqInt descriptor; + sqInt frameNumArgs; + sqInt litVar; + sqInt objOop; + sqInt referent; + sqInt value; + sqInt variableIndex; + sqInt variableType; + + VM_LABEL(extendedStoreBytecode); + /* begin extendedStoreBytecodePop: */ + descriptor = byteAtPointer(++localIP); + variableType = (((usqInt) descriptor) >> 6) & 3; + variableIndex = descriptor & 0x3F; + value = longAtPointer(localSP); + if (variableType == 0) { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + objOop = longAt(localFP + FoxIFReceiver); + +# if IMMUTABILITY + assert(!((isImmediate(objOop)))); + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), objOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l49; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(objOop))); + if ((assert(isNonImmediate(objOop)), + oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop); + } + } + } + longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); + l49: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l43; + } + if (variableType == 1) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord), value); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); + } + goto l43; + } + if (variableType == 3) { + /* begin storeLiteralVariable:withValue: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(litVar)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((litVar + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + litVar = referent; + } + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(litVar)))); + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l47; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(litVar))); + if ((assert(isNonImmediate(litVar)), + oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) { + remember(litVar); + } + } + } + longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); + l47: /* end storeLiteralVariable:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l43; + } + error("illegal store"); + l43: /* end extendedStoreBytecodePop: */; + } + break; + case 130: + /* extendedStoreAndPopBytecode */ + { + sqInt descriptor; + sqInt frameNumArgs; + sqInt litVar; + sqInt objOop; + sqInt referent; + sqInt value; + sqInt variableIndex; + sqInt variableType; + + VM_LABEL(extendedStoreAndPopBytecode); + /* begin extendedStoreBytecodePop: */ + descriptor = byteAtPointer(++localIP); + variableType = (((usqInt) descriptor) >> 6) & 3; + variableIndex = descriptor & 0x3F; + value = longAtPointer(localSP); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + + if (variableType == 0) { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + objOop = longAt(localFP + FoxIFReceiver); + +# if IMMUTABILITY + assert(!((isImmediate(objOop)))); + if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), objOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l61; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(objOop))); + if ((assert(isNonImmediate(objOop)), + oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop); + } + } + } + longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); + l61: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l55; + } + if (variableType == 1) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord), value); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value); + } + goto l55; + } + if (variableType == 3) { + /* begin storeLiteralVariable:withValue: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(litVar)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((litVar + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + litVar = referent; + } + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(litVar)))); + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l59; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(litVar))); + if ((assert(isNonImmediate(litVar)), + oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) { + remember(litVar); + } + } + } + longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); + l59: /* end storeLiteralVariable:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l55; + } + error("illegal store"); + l55: /* end extendedStoreBytecodePop: */; + } + break; + case 131: + /* singleExtendedSendBytecode */ + { + sqInt descriptor; + + VM_LABEL(singleExtendedSendBytecode); + /* begin fetchByte */ + descriptor = byteAtPointer(++localIP); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x1F) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = ((usqInt) descriptor) >> 5; + /* goto normalSend */ + } + + normalSend: + /* normalSend */ + { + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(normalSend); + /* begin internalStackValue: */ + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(rcvr)) & (classIndexMask())); + assert(lkupClassTag != (nilObject())); + + commonSendOrdinary: + /* commonSendOrdinary */ + { + usqInt aMethodObj; + usqInt aMethodObj1; + sqInt aValue; + sqInt classOrInteger; + sqInt classTablePage; + sqInt classTablePage1; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt errorCode; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt fieldIndex11; + sqInt fieldIndex2; + sqInt hash; + sqInt i; + sqInt localPrimIndex; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt nArgs; + sqInt numTemps; + sqInt object; + sqInt ok; + sqInt probe; + sqInt rcvr; + char *savedFramePointer; + char *savedStackPointer; + sqInt selector; + sqInt selector1; + sqInt succeeded; + sqInt switched; + sqInt table; + + VM_LABEL(commonSendOrdinary); + nArgs = 0; + savedFramePointer = 0; + savedStackPointer = 0; + /* begin sendBreakpoint:receiver: */ + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))); + if (recordSendTrace()) { + /* begin recordTrace:thing:source: */ + assert((lkupClassTag <= (tagMask())) + || (lkupClassTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) lkupClassTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + classOrInteger = null; + goto l3203; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = lkupClassTag & ((1U << (classTableMajorIndexShift())) - 1); + classOrInteger = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l3203: /* end classAtIndex: */; + GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger; + GIV(traceLog)[GIV(traceLogIndex) + 1] = GIV(messageSelector); + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + if (printOnTrace()) { + printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(lkupClassTag)); + /* begin cr */ + printf("\n"); + } + } + /* begin internalFindNewMethodOrdinary */ + hash = GIV(messageSelector) ^ (((sqInt)((usqInt)(lkupClassTag) << 2))); + + /* first probe */ + probe = hash & MethodCacheMask; + if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) + && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) { + GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; + primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); + ok = 1; + goto l3187; + } + + /* second probe */ + probe = (((usqInt) hash) >> 1) & MethodCacheMask; + if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) + && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) { + GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; + primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); + ok = 1; + goto l3187; + } + probe = (((usqInt) hash) >> 2) & MethodCacheMask; + if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) + && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) { + GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; + primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); + ok = 1; + goto l3187; + } + ok = 0; + l3187: /* end inlineLookupInMethodCacheSel:classTag: */; + if (ok) { + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + } + else { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + if ((((GIV(messageSelector) & (tagMask())) == 0) + && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) + || (lkupClassTag == (isForwardedObjectClassIndexPun()))) { + if (((GIV(messageSelector) & (tagMask())) == 0) + && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + GIV(messageSelector) = handleForwardedSelectorFaultFor(GIV(messageSelector)); + } + if (lkupClassTag == (isForwardedObjectClassIndexPun())) { + lkupClassTag = handleForwardedSendFaultForTag(lkupClassTag); + } + if (lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag)) { + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj1 = GIV(newMethod); + selector1 = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector1); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj1, selector1); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj1); + } + } + goto l3204; + } + } + /* begin classAtIndex: */ + assert((lkupClassTag <= (tagMask())) + || (lkupClassTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex2 = ((usqInt) lkupClassTag) >> (classTableMajorIndexShift()); + classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord()))))); + if (classTablePage1 == GIV(nilObj)) { + GIV(lkupClass) = null; + goto l3196; + } + /* begin fetchPointer:ofObject: */ + fieldIndex11 = lkupClassTag & ((1U << (classTableMajorIndexShift())) - 1); + GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord()))))); + l3196: /* end classAtIndex: */; + lookupMethodInClass(GIV(lkupClass)); + + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + addNewMethodToCache(GIV(lkupClass)); + } + l3204: /* end internalFindNewMethodOrdinary */; + /* begin internalExecuteNewMethod */ + if (primitiveFunctionPointer != 0) { + if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { + /* begin internalQuickPrimitiveResponse */ + assert(isPrimitiveFunctionPointerAnIndex()); + localPrimIndex = ((sqInt) primitiveFunctionPointer); + assert((localPrimIndex > 0xFF) + && (localPrimIndex < 520)); + if (localPrimIndex >= 264) { + /* begin internalStackTopPut: */ + aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord()))))); + longAtPointerput(localSP, aValue); + goto l3208; + } + if (localPrimIndex == 256) { + goto l3208; + } + if (localPrimIndex == 257) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, GIV(trueObj)); + goto l3208; + } + if (localPrimIndex == 258) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, GIV(falseObj)); + goto l3208; + } + if (localPrimIndex == 259) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, GIV(nilObj)); + goto l3208; + } + longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 1) | 1)); + goto l3208; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin slowPrimitiveResponse */ + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector); + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); + assert((remapBufferCount()) == 0); + nArgs = GIV(argumentCount); + savedStackPointer = GIV(stackPointer); + savedFramePointer = GIV(framePointer); + + /* begin initPrimCall */ + GIV(primFailCode) = 0; + dispatchFunctionPointer(primitiveFunctionPointer); + assert(maybeLeakCheckExternalPrimCall(GIV(newMethod))); + /* begin maybeRetryPrimitiveOnFailure */ + if (GIV(primFailCode)) { + retryPrimitiveOnFailure(); + } + /* begin maybeFailForLastObjectOverwrite */ + if (checkAllocFiller) { + if (((freeStart()) < GIV(scavengeThreshold)) + && ((longAt(freeStart())) != (freeStart()))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrWritePastObject; + } + } + if ((!GIV(primFailCode)) + && ((GIV(framePointer) == savedFramePointer) + && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) { + + /* Don't fail if primitive has done something radical, e.g. perform: */ + if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) { + flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context"); + failUnbalancedPrimitive(); + GIV(stackPointer) = savedStackPointer; + } + } + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + succeeded = !GIV(primFailCode); + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + /* begin iframeSavedIP: */ + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (succeeded) { + returntoExecutive(popStack(), 1); + browserPluginReturnIfNeeded(); + goto l3208; + } + } + if ((assert(isNonImmediate(GIV(newMethod))), + isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(localFP))); + longAtput(localFP + FoxIFSavedIP, ((sqInt)localIP)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + /* begin externalizeFPandSP */ + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + activateCoggedNewMethod(1); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + } + else { + /* begin internalActivateNewMethod */ + methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert(!(isCogMethodReference(methodHeader2))); + numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F; + assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader2))); + + /* could new rcvr be set at point of send? */ + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(!(isOopForwarded(rcvr))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localIP); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), localFP); + localFP = localSP; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(newMethod)); + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader2); + GIV(bytecodeSetSelector) = ((((int) methodHeader2)) < 0 + ? 256 + : 0); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); + /* begin internalPush: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0)); + longAtPointerput((localSP -= BytesPerOop), object); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), 0); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + for (i = (GIV(argumentCount) + 1); i <= numTemps; i += 1) { + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(nilObj)); + } + localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader2 & 1)), +((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1); + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader2 & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + localIP += 3; + if (GIV(primFailCode) != 0) { + if ((byteAt(localIP + 1)) == (((((int) methodHeader2)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l3201; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l3201: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(localSP, errorCode); + } + GIV(primFailCode) = 0; + } + } + assert((frameNumArgs(localFP)) == GIV(argumentCount)); + assert(!(frameIsBlockActivation(localFP))); + assert(!(frameHasContext(localFP))); + if (localSP < GIV(stackLimit)) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2)); + returnToExecutivepostContextSwitch(1, switched); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + } + } + l3208: /* end internalExecuteNewMethod */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + } + break; + case 132: + /* doubleExtendedDoAnythingBytecode */ + { + sqInt byte2; + sqInt byte3; + sqInt callerContextOrNil; + char *callerFP; + sqInt litVar; + sqInt litVar1; + sqInt obj; + sqInt obj1; + sqInt object; + sqInt object11; + sqInt object2; + sqInt object3; + int onCurrentPage; + sqInt opType; + sqInt referent; + sqInt result; + sqInt senderOop; + sqInt senderOop1; + char *spouseFP; + char * theFP; + StackPage *thePage; + StackPage * thePage1; + sqInt top; + sqInt value; + + VM_LABEL(doubleExtendedDoAnythingBytecode); + byte2 = byteAtPointer(++localIP); + byte3 = byteAtPointer(++localIP); + opType = ((usqInt) byte2) >> 5; + if (opType == 0) { + assert(GIV(method) == (iframeMethod(localFP))); + /* begin literal:ofMethod: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = byte2 & 0x1F; + goto normalSend; + goto l66; + } + if (opType == 1) { + assert(GIV(method) == (iframeMethod(localFP))); + /* begin literal:ofMethod: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = byte2 & 0x1F; + goto superclassSend; + goto l66; + } + if (opType == 2) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushMaybeContextReceiverVariable: */ + obj = longAt(localFP + FoxIFReceiver); + if ((byte3 <= StackPointerIndex) + && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + /* begin internalPush: */ + assert(byte3 < MethodIndex); + assert(isContext(obj)); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + value = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + if ((byte3 == InstructionPointerIndex) + && (((value & 1)) + && ((((int) value)) < 0))) { + /* begin internalMustMapMachineCodePC:context: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + result = mustMapMachineCodePCcontext((value >> 1), obj); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + value = result; + } + object3 = value; + goto l90; + } + if (isWidowedContext(obj)) { + object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + goto l90; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + spouseFP = pointerForOop(senderOop - 1); + + if (byte3 == SenderIndex) { + /* begin ensureCallerContext: */ + callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP)); + if (callerFP == 0) { + + /* base frame, context in saved ip slot (or base of stack in Cog) */ + /* begin frameCallerContext: */ + assert(isBaseFrame(spouseFP)); + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + object3 = callerContextOrNil; + goto l90; + } + /* begin ensureFrameIsMarried:SP: */ + if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(callerFP))); + object3 = longAt(callerFP + FoxThisContext); + goto l90; + } + object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); + goto l90; + } + if (byte3 == StackPointerIndex) { + assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); + object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l90; + } + if (byte3 == InstructionPointerIndex) { + object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l90; + } + error("bad index"); + object3 = 0; + l90: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object3); + } + else { + /* begin internalPush: */ + object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object11); + } + goto l66; + } + if (opType == 3) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + + longAtPointerput((localSP -= BytesPerOop), object); + goto l66; + } + if (opType == 4) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, byte3); + } + /* begin internalPush: */ + object2 = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object2); + + goto l66; + } + top = longAtPointer(localSP); + if (opType == 7) { + /* begin storeLiteralVariable:withValue: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar1 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(litVar1)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((litVar1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + litVar1 = referent; + } + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(litVar1)))); + if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l94; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(litVar1))); + if ((assert(isNonImmediate(litVar1)), + oopisGreaterThanOrEqualTo(litVar1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(litVar1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(litVar1); + } + } + } + longAtput((litVar1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), top); + l94: /* end storeLiteralVariable:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l66; + } + if (opType == 6) { + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + /* begin storeMaybeContextReceiverVariable:withValue: */ + obj1 = longAt(localFP + FoxIFReceiver); + if ((byte3 <= ReceiverIndex) + && ((((longAt(obj1)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + /* begin instVar:ofContext:put: */ + assert(isMarriedOrWidowedContext(obj1)); + assert(!((isObjImmutable(obj1)))); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!((((longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(obj1))))) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj1))); + if ((assert(isNonImmediate(obj1)), + oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj1); + } + } + } + longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); + if (byte3 == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1); + } + goto l80; + } + /* begin frameOfMarriedContext: */ + senderOop1 = longAt((obj1 + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + theFP = pointerForOop(senderOop1 - 1); + + if (byte3 == SenderIndex) { + /* begin stackPageFor: */ + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + onCurrentPage = thePage1 == GIV(stackPage); + storeSenderOfFramewithValue(theFP, top); + if (onCurrentPage) { + localFP = (GIV(stackPage)->headFP); + localSP = (GIV(stackPage)->headSP); + } + else { + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + goto l80; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + externalDivorceFrameandContext(theFP, obj1); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj1))); + if ((assert(isNonImmediate(obj1)), + oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj1); + } + } + } + longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); + if (byte3 == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + markStackPageMostRecentlyUsed(GIV(stackPage)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); + l80: /* end instVar:ofContext:put: */; + } + else { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(obj1)))); + if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), obj1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(byte3 + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l93; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj1))); + if ((assert(isNonImmediate(obj1)), + oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj1); + } + } + } + longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top); + l93: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + l66: /* end case */; + break; + case 133: + /* singleExtendedSuperBytecode */ + { + sqInt descriptor; + + VM_LABEL(singleExtendedSuperBytecode); + /* begin fetchByte */ + descriptor = byteAtPointer(++localIP); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x1F) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = ((usqInt) descriptor) >> 5; + /* goto superclassSend */ + } + + superclassSend: + /* superclassSend */ + { + sqInt aValue; + sqInt classPointer; + sqInt err; + sqInt hash; + sqInt objOop; + sqInt objOop1; + sqInt referent; + sqInt superclass; + + VM_LABEL(superclassSend); + /* begin superclassOf: */ + classPointer = methodClassOf(GIV(method)); + /* begin followField:ofObject: */ + objOop = longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop); + } + superclass = objOop; + + /* To maintain the invariant that all receivers are unforwarded we need an explicit + read barrier in the super send cases. Even though we always follow receivers + on become e.g. super doSomethingWith: (self become: other) forwards the receiver + self pushed on the stack. */ + assert(addressCouldBeClassObj(superclass)); + lkupClassTag = (((hash = (long32At(superclass + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(superclass) + ? (((err = enterIntoClassTable(superclass))) != 0 + ? -err + : (/* begin rawHashBitsOf: */ + (long32At(superclass + 4)) & (identityHashHalfWordMask()))) + : -PrimErrBadReceiver)); + + /* begin ensureReceiverUnforwarded */ + if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & (tagMask())) == 0) + && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin internalStackValue:put: */ + objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(isUnambiguouslyForwarder(objOop1)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + aValue = referent; + longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue); + } + assert(lkupClassTag != (nilObject())); + goto commonSendOrdinary; + } + break; + case 134: + /* secondExtendedSendBytecode */ + { + sqInt descriptor; + + VM_LABEL(secondExtendedSendBytecode); + /* begin fetchByte */ + descriptor = byteAtPointer(++localIP); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x3F) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = ((usqInt) descriptor) >> 6; + goto normalSend; + } + break; + case 135: + case 472: /*216*/ + /* popStackBytecode */ + { + VM_LABEL(popStackBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 136: + case 339: /*83*/ + /* duplicateTopBytecode */ + { + sqInt object; + + VM_LABEL(duplicateTopBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = longAtPointer(localSP); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 137: + /* pushActiveContextBytecode */ + { + sqInt ourContext; + char *theFP; + char *theSP; + + VM_LABEL(pushActiveContextBytecode); + /* begin ensureFrameIsMarried:SP: */ + theFP = localFP; + theSP = localSP; + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + ourContext = longAt(theFP + FoxThisContext); + goto l104; + } + ourContext = marryFrameSP(theFP, theSP); + l104: /* end ensureFrameIsMarried:SP: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext); + } + break; + case 138: + /* pushNewArrayBytecode */ + { + sqInt array; + sqInt i; + usqInt newObj; + usqInt numBytes; + int popValues; + sqInt size; + sqInt valuePointer; + sqInt valuePointer1; + + VM_LABEL(pushNewArrayBytecode); + /* begin fetchByte */ + size = byteAtPointer(++localIP); + popValues = size > 0x7F; + size = size & 0x7F; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + assert((size >= 0) + && (ClassArrayCompactIndex != 0)); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(size < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((size <= 1 + ? 8 + : (size + (size & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + array = 0; + goto l105; + } + } + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); + GIV(freeStart) += numBytes; + array = newObj; + l105: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + if (popValues) { + for (i = 0; i < size; i += 1) { + + /* Assume: have just allocated a new Array; it must be young. Thus, can use unchecked stores. */ + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = longAtPointer(localSP + (((size - i) - 1) * BytesPerOop)); + assert(!(isOopForwarded(array))); + longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + /* begin internalPop: */ + localSP += size * BytesPerOop; + } + else { + for (i = 0; i < size; i += 1) { + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer1 = GIV(nilObj); + assert(!(isOopForwarded(array))); + longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer1); + } + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), array); + } + break; + case 139: + /* callPrimitiveBytecode */ + { + sqInt alignment; + sqInt arg; + float argumentValue; + double argumentValue1; + sqInt aValue; + sqInt aValue1; + char*base; + char*base1; + char*base11; + char*base2; + char*base3; + sqInt baseOffset; + sqInt baseOffset1; + sqInt baseOffset10; + sqInt baseOffset11; + sqInt baseOffset110; + sqInt baseOffset12; + sqInt baseOffset13; + sqInt baseOffset14; + sqInt baseOffset15; + sqInt baseOffset16; + sqInt baseOffset17; + sqInt baseOffset18; + sqInt baseOffset19; + sqInt baseOffset2; + sqInt baseOffset20; + sqInt baseOffset21; + sqInt baseOffset22; + sqInt baseOffset23; + sqInt baseOffset24; + sqInt baseOffset25; + sqInt baseOffset3; + sqInt baseOffset31; + sqInt baseOffset4; + sqInt baseOffset41; + sqInt baseOffset5; + sqInt baseOffset51; + sqInt baseOffset6; + sqInt baseOffset7; + sqInt baseOffset8; + sqInt baseOffset9; + sqInt bool; + sqInt bool1; + sqInt bool2; + sqInt bool3; + sqInt bool4; + sqInt bool5; + sqInt byte1; + sqInt byte2; + sqInt byteIndex; + sqInt byteIndex1; + usqIntptr_t calloutStateSize; + usqIntptr_t calloutStateSize1; + usqIntptr_t calloutStateSize10; + usqIntptr_t calloutStateSize11; + usqIntptr_t calloutStateSize12; + usqIntptr_t calloutStateSize13; + usqIntptr_t calloutStateSize14; + usqIntptr_t calloutStateSize2; + usqIntptr_t calloutStateSize3; + usqIntptr_t calloutStateSize4; + usqIntptr_t calloutStateSize5; + usqIntptr_t calloutStateSize6; + usqIntptr_t calloutStateSize7; + usqIntptr_t calloutStateSize8; + usqIntptr_t calloutStateSize9; + char*check; + sqInt classObj; + sqInt classOop; + sqInt classOop1; + sqInt classOop2; + sqInt code; + sqInt constant; + sqInt constant1; + char*dest; + char*dest1; + char*dest2; + double doubleResult; + double doubleValue; + double doubleValue1; + double doubleValue2; + float dup1; + double dup11; + sqInt dup12; + sqLong dup13; + char*dup14; + float dup2; + double dup21; + sqInt dup22; + sqLong dup23; + char*dup24; + sqInt expectedSession; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt fieldIndex11; + sqInt fieldIndex12; + sqInt fieldIndex2; + sqInt fieldIndex3; + sqInt fieldIndex4; + sqInt fieldValue; + sqInt fieldValue1; + sqInt first; + sqInt first1; + float first10; + sqLong first101; + sqLong first102; + float first11; + sqLong first110; + sqLong first111; + sqLong first112; + sqInt first113; + sqLong first114; + float first12; + sqLong first121; + float first13; + sqLong first131; + float first14; + sqInt first141; + float first15; + sqLong first151; + double first16; + sqLong first161; + double first17; + sqInt first171; + double first18; + sqInt first181; + double first19; + sqLong first191; + sqInt first2; + double first20; + sqInt first201; + double first21; + sqInt first211; + double first22; + sqInt first221; + double first23; + sqInt first231; + double first24; + double first25; + sqInt first26; + sqInt first27; + sqInt first28; + sqLong first3; + sqLong first31; + sqLong first32; + sqLong first33; + sqInt first34; + sqInt first4; + sqInt first41; + char*first42; + sqInt first43; + sqLong first5; + sqLong first51; + char*first52; + sqInt first53; + float first6; + sqInt first61; + sqLong first62; + float first7; + sqInt first71; + sqLong first72; + float first8; + sqInt first81; + sqLong first82; + float first9; + sqInt first91; + sqLong first92; + double floatValue; + double floatValue1; + double floatValue2; + double floatValue3; + double floatValue4; + float floatValue5; + float floatValue6; + float floatValue7; + double floatValue8; + sqInt fmt; + sqInt fmt1; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt function; + sqInt function1; + sqInt function10; + sqInt function11; + sqInt function12; + sqInt function13; + sqInt function14; + char*function2; + char*function3; + char*function4; + char*function5; + char*function6; + char*function7; + char*function8; + sqInt function9; + sqInt hash; + sqInt header; + sqInt header1; + sqInt i; + sqInt index; + sqLong index1; + sqInt indexableSize; + sqInt indexableSize1; + char*initialShadowCallStackPointer; + char*initialShadowCallStackPointer1; + char*initialShadowCallStackPointer10; + char*initialShadowCallStackPointer11; + char*initialShadowCallStackPointer12; + char*initialShadowCallStackPointer13; + char*initialShadowCallStackPointer2; + char*initialShadowCallStackPointer3; + char*initialShadowCallStackPointer4; + char*initialShadowCallStackPointer5; + char*initialShadowCallStackPointer6; + char*initialShadowCallStackPointer7; + char*initialShadowCallStackPointer8; + char*initialShadowCallStackPointer9; + sqInt int32Result; + sqLong int64Result; + sqInt int64Result1; + sqLong int64Result2; + sqInt isFloat; + sqInt isFloat1; + sqInt knownClassIndex; + sqInt longIndex; + sqInt longIndex1; + char*memoryPointer; + sqInt newLargeInteger; + usqInt newObj; + usqInt newObj1; + sqInt newValue; + usqInt numBytes; + usqInt numBytes1; + usqInt numBytes2; + usqInt numBytes3; + sqInt numSlots; + usqInt numSlots1; + usqInt numSlots2; + usqInt numSlots3; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object10; + sqInt object101; + sqInt object11; + sqInt object110; + sqInt object111; + sqInt object12; + sqInt object121; + sqInt object13; + sqInt object131; + sqInt object14; + sqInt object141; + sqInt object15; + sqInt object16; + sqInt object17; + sqInt object18; + sqInt object19; + sqInt object2; + sqInt object20; + sqInt object21; + sqInt object211; + sqInt object22; + sqInt object23; + sqInt object24; + sqInt object25; + sqInt object3; + sqInt object31; + sqInt object32; + sqInt object4; + sqInt object41; + sqInt object42; + sqInt object5; + sqInt object51; + sqInt object6; + sqInt object61; + sqInt object7; + sqInt object71; + sqInt object8; + sqInt object81; + sqInt object9; + sqInt object91; + sqInt objFormat; + sqInt objFormat1; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop12; + sqInt objOop2; + sqInt objOop21; + sqInt objOop22; + sqInt objOop3; + sqInt objOop31; + sqInt objOop4; + sqInt objOop41; + sqInt objOop5; + sqInt offset; + sqLong offset1; + sqInt offset11; + sqLong offset2; + sqInt offset3; + sqInt offset4; + sqInt oldValue; + sqInt oop; + sqInt oop1; + sqInt oop2; + char*pointer; + char*pointer1; + char*pointer10; + char*pointer11; + char*pointer12; + char*pointer13; + char*pointer14; + char*pointer15; + char*pointer16; + char*pointer17; + char*pointer18; + char*pointer2; + char*pointer21; + char*pointer22; + char*pointer23; + char*pointer3; + char*pointer31; + char*pointer32; + char*pointer33; + char*pointer4; + char*pointer41; + char*pointer42; + char*pointer5; + char*pointer51; + char*pointer52; + char*pointer6; + char*pointer61; + char*pointer7; + char*pointer71; + char*pointer8; + char*pointer81; + char*pointer9; + sqInt pointerClassLiteral; + char*pointerResult; + char*pointerResult1; + char*pointerResult2; + char*pointerValue; + char*pointerValue1; + char*pointerValue11; + char*pointerValue12; + char*pointerValue2; + char*pointerValue3; + char*pointerValue4; + sqInt popSize; + sqInt prim; + sqInt primSet; + sqInt rcvr; + sqInt registerID; + sqInt registerID1; + sqInt registerID11; + sqInt registerID2; + sqInt registerID21; + sqInt registerID3; + sqInt registerID31; + sqInt registerID4; + sqInt registerID41; + sqInt registerID5; + sqInt registerID6; + sqInt result; + sqInt result1; + float result10; + sqInt result101; + char*result102; + float result11; + sqLong result110; + sqInt result111; + double result112; + sqLong result113; + sqInt result114; + double result115; + sqLong result116; + double result117; + float result12; + sqLong result121; + sqLong result122; + float result13; + sqLong result131; + sqInt result132; + float result14; + sqLong result141; + sqLong result142; + float result15; + sqInt result151; + char*result152; + sqInt result16; + sqLong result161; + sqInt result162; + sqLong result17; + sqInt result171; + sqLong result172; + sqInt result18; + sqInt result181; + float result182; + sqLong result19; + sqInt result191; + double result192; + usqInt result2; + double result20; + sqInt result201; + float result202; + double result21; + sqInt result210; + sqInt result211; + sqInt result212; + sqInt result213; + double result214; + char*result215; + sqInt result216; + double result22; + sqInt result221; + sqInt result222; + double result23; + sqLong result231; + sqLong result232; + double result24; + float result241; + char*result242; + double result25; + double result251; + char*result252; + sqInt result26; + float result261; + sqLong result27; + double result271; + char*result28; + sqInt result281; + char*result29; + sqLong result291; + sqLong result3; + sqInt result30; + sqLong result31; + float result32; + sqLong result33; + sqLong result34; + sqInt result35; + double result36; + float result37; + sqInt result38; + double result39; + sqInt result4; + sqInt result41; + float result42; + sqInt result43; + double result44; + sqLong result5; + sqInt result51; + double result52; + sqLong result53; + char*result54; + sqInt result6; + sqLong result61; + sqInt result62; + sqInt result63; + sqLong result64; + sqInt result641; + sqLong result7; + sqLong result71; + sqLong result72; + sqLong result73; + sqLong result74; + char*result8; + sqLong result81; + sqInt result82; + char*result83; + char*result9; + sqLong result91; + char*result92; + char*resultPointer; + char*resultPointer1; + sqInt scale; + sqLong scale1; + sqInt second; + sqInt second1; + float second10; + sqLong second101; + sqLong second102; + float second11; + sqLong second110; + sqLong second111; + sqInt second112; + sqLong second113; + sqLong second114; + float second12; + sqLong second121; + float second13; + sqLong second131; + float second14; + sqInt second141; + float second15; + sqLong second151; + double second16; + sqInt second161; + double second17; + sqLong second171; + double second18; + sqInt second181; + double second19; + sqLong second191; + sqInt second2; + double second20; + sqInt second201; + double second21; + sqInt second211; + double second22; + sqInt second221; + double second23; + sqInt second231; + double second24; + double second25; + sqInt second26; + sqInt second27; + sqInt second28; + sqLong second3; + sqLong second31; + sqLong second32; + sqLong second33; + sqInt second34; + sqInt second4; + sqInt second41; + char*second42; + sqInt second43; + sqLong second5; + sqLong second51; + char*second52; + sqInt second53; + float second6; + sqInt second61; + sqLong second62; + float second7; + sqInt second71; + sqLong second72; + float second8; + sqInt second81; + sqLong second82; + float second9; + sqInt second91; + sqLong second92; + sqInt shiftAmount; + sqLong shiftAmount1; + sqLong shiftAmount11; + sqLong shiftAmount12; + sqInt shiftAmount2; + sqInt shiftAmount3; + sqInt shortIndex; + sqInt shortIndex1; + float singleFloatResult; + float singleFloatValue; + float singleFloatValue1; + sqInt size; + sqLong size1; + sqLong size11; + sqInt size2; + sqLong size3; + sqInt size4; + sqInt size5; + sqInt size6; + char*source; + char*source1; + char*source2; + sqInt spaceSize; + char*structurePointer; + sqInt structureSize; + sqInt structureSize1; + sqInt structureSize2; + sqInt tagBits; + sqInt top; + sqInt top1; + sqInt top10; + sqInt top11; + sqInt top110; + sqInt top111; + sqInt top12; + sqInt top121; + sqInt top13; + sqInt top131; + sqInt top14; + sqInt top141; + sqInt top15; + sqInt top16; + sqInt top17; + sqInt top18; + sqInt top19; + sqInt top2; + sqInt top20; + sqInt top21; + sqInt top211; + sqInt top22; + sqInt top23; + sqInt top24; + sqInt top25; + sqInt top3; + sqInt top31; + sqInt top32; + sqInt top4; + sqInt top41; + sqInt top42; + sqInt top5; + sqInt top51; + sqInt top6; + sqInt top7; + sqInt top8; + sqInt top9; + double topDouble; + double topDouble1; + double topDouble10; + double topDouble11; + double topDouble110; + double topDouble111; + double topDouble112; + double topDouble12; + double topDouble121; + double topDouble13; + double topDouble14; + double topDouble15; + double topDouble16; + double topDouble17; + double topDouble18; + double topDouble19; + double topDouble2; + double topDouble20; + double topDouble21; + double topDouble211; + double topDouble22; + double topDouble23; + double topDouble24; + double topDouble25; + double topDouble3; + double topDouble31; + double topDouble4; + double topDouble41; + double topDouble5; + double topDouble51; + double topDouble6; + double topDouble7; + double topDouble8; + double topDouble9; + sqInt topInt32; + sqInt topInt321; + sqInt topInt3210; + sqInt topInt32101; + sqInt topInt3211; + sqInt topInt32110; + sqInt topInt32111; + sqInt topInt321110; + sqInt topInt321111; + sqInt topInt32112; + sqInt topInt32113; + sqInt topInt32114; + sqInt topInt32115; + sqInt topInt32116; + sqInt topInt32117; + sqInt topInt32118; + sqInt topInt32119; + sqInt topInt3212; + sqInt topInt32120; + sqInt topInt32121; + sqInt topInt32122; + sqInt topInt32123; + sqInt topInt32124; + sqInt topInt3213; + sqInt topInt32131; + sqInt topInt32132; + sqInt topInt3214; + sqInt topInt32141; + sqInt topInt32142; + sqInt topInt3215; + sqInt topInt32151; + sqInt topInt32152; + sqInt topInt3216; + sqInt topInt32161; + sqInt topInt3217; + sqInt topInt32171; + sqInt topInt3218; + sqInt topInt32181; + sqInt topInt3219; + sqInt topInt322; + sqInt topInt3220; + sqInt topInt3221; + sqInt topInt32210; + sqInt topInt32211; + sqInt topInt32212; + sqInt topInt32213; + sqInt topInt3222; + sqInt topInt3223; + sqInt topInt3224; + sqInt topInt3225; + sqInt topInt3226; + sqInt topInt3227; + sqInt topInt3228; + sqInt topInt3229; + sqInt topInt323; + sqInt topInt3230; + sqInt topInt3231; + sqInt topInt3232; + sqInt topInt3233; + sqInt topInt3234; + sqInt topInt3235; + sqInt topInt3236; + sqInt topInt3237; + sqInt topInt324; + sqInt topInt3241; + sqInt topInt3242; + sqInt topInt3243; + sqInt topInt3244; + sqInt topInt3245; + sqInt topInt325; + sqInt topInt3251; + sqInt topInt3252; + sqInt topInt3253; + sqInt topInt3254; + sqInt topInt326; + sqInt topInt3261; + sqInt topInt3262; + sqInt topInt3263; + sqInt topInt327; + sqInt topInt3271; + sqInt topInt3272; + sqInt topInt3273; + sqInt topInt328; + sqInt topInt3281; + sqInt topInt3282; + sqInt topInt3283; + sqInt topInt329; + sqInt topInt3291; + sqInt topInt3292; + sqLong topInt64; + sqLong topInt641; + sqLong topInt6410; + sqLong topInt64101; + sqLong topInt6411; + sqLong topInt64110; + sqLong topInt64111; + sqLong topInt64112; + sqLong topInt64113; + sqLong topInt64114; + sqLong topInt64115; + sqLong topInt64116; + sqLong topInt64117; + sqLong topInt64118; + sqLong topInt64119; + sqLong topInt6412; + sqLong topInt64120; + sqLong topInt64121; + sqLong topInt64122; + sqLong topInt64123; + sqLong topInt64124; + sqLong topInt6413; + sqLong topInt64131; + sqLong topInt64132; + sqLong topInt6414; + sqLong topInt64141; + sqLong topInt64142; + sqLong topInt6415; + sqLong topInt64151; + sqLong topInt6416; + sqLong topInt64161; + sqLong topInt6417; + sqLong topInt6418; + sqLong topInt6419; + sqLong topInt642; + sqLong topInt6420; + sqLong topInt6421; + sqLong topInt64210; + sqLong topInt64211; + sqLong topInt64212; + sqLong topInt6422; + sqLong topInt6423; + sqLong topInt6424; + sqLong topInt6425; + sqLong topInt6426; + sqLong topInt6427; + sqLong topInt6428; + sqLong topInt6429; + sqLong topInt643; + sqLong topInt6430; + sqLong topInt6431; + sqLong topInt6432; + sqLong topInt6433; + sqLong topInt6434; + sqLong topInt6435; + sqLong topInt644; + sqLong topInt6441; + sqLong topInt6442; + sqLong topInt6443; + sqLong topInt6444; + sqLong topInt645; + sqLong topInt6451; + sqLong topInt6452; + sqLong topInt6453; + sqLong topInt646; + sqLong topInt6462; + sqLong topInt6463; + sqLong topInt647; + sqLong topInt6471; + sqLong topInt6472; + sqLong topInt6473; + sqLong topInt648; + sqLong topInt6481; + sqLong topInt6482; + sqLong topInt6483; + sqLong topInt649; + sqLong topInt6491; + char*topPointer; + char*topPointer1; + char*topPointer10; + char*topPointer11; + char*topPointer110; + char*topPointer111; + char*topPointer112; + char*topPointer113; + char*topPointer114; + char*topPointer115; + char*topPointer12; + char*topPointer13; + char*topPointer14; + char*topPointer15; + char*topPointer16; + char*topPointer17; + char*topPointer18; + char*topPointer19; + char*topPointer2; + char*topPointer20; + char*topPointer21; + char*topPointer210; + char*topPointer211; + char*topPointer212; + char*topPointer22; + char*topPointer23; + char*topPointer24; + char*topPointer25; + char*topPointer26; + char*topPointer27; + char*topPointer28; + char*topPointer29; + char*topPointer3; + char*topPointer30; + char*topPointer31; + char*topPointer32; + char*topPointer33; + char*topPointer34; + char*topPointer35; + char*topPointer36; + char*topPointer4; + char*topPointer41; + char*topPointer42; + char*topPointer43; + char*topPointer5; + char*topPointer51; + char*topPointer52; + char*topPointer53; + char*topPointer6; + char*topPointer61; + char*topPointer62; + char*topPointer7; + char*topPointer71; + char*topPointer8; + char*topPointer9; + float topSingle; + float topSingle1; + float topSingle10; + float topSingle11; + float topSingle110; + float topSingle111; + float topSingle112; + float topSingle113; + float topSingle12; + float topSingle13; + float topSingle14; + float topSingle15; + float topSingle16; + float topSingle17; + float topSingle18; + float topSingle19; + float topSingle2; + float topSingle20; + float topSingle21; + float topSingle22; + float topSingle23; + float topSingle24; + float topSingle25; + float topSingle26; + float topSingle27; + float topSingle28; + float topSingle29; + float topSingle3; + float topSingle4; + float topSingle5; + float topSingle6; + float topSingle7; + float topSingle8; + float topSingle9; + sqInt value; + sqInt value1; + sqInt value10; + sqInt value101; + sqInt value102; + sqInt value103; + sqLong value104; + sqLong value11; + sqInt value110; + double value111; + sqLong value112; + sqLong value113; + sqInt value114; + sqInt value115; + sqInt value116; + sqInt value117; + sqLong value118; + float value119; + sqInt value12; + sqInt value120; + sqInt value121; + sqInt value122; + sqInt value123; + double value124; + sqInt value13; + sqInt value131; + sqInt value132; + sqInt value133; + sqInt value134; + sqInt value14; + sqLong value141; + float value142; + sqInt value143; + sqLong value144; + float value15; + sqInt value151; + double value152; + sqLong value153; + sqInt value154; + sqInt value16; + float value161; + sqInt value162; + sqLong value163; + sqLong value164; + float value17; + double value171; + sqLong value172; + sqLong value173; + sqInt value174; + float value18; + sqInt value181; + sqInt value182; + float value19; + sqInt value191; + sqLong value192; + sqInt value2; + float value20; + sqInt value201; + sqInt value202; + sqInt value21; + sqLong value210; + sqInt value211; + sqLong value212; + sqInt value213; + sqInt value214; + sqInt value215; + sqInt value216; + float value217; + sqInt value218; + sqInt value22; + sqInt value221; + sqLong value222; + sqInt value23; + sqLong value231; + sqInt value232; + sqInt value24; + sqLong value241; + sqInt value242; + sqInt value25; + sqLong value251; + sqInt value252; + sqInt value26; + sqInt value261; + sqLong value262; + double value27; + sqInt value271; + sqInt value272; + sqInt value28; + sqInt value281; + float value282; + double value29; + sqInt value291; + double value292; + sqInt value3; + sqInt value30; + sqInt value301; + sqLong value31; + sqLong value310; + sqInt value311; + sqInt value312; + sqInt value313; + sqLong value314; + sqInt value315; + sqInt value316; + sqLong value32; + sqInt value321; + sqInt value33; + sqInt value331; + sqInt value34; + sqInt value341; + sqInt value35; + sqInt value351; + sqLong value36; + sqLong value361; + sqInt value37; + sqLong value371; + sqInt value38; + sqInt value381; + sqInt value39; + sqInt value391; + sqInt value4; + sqLong value40; + float value401; + sqInt value41; + sqLong value411; + sqInt value42; + float value43; + sqInt value44; + sqInt value45; + sqInt value46; + sqInt value47; + sqInt value48; + sqInt value49; + sqInt value5; + sqInt value50; + sqInt value51; + double value52; + sqInt value53; + sqInt value54; + sqInt value55; + sqLong value6; + sqLong value61; + sqInt value62; + sqInt value63; + float value64; + sqInt value65; + sqInt value7; + sqInt value71; + sqLong value72; + sqInt value73; + double value74; + sqInt value75; + sqInt value8; + sqInt value81; + sqInt value82; + sqInt value83; + sqLong value84; + sqLong value9; + sqLong value91; + sqLong value92; + sqInt value93; + sqInt value94; + sqInt valueOop; + char *valueOopPointer; + char *valueOopPointer1; + char *valueOopPointer10; + char *valueOopPointer101; + char *valueOopPointer102; + char *valueOopPointer103; + char *valueOopPointer104; + char *valueOopPointer11; + char *valueOopPointer110; + char *valueOopPointer1101; + char *valueOopPointer1102; + char *valueOopPointer1103; + char *valueOopPointer111; + char *valueOopPointer1110; + char *valueOopPointer1111; + char *valueOopPointer1112; + char *valueOopPointer1113; + char *valueOopPointer1114; + char *valueOopPointer1115; + char *valueOopPointer1116; + char *valueOopPointer1117; + char *valueOopPointer112; + char *valueOopPointer1121; + char *valueOopPointer1122; + char *valueOopPointer1123; + char *valueOopPointer113; + char *valueOopPointer1131; + char *valueOopPointer1132; + char *valueOopPointer1133; + char *valueOopPointer114; + char *valueOopPointer1141; + char *valueOopPointer1142; + char *valueOopPointer1143; + char *valueOopPointer115; + char *valueOopPointer1151; + char *valueOopPointer1152; + char *valueOopPointer1153; + char *valueOopPointer116; + char *valueOopPointer1161; + char *valueOopPointer1162; + char *valueOopPointer1163; + char *valueOopPointer117; + char *valueOopPointer1171; + char *valueOopPointer1172; + char *valueOopPointer1173; + char *valueOopPointer118; + char *valueOopPointer1181; + char *valueOopPointer119; + char *valueOopPointer1191; + char *valueOopPointer12; + char *valueOopPointer120; + char *valueOopPointer1201; + char *valueOopPointer121; + char *valueOopPointer1210; + char *valueOopPointer1211; + char *valueOopPointer1212; + char *valueOopPointer1213; + char *valueOopPointer122; + char *valueOopPointer1221; + char *valueOopPointer123; + char *valueOopPointer1231; + char *valueOopPointer124; + char *valueOopPointer1241; + char *valueOopPointer125; + char *valueOopPointer1251; + char *valueOopPointer126; + char *valueOopPointer1261; + char *valueOopPointer127; + char *valueOopPointer1271; + char *valueOopPointer128; + char *valueOopPointer1281; + char *valueOopPointer129; + char *valueOopPointer1291; + char *valueOopPointer13; + char *valueOopPointer130; + char *valueOopPointer1301; + char *valueOopPointer131; + char *valueOopPointer1311; + char *valueOopPointer132; + char *valueOopPointer1321; + char *valueOopPointer133; + char *valueOopPointer1331; + char *valueOopPointer134; + char *valueOopPointer135; + char *valueOopPointer136; + char *valueOopPointer137; + char *valueOopPointer14; + char *valueOopPointer141; + char *valueOopPointer142; + char *valueOopPointer143; + char *valueOopPointer15; + char *valueOopPointer151; + char *valueOopPointer152; + char *valueOopPointer153; + char *valueOopPointer16; + char *valueOopPointer161; + char *valueOopPointer162; + char *valueOopPointer163; + char *valueOopPointer17; + char *valueOopPointer171; + char *valueOopPointer172; + char *valueOopPointer173; + char *valueOopPointer18; + char *valueOopPointer181; + char *valueOopPointer182; + char *valueOopPointer183; + char *valueOopPointer19; + char *valueOopPointer191; + char *valueOopPointer192; + char *valueOopPointer193; + char *valueOopPointer2; + char *valueOopPointer20; + char *valueOopPointer201; + char *valueOopPointer202; + char *valueOopPointer203; + char *valueOopPointer21; + char *valueOopPointer210; + char *valueOopPointer2101; + char *valueOopPointer211; + char *valueOopPointer2111; + char *valueOopPointer212; + char *valueOopPointer213; + char *valueOopPointer214; + char *valueOopPointer215; + char *valueOopPointer216; + char *valueOopPointer217; + char *valueOopPointer22; + char *valueOopPointer221; + char *valueOopPointer222; + char *valueOopPointer223; + char *valueOopPointer23; + char *valueOopPointer231; + char *valueOopPointer232; + char *valueOopPointer233; + char *valueOopPointer24; + char *valueOopPointer241; + char *valueOopPointer242; + char *valueOopPointer243; + char *valueOopPointer25; + char *valueOopPointer251; + char *valueOopPointer252; + char *valueOopPointer253; + char *valueOopPointer26; + char *valueOopPointer261; + char *valueOopPointer262; + char *valueOopPointer263; + char *valueOopPointer27; + char *valueOopPointer272; + char *valueOopPointer273; + char *valueOopPointer28; + char *valueOopPointer281; + char *valueOopPointer282; + char *valueOopPointer283; + char *valueOopPointer29; + char *valueOopPointer291; + char *valueOopPointer292; + char *valueOopPointer293; + char *valueOopPointer3; + char *valueOopPointer30; + char *valueOopPointer301; + char *valueOopPointer302; + char *valueOopPointer303; + char *valueOopPointer31; + char *valueOopPointer310; + char *valueOopPointer311; + char *valueOopPointer312; + char *valueOopPointer313; + char *valueOopPointer314; + char *valueOopPointer315; + char *valueOopPointer316; + char *valueOopPointer317; + char *valueOopPointer32; + char *valueOopPointer321; + char *valueOopPointer322; + char *valueOopPointer323; + char *valueOopPointer33; + char *valueOopPointer331; + char *valueOopPointer332; + char *valueOopPointer333; + char *valueOopPointer34; + char *valueOopPointer341; + char *valueOopPointer342; + char *valueOopPointer343; + char *valueOopPointer35; + char *valueOopPointer351; + char *valueOopPointer352; + char *valueOopPointer353; + char *valueOopPointer36; + char *valueOopPointer361; + char *valueOopPointer362; + char *valueOopPointer363; + char *valueOopPointer37; + char *valueOopPointer371; + char *valueOopPointer372; + char *valueOopPointer373; + char *valueOopPointer38; + char *valueOopPointer381; + char *valueOopPointer382; + char *valueOopPointer383; + char *valueOopPointer39; + char *valueOopPointer391; + char *valueOopPointer392; + char *valueOopPointer393; + char *valueOopPointer4; + char *valueOopPointer40; + char *valueOopPointer401; + char *valueOopPointer402; + char *valueOopPointer41; + char *valueOopPointer410; + char *valueOopPointer411; + char *valueOopPointer412; + char *valueOopPointer413; + char *valueOopPointer414; + char *valueOopPointer415; + char *valueOopPointer416; + char *valueOopPointer42; + char *valueOopPointer421; + char*valueOopPointer422; + char *valueOopPointer43; + char *valueOopPointer431; + char *valueOopPointer432; + char *valueOopPointer44; + char *valueOopPointer441; + char *valueOopPointer442; + char *valueOopPointer45; + char *valueOopPointer451; + char *valueOopPointer452; + char *valueOopPointer46; + char *valueOopPointer461; + char *valueOopPointer462; + char *valueOopPointer47; + char *valueOopPointer471; + char *valueOopPointer472; + char *valueOopPointer48; + char *valueOopPointer481; + char *valueOopPointer482; + char *valueOopPointer49; + char *valueOopPointer491; + char *valueOopPointer492; + char *valueOopPointer5; + char *valueOopPointer50; + char *valueOopPointer501; + char *valueOopPointer502; + char *valueOopPointer51; + char *valueOopPointer510; + char *valueOopPointer511; + char *valueOopPointer512; + char *valueOopPointer52; + char *valueOopPointer521; + char *valueOopPointer53; + char *valueOopPointer531; + char *valueOopPointer54; + char *valueOopPointer541; + char *valueOopPointer55; + char *valueOopPointer551; + char *valueOopPointer56; + char *valueOopPointer561; + char *valueOopPointer57; + char *valueOopPointer571; + char *valueOopPointer58; + char *valueOopPointer581; + char *valueOopPointer59; + char *valueOopPointer591; + char *valueOopPointer6; + char *valueOopPointer60; + char *valueOopPointer61; + char *valueOopPointer611; + char *valueOopPointer62; + char *valueOopPointer621; + char *valueOopPointer63; + char *valueOopPointer631; + char *valueOopPointer64; + char *valueOopPointer65; + char *valueOopPointer66; + char *valueOopPointer67; + char *valueOopPointer68; + char *valueOopPointer7; + char *valueOopPointer71; + char *valueOopPointer72; + char *valueOopPointer73; + char *valueOopPointer74; + char *valueOopPointer75; + char *valueOopPointer8; + char *valueOopPointer81; + char *valueOopPointer82; + char *valueOopPointer83; + char *valueOopPointer84; + char *valueOopPointer85; + char *valueOopPointer9; + char *valueOopPointer91; + char *valueOopPointer92; + char *valueOopPointer93; + char *valueOopPointer94; + char *valueOopPointer95; + sqInt valuePointer; + sqInt valueWord; + + VM_LABEL(callPrimitiveBytecode); + code = 0; + value54 = 0; + byte1 = byteAtPointer(++localIP); + byte2 = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if (byte2 < 128) { + /* begin methodHeaderOf: */ + assert(isCompiledMethod(GIV(method))); + header1 = longAt((GIV(method) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + if (((/* begin alternateHeaderHasPrimitiveFlag: */ + header & AlternateHeaderHasPrimFlag)) + && (((((usqInt)localIP)) == ((GIV(method) + ((LiteralStart + ((assert((header & 1)), +((header >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize)) + (3))) { + goto l1247; + } + localIP -= 3; + goto respondToUnknownBytecode; + goto l1247; + } + prim = (((sqInt)((usqInt)((byte2 - 128)) << 8))) + byte1; + primSet = (((usqInt) prim) >> 13) & 3; + prim = prim & 0x1FFF; + if (primSet == 0) { + if (prim < 1000) { + /* begin nullaryInlinePrimitive: */ + localIP -= 3; + goto respondToUnknownBytecode; + goto l1247; + } + if (prim < 2000) { + /* begin unaryInlinePrimitive: */ + + switch (prim - 1000) { + case 0: + /* begin fetchClassOf: */ + oop2 = longAtPointer(localSP); + result2 = (((tagBits = oop2 & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) + : fetchClassOfNonImm(oop2)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result2); + break; + case 1: + /* begin numSlotsOf: */ + objOop5 = longAtPointer(localSP); + assert((classIndexOf(objOop5)) > (isForwardedObjectClassIndexPun())); + numSlots1 = byteAt(objOop5 + 7); + result2 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop5 - BaseHeaderSize) + : numSlots1); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 2: + result2 = (numSlotsOf(longAtPointer(localSP))) - (fixedFieldsOfClass(fetchClassOfNonImm(longAtPointer(localSP)))); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 3: + /* begin numBytesOf: */ + objOop12 = longAtPointer(localSP); + fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(objOop12)) > (isForwardedObjectClassIndexPun())); + numSlots2 = byteAt(objOop12 + 7); + numBytes = (numSlots2 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots2); + numBytes = numBytes << (shiftForWord()); + if (fmt >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + result2 = numBytes - (fmt & 7); + goto l1268; + } + if (fmt <= (sixtyFourBitIndexableFormat())) { + result2 = numBytes; + goto l1268; + } + if (fmt >= (firstShortFormat())) { + result2 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); + goto l1268; + } + result2 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); + l1268: /* end numBytesOf: */; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 4: + /* begin num16BitUnitsOf: */ + objOop22 = longAtPointer(localSP); + result2 = ((sqInt) (((usqInt) (numBytesOf(objOop22))) >> 1)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 5: + /* begin num32BitUnitsOf: */ + objOop31 = longAtPointer(localSP); + result2 = ((usqInt) (numBytesOf(objOop31))) >> 2; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 6: + /* begin num64BitUnitsOf: */ + objOop41 = longAtPointer(localSP); + result2 = ((sqInt) (((usqInt) (numBytesOf(objOop41))) >> 3)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 11: + /* begin internalStackTop */ + classObj = longAtPointer(localSP); + /* begin instanceSizeOf: */ + assert(addressCouldBeClassObj(classObj)); + numSlots = (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1); + assert((rawHashBitsOf(classObj)) != 0); + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + /* begin instSpecOfClassFormat: */ + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); + assert((numSlots >= 0) + && (knownClassIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + goto l1272; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); + GIV(freeStart) += numBytes1; + result2 = newObj; + l1272: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + if ((extB & 1) == 0) { + for (i = 0; i < numSlots; i += 1) { + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(result2))); + longAtput((result2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + } + extB = 0; + numExtB = 0; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result2); + break; + case 20: + /* begin hashBitsOf: */ + hash = (long32At((longAtPointer(localSP)) + 4)) & (identityHashHalfWordMask()); + if (hash == 0) { + + /* would like to assert + self assert: (coInterpreter addressCouldBeClassObj: objOop) not + but instance-specific behaviors that are instances of themselves may + fail this test. */ + hash = (newObjectHash()) & (identityHashHalfWordMask()); + /* begin setHashBitsOf:to: */ + assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); + long32Atput((longAtPointer(localSP)) + 4, ((((long32At((longAtPointer(localSP)) + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); + } + result2 = hash; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1247; + } + if (prim < 3000) { + /* begin binaryInlinePrimitive: */ + + switch (prim - 2000) { + case 0: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) + (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 1: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 2: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) * (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 3: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) / (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 4: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) / (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 5: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) % (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 6: + rcvr = ((longAtPointer(localSP + (1 * BytesPerOop))) >> 1); + arg = ((longAtPointer(localSP)) >> 1); + /* begin quot:ient: */ + result = (rcvr > 0 + ? (arg > 0 + ? rcvr / arg + : 0 - (rcvr / (0 - arg))) + : (arg > 0 + ? 0 - ((0 - rcvr) / arg) + : (0 - rcvr) / (0 - arg))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 16: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) & (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 17: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) | (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 18: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) ^ (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 19: + result = (((usqInt)((((((longAtPointer(localSP)) >> 1)) < 0) ? ((usqInt) (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) >> -(((longAtPointer(localSP)) >> 1))) : ((usqInt) (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) << (((longAtPointer(localSP)) >> 1))))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 32: + /* begin booleanObjectOf: */ + bool = (longAtPointer(localSP + (1 * BytesPerOop))) > (longAtPointer(localSP)); + result = (bool + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 33: + /* begin booleanObjectOf: */ + bool1 = (longAtPointer(localSP + (1 * BytesPerOop))) < (longAtPointer(localSP)); + result = (bool1 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 34: + /* begin booleanObjectOf: */ + bool2 = (longAtPointer(localSP + (1 * BytesPerOop))) >= (longAtPointer(localSP)); + result = (bool2 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 35: + /* begin booleanObjectOf: */ + bool3 = (longAtPointer(localSP + (1 * BytesPerOop))) <= (longAtPointer(localSP)); + result = (bool3 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 36: + /* begin booleanObjectOf: */ + bool4 = (longAtPointer(localSP + (1 * BytesPerOop))) == (longAtPointer(localSP)); + result = (bool4 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 37: + /* begin booleanObjectOf: */ + bool5 = (longAtPointer(localSP + (1 * BytesPerOop))) != (longAtPointer(localSP)); + result = (bool5 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 64: + /* begin fetchPointer:ofObject: */ + fieldIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop = longAtPointer(localSP + (1 * BytesPerOop)); + result = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 65: + /* begin fetchByte:ofObject: */ + byteIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop1 = longAtPointer(localSP + (1 * BytesPerOop)); + result = byteAt((objOop1 + BaseHeaderSize) + byteIndex); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 66: + /* begin fetchShort16:ofObject: */ + shortIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop2 = longAtPointer(localSP + (1 * BytesPerOop)); + result = shortAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(shortIndex) << 1)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 67: + /* begin fetchLong32:ofObject: */ + fieldIndex1 = (((longAtPointer(localSP)) >> 1)) - 1; + oop = longAtPointer(localSP + (1 * BytesPerOop)); + result = long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << 2)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin internalStackTopPut: */ + aValue = ((sqInt) (signed64BitValueOf(result))); + longAtPointerput(localSP, aValue); + break; + case 68: + /* begin fetchLong64:ofObject: */ + longIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop3 = longAtPointer(localSP + (1 * BytesPerOop)); + result64 = long64At((objOop3 + BaseHeaderSize) + (((sqInt)((usqInt)(longIndex) << 3)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin internalStackTopPut: */ + aValue1 = ((sqInt) (signed64BitValueOf(result))); + longAtPointerput(localSP, aValue1); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1247; + } + if (prim < 4000) { + /* begin trinaryInlinePrimitive: */ + + switch (prim - 3000) { + case 0: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storePointer:ofObject:withValue: */ + objOop21 = longAtPointer(localSP + (2 * BytesPerOop)); + assert(!(isForwarded(objOop21))); + if ((assert(isNonImmediate(objOop21)), + oopisGreaterThanOrEqualTo(objOop21, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((result1 & (tagMask())) == 0) + && (oopisLessThan(result1, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop21))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop21); + } + } + } + longAtput((objOop21 + BaseHeaderSize) + (((sqInt)((usqInt)(((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1)) << (shiftForWord())))), result1); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 1: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeByte:ofObject:withValue: */ + byteIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + oop1 = longAtPointer(localSP + (2 * BytesPerOop)); + byteAtput((oop1 + BaseHeaderSize) + byteIndex1, (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 2: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeShort16:ofObject:withValue: */ + shortIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + objOop4 = longAtPointer(localSP + (2 * BytesPerOop)); + shortAtput((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(shortIndex1) << 1))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 3: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeLong32:ofObject:withValue: */ + fieldIndex2 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + obj = longAtPointer(localSP + (2 * BytesPerOop)); + long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << 2))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 4: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeLong64:ofObject:withValue: */ + longIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + objOop11 = longAtPointer(localSP + (2 * BytesPerOop)); + long64Atput((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(longIndex1) << 3))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1247; + } + } + if (primSet == 1) { + if (prim < 1000) { + /* begin lowcodeNullaryInlinePrimitive: */ + + switch (prim) { + case 0: + /* begin lowcodePrimitiveBoolean32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt324 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer11 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer11) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer11)))); + value7 = topInt324; + if (value7 != 0) { + /* begin trueObject */ + object12 = GIV(trueObj); + } + else { + /* begin falseObject */ + object12 = GIV(falseObj); + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object12); + goto l120; + break; + case 1: + /* begin lowcodePrimitiveBoolean64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1)))); + value11 = topInt64; + if (value11 != 0) { + /* begin trueObject */ + object11 = GIV(trueObj); + } + else { + /* begin falseObject */ + object11 = GIV(falseObj); + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object11); + goto l120; + break; + case 2: + /* begin lowcodePrimitiveFloat32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2)))); + singleFloatValue = topSingle; + object2 = floatObjectOf(singleFloatValue); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object2); + goto l120; + break; + case 3: + /* begin lowcodePrimitiveFloat64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer3 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer3) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer3)))); + floatValue = topDouble; + object3 = floatObjectOf(floatValue); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object3); + goto l120; + break; + case 4: + /* begin lowcodePrimitiveInt32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer4 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer4) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer4)))); + value21 = topInt321; + /* begin signed32BitIntegerFor: */ + if ((((sqInt)((((usqInt)value21)) ^ ((((usqInt)value21)) << 1)))) >= 0) { + object4 = (((usqInt)value21 << 1) | 1); + goto l1296; + } + object4 = noInlineSigned32BitIntegerGutsFor(value21); + goto l1296; + + l1296: /* end signed32BitIntegerFor: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object4); + goto l120; + break; + case 5: + /* begin lowcodePrimitiveInt64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt641 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer5 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer5) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer5)))); + value31 = topInt641; + object5 = signed64BitIntegerFor(value31); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object5); + goto l120; + break; + case 6: + /* begin lowcodePrimitivePointerToOop */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + pointerClassLiteral = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((extA + LiteralStart)) << (shiftForWord()))))); + + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer1 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer8 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer8) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer8)))); + pointer1 = topPointer1; + object8 = instantiateClassindexableSize(pointerClassLiteral, BytesPerWord); + pointerAtPointerput(firstIndexableField(object8), pointer1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object8); + extA = 0; + goto l120; + break; + case 7: + /* begin lowcodePrimitivePointerToOopReinterprer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer6 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer6) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer6)))); + pointer = topPointer; + object6 = ((sqInt) pointer); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object6); + goto l120; + break; + case 8: + /* begin lowcodePrimitiveSmallInt32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt322 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer7 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer7) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer7)))); + value4 = topInt322; + object7 = (((usqInt)value4 << 1) | 1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object7); + goto l120; + break; + case 9: + /* begin lowcodePrimitiveUint32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt323 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer9 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer9) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer9)))); + value5 = topInt323; + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) value5)) <= (MaxSmallInteger)) { + object9 = (((usqInt)value5 << 1) | 1); + goto l1337; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj1 = GIV(freeStart); + numBytes2 = BaseHeaderSize + (8); + assert((numBytes2 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes2) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes2) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l1303; + } + } + long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes2; + newLargeInteger = newObj1; + l1303: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(value5); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + object9 = newLargeInteger; + goto l1337; + + l1337: /* end positive32BitIntegerFor: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object9); + goto l120; + break; + case 10: + /* begin lowcodePrimitiveUint64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt642 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer10 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer10) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer10)))); + value6 = topInt642; + object10 = positive64BitIntegerFor(value6); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object10); + goto l120; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l120; + + } + l120: /* end lowcodeNullaryInlinePrimitive: */; + goto l1247; + } + if (prim < 2000) { + /* begin lowcodeUnaryInlinePrimitive: */ + + switch (prim - 1000) { + case 0: + /* begin lowcodePrimitiveAdd32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3236 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer67 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer67) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer67)))); + second28 = topInt3236; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32124 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer137 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer137) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer137)))); + first28 = topInt32124; + result38 = first28 + second28; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result38); + goto l1191; + break; + case 1: + /* begin lowcodePrimitiveAdd64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6435 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer217 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer217) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer217)))); + second114 = topInt6435; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64124 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1117 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1117) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1117)))); + first114 = topInt64124; + result116 = first114 + second114; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result116); + goto l1191; + break; + case 2: + /* begin lowcodePrimitiveAlloca32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32213 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer317 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer317) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer317)))); + size = topInt32213; + GIV(nativeStackPointer) = ((char*) ((((size_t) (GIV(nativeStackPointer) - size))) & -16)); + pointer15 = GIV(nativeStackPointer); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer15); + goto l1191; + break; + case 3: + /* begin lowcodePrimitiveAlloca64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64212 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer416 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer416) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer416)))); + size1 = topInt64212; + GIV(nativeStackPointer) -= size1; + pointer16 = GIV(nativeStackPointer); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer16); + goto l1191; + break; + case 4: + /* begin lowcodePrimitiveAnd32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3237 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer512 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer512) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer512)))); + second2 = topInt3237; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3211 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer12 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer12) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer12)))); + first2 = topInt3211; + result216 = first2 & second2; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result216); + goto l1191; + break; + case 5: + /* begin lowcodePrimitiveAnd64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt643 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer68 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer68) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer68)))); + second3 = topInt643; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6411 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer13 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer13) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer13)))); + first3 = topInt6411; + result3 = first3 & second3; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result3); + goto l1191; + break; + case 6: + /* begin lowcodePrimitiveArithmeticRightShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3245 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer75 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer75) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer75)))); + shiftAmount = topInt3245; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3212 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer14 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer14) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer14)))); + value48 = topInt3212; + result4 = ((usqInt) value48) >> shiftAmount; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result4); + goto l1191; + break; + case 7: + /* begin lowcodePrimitiveArithmeticRightShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt644 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer85 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer85) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer85)))); + shiftAmount1 = topInt644; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6412 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer15 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer15) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer15)))); + value118 = topInt6412; + result5 = ((unsigned sqLong)value118) >> shiftAmount1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result5); + goto l1191; + break; + case 8: + /* begin lowcodePrimitiveBeginCall */ + + /* Store the shadow stack pointer */ + alignment = extA; + valueOopPointer95 = ((char *) (GIV(shadowCallStackPointer) + 1)); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer95); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer95); + } + /* begin allocateLowcodeCalloutState */ + calloutStateSize = sizeof(sqLowcodeCalloutState); + GIV(shadowCallStackPointer) = ((char*) ((((size_t) (GIV(shadowCallStackPointer) - calloutStateSize))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) GIV(shadowCallStackPointer)); + extA = 0; + goto l1191; + break; + case 9: + /* begin lowcodePrimitiveCallArgumentFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle29 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer104 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer104) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer104)))); + argumentValue = topSingle29; + /* begin internalPushShadowCallStackFloat32: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 4; + singleFloatAtPointerput(GIV(shadowCallStackPointer), argumentValue); + goto l1191; + break; + case 10: + /* begin lowcodePrimitiveCallArgumentFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble25 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer16 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer16) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer16)))); + argumentValue1 = topDouble25; + /* begin internalPushShadowCallStackFloat64: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 8; + singleFloatAtPointerput(GIV(shadowCallStackPointer), argumentValue1); + goto l1191; + break; + case 11: + /* begin lowcodePrimitiveCallArgumentInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt325 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer17 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer17) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer17)))); + value216 = topInt325; + /* begin internalPushShadowCallStackInt32: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 4; + int32AtPointerput(GIV(shadowCallStackPointer), value216); + goto l1191; + break; + case 12: + /* begin lowcodePrimitiveCallArgumentInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt645 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer18 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer18) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer18)))); + value314 = topInt645; + /* begin internalPushShadowCallStackInt64: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 8; + int64AtPointerput(GIV(shadowCallStackPointer), value314); + goto l1191; + break; + case 13: + /* begin lowcodePrimitiveCallArgumentPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer36 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer19 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer19) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer19)))); + pointerValue = topPointer36; + /* begin internalPushShadowCallStackPointer: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), pointerValue); + goto l1191; + break; + case 14: + /* begin lowcodePrimitiveCallArgumentSpace */ + spaceSize = extA; + /* begin internalPushShadowCallStackSpace: */ + GIV(shadowCallStackPointer) -= spaceSize; + extA = 0; + goto l1191; + break; + case 15: + /* begin lowcodePrimitiveCallArgumentStructure */ + structureSize = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer115 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer20 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer20) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer20)))); + structurePointer = topPointer115; + /* begin internalPushShadowCallStackStructure:size: */ + GIV(shadowCallStackPointer) -= structureSize; + memcpy(GIV(shadowCallStackPointer), structurePointer, structureSize); + extA = 0; + goto l1191; + break; + case 16: + /* begin lowcodePrimitiveCallInstruction */ + function = extA; + abort(); + extA = 0; + goto l1191; + break; + case 17: + /* begin lowcodePrimitiveCallPhysical */ + registerID = extA; + abort(); + extA = 0; + goto l1191; + break; + case 18: + /* begin lowcodePrimitiveCheckSessionIdentifier */ + expectedSession = extA; + value47 = (expectedSession == (getThisSessionID()) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value47); + extA = 0; + goto l1191; + break; + case 19: + /* begin lowcodePrimitiveCompareAndSwap32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt326 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer21 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer21) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer21)))); + newValue = topInt326; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3213 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer110 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer110) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer110)))); + oldValue = topInt3213; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer2 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer22 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer22) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer22)))); + check = topPointer2; + abort(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value54); + goto l1191; + break; + case 20: + /* begin lowcodePrimitiveDiv32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt327 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer23 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer23) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer23)))); + second4 = topInt327; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3214 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer111 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer111)))); + first4 = topInt3214; + result6 = first4 / second4; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result6); + goto l1191; + break; + case 21: + /* begin lowcodePrimitiveDiv64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt646 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer24 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer24) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer24)))); + second5 = topInt646; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6413 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer112 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer112) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer112)))); + first5 = topInt6413; + result7 = first5 / second5; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result7); + goto l1191; + break; + case 22: + /* begin lowcodePrimitiveDuplicateFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle1 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer25 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer25) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer25)))); + value64 = topSingle1; + dup1 = value64; + dup2 = value64; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, dup1); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, dup2); + goto l1191; + break; + case 23: + /* begin lowcodePrimitiveDuplicateFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble1 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer26 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer26) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer26)))); + value74 = topDouble1; + dup11 = value74; + dup21 = value74; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, dup11); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, dup21); + goto l1191; + break; + case 24: + /* begin lowcodePrimitiveDuplicateInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt328 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer27 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer27) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer27)))); + value8 = topInt328; + dup12 = value8; + dup22 = value8; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, dup12); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, dup22); + goto l1191; + break; + case 25: + /* begin lowcodePrimitiveDuplicateInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt647 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer28 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer28) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer28)))); + value9 = topInt647; + dup13 = value9; + dup23 = value9; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, dup13); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, dup23); + goto l1191; + break; + case 26: + /* begin lowcodePrimitiveDuplicatePointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer3 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer29 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer29) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer29)))); + pointerValue1 = topPointer3; + dup14 = pointerValue1; + dup24 = pointerValue1; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, dup14); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, dup24); + goto l1191; + break; + case 27: + /* begin lowcodePrimitiveEffectiveAddress32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt329 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer30 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer30) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer30)))); + offset = topInt329; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3215 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer113 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer113) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer113)))); + scale = topInt3215; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3221 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer210 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer210) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer210)))); + index = topInt3221; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer4 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer31 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer31) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer31)))); + base = topPointer4; + result8 = (base + (index * scale)) + offset; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result8); + goto l1191; + break; + case 28: + /* begin lowcodePrimitiveEffectiveAddress64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt648 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer32 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer32) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer32)))); + offset1 = topInt648; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6414 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer114 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer114) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer114)))); + scale1 = topInt6414; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6421 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer211 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer211) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer211)))); + index1 = topInt6421; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer5 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer33 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer33) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer33)))); + base1 = topPointer5; + result9 = (base1 + (index1 * scale1)) + offset1; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result9); + goto l1191; + break; + case 29: + /* begin lowcodePrimitiveEndCall */ + GIV(shadowCallStackPointer) = (shadowCallStackPointerIn(localFP)) - 1; + /* begin shadowCallStackPointerIn:put: */ + valueOopPointer34 = ((char *) (((char*) 1))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer34); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer34); + } + goto l1191; + break; + case 30: + /* begin lowcodePrimitiveEndCallNoCleanup */ + GIV(shadowCallStackPointer) = (shadowCallStackPointerIn(localFP)) - 1; + /* begin shadowCallStackPointerIn:put: */ + valueOopPointer35 = ((char *) (((char*) 1))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer35); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer35); + } + goto l1191; + break; + case 0x1F: + /* begin lowcodePrimitiveFloat32Add */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle2 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer36 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer36) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer36)))); + second6 = topSingle2; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle11 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer115 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer115) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer115)))); + first6 = topSingle11; + result10 = first6 + second6; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result10); + goto l1191; + break; + case 32: + /* begin lowcodePrimitiveFloat32Div */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle3 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer37 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer37) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer37)))); + second7 = topSingle3; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle12 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer116 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer116) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer116)))); + first7 = topSingle12; + result11 = first7 / second7; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result11); + goto l1191; + break; + case 33: + /* begin lowcodePrimitiveFloat32Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle4 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer38 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer38) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer38)))); + second8 = topSingle4; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle13 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer117 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer117) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer117)))); + first8 = topSingle13; + value10 = (first8 == second8 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value10); + goto l1191; + break; + case 34: + /* begin lowcodePrimitiveFloat32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle5 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer39 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer39) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer39)))); + second9 = topSingle5; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle14 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer118 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer118) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer118)))); + first9 = topSingle14; + value117 = (first9 > second9 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value117); + goto l1191; + break; + case 35: + /* begin lowcodePrimitiveFloat32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle6 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer40 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer40) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer40)))); + second10 = topSingle6; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle15 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer119 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer119) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer119)))); + first10 = topSingle15; + value12 = (first10 >= second10 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value12); + goto l1191; + break; + case 36: + /* begin lowcodePrimitiveFloat32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle7 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer41 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer41) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer41)))); + second11 = topSingle7; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle16 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer120 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer120) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer120)))); + first11 = topSingle16; + value13 = (first11 < second11 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value13); + goto l1191; + break; + case 37: + /* begin lowcodePrimitiveFloat32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle8 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer42 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer42) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer42)))); + second12 = topSingle8; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle17 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer121 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer121) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer121)))); + first12 = topSingle17; + value14 = (first12 <= second12 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value14); + goto l1191; + break; + case 38: + /* begin lowcodePrimitiveFloat32Mul */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle9 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer43 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer43) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer43)))); + second13 = topSingle9; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle18 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer122 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer122) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer122)))); + first13 = topSingle18; + result12 = first13 * second13; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result12); + goto l1191; + break; + case 39: + /* begin lowcodePrimitiveFloat32Neg */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle10 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer44 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer44) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer44)))); + value15 = topSingle10; + result13 = -value15; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result13); + goto l1191; + break; + case 40: + /* begin lowcodePrimitiveFloat32NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle19 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer45 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer45) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer45)))); + second14 = topSingle19; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle110 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer123 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer123) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer123)))); + first14 = topSingle110; + value16 = (first14 != second14 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value16); + goto l1191; + break; + case 41: + /* begin lowcodePrimitiveFloat32Sqrt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle20 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer46 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer46) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer46)))); + value17 = topSingle20; + result14 = sqrt(value17); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result14); + goto l1191; + break; + case 42: + /* begin lowcodePrimitiveFloat32Sub */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle21 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer47 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer47) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer47)))); + second15 = topSingle21; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle111 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer124 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer124) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer124)))); + first15 = topSingle111; + result15 = first15 - second15; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result15); + goto l1191; + break; + case 43: + /* begin lowcodePrimitiveFloat32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle22 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer48 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer48) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer48)))); + singleFloatValue1 = topSingle22; + doubleResult = ((double) singleFloatValue1); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleResult); + goto l1191; + break; + case 44: + /* begin lowcodePrimitiveFloat32ToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle23 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer49 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer49) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer49)))); + value18 = topSingle23; + result16 = ((sqInt) value18); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result16); + goto l1191; + break; + case 45: + /* begin lowcodePrimitiveFloat32ToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle24 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer50 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer50) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer50)))); + value19 = topSingle24; + result17 = ((sqLong) value19); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result17); + goto l1191; + break; + case 46: + /* begin lowcodePrimitiveFloat32ToUInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle25 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer51 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer51) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer51)))); + value20 = topSingle25; + result18 = ((uint32_t) value20); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result18); + goto l1191; + break; + case 47: + /* begin lowcodePrimitiveFloat32ToUInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle26 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer52 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer52) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer52)))); + value217 = topSingle26; + result19 = ((uint64_t) value217); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result19); + goto l1191; + break; + case 48: + /* begin lowcodePrimitiveFloat64Add */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble2 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer53 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer53) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer53)))); + second16 = topDouble2; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble11 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer125 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer125) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer125)))); + first16 = topDouble11; + result20 = first16 + second16; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result20); + goto l1191; + break; + case 49: + /* begin lowcodePrimitiveFloat64Div */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble3 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer54 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer54) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer54)))); + second17 = topDouble3; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble12 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer126 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer126) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer126)))); + first17 = topDouble12; + result21 = first17 / second17; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result21); + goto l1191; + break; + case 50: + /* begin lowcodePrimitiveFloat64Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble4 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer55 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer55) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer55)))); + second18 = topDouble4; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble13 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer127 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer127) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer127)))); + first18 = topDouble13; + value22 = (first18 == second18 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value22); + goto l1191; + break; + case 51: + /* begin lowcodePrimitiveFloat64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble5 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer56 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer56) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer56)))); + second19 = topDouble5; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble14 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer128 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer128) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer128)))); + first19 = topDouble14; + value23 = (first19 > second19 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value23); + goto l1191; + break; + case 52: + /* begin lowcodePrimitiveFloat64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble6 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer57 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer57) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer57)))); + second20 = topDouble6; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble15 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer129 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer129) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer129)))); + first20 = topDouble15; + value24 = (first20 >= second20 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value24); + goto l1191; + break; + case 53: + /* begin lowcodePrimitiveFloat64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble7 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer58 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer58) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer58)))); + second21 = topDouble7; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble16 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer130 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer130) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer130)))); + first21 = topDouble16; + value25 = (first21 < second21 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value25); + goto l1191; + break; + case 54: + /* begin lowcodePrimitiveFloat64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble8 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer59 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer59) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer59)))); + second22 = topDouble8; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble17 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer131 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer131) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer131)))); + first22 = topDouble17; + value26 = (first22 <= second22 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value26); + goto l1191; + break; + case 55: + /* begin lowcodePrimitiveFloat64Mul */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble9 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer60 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer60) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer60)))); + second23 = topDouble9; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble18 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer132 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer132) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer132)))); + first23 = topDouble18; + result22 = first23 * second23; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result22); + goto l1191; + break; + case 56: + /* begin lowcodePrimitiveFloat64Neg */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble10 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer61 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer61) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer61)))); + value27 = topDouble10; + result23 = -value27; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result23); + goto l1191; + break; + case 57: + /* begin lowcodePrimitiveFloat64NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble20 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer62 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer62) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer62)))); + second24 = topDouble20; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble19 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer133 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer133) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer133)))); + first24 = topDouble19; + value28 = (first24 != second24 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value28); + goto l1191; + break; + case 58: + /* begin lowcodePrimitiveFloat64Sqrt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble21 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer63 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer63) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer63)))); + value29 = topDouble21; + result24 = sqrt(value29); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result24); + goto l1191; + break; + case 59: + /* begin lowcodePrimitiveFloat64Sub */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble22 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer64 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer64) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer64)))); + second25 = topDouble22; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble110 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer134 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer134) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer134)))); + first25 = topDouble110; + result25 = first25 - second25; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result25); + goto l1191; + break; + default: + /* begin lowcodeUnaryInlinePrimitive2: */ + + switch (prim - 1000) { + case 60: + /* begin lowcodePrimitiveFloat64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble24 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer65 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer65) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer65)))); + floatValue8 = topDouble24; + singleFloatResult = ((float) floatValue8); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, singleFloatResult); + goto l1070; + break; + case 61: + /* begin lowcodePrimitiveFloat64ToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble112 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer136 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer136) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer136)))); + floatValue1 = topDouble112; + int32Result = ((sqInt) floatValue1); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, int32Result); + goto l1070; + break; + case 0x3E: + /* begin lowcodePrimitiveFloat64ToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble23 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer215 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer215) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer215)))); + floatValue2 = topDouble23; + int64Result = ((sqLong) floatValue2); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, int64Result); + goto l1070; + break; + case 0x3F: + /* begin lowcodePrimitiveFloat64ToUInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble31 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer316 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer316) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer316)))); + floatValue3 = topDouble31; + int64Result1 = ((uint32_t) floatValue3); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, int64Result1); + goto l1070; + break; + case 64: + /* begin lowcodePrimitiveFloat64ToUInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble41 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer414 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer414) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer414)))); + floatValue4 = topDouble41; + int64Result2 = ((uint64_t) floatValue4); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, int64Result2); + goto l1070; + break; + case 65: + /* begin lowcodePrimitiveFree */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer34 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer510 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer510) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer510)))); + pointer13 = topPointer34; + free(pointer13); + goto l1070; + break; + case 66: + /* begin lowcodePrimitiveInstantiateIndexable32Oop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3218 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer393 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer393) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer393)))); + indexableSize = topInt3218; + /* begin internalPopStack */ + top14 = longAt(localSP); + localSP += BytesPerOop; + classOop = top14; + object14 = instantiateClassindexableSize(classOop, indexableSize); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object14); + goto l1070; + break; + case 67: + /* begin lowcodePrimitiveInstantiateIndexableOop */ + indexableSize1 = extA; + /* begin internalPopStack */ + top21 = longAt(localSP); + localSP += BytesPerOop; + classOop1 = top21; + object21 = instantiateClassindexableSize(classOop1, indexableSize1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object21); + extA = 0; + goto l1070; + break; + case 68: + /* begin lowcodePrimitiveInstantiateOop */ + top31 = longAt(localSP); + localSP += BytesPerOop; + classOop2 = top31; + object31 = instantiateClassindexableSize(classOop2, 0); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object31); + goto l1070; + break; + case 69: + /* begin lowcodePrimitiveInt32Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3234 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer66 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer66) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer66)))); + second26 = topInt3234; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32120 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1116 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1116) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1116)))); + first27 = topInt32120; + value46 = (first27 == second26 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value46); + goto l1070; + break; + case 70: + /* begin lowcodePrimitiveInt32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32211 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer74 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer74) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer74)))); + second112 = topInt32211; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321111 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1212 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1212) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1212)))); + first113 = topInt321111; + value116 = (first113 > second112 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value116); + goto l1070; + break; + case 71: + /* begin lowcodePrimitiveInt32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3235 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer84 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer84) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer84)))); + second27 = topInt3235; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32123 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer135 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer135) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer135)))); + first26 = topInt32123; + value214 = (first26 >= second27 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value214); + goto l1070; + break; + case 72: + /* begin lowcodePrimitiveInt32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3244 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer94 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer94) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer94)))); + second34 = topInt3244; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32132 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer143 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer143) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer143)))); + first34 = topInt32132; + value313 = (first34 < second34 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value313); + goto l1070; + break; + case 73: + /* begin lowcodePrimitiveInt32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3254 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer103 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer103) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer103)))); + second43 = topInt3254; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32142 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer153 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer153) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer153)))); + first43 = topInt32142; + value45 = (first43 <= second43 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value45); + goto l1070; + break; + case 74: + /* begin lowcodePrimitiveInt32NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3263 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer173 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer173) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer173)))); + second53 = topInt3263; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32152 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer163 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer163) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer163)))); + first53 = topInt32152; + value53 = (first53 != second53 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value53); + goto l1070; + break; + case 75: + /* begin lowcodePrimitiveInt32ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3273 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer183 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer183) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer183)))); + value63 = topInt3273; + result37 = ((float) value63); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result37); + goto l1070; + break; + case 76: + /* begin lowcodePrimitiveInt32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3283 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer193 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer193) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer193)))); + value73 = topInt3283; + result115 = ((double) value73); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result115); + goto l1070; + break; + case 77: + /* begin lowcodePrimitiveInt32ToPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3292 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer203 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer203) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer203)))); + value83 = topInt3292; + result215 = ((uintptr_t) value83); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result215); + goto l1070; + break; + case 78: + /* begin lowcodePrimitiveInt64Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6430 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer216 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer216) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer216)))); + second62 = topInt6430; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64120 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1103 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1103) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1103)))); + first62 = topInt64120; + value93 = (first62 == second62 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value93); + goto l1070; + break; + case 79: + /* begin lowcodePrimitiveInt64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64210 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer223 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer223) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer223)))); + second72 = topInt64210; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64119 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1115 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1115) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1115)))); + first72 = topInt64119; + value103 = (first72 > second72 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value103); + goto l1070; + break; + case 80: + /* begin lowcodePrimitiveInt64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6434 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer233 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer233) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer233)))); + second82 = topInt6434; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64123 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1123 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1123) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1123)))); + first82 = topInt64123; + value115 = (first82 >= second82 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value115); + goto l1070; + break; + case 81: + /* begin lowcodePrimitiveInt64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6444 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer243 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer243) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer243)))); + second92 = topInt6444; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64132 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1133 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1133) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1133)))); + first92 = topInt64132; + value123 = (first92 < second92 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value123); + goto l1070; + break; + case 82: + /* begin lowcodePrimitiveInt64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6453 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer253 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer253) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer253)))); + second102 = topInt6453; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64142 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1143 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1143) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1143)))); + first102 = topInt64142; + value133 = (first102 <= second102 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value133); + goto l1070; + break; + case 83: + /* begin lowcodePrimitiveInt64NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6463 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer263 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer263) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer263)))); + second113 = topInt6463; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6415 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1153 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1153) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1153)))); + first112 = topInt6415; + value143 = (first112 != second113 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value143); + goto l1070; + break; + case 84: + /* begin lowcodePrimitiveInt64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6473 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer273 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer273) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer273)))); + value153 = topInt6473; + result36 = ((float) value153); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result36); + goto l1070; + break; + case 85: + /* begin lowcodePrimitiveInt64ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6483 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer283 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer283) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer283)))); + value163 = topInt6483; + result44 = ((double) value163); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result44); + goto l1070; + break; + case 86: + /* begin lowcodePrimitiveInt64ToPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt649 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer293 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer293) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer293)))); + value173 = topInt649; + result54 = ((char*) (((intptr_t) value173))); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result54); + goto l1070; + break; + case 87: + /* begin lowcodePrimitiveLeftShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3210 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer303 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer303) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer303)))); + shiftAmount3 = topInt3210; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3216 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1163 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1163) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1163)))); + value182 = topInt3216; + result641 = ((sqInt)((usqInt)(value182) << shiftAmount3)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result641); + goto l1070; + break; + case 88: + /* begin lowcodePrimitiveLeftShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6410 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer315 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer315) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer315)))); + shiftAmount12 = topInt6410; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6416 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1173 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1173) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1173)))); + value192 = topInt6416; + result74 = ((sqLong)((usqLong)(value192) << shiftAmount12)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result74); + goto l1070; + break; + case 89: + /* begin lowcodePrimitiveLoadArgumentAddress */ + baseOffset = extA; + pointer14 = framePointerOfNativeArgumentin(baseOffset, localFP); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer14); + extA = 0; + goto l1070; + break; + case 90: + /* begin lowcodePrimitiveLoadArgumentFloat32 */ + baseOffset1 = extA; + floatValue5 = singleFloatAtPointer(framePointerOfNativeArgumentin(baseOffset1, localFP)); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, floatValue5); + extA = 0; + goto l1070; + break; + case 91: + /* begin lowcodePrimitiveLoadArgumentFloat64 */ + baseOffset2 = extA; + doubleValue = floatAtPointer(framePointerOfNativeArgumentin(baseOffset2, localFP)); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleValue); + extA = 0; + goto l1070; + break; + case 92: + /* begin lowcodePrimitiveLoadArgumentInt16 */ + baseOffset3 = extA; + value202 = int16AtPointer(framePointerOfNativeArgumentin(baseOffset3, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value202); + extA = 0; + goto l1070; + break; + case 93: + /* begin lowcodePrimitiveLoadArgumentInt32 */ + baseOffset4 = extA; + value215 = int32AtPointer(framePointerOfNativeArgumentin(baseOffset4, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value215); + extA = 0; + goto l1070; + break; + case 94: + /* begin lowcodePrimitiveLoadArgumentInt64 */ + baseOffset5 = extA; + value222 = int64AtPointer(framePointerOfNativeArgumentin(baseOffset5, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value222); + extA = 0; + goto l1070; + break; + case 95: + /* begin lowcodePrimitiveLoadArgumentInt8 */ + baseOffset6 = extA; + value232 = int8AtPointer(framePointerOfNativeArgumentin(baseOffset6, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value232); + extA = 0; + goto l1070; + break; + case 96: + /* begin lowcodePrimitiveLoadArgumentPointer */ + baseOffset7 = extA; + pointerResult = pointerAtPointer(framePointerOfNativeArgumentin(baseOffset7, localFP)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult); + extA = 0; + goto l1070; + break; + case 97: + /* begin lowcodePrimitiveLoadArgumentUInt16 */ + baseOffset8 = extA; + value242 = uint16AtPointer(framePointerOfNativeArgumentin(baseOffset8, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value242); + extA = 0; + goto l1070; + break; + case 98: + /* begin lowcodePrimitiveLoadArgumentUInt32 */ + baseOffset9 = extA; + value252 = uint32AtPointer(framePointerOfNativeArgumentin(baseOffset9, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value252); + extA = 0; + goto l1070; + break; + case 99: + /* begin lowcodePrimitiveLoadArgumentUInt64 */ + baseOffset10 = extA; + value262 = uint64AtPointer(framePointerOfNativeArgumentin(baseOffset10, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value262); + extA = 0; + goto l1070; + break; + case 100: + /* begin lowcodePrimitiveLoadArgumentUInt8 */ + baseOffset11 = extA; + value272 = uint8AtPointer(framePointerOfNativeArgumentin(baseOffset11, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value272); + extA = 0; + goto l1070; + break; + case 101: + /* begin lowcodePrimitiveLoadFloat32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer114 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer323 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer323) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer323)))); + pointer2 = topPointer114; + value282 = singleFloatAtPointer(pointer2); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value282); + goto l1070; + break; + case 102: + /* begin lowcodePrimitiveLoadFloat64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer212 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer333 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer333) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer333)))); + pointer3 = topPointer212; + value292 = floatAtPointer(pointer3); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value292); + goto l1070; + break; + case 103: + /* begin lowcodePrimitiveLoadInt16FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer35 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer343 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer343) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer343)))); + pointer4 = topPointer35; + value30 = int16AtPointer(pointer4); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value30); + goto l1070; + break; + case 104: + /* begin lowcodePrimitiveLoadInt32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer43 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer353 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer353) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer353)))); + pointer5 = topPointer43; + value315 = int32AtPointer(pointer5); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value315); + goto l1070; + break; + case 105: + /* begin lowcodePrimitiveLoadInt64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer53 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer363 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer363) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer363)))); + pointer6 = topPointer53; + value32 = int64AtPointer(pointer6); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value32); + goto l1070; + break; + case 106: + /* begin lowcodePrimitiveLoadInt8FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer6 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer373 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer373) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer373)))); + pointer7 = topPointer6; + value33 = int8AtPointer(pointer7); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value33); + goto l1070; + break; + case 107: + /* begin lowcodePrimitiveLoadLocalAddress */ + baseOffset12 = extA; + pointer8 = framePointerOfNativeLocalin(baseOffset12, localFP); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer8); + extA = 0; + goto l1070; + break; + case 108: + /* begin lowcodePrimitiveLoadLocalFloat32 */ + baseOffset13 = extA; + floatValue6 = singleFloatAtPointer(framePointerOfNativeLocalin(baseOffset13, localFP)); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, floatValue6); + extA = 0; + goto l1070; + break; + case 109: + /* begin lowcodePrimitiveLoadLocalFloat64 */ + baseOffset14 = extA; + doubleValue1 = floatAtPointer(framePointerOfNativeLocalin(baseOffset14, localFP)); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleValue1); + extA = 0; + goto l1070; + break; + case 110: + /* begin lowcodePrimitiveLoadLocalInt16 */ + baseOffset15 = extA; + value34 = int16AtPointer(framePointerOfNativeLocalin(baseOffset15, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value34); + extA = 0; + goto l1070; + break; + case 111: + /* begin lowcodePrimitiveLoadLocalInt32 */ + baseOffset16 = extA; + value35 = int32AtPointer(framePointerOfNativeLocalin(baseOffset16, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value35); + extA = 0; + goto l1070; + break; + case 112: + /* begin lowcodePrimitiveLoadLocalInt64 */ + baseOffset17 = extA; + value36 = int64AtPointer(framePointerOfNativeLocalin(baseOffset17, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value36); + extA = 0; + goto l1070; + break; + case 113: + /* begin lowcodePrimitiveLoadLocalInt8 */ + baseOffset18 = extA; + value37 = int8AtPointer(framePointerOfNativeLocalin(baseOffset18, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value37); + extA = 0; + goto l1070; + break; + case 114: + /* begin lowcodePrimitiveLoadLocalPointer */ + baseOffset19 = extA; + pointerResult1 = pointerAtPointer(framePointerOfNativeLocalin(baseOffset19, localFP)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult1); + extA = 0; + goto l1070; + break; + case 115: + /* begin lowcodePrimitiveLoadLocalUInt16 */ + baseOffset20 = extA; + value38 = uint16AtPointer(framePointerOfNativeLocalin(baseOffset20, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value38); + extA = 0; + goto l1070; + break; + case 116: + /* begin lowcodePrimitiveLoadLocalUInt32 */ + baseOffset21 = extA; + value39 = uint32AtPointer(framePointerOfNativeLocalin(baseOffset21, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value39); + extA = 0; + goto l1070; + break; + case 117: + /* begin lowcodePrimitiveLoadLocalUInt64 */ + baseOffset22 = extA; + value40 = uint64AtPointer(framePointerOfNativeLocalin(baseOffset22, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value40); + extA = 0; + goto l1070; + break; + case 118: + /* begin lowcodePrimitiveLoadLocalUInt8 */ + baseOffset23 = extA; + value41 = uint8AtPointer(framePointerOfNativeLocalin(baseOffset23, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value41); + extA = 0; + goto l1070; + break; + case 119: + /* begin lowcodePrimitiveLoadObjectAt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3217 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer383 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer383) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer383)))); + fieldIndex4 = topInt3217; + /* begin internalPopStack */ + top5 = longAt(localSP); + localSP += BytesPerOop; + object13 = top5; + /* begin fetchPointer:ofObject: */ + fieldValue = longAt((object13 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex4) << (shiftForWord()))))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), fieldValue); + goto l1070; + break; + default: + /* begin lowcodeUnaryInlinePrimitive3: */ + + switch (prim - 1000) { + case 120: + /* begin lowcodePrimitiveLoadObjectField */ + fieldIndex12 = extA; + /* begin internalPopStack */ + top41 = longAt(localSP); + localSP += BytesPerOop; + object41 = top41; + /* begin fetchPointer:ofObject: */ + fieldValue1 = longAt((object41 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), fieldValue1); + extA = 0; + goto l746; + break; + case 121: + /* begin lowcodePrimitiveLoadPointerFromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer32 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer591 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer591) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer591)))); + pointer10 = topPointer32; + pointerResult2 = pointerAtPointer(pointer10); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult2); + goto l746; + break; + case 122: + /* begin lowcodePrimitiveLoadUInt16FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer113 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1301 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1301) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1301)))); + pointer12 = topPointer113; + value44 = uint16AtPointer(pointer12); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value44); + goto l746; + break; + case 123: + /* begin lowcodePrimitiveLoadUInt32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer211 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer213 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer213) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer213)))); + pointer22 = topPointer211; + value114 = uint32AtPointer(pointer22); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value114); + goto l746; + break; + case 0x7C: + /* begin lowcodePrimitiveLoadUInt64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer33 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer314 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer314) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer314)))); + pointer32 = topPointer33; + value212 = uint64AtPointer(pointer32); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value212); + goto l746; + break; + case 125: + /* begin lowcodePrimitiveLoadUInt8FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer42 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer413 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer413) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer413)))); + pointer42 = topPointer42; + value312 = uint8AtPointer(pointer42); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value312); + goto l746; + break; + case 0x7E: + /* begin lowcodePrimitiveLocalFrameSize */ + + /* Mark the frame */ + size5 = extA; + offset3 = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(localFP))->cmNumArgs) + : byteAt((localFP + FoxIFrameFlags) + 1)); + /* begin splObj: */ + valueOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(LowcodeContextMark) << (shiftForWord()))))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + longAtput((offset3 < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? (localFP + FoxCallerSavedIP) + ((frameNumArgs - offset3) * BytesPerWord) + : ((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - offset3) * BytesPerWord)), valueOop); + } + else { + if (offset3 < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - offset3) * BytesPerWord), valueOop); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - offset3) * BytesPerWord), valueOop); + } + } + /* begin nativePreviousStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 2), GIV(nativeStackPointer) + 1); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 2), GIV(nativeStackPointer) + 1); + } + GIV(nativeStackPointer) -= size5; + /* begin nativeFramePointerIn:put: */ + valueOopPointer422 = ((char*) (GIV(nativeStackPointer) + 1)); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 3), valueOopPointer422); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 3), valueOopPointer422); + } + nativeSP = GIV(nativeStackPointer) + 1; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), GIV(nativeStackPointer) + 1); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), GIV(nativeStackPointer) + 1); + } + GIV(nativeStackPointer) -= 256; + extA = 0; + goto l746; + break; + case 0x7F: + /* begin lowcodePrimitiveLockRegisters */ + abort(); + goto l746; + break; + case 128: + /* begin lowcodePrimitiveLockVM */ + abort(); + goto l746; + break; + case 129: + /* begin lowcodePrimitiveMalloc32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3230 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer581 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer581) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer581)))); + size6 = topInt3230; + pointer52 = malloc(size6); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer52); + goto l746; + break; + case 130: + /* begin lowcodePrimitiveMalloc64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6429 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer631 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer631) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer631)))); + size11 = topInt6429; + pointer61 = malloc(size11); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer61); + goto l746; + break; + case 131: + /* begin lowcodePrimitiveMemcpy32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32119 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer73 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer73) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer73)))); + size2 = topInt32119; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer52 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1113 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1113) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1113)))); + source = topPointer52; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer11 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer214 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer214) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer214)))); + dest = topPointer11; + memcpy(dest, source, size2); + goto l746; + break; + case 132: + /* begin lowcodePrimitiveMemcpy64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64117 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer83 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer83) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer83)))); + size3 = topInt64117; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer62 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1211 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1211) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1211)))); + source1 = topPointer62; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer12 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer222 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer222) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer222)))); + dest1 = topPointer12; + memcpy(dest1, source1, size3); + goto l746; + break; + case 133: + /* begin lowcodePrimitiveMemcpyFixed */ + size4 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer7 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer93 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer93) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer93)))); + source2 = topPointer7; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer13 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1331 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1331) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1331)))); + dest2 = topPointer13; + memcpy(dest2, source2, size4); + extA = 0; + goto l746; + break; + case 134: + /* begin lowcodePrimitiveMoveFloat32ToPhysical */ + registerID6 = extA; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle28 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer102 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer102) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer102)))); + value43 = topSingle28; + lowcodeCalloutStatefloat32Registervalue(lowcodeCalloutState, registerID6, value43); + extA = 0; + goto l746; + break; + case 135: + /* begin lowcodePrimitiveMoveFloat64ToPhysical */ + registerID1 = extA; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble51 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer142 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer142) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer142)))); + value52 = topDouble51; + lowcodeCalloutStatefloat64Registervalue(lowcodeCalloutState, registerID1, value52); + extA = 0; + goto l746; + break; + case 136: + /* begin lowcodePrimitiveMoveInt32ToPhysical */ + registerID2 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32210 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer152 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer152) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer152)))); + value62 = topInt32210; + lowcodeCalloutStateint32Registervalue(lowcodeCalloutState, registerID2, value62); + extA = 0; + goto l746; + break; + case 137: + /* begin lowcodePrimitiveMoveInt64ToPhysical */ + registerID3 = extA; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6428 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer162 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer162) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer162)))); + value72 = topInt6428; + lowcodeCalloutStateint64Registervalue(lowcodeCalloutState, registerID3, value72); + extA = 0; + goto l746; + break; + case 138: + /* begin lowcodePrimitiveMovePointerToPhysical */ + registerID4 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer8 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer172 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer172) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer172)))); + pointerValue4 = topPointer8; + lowcodeCalloutStatepointerRegistervalue(lowcodeCalloutState, registerID4, pointerValue4); + extA = 0; + goto l746; + break; + case 139: + /* begin lowcodePrimitiveMul32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3233 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer192 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer192) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer192)))); + second201 = topInt3233; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321110 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer182 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer182) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer182)))); + first201 = topInt321110; + result35 = first201 * second201; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result35); + goto l746; + break; + case 140: + /* begin lowcodePrimitiveMul64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6433 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer202 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer202) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer202)))); + second110 = topInt6433; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64118 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1102 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1102) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1102)))); + first110 = topInt64118; + result113 = first110 * second110; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result113); + goto l746; + break; + case 141: + /* begin lowcodePrimitiveNeg32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3243 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer232 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer232) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer232)))); + value82 = topInt3243; + result213 = -value82; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result213); + goto l746; + break; + case 142: + /* begin lowcodePrimitiveNeg64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6443 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer242 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer242) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer242)))); + value92 = topInt6443; + result34 = -value92; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result34); + goto l746; + break; + case 143: + /* begin lowcodePrimitiveNot32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3253 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer252 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer252) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer252)))); + value102 = topInt3253; + result43 = value102 ^ -1; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result43); + goto l746; + break; + case 144: + /* begin lowcodePrimitiveNot64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6452 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer262 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer262) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer262)))); + value113 = topInt6452; + result53 = value113 ^ -1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result53); + goto l746; + break; + case 145: + /* begin lowcodePrimitiveOr32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3262 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer272 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer272) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer272)))); + second231 = topInt3262; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32122 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1114 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1114) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1114)))); + first231 = topInt32122; + result63 = first231 | second231; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result63); + goto l746; + break; + case 146: + /* begin lowcodePrimitiveOr64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6462 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer282 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer282) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer282)))); + second33 = topInt6462; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64122 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1122 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1122) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1122)))); + first33 = topInt64122; + result73 = first33 | second33; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result73); + goto l746; + break; + case 147: + /* begin lowcodePrimitivePerformCallFloat32 */ + function14 = extA; + /* begin lowcodeCalloutFloat32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function14)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize14 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer = ((char*) ((((size_t) (initialShadowCallStackPointer - calloutStateSize14))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer); + result182 = lowcodeCalloutStateFetchResultFloat32(lowcodeCalloutState); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result182); + extA = 0; + goto l746; + break; + case 148: + /* begin lowcodePrimitivePerformCallFloat64 */ + function1 = extA; + /* begin lowcodeCalloutFloat64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function1)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize1 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer1 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer1 = ((char*) ((((size_t) (initialShadowCallStackPointer1 - calloutStateSize1))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer1); + result192 = lowcodeCalloutStateFetchResultFloat64(lowcodeCalloutState); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result192); + extA = 0; + goto l746; + break; + case 149: + /* begin lowcodePrimitivePerformCallIndirectFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer22 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer432 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer432) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer432)))); + function2 = topPointer22; + /* begin lowcodeCalloutFloat32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function2); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize2 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer2 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer2 = ((char*) ((((size_t) (initialShadowCallStackPointer2 - calloutStateSize2))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer2); + result202 = lowcodeCalloutStateFetchResultFloat32(lowcodeCalloutState); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result202); + goto l746; + break; + case 150: + /* begin lowcodePrimitivePerformCallIndirectFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer23 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer442 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer442) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer442)))); + function3 = topPointer23; + /* begin lowcodeCalloutFloat64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function3); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize3 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer3 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer3 = ((char*) ((((size_t) (initialShadowCallStackPointer3 - calloutStateSize3))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer3); + result214 = lowcodeCalloutStateFetchResultFloat64(lowcodeCalloutState); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result214); + goto l746; + break; + case 151: + /* begin lowcodePrimitivePerformCallIndirectInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer24 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer452 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer452) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer452)))); + function4 = topPointer24; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function4); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize4 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer4 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer4 = ((char*) ((((size_t) (initialShadowCallStackPointer4 - calloutStateSize4))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer4); + result222 = lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result222); + goto l746; + break; + case 152: + /* begin lowcodePrimitivePerformCallIndirectInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer25 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer462 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer462) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer462)))); + function5 = topPointer25; + /* begin lowcodeCalloutInt64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function5); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize5 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer5 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer5 = ((char*) ((((size_t) (initialShadowCallStackPointer5 - calloutStateSize5))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer5); + result232 = lowcodeCalloutStateFetchResultInt64(lowcodeCalloutState); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result232); + goto l746; + break; + case 153: + /* begin lowcodePrimitivePerformCallIndirectPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer26 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer472 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer472) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer472)))); + function6 = topPointer26; + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function6); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize6 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer6 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer6 = ((char*) ((((size_t) (initialShadowCallStackPointer6 - calloutStateSize6))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer6); + result242 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result242); + goto l746; + break; + case 154: + /* begin lowcodePrimitivePerformCallIndirectStructure */ + structureSize2 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer27 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer482 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer482) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer482)))); + result252 = topPointer27; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer110 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1172 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1172) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1172)))); + function7 = topPointer110; + /* begin lowcodeCallout:structureResult: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), result252); + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function7); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize7 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer7 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer7 = ((char*) ((((size_t) (initialShadowCallStackPointer7 - calloutStateSize7))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer7); + resultPointer = lowcodeCalloutStateFetchResultStructure(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, resultPointer); + extA = 0; + goto l746; + break; + case 155: + /* begin lowcodePrimitivePerformCallIndirectVoid */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer28 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer492 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer492) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer492)))); + function8 = topPointer28; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function8); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize8 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer8 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer8 = ((char*) ((((size_t) (initialShadowCallStackPointer8 - calloutStateSize8))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer8); + lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + goto l746; + break; + case 156: + /* begin lowcodePrimitivePerformCallInt32 */ + function9 = extA; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function9)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize9 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer9 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer9 = ((char*) ((((size_t) (initialShadowCallStackPointer9 - calloutStateSize9))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer9); + result26 = lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result26); + extA = 0; + goto l746; + break; + case 157: + /* begin lowcodePrimitivePerformCallInt64 */ + function10 = extA; + /* begin lowcodeCalloutInt64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function10)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize10 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer10 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer10 = ((char*) ((((size_t) (initialShadowCallStackPointer10 - calloutStateSize10))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer10); + result27 = lowcodeCalloutStateFetchResultInt64(lowcodeCalloutState); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result27); + extA = 0; + goto l746; + break; + case 158: + /* begin lowcodePrimitivePerformCallPointer */ + function11 = extA; + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function11)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize11 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer11 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer11 = ((char*) ((((size_t) (initialShadowCallStackPointer11 - calloutStateSize11))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer11); + result28 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result28); + extA = 0; + goto l746; + break; + case 159: + /* begin lowcodePrimitivePerformCallStructure */ + function12 = extA; + structureSize1 = extB; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer29 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer502 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer502) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer502)))); + result29 = topPointer29; + /* begin internalPushShadowCallStackPointer: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), result29); + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function12)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize12 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer12 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer12 = ((char*) ((((size_t) (initialShadowCallStackPointer12 - calloutStateSize12))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer12); + resultPointer1 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, resultPointer1); + extA = 0; + extB = 0; + numExtB = 0; + goto l746; + break; + case 160: + /* begin lowcodePrimitivePerformCallVoid */ + function13 = extA; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function13)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize13 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer13 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer13 = ((char*) ((((size_t) (initialShadowCallStackPointer13 - calloutStateSize13))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer13); + lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + extA = 0; + goto l746; + break; + case 161: + /* begin lowcodePrimitivePlaftormCode */ + abort(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, code); + goto l746; + break; + case 162: + /* begin lowcodePrimitivePointerAddConstantOffset */ + offset4 = extB; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer9 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer292 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer292) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer292)))); + base3 = topPointer9; + result83 = base3 + offset4; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result83); + extB = 0; + numExtB = 0; + goto l746; + break; + case 163: + /* begin lowcodePrimitivePointerAddOffset32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3272 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer302 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer302) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer302)))); + offset11 = topInt3272; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer10 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1132 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1132) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1132)))); + base11 = topPointer10; + result92 = base11 + offset11; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result92); + goto l746; + break; + case 164: + /* begin lowcodePrimitivePointerAddOffset64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6472 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer313 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer313) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer313)))); + offset2 = topInt6472; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer14 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1142 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1142) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1142)))); + base2 = topPointer14; + result102 = base2 + offset2; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result102); + goto l746; + break; + case 165: + /* begin lowcodePrimitivePointerEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer16 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer322 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer322) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer322)))); + second42 = topPointer16; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer15 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1152 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1152) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1152)))); + first42 = topPointer15; + value122 = (first42 == second42 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value122); + goto l746; + break; + case 166: + /* begin lowcodePrimitivePointerNotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer18 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer332 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer332) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer332)))); + second52 = topPointer18; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer17 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1162 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1162) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1162)))); + first52 = topPointer17; + value132 = (first52 != second52 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value132); + goto l746; + break; + case 167: + /* begin lowcodePrimitivePointerToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer19 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer342 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer342) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer342)))); + pointer71 = topPointer19; + result114 = ((uintptr_t) pointer71); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result114); + goto l746; + break; + case 168: + /* begin lowcodePrimitivePointerToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer20 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer352 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer352) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer352)))); + pointer81 = topPointer20; + result122 = ((uintptr_t) pointer81); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result122); + goto l746; + break; + case 169: + /* begin lowcodePrimitivePopFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle112 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer362 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer362) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer362)))); + value142 = topSingle112; + goto l746; + break; + case 170: + /* begin lowcodePrimitivePopFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble121 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer372 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer372) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer372)))); + value152 = topDouble121; + goto l746; + break; + case 171: + /* begin lowcodePrimitivePopInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3282 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer382 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer382) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer382)))); + value162 = topInt3282; + goto l746; + break; + case 172: + /* begin lowcodePrimitivePopInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6482 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer392 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer392) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer392)))); + value172 = topInt6482; + goto l746; + break; + case 173: + /* begin lowcodePrimitivePopMultipleNative */ + popSize = extA; + /* begin internalPopStackNativeSize: */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + /* begin nativeStackPointerIn:put: */ + valueOopPointer402 = nativeSP + popSize; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer402) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer402)))); + extA = 0; + goto l746; + break; + case 174: + /* begin lowcodePrimitivePopPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer21 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer415 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer415) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer415)))); + pointerValue12 = topPointer21; + goto l746; + break; + case 175: + /* begin lowcodePrimitivePushConstantUInt32 */ + constant = extA; + result132 = constant; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result132); + extA = 0; + goto l746; + break; + case 176: + /* begin lowcodePrimitivePushConstantUInt64 */ + constant1 = extA; + result142 = constant1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result142); + extA = 0; + goto l746; + break; + case 177: + /* begin lowcodePrimitivePushNullPointer */ + result152 = 0; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result152); + goto l746; + break; + case 178: + /* begin lowcodePrimitivePushOne32 */ + result162 = 1; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result162); + goto l746; + break; + case 179: + /* begin lowcodePrimitivePushOne64 */ + result172 = 1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result172); + goto l746; + break; + default: + /* begin lowcodeUnaryInlinePrimitive4: */ + + switch (prim - 1000) { + case 180: + /* begin lowcodePrimitivePushOneFloat32 */ + result32 = 1.0; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result32); + goto l541; + break; + case 181: + /* begin lowcodePrimitivePushOneFloat64 */ + result112 = 1.0; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result112); + goto l541; + break; + case 182: + /* begin lowcodePrimitivePushPhysicalFloat32 */ + registerID5 = extA; + value401 = lowcodeCalloutStatefloat32Register(lowcodeCalloutState, registerID5); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value401); + extA = 0; + goto l541; + break; + case 183: + /* begin lowcodePrimitivePushPhysicalFloat64 */ + registerID11 = extA; + value111 = lowcodeCalloutStatefloat64Register(lowcodeCalloutState, registerID11); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value111); + extA = 0; + goto l541; + break; + case 184: + /* begin lowcodePrimitivePushPhysicalInt32 */ + registerID21 = extA; + value211 = lowcodeCalloutStateint32Register(lowcodeCalloutState, registerID21); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value211); + extA = 0; + goto l541; + break; + case 185: + /* begin lowcodePrimitivePushPhysicalInt64 */ + registerID31 = extA; + value310 = lowcodeCalloutStateint64Register(lowcodeCalloutState, registerID31); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value310); + extA = 0; + goto l541; + break; + case 186: + /* begin lowcodePrimitivePushPhysicalPointer */ + registerID41 = extA; + pointerValue3 = lowcodeCalloutStatepointerRegister(lowcodeCalloutState, registerID41); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerValue3); + extA = 0; + goto l541; + break; + case 187: + /* begin lowcodePrimitivePushSessionIdentifier */ + value42 = getThisSessionID(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value42); + goto l541; + break; + case 188: + /* begin lowcodePrimitivePushZero32 */ + result212 = 0; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result212); + goto l541; + break; + case 189: + /* begin lowcodePrimitivePushZero64 */ + result33 = 0; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result33); + goto l541; + break; + case 190: + /* begin lowcodePrimitivePushZeroFloat32 */ + result42 = 0.0; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result42); + goto l541; + break; + case 191: + /* begin lowcodePrimitivePushZeroFloat64 */ + result52 = 0.0; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result52); + goto l541; + break; + case 192: + /* begin lowcodePrimitiveRem32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3229 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer571 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer571) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer571)))); + second181 = topInt3229; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32117 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1291 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1291) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1291)))); + first181 = topInt32117; + result62 = first181 % second181; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result62); + goto l541; + break; + case 193: + /* begin lowcodePrimitiveRem64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6426 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2111 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2111)))); + second191 = topInt6426; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64116 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1112 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1112) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1112)))); + first191 = topInt64116; + result72 = first191 % second191; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result72); + goto l541; + break; + case 194: + /* begin lowcodePrimitiveRightShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3228 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer311 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer311) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer311)))); + shiftAmount2 = topInt3228; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32118 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1210 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1210) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1210)))); + value51 = topInt32118; + result82 = ((usqInt) value51) >> shiftAmount2; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result82); + goto l541; + break; + case 195: + /* begin lowcodePrimitiveRightShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6427 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer411 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer411) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer411)))); + shiftAmount11 = topInt6427; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64115 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1321 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1321) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1321)))); + value61 = topInt64115; + result91 = ((unsigned sqLong)value61) >> shiftAmount11; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result91); + goto l541; + break; + case 196: + /* begin lowcodePrimitiveSignExtend32From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3232 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer561 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer561) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer561)))); + value71 = topInt3232; + result101 = ((signed short) value71); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result101); + goto l541; + break; + case 197: + /* begin lowcodePrimitiveSignExtend32From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3242 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer621 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer621) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer621)))); + value81 = topInt3242; + result111 = ((signed char) value81); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result111); + goto l541; + break; + case 198: + /* begin lowcodePrimitiveSignExtend64From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6432 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer72 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer72) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer72)))); + value91 = topInt6432; + result121 = ((int16_t) value91); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result121); + goto l541; + break; + case 199: + /* begin lowcodePrimitiveSignExtend64From32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3252 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer82 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer82) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer82)))); + value101 = topInt3252; + result131 = ((int32_t) value101); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result131); + goto l541; + break; + case 200: + /* begin lowcodePrimitiveSignExtend64From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6442 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer92 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer92) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer92)))); + value112 = topInt6442; + result141 = ((signed char) value112); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result141); + goto l541; + break; + case 201: + /* begin lowcodePrimitiveStoreFloat32ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer30 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer101 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer101)))); + pointer9 = topPointer30; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle27 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer141 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer141) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer141)))); + floatValue7 = topSingle27; + singleFloatAtPointerput(pointer9, floatValue7); + goto l541; + break; + case 202: + /* begin lowcodePrimitiveStoreFloat64ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer112 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer161 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer161) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer161)))); + pointer11 = topPointer112; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble211 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer151 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer151) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer151)))); + doubleValue2 = topDouble211; + floatAtPointerput(pointer11, doubleValue2); + goto l541; + break; + case 203: + /* begin lowcodePrimitiveStoreInt16ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer210 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer181 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer181) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer181)))); + pointer21 = topPointer210; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3261 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer171 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer171) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer171)))); + value121 = topInt3261; + int16AtPointerput(pointer21, value121); + goto l541; + break; + case 204: + /* begin lowcodePrimitiveStoreInt32ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer31 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer201 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer201) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer201)))); + pointer31 = topPointer31; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3271 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer191 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer191) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer191)))); + value131 = topInt3271; + int32AtPointerput(pointer31, value131); + goto l541; + break; + case 205: + /* begin lowcodePrimitiveStoreInt64ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer41 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer212 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer212) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer212)))); + pointer41 = topPointer41; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6451 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1101 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1101)))); + value141 = topInt6451; + int64AtPointerput(pointer41, value141); + goto l541; + break; + case 206: + /* begin lowcodePrimitiveStoreInt8ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer51 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer221 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer221) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer221)))); + pointer51 = topPointer51; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3281 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1111 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1111)))); + value151 = topInt3281; + int8AtPointerput(pointer51, value151); + goto l541; + break; + case 207: + /* begin lowcodePrimitiveStoreLocalFloat32 */ + baseOffset25 = extA; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle113 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer231 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer231) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer231)))); + value161 = topSingle113; + singleFloatAtPointerput(framePointerOfNativeLocalin(baseOffset25, localFP), value161); + extA = 0; + goto l541; + break; + case 208: + /* begin lowcodePrimitiveStoreLocalFloat64 */ + baseOffset110 = extA; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble111 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer241 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer241) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer241)))); + value171 = topDouble111; + floatAtPointerput(framePointerOfNativeLocalin(baseOffset110, localFP), value171); + extA = 0; + goto l541; + break; + case 209: + /* begin lowcodePrimitiveStoreLocalInt16 */ + baseOffset24 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3291 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer251 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer251) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer251)))); + value181 = topInt3291; + int16AtPointerput(framePointerOfNativeLocalin(baseOffset24, localFP), value181); + extA = 0; + goto l541; + break; + case 210: + /* begin lowcodePrimitiveStoreLocalInt32 */ + baseOffset31 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32101 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer261 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer261) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer261)))); + value191 = topInt32101; + int32AtPointerput(framePointerOfNativeLocalin(baseOffset31, localFP), value191); + extA = 0; + goto l541; + break; + case 211: + /* begin lowcodePrimitiveStoreLocalInt64 */ + lowcodeStoreLocalInt64Workaroundinsp(extA, localFP, localSP); + + extA = 0; + goto l541; + break; + case 212: + /* begin lowcodePrimitiveStoreLocalInt8 */ + baseOffset41 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32121 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer281 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer281) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer281)))); + value201 = topInt32121; + int8AtPointerput(framePointerOfNativeLocalin(baseOffset41, localFP), value201); + extA = 0; + goto l541; + break; + case 213: + /* begin lowcodePrimitiveStoreLocalPointer */ + baseOffset51 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer61 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer291 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer291) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer291)))); + pointerValue11 = topPointer61; + pointerAtPointerput(framePointerOfNativeLocalin(baseOffset51, localFP), pointerValue11); + extA = 0; + goto l541; + break; + case 214: + /* begin lowcodePrimitiveStorePointerToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer71 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer301 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer301) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer301)))); + memoryPointer = topPointer71; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer111 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1121 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1121) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1121)))); + pointerValue2 = topPointer111; + pointerAtPointerput(memoryPointer, pointerValue2); + goto l541; + break; + case 215: + /* begin lowcodePrimitiveSub32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32131 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer312 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer312) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer312)))); + second221 = topInt32131; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32141 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1131 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1131) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1131)))); + first221 = topInt32141; + result151 = first221 - second221; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result151); + goto l541; + break; + case 216: + /* begin lowcodePrimitiveSub64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6471 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer321 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer321) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer321)))); + second32 = topInt6471; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64121 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1141 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1141) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1141)))); + first32 = topInt64121; + result161 = first32 - second32; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result161); + goto l541; + break; + case 217: + /* begin lowcodePrimitiveTruncate32To16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32151 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer331 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer331) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer331)))); + value213 = topInt32151; + result171 = value213 & 0xFFFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result171); + goto l541; + break; + case 218: + /* begin lowcodePrimitiveTruncate32To8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32161 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer341 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer341) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer341)))); + value221 = topInt32161; + result181 = value221 & 0xFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result181); + goto l541; + break; + case 219: + /* begin lowcodePrimitiveTruncate64To16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6481 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer351 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer351) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer351)))); + value231 = topInt6481; + result191 = value231 & 0xFFFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result191); + goto l541; + break; + case 220: + /* begin lowcodePrimitiveTruncate64To32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6491 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer361 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer361) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer361)))); + value241 = topInt6491; + result201 = value241 & 0xFFFFFFFFU; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result201); + goto l541; + break; + case 221: + /* begin lowcodePrimitiveTruncate64To8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64101 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer371 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer371) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer371)))); + value251 = topInt64101; + result211 = value251 & 0xFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result211); + goto l541; + break; + case 222: + /* begin lowcodePrimitiveUdiv32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32171 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer381 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer381) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer381)))); + second41 = topInt32171; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32181 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1151 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1151) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1151)))); + first41 = topInt32181; + result221 = (((unsigned int) first41)) / (((unsigned int) second41)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result221); + goto l541; + break; + case 223: + /* begin lowcodePrimitiveUdiv64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64131 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer391 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer391) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer391)))); + second51 = topInt64131; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64141 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1161 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1161) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1161)))); + first51 = topInt64141; + result231 = (((uint64_t) first51)) / (((uint64_t) second51)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result231); + goto l541; + break; + case 224: + /* begin lowcodePrimitiveUint32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3219 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer401 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer401) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer401)))); + second61 = topInt3219; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32110 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1171 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1171) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1171)))); + first61 = topInt32110; + value261 = ((((unsigned int) first61)) > (((unsigned int) second61)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value261); + goto l541; + break; + case 225: + /* begin lowcodePrimitiveUint32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3220 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer412 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer412) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer412)))); + second71 = topInt3220; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32111 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1181 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1181) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1181)))); + first71 = topInt32111; + value271 = ((((unsigned int) first71)) >= (((unsigned int) second71)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value271); + goto l541; + break; + case 226: + /* begin lowcodePrimitiveUint32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32212 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer421 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer421) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer421)))); + second81 = topInt32212; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32112 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1191 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1191) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1191)))); + first81 = topInt32112; + value281 = ((((unsigned int) first81)) < (((unsigned int) second81)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value281); + goto l541; + break; + case 227: + /* begin lowcodePrimitiveUint32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3222 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer431 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer431) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer431)))); + second91 = topInt3222; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32113 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1201 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1201) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1201)))); + first91 = topInt32113; + value291 = ((((unsigned int) first91)) <= (((unsigned int) second91)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value291); + goto l541; + break; + case 228: + /* begin lowcodePrimitiveUint32ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3223 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer441 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer441) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer441)))); + value301 = topInt3223; + result241 = ((float) (((unsigned int) value301))); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result241); + goto l541; + break; + case 229: + /* begin lowcodePrimitiveUint32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3224 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer451 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer451) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer451)))); + value311 = topInt3224; + result251 = ((double) (((unsigned int) value311))); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result251); + goto l541; + break; + case 230: + /* begin lowcodePrimitiveUint64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64151 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer461 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer461) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer461)))); + second101 = topInt64151; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64161 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1213 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1213) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1213)))); + first101 = topInt64161; + value321 = ((((uint64_t) first101)) > (((uint64_t) second101)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value321); + goto l541; + break; + case 231: + /* begin lowcodePrimitiveUint64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6417 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer471 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer471) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer471)))); + second111 = topInt6417; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6418 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1221 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1221) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1221)))); + first111 = topInt6418; + value331 = ((((uint64_t) first111)) >= (((uint64_t) second111)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value331); + goto l541; + break; + case 232: + /* begin lowcodePrimitiveUint64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6419 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer481 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer481) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer481)))); + second121 = topInt6419; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64110 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1231 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1231) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1231)))); + first121 = topInt64110; + value341 = ((((uint64_t) first121)) < (((uint64_t) second121)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value341); + goto l541; + break; + case 233: + /* begin lowcodePrimitiveUint64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6420 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer491 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer491) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer491)))); + second131 = topInt6420; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64111 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1241 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1241) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1241)))); + first131 = topInt64111; + value351 = ((((uint64_t) first131)) <= (((uint64_t) second131)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value351); + goto l541; + break; + case 234: + /* begin lowcodePrimitiveUint64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64211 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer501 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer501) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer501)))); + value361 = topInt64211; + result261 = ((float) (((uint64_t) value361))); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result261); + goto l541; + break; + case 235: + /* begin lowcodePrimitiveUint64ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6422 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer511 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer511) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer511)))); + value371 = topInt6422; + result271 = ((double) (((uint64_t) value371))); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result271); + goto l541; + break; + case 236: + /* begin lowcodePrimitiveUmul32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3225 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer521 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer521) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer521)))); + second141 = topInt3225; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32114 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1251 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1251) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1251)))); + first141 = topInt32114; + result281 = (((unsigned int) first141)) * (((unsigned int) second141)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result281); + goto l541; + break; + case 237: + /* begin lowcodePrimitiveUmul64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6423 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer531 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer531) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer531)))); + second151 = topInt6423; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64112 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1261 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1261) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1261)))); + first151 = topInt64112; + result291 = (((uint64_t) first151)) * (((uint64_t) second151)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result291); + goto l541; + break; + case 238: + /* begin lowcodePrimitiveUnlockRegisters */ + abort(); + goto l541; + break; + case 239: + /* begin lowcodePrimitiveUnlockVM */ + abort(); + goto l541; + break; + default: + /* begin lowcodeUnaryInlinePrimitive5: */ + + switch (prim - 1000) { + case 240: + /* begin lowcodePrimitiveUrem32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3227 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer541 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer541) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer541)))); + second161 = topInt3227; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32115 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1271 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1271) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1271)))); + first171 = topInt32115; + result30 = (((unsigned int) first171)) % (((unsigned int) second161)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result30); + goto l953; + break; + case 241: + /* begin lowcodePrimitiveUrem64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6425 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2101 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2101)))); + second171 = topInt6425; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64113 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1110 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1110) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1110)))); + first161 = topInt64113; + result110 = (((unsigned int) first161)) % (((unsigned int) second171)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result110); + goto l953; + break; + case 242: + /* begin lowcodePrimitiveXor32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3226 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer310 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer310) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer310)))); + second211 = topInt3226; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32116 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1281 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1281) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1281)))); + first211 = topInt32116; + result210 = first211 ^ second211; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result210); + goto l953; + break; + case 243: + /* begin lowcodePrimitiveXor64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6424 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer410 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer410) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer410)))); + second31 = topInt6424; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64114 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1311 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1311) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1311)))); + first31 = topInt64114; + result31 = first31 ^ second31; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result31); + goto l953; + break; + case 244: + /* begin lowcodePrimitiveZeroExtend32From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3231 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer551 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer551) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer551)))); + value391 = topInt3231; + result41 = ((uint16_t) value391); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result41); + goto l953; + break; + case 245: + /* begin lowcodePrimitiveZeroExtend32From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3241 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer611 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer611) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer611)))); + value110 = topInt3241; + result51 = ((uint8_t) value110); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result51); + goto l953; + break; + case 246: + /* begin lowcodePrimitiveZeroExtend64From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6431 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer71 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer71) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer71)))); + value210 = topInt6431; + result61 = ((uint16_t) value210); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result61); + goto l953; + break; + case 247: + /* begin lowcodePrimitiveZeroExtend64From32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3251 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer81 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer81) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer81)))); + value381 = topInt3251; + result71 = ((uint32_t) value381); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result71); + goto l953; + break; + case 0xF8: + /* begin lowcodePrimitiveZeroExtend64From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6441 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer91 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer91) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer91)))); + value411 = topInt6441; + result81 = ((uint8_t) value411); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result81); + goto l953; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l953; + + } + l953: /* end lowcodeUnaryInlinePrimitive5: */; + goto l541; + + } + l541: /* end lowcodeUnaryInlinePrimitive4: */; + goto l746; + + } + l746: /* end lowcodeUnaryInlinePrimitive3: */; + goto l1070; + + } + l1070: /* end lowcodeUnaryInlinePrimitive2: */; + goto l1191; + + } + l1191: /* end lowcodeUnaryInlinePrimitive: */; + goto l1247; + } + if (prim < 3000) { + /* begin lowcodeBinaryInlinePrimitive: */ + + switch (prim - 2000) { + case 0: + /* begin lowcodePrimitiveByteSizeOf */ + top211 = longAt(localSP); + localSP += BytesPerOop; + object211 = top211; + /* begin byteSizeOf: */ + if (object211 & (tagMask())) { + value154 = 0; + goto l1243; + } + /* begin numBytesOf: */ + fmt1 = (((usqInt) (longAt(object211))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(object211)) > (isForwardedObjectClassIndexPun())); + numSlots3 = byteAt(object211 + 7); + numBytes3 = (numSlots3 == (numSlotsMask()) + ? longAt(object211 - BaseHeaderSize) + : numSlots3); + numBytes3 = numBytes3 << (shiftForWord()); + if (fmt1 >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + value154 = numBytes3 - (fmt1 & 7); + goto l1243; + } + if (fmt1 <= (sixtyFourBitIndexableFormat())) { + value154 = numBytes3; + goto l1243; + } + if (fmt1 >= (firstShortFormat())) { + value154 = numBytes3 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); + goto l1243; + } + value154 = numBytes3 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); + l1243: /* end byteSizeOf: */; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value154); + goto l1246; + break; + case 1: + /* begin lowcodePrimitiveFirstFieldPointer */ + top110 = longAt(localSP); + localSP += BytesPerOop; + object110 = top110; + /* begin firstFixedField: */ + pointer17 = ((void *) (pointerForOop(object110 + BaseHeaderSize))); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer17); + goto l1246; + break; + case 2: + /* begin lowcodePrimitiveFirstIndexableFieldPointer */ + top25 = longAt(localSP); + localSP += BytesPerOop; + object25 = top25; + pointer18 = firstIndexableField(object25); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer18); + goto l1246; + break; + case 3: + /* begin lowcodePrimitiveIsBytes */ + top32 = longAt(localSP); + localSP += BytesPerOop; + object32 = top32; + value50 = (((object32 & (tagMask())) == 0) + && (((((usqInt) (longAt(object32))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value50); + goto l1246; + break; + case 4: + /* begin lowcodePrimitiveIsFloatObject */ + top42 = longAt(localSP); + localSP += BytesPerOop; + object42 = top42; + value120 = (((object42 & (tagMask())) == 0) + && (((longAt(object42)) & (classIndexMask())) == ClassFloatCompactIndex) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value120); + goto l1246; + break; + case 5: + /* begin lowcodePrimitiveIsIndexable */ + top51 = longAt(localSP); + localSP += BytesPerOop; + object51 = top51; + value218 = (isIndexable(object51) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value218); + goto l1246; + break; + case 6: + /* begin lowcodePrimitiveIsIntegerObject */ + top6 = longAt(localSP); + localSP += BytesPerOop; + object61 = top6; + value316 = ((object61 & 1) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value316); + goto l1246; + break; + case 7: + /* begin lowcodePrimitiveIsPointers */ + top7 = longAt(localSP); + localSP += BytesPerOop; + object71 = top7; + value49 = (((object71 & (tagMask())) == 0) + && (((((usqInt) (longAt(object71))) >> (formatShift())) & (formatMask())) <= 5) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value49); + goto l1246; + break; + case 8: + /* begin lowcodePrimitiveIsWords */ + top8 = longAt(localSP); + localSP += BytesPerOop; + object81 = top8; + value55 = (((object81 & (tagMask())) == 0) + && (((((usqInt) (longAt(object81))) >> (formatShift())) & (formatMask())) == (firstLongFormat())) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value55); + goto l1246; + break; + case 9: + /* begin lowcodePrimitiveIsWordsOrBytes */ + top9 = longAt(localSP); + localSP += BytesPerOop; + object91 = top9; + value65 = (((object91 & (tagMask())) == 0) + && (isPureBitsFormat((((usqInt) (longAt(object91))) >> (formatShift())) & (formatMask()))) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value65); + goto l1246; + break; + case 10: + /* begin lowcodePrimitiveOopSmallIntegerToInt32 */ + top10 = longAt(localSP); + localSP += BytesPerOop; + object101 = top10; + value75 = (object101 >> 1); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value75); + goto l1246; + break; + case 11: + /* begin lowcodePrimitiveOopSmallIntegerToInt64 */ + top111 = longAt(localSP); + localSP += BytesPerOop; + object111 = top111; + value84 = (object111 >> 1); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value84); + goto l1246; + break; + case 12: + /* begin lowcodePrimitiveOopToBoolean32 */ + top121 = longAt(localSP); + localSP += BytesPerOop; + object121 = top121; + /* begin booleanValueOf: */ + if (object121 == GIV(trueObj)) { + value94 = 1; + goto l1210; + } + if (object121 == GIV(falseObj)) { + value94 = 0; + goto l1210; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + value94 = null; + l1210: /* end booleanValueOf: */; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value94); + goto l1246; + break; + case 13: + /* begin lowcodePrimitiveOopToBoolean64 */ + top131 = longAt(localSP); + localSP += BytesPerOop; + object131 = top131; + /* begin booleanValueOf: */ + if (object131 == GIV(trueObj)) { + value104 = ((sqInt) 1); + goto l1227; + } + if (object131 == GIV(falseObj)) { + value104 = ((sqInt) 0); + goto l1227; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + value104 = null; + l1227: /* end booleanValueOf: */; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value104); + goto l1246; + break; + case 14: + /* begin lowcodePrimitiveOopToFloat32 */ + top141 = longAt(localSP); + localSP += BytesPerOop; + object141 = top141; + /* begin floatValueOf: */ + isFloat = ((object141 & (tagMask())) == 0) + && (((longAt(object141)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(object141 + BaseHeaderSize, result39); + value119 = result39; + goto l1211; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + value119 = 0.0; + l1211: /* end floatValueOf: */; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value119); + goto l1246; + break; + case 15: + /* begin lowcodePrimitiveOopToFloat64 */ + top15 = longAt(localSP); + localSP += BytesPerOop; + object15 = top15; + /* begin floatValueOf: */ + isFloat1 = ((object15 & (tagMask())) == 0) + && (((longAt(object15)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(object15 + BaseHeaderSize, result117); + value124 = result117; + goto l1200; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + value124 = 0.0; + l1200: /* end floatValueOf: */; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value124); + goto l1246; + break; + case 16: + /* begin lowcodePrimitiveOopToInt32 */ + top16 = longAt(localSP); + localSP += BytesPerOop; + object16 = top16; + value134 = signed32BitValueOf(object16); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value134); + goto l1246; + break; + case 17: + /* begin lowcodePrimitiveOopToInt64 */ + top17 = longAt(localSP); + localSP += BytesPerOop; + object17 = top17; + value144 = signed64BitValueOf(object17); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value144); + goto l1246; + break; + case 18: + /* begin lowcodePrimitiveOopToPointer */ + top18 = longAt(localSP); + localSP += BytesPerOop; + object18 = top18; + pointer23 = pointerAtPointer(firstIndexableField(object18)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer23); + goto l1246; + break; + case 19: + /* begin lowcodePrimitiveOopToPointerReinterpret */ + top19 = longAt(localSP); + localSP += BytesPerOop; + object19 = top19; + pointer33 = ((char*) object19); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer33); + goto l1246; + break; + case 20: + /* begin lowcodePrimitiveOopToUInt32 */ + top23 = longAt(localSP); + localSP += BytesPerOop; + object23 = top23; + value174 = positive32BitValueOf(object23); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value174); + goto l1246; + break; + case 21: + /* begin lowcodePrimitiveOopToUInt64 */ + top22 = longAt(localSP); + localSP += BytesPerOop; + object22 = top22; + value164 = positive64BitValueOf(object22); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value164); + goto l1246; + break; + case 22: + /* begin lowcodePrimitivePin */ + top24 = longAt(localSP); + localSP += BytesPerOop; + object24 = top24; + pinObject(object24); + goto l1246; + break; + case 23: + /* begin lowcodePrimitiveUnpin */ + top20 = longAt(localSP); + localSP += BytesPerOop; + object20 = top20; + /* begin unpinObject: */ + assert(isNonImmediate(object20)); + /* begin setIsPinnedOf:to: */ + longAtput(object20, (longAt(object20)) & ((unsigned int)~(1U << (pinnedBitShift())))); + goto l1246; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l1246; + + } + l1246: /* end lowcodeBinaryInlinePrimitive: */; + goto l1247; + } + if (prim < 4000) { + /* begin lowcodeTrinaryInlinePrimitive: */ + + switch (prim - 3000) { + case 0: + /* begin lowcodePrimitiveOopEqual */ + top = longAt(localSP); + localSP += BytesPerOop; + second = top; + /* begin internalPopStack */ + top1 = longAt(localSP); + localSP += BytesPerOop; + first = top1; + value = (first == second + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value); + goto l1280; + break; + case 1: + /* begin lowcodePrimitiveOopNotEqual */ + top2 = longAt(localSP); + localSP += BytesPerOop; + second1 = top2; + /* begin internalPopStack */ + top11 = longAt(localSP); + localSP += BytesPerOop; + first1 = top11; + value1 = (first1 != second1 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value1); + goto l1280; + break; + case 2: + /* begin lowcodePrimitiveStoreObjectField */ + fieldIndex3 = extA; + /* begin internalPopStack */ + top3 = longAt(localSP); + localSP += BytesPerOop; + value2 = top3; + /* begin internalPopStack */ + top12 = longAt(localSP); + localSP += BytesPerOop; + object = top12; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value2 & (tagMask())) == 0) + && (oopisLessThan(value2, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))), value2); + extA = 0; + goto l1280; + break; + case 3: + /* begin lowcodePrimitiveStoreObjectFieldAt */ + top4 = longAt(localSP); + localSP += BytesPerOop; + value3 = top4; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer)))); + fieldIndex11 = topInt32; + /* begin internalPopStack */ + top13 = longAt(localSP); + localSP += BytesPerOop; + object1 = top13; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object1))); + if ((assert(isNonImmediate(object1)), + oopisGreaterThanOrEqualTo(object1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value3 & (tagMask())) == 0) + && (oopisLessThan(value3, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object1); + } + } + } + longAtput((object1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord())))), value3); + goto l1280; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l1280; + + } + l1280: /* end lowcodeTrinaryInlinePrimitive: */; + goto l1247; + } + } + + localIP -= 3; + goto respondToUnknownBytecode; + goto l1247; + + } + l1247: /* end case */; + break; + case 140: + /* pushRemoteTempLongBytecode */ + { + sqInt frameNumArgs; + sqInt remoteTempIndex; + sqInt tempVector; + sqInt tempVectorIndex; + + VM_LABEL(pushRemoteTempLongBytecode); + /* begin fetchByte */ + remoteTempIndex = byteAtPointer(++localIP); + /* begin fetchByte */ + tempVectorIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin pushRemoteTemp:inVectorAt: */ + tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), longAt((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))))); + } + break; + case 141: + /* storeRemoteTempLongBytecode */ + { + sqInt frameNumArgs; + sqInt remoteTempIndex; + sqInt tempVector; + sqInt tempVectorIndex; + + VM_LABEL(storeRemoteTempLongBytecode); + /* begin fetchByte */ + remoteTempIndex = byteAtPointer(++localIP); + /* begin fetchByte */ + tempVectorIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin storeRemoteTemp:inVectorAt: */ + tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(tempVector))); + if ((assert(isNonImmediate(tempVector)), + oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { + remember(tempVector); + } + } + } + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); + } + break; + case 142: + /* storeAndPopRemoteTempLongBytecode */ + { + sqInt frameNumArgs; + sqInt remoteTempIndex; + sqInt tempVector; + sqInt tempVectorIndex; + + VM_LABEL(storeAndPopRemoteTempLongBytecode); + /* begin storeRemoteTempLongBytecode */ + remoteTempIndex = byteAtPointer(++localIP); + /* begin fetchByte */ + tempVectorIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin storeRemoteTemp:inVectorAt: */ + tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(tempVector))); + if ((assert(isNonImmediate(tempVector)), + oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { + remember(tempVector); + } + } + } + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 143: + /* pushClosureCopyCopiedValuesBytecode */ + { + sqInt blockSize; + sqInt context; + sqInt i; + sqInt initialIP; + sqInt newClosure; + sqInt newClosure1; + usqInt newObj; + sqInt numArgs; + sqInt numArgsNumCopied; + usqInt numBytes; + sqInt numCopied; + sqInt numSlots; + sqInt objFormat; + char *theFP; + char *theSP; + + VM_LABEL(pushClosureCopyCopiedValuesBytecode); + /* begin fetchByte */ + numArgsNumCopied = byteAtPointer(++localIP); + numArgs = numArgsNumCopied & 15; + + /* Split blockSize := (self fetchByte * 256) + self fetchByte. into two because evaluation order in C is undefined. */ + numCopied = ((usqInt) numArgsNumCopied >> 4); + blockSize = ((sqInt)((usqInt)((byteAtPointer(++localIP))) << 8)); + blockSize += byteAtPointer(++localIP); + /* begin pushClosureNumArgs:copiedValues:blockSize: */ + theFP = localFP; + theSP = localSP + (numCopied * BytesPerOop); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + context = longAt(theFP + FoxThisContext); + goto l1375; + } + context = marryFrameSP(theFP, theSP); + l1375: /* end ensureFrameIsMarried:SP: */; + /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ + initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = indexablePointersFormat(); + numSlots = ClosureFirstCopiedValueIndex + numCopied; + assert((numSlots >= 0) + && (ClassBlockClosureCompactIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newClosure1 = 0; + goto l1370; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); + GIV(freeStart) += numBytes; + newClosure1 = newObj; + l1370: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 1) | 1)); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 1) | 1)); + newClosure = newClosure1; + if (recordSendTrace()) { + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation; + GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure; + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + if (numCopied > 0) { + for (i = 0; i < numCopied; i += 1) { + + /* Assume: have just allocated a new BlockClosure; it must be young. + Thus, can use unchecked stores. */ + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure))); + longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied - i) - 1) * BytesPerOop))); + } + /* begin internalPop: */ + localSP += numCopied * BytesPerOop; + } + localIP += blockSize; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), newClosure); + } + break; + case 144: + case 432: /*176*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump); + /* begin jump: */ + offset = 1 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 145: + case 433: /*177*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump1); + /* begin jump: */ + offset = 2 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 146: + case 434: /*178*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump2); + /* begin jump: */ + offset = 3 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 147: + case 435: /*179*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump3); + /* begin jump: */ + offset = 4 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 148: + case 436: /*180*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump4); + /* begin jump: */ + offset = 5 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 149: + case 437: /*181*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump5); + /* begin jump: */ + offset = 6 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 150: + case 438: /*182*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump6); + /* begin jump: */ + offset = 7 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 151: + case 439: /*183*/ + /* shortUnconditionalJump */ + { + sqInt offset; + + VM_LABEL(shortUnconditionalJump7); + /* begin jump: */ + offset = 8 /* (currentBytecode bitAnd: 7) + 1 */; + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 152: + case 153: + case 154: + case 155: + case 156: + case 157: + case 158: + case 159: + /* shortConditionalJumpFalse */ + { + sqInt boolean; + sqInt offset; + + VM_LABEL(shortConditionalJumpFalse); + /* begin jumplfFalseBy: */ + offset = (currentBytecode & 7) + 1; + /* begin internalStackTop */ + boolean = longAtPointer(localSP); + if (boolean == GIV(falseObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(trueObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1383; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1383: /* end jumplfFalseBy: */; + } + break; + case 160: + case 161: + case 162: + case 163: + case 164: + case 165: + case 166: + case 167: + /* longUnconditionalJump */ + { + sqInt backwardJumpCountByte; + sqInt offset; + sqInt switched; + + VM_LABEL(longUnconditionalJump); + offset = (((currentBytecode & 7) - 4) * 256) + (byteAtPointer(++localIP)); + localIP += offset; + /* begin ifBackwardsCheckForEvents: */ + if (offset >= 0) { + goto l1386; + } + if (localSP < GIV(stackLimit)) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + switched = checkForEventsMayContextSwitch(1); + returnToExecutivepostContextSwitch(1, switched); + browserPluginReturnIfNeeded(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (switched) { + goto l1386; + } + } + backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN + ? (FoxIFrameFlags + BytesPerWord) - 1 + : FoxIFrameFlags))); + if (((backwardJumpCountByte -= 2)) == 1) { + if (methodWithHeaderShouldBeCogged(methodHeaderOf(GIV(method)))) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1); + } + backwardJumpCountByte = 0x7F; + } + else { + if (backwardJumpCountByte == -1) { + + /* initialize the count */ + assert(minBackwardJumpCountForCompile <= 128); + backwardJumpCountByte = (((sqInt)((usqInt)((minBackwardJumpCountForCompile - 1)) << 1))) + 1; + } + } + /* begin iframeBackwardBranchByte:put: */ + byteAtput(localFP + ((VMBIGENDIAN + ? (FoxIFrameFlags + BytesPerWord) - 1 + : FoxIFrameFlags)), backwardJumpCountByte); + l1386: /* end ifBackwardsCheckForEvents: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 168: + case 169: + case 170: + case 171: + /* longJumpIfTrue */ + { + sqInt boolean; + sqInt offset; + + VM_LABEL(longJumpIfTrue); + /* begin jumplfTrueBy: */ + offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP)); + /* begin internalStackTop */ + boolean = longAtPointer(localSP); + if (boolean == GIV(trueObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(falseObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1389; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1389: /* end jumplfTrueBy: */; + } + break; + case 172: + case 173: + case 174: + case 175: + /* longJumpIfFalse */ + { + sqInt boolean; + sqInt offset; + + VM_LABEL(longJumpIfFalse); + /* begin jumplfFalseBy: */ + offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP)); + /* begin internalStackTop */ + boolean = longAtPointer(localSP); + if (boolean == GIV(falseObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(trueObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1393; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1393: /* end jumplfFalseBy: */; + } + break; + case 176: + /* bytecodePrimAdd */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimAdd); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + result = ((rcvr >> 1)) + ((arg >> 1)); + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1395; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatAdd:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1400; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1400; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1400: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1396; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1396; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1396: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1395; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((0 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1395: /* end case */; + break; + case 177: + /* bytecodePrimSubtract */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimSubtract); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + result = ((rcvr >> 1)) - ((arg >> 1)); + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1402; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatSubtract:fromArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1407; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1407; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1407: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1403; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1403; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1403: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1402; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((1 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1402: /* end case */; + break; + case 178: + /* bytecodePrimLessThan */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimLessThan); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheat: */ + if (rcvr < arg) { + /* goto booleanCheatTrue */ + } + else { + goto booleanCheatFalse; + } + goto l1409; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatLess:thanArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1411; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1411; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1411: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1414; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1414; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1414: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 < arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1409; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((2 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1409: /* end case */; + + booleanCheatTrue: + /* booleanCheatTrue */ + { + sqInt bytecode; + sqInt offset; + + VM_LABEL(booleanCheatTrue); + + /* assume next bytecode is jumpIfFalse (99%) */ + bytecode = byteAtPointer(++localIP); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + if ((bytecode < 173) + && (bytecode > 151)) { + if (bytecode < 160) { + + /* short jumpIfFalse 152 - 159 */ + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3217; + } + if (bytecode == 172) { + + /* long jumpIfFalse */ + byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3217; + } + if (bytecode > 167) { + + /* long jumpIfTrue 168 - 171 */ + offset = (((sqInt)((usqInt)((bytecode - 168)) << 8))) + (byteAtPointer(++localIP)); + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3217; + } + } + currentBytecode = bytecode + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); + } + l3217: /* end case */; + break; + case 179: + /* bytecodePrimGreaterThan */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimGreaterThan); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheat: */ + if (rcvr > arg) { + goto booleanCheatTrue; + } + else { + /* goto booleanCheatFalse */ + } + goto l1415; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatGreater:thanArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1417; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1417; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1417: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1420; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1420; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1420: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 > arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1415; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((3 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1415: /* end case */; + + booleanCheatFalse: + /* booleanCheatFalse */ + { + sqInt bytecode; + sqInt offset; + + VM_LABEL(booleanCheatFalse); + + /* assume next bytecode is jumpIfFalse (99%) */ + bytecode = byteAtPointer(++localIP); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + if ((bytecode < 160) + && (bytecode > 151)) { + + /* short jumpIfFalse */ + /* begin jump: */ + localIP = (localIP + (bytecode - 151)) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3220; + } + if (bytecode == 172) { + + /* long jumpIfFalse */ + offset = byteAtPointer(++localIP); + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3220; + } + currentBytecode = bytecode + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); + } + l3220: /* end case */; + break; + case 180: + /* bytecodePrimLessOrEqual */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimLessOrEqual); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheat: */ + if (rcvr <= arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1421; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatLessOrEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1423; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1423; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1423: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1426; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1426; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1426: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 <= arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1421; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((4 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1421: /* end case */; + break; + case 181: + /* bytecodePrimGreaterOrEqual */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimGreaterOrEqual); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheat: */ + if (rcvr >= arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1427; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatGreaterOrEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1429; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1429; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1429: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1432; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1432; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1432: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 >= arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1427; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((5 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1427: /* end case */; + break; + case 182: + /* bytecodePrimEqual */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimEqual); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + /* begin booleanCheat: */ + if (rcvr == arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1433; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1435; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1435; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1435: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1438; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1438; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1438: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 == arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1433; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((6 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1433: /* end case */; + break; + case 183: + /* bytecodePrimNotEqual */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimNotEqual); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + /* begin booleanCheat: */ + if (rcvr != arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1439; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1441; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1441; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1441: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1444; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1444; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1444: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 == arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheat: */ + if (!aBool) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + goto l1439; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((7 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1439: /* end case */; + break; + case 184: + /* bytecodePrimMultiply */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt oop; + int overflow; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimMultiply); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + overflow = (rcvr > 0 + ? (arg > 0 + ? rcvr > ((MaxSmallInteger) / arg) + : arg < ((MinSmallInteger) / rcvr)) + : (arg > 0 + ? rcvr < ((MinSmallInteger) / arg) + : (rcvr < 0) + && (arg < ((MaxSmallInteger) / rcvr)))); + if (!overflow) { + result = rcvr * arg; + oop = (((usqInt)result << 1) | 1); + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), oop); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1445; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatMultiply:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1450; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1450; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1450: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1446; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1446; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1446: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1445; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1445: /* end case */; + break; + case 185: + /* bytecodePrimDivide */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimDivide); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + if ((arg != 0) + && ((rcvr % arg) == 0)) { + + /* generates C / operation */ + result = rcvr / arg; + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1452; + } + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatDivide:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1457; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1457; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1457: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1453; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1453; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1453: /* end loadFloatOrIntFrom: */; + /* begin success: */ + if (!(arg1 != 0.0)) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 / arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1452; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((9 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1452: /* end case */; + break; + case 186: + /* bytecodePrimMod */ + { + sqInt mod; + sqInt objOop; + + VM_LABEL(bytecodePrimMod); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + mod = doPrimitiveModby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop))); + if (!GIV(primFailCode)) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)mod << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1459; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((10 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1459: /* end case */; + break; + case 187: + /* bytecodePrimMakePoint */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimMakePoint); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveMakePoint(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1463; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((11 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1463: /* end case */; + break; + case 188: + /* bytecodePrimBitShift */ + { + sqInt integerArgument; + sqInt integerReceiver; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt objOop; + sqInt shifted; + char *sp; + sqInt valueWord; + + VM_LABEL(bytecodePrimBitShift); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveBitShift */ + integerArgument = longAt(GIV(stackPointer)); + if (!((integerArgument & 1))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1471; + } + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + integerReceiver = positive32BitValueOf(integerReceiver); + + if (!GIV(primFailCode)) { + if (((integerArgument = (integerArgument >> 1))) >= 0) { + + /* Left shift -- must fail bits would be lost */ + if (!(integerArgument <= 0x1F)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1471; + } + shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); + if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1471; + } + } + else { + + /* Right shift -- OK to lose bits */ + if (!(integerArgument >= (-0x1F))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1471; + } + shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); + } + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { + shifted = (((usqInt)shifted << 1) | 1); + goto l1475; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l1469; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; + l1469: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(shifted); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + shifted = newLargeInteger; + goto l1475; + + l1475: /* end positive32BitIntegerFor: */; + + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); + GIV(stackPointer) = sp; + } + l1471: /* end primitiveBitShift */; + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1467; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((12 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1467: /* end case */; + break; + case 189: + /* bytecodePrimDiv */ + { + sqInt objOop; + sqInt quotient; + + VM_LABEL(bytecodePrimDiv); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + quotient = doPrimitiveDivby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop))); + if (!GIV(primFailCode)) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)quotient << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1477; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((13 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1477: /* end case */; + break; + case 190: + /* bytecodePrimBitAnd */ + { + sqInt arg; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimBitAnd); + arg = longAtPointer(localSP); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((arg & 1)) + && ((rcvr & 1))) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg & rcvr); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1481; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveBitAnd(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1481; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((14 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1481: /* end case */; + break; + case 191: + /* bytecodePrimBitOr */ + { + sqInt arg; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimBitOr); + arg = longAtPointer(localSP); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((arg & 1)) + && ((rcvr & 1))) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg | rcvr); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1486; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveBitOr(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1486; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((15 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1486: /* end case */; + break; + case 192: + case 368: /*112*/ + /* bytecodePrimAt */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimAt); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((16 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + break; + case 193: + case 369: /*113*/ + /* bytecodePrimAtPut */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimAtPut); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((17 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + } + break; + case 194: + /* bytecodePrimSize */ + { + sqInt ccIndex; + sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; + sqInt fmt; + sqInt fmt1; + sqInt isArray; + sqInt isString; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots2; + sqInt objOop; + sqInt rcvr; + sqInt sz; + + VM_LABEL(bytecodePrimSize); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + + /* Shortcut the mega-lookup for ByteString and Array, the two big consumers of cycles + here. Both of these have compact class indices and neither has any added fields. */ + rcvr = longAtPointer(localSP); + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isString = 0; + goto l1504; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isString = ClassByteStringCompactIndex == ccIndex; + goto l1504; + + l1504: /* end is:instanceOf:compactClassIndex: */; + if (isString) { + /* begin lengthOf:format: */ + fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + sz = numSlots; + goto l1506; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots << (shiftForWord())) - (fmt & 7); + goto l1506; + } + if (fmt >= (firstShortFormat())) { + sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l1506; + } + if (fmt >= (firstLongFormat())) { + sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l1506; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots) >> 1; + goto l1506; + } + sz = 0; + l1506: /* end lengthOf:format: */; + longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1495; + } + /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isArray = 0; + goto l1507; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(rcvr)) & (classIndexMask()); + isArray = ClassArrayCompactIndex == ccIndex1; + goto l1507; + + l1507: /* end is:instanceOf:compactClassIndex: */; + if (isArray) { + /* begin lengthOf:format: */ + fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); + if (fmt1 <= 5) { + sz = numSlots2; + goto l1505; + } + if (fmt1 >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l1505; + } + if (fmt1 >= (firstShortFormat())) { + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l1505; + } + if (fmt1 >= (firstLongFormat())) { + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l1505; + } + if (fmt1 == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots2) >> 1; + goto l1505; + } + sz = 0; + l1505: /* end lengthOf:format: */; + longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1495; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((18 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1495: /* end case */; + break; + case 195: + case 371: /*115*/ + /* bytecodePrimNext */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimNext); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((19 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = ((fetchPointerofObject((19 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 1); + goto normalSend; + } + break; + case 196: + case 372: /*116*/ + /* bytecodePrimNextPut */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimNextPut); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((20 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = ((fetchPointerofObject((20 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 1); + goto normalSend; + } + break; + case 197: + case 373: /*117*/ + /* bytecodePrimAtEnd */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimAtEnd); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((21 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = ((fetchPointerofObject((21 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 1); + goto normalSend; + } + break; + case 198: + /* bytecodePrimIdentical */ + { + sqInt arg; + sqInt rcvr; + + VM_LABEL(bytecodePrimIdentical); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP); + } + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP); + } + /* begin booleanCheat: */ + if (rcvr == arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + } + break; + case 199: + case 375: /*119*/ + /* bytecodePrimClass */ + { + sqInt aValue; + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(bytecodePrimClass); + rcvr = longAtPointer(localSP); + if (((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP); + } + /* begin internalStackTopPut: */ + aValue = (((tagBits = rcvr & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) + : fetchClassOfNonImm(rcvr)); + longAtPointerput(localSP, aValue); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 200: + /* bytecodePrimNotIdentical */ + { + sqInt arg; + sqInt rcvr; + + VM_LABEL(bytecodePrimNotIdentical); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP); + } + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP); + } + /* begin booleanCheat: */ + if (rcvr != arg) { + goto booleanCheatTrue; + } + else { + goto booleanCheatFalse; + } + } + break; + case 201: + /* bytecodePrimValue */ + { + sqInt ccIndex; + sqInt classOop; + sqInt isBlock; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimValue); + rcvr = longAtPointer(localSP); + GIV(argumentCount) = 0; + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isBlock = 0; + goto l1518; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isBlock = ClassBlockClosureCompactIndex == ccIndex; + goto l1518; + + l1518: /* end is:instanceOf:compactClassIndex: */; + if (isBlock) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin initPrimCall */ + GIV(primFailCode) = 0; + primitiveClosureValue(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1516; + } + GIV(primFailCode) = 0; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); + goto normalSend; + } + l1516: /* end case */; + break; + case 202: + /* bytecodePrimValueWithArg */ + { + sqInt ccIndex; + sqInt classOop; + sqInt isBlock; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimValueWithArg); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + GIV(argumentCount) = 1; + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isBlock = 0; + goto l1524; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isBlock = ClassBlockClosureCompactIndex == ccIndex; + goto l1524; + + l1524: /* end is:instanceOf:compactClassIndex: */; + if (isBlock) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin initPrimCall */ + GIV(primFailCode) = 0; + primitiveClosureValue(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1522; + } + GIV(primFailCode) = 0; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); + goto normalSend; + } + l1522: /* end case */; + break; + case 203: + case 379: /*123*/ + /* bytecodePrimDo */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimDo); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((27 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = ((fetchPointerofObject((27 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 1); + goto normalSend; + } + break; + case 204: + case 380: /*124*/ + /* bytecodePrimNew */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimNew); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((28 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + break; + case 205: + case 381: /*125*/ + /* bytecodePrimNewWithArg */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimNewWithArg); + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((29 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + break; + case 206: + /* bytecodePrimPointX */ + { + sqInt classOop; + sqInt objOop; + sqInt ok; + sqInt rcvr; + + VM_LABEL(bytecodePrimPointX); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + rcvr = longAtPointer(localSP); + /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassPoint) << (shiftForWord()))))); + /* begin isNonImmediate: */ + ok = (rcvr & (tagMask())) == 0; + if (ok) { + /* begin isClassOfNonImm:equalTo: */ + assert(isNonImmediate(rcvr)); + ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); + } + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1534; + } + GIV(primFailCode) = 0; + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((30 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1534: /* end case */; + break; + case 207: + /* bytecodePrimPointY */ + { + sqInt classOop; + sqInt objOop; + sqInt ok; + sqInt rcvr; + + VM_LABEL(bytecodePrimPointY); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + rcvr = longAtPointer(localSP); + /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassPoint) << (shiftForWord()))))); + /* begin isNonImmediate: */ + ok = (rcvr & (tagMask())) == 0; + if (ok) { + /* begin isClassOfNonImm:equalTo: */ + assert(isNonImmediate(rcvr)); + ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); + } + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(YIndex) << (shiftForWord())))))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1542; + } + GIV(primFailCode) = 0; + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((0x1F * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1542: /* end case */; + break; + case 208: + case 209: + case 210: + case 211: + case 212: + case 213: + case 214: + case 215: + case 216: + case 217: + case 218: + case 219: + case 220: + case 221: + case 222: + case 223: + case 384: /*128*/ + case 385: /*129*/ + case 386: /*130*/ + case 387: /*131*/ + case 388: /*132*/ + case 389: /*133*/ + case 390: /*134*/ + case 391: /*135*/ + case 392: /*136*/ + case 393: /*137*/ + case 394: /*138*/ + case 395: /*139*/ + case 396: /*140*/ + case 397: /*141*/ + case 398: /*142*/ + case 399: /*143*/ + /* sendLiteralSelector0ArgsBytecode */ + { + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(sendLiteralSelector0ArgsBytecode); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = 0; + /* begin internalStackValue: */ + rcvr = longAtPointer(localSP + (0 * BytesPerOop)); + lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(rcvr)) & (classIndexMask())); + assert(lkupClassTag != (nilObject())); + goto commonSendOrdinary; + } + break; + case 224: + case 225: + case 226: + case 227: + case 228: + case 229: + case 230: + case 231: + case 232: + case 233: + case 234: + case 235: + case 236: + case 237: + case 238: + case 239: + case 400: /*144*/ + case 401: /*145*/ + case 402: /*146*/ + case 403: /*147*/ + case 404: /*148*/ + case 405: /*149*/ + case 406: /*150*/ + case 407: /*151*/ + case 408: /*152*/ + case 409: /*153*/ + case 410: /*154*/ + case 411: /*155*/ + case 412: /*156*/ + case 413: /*157*/ + case 414: /*158*/ + case 415: /*159*/ + /* sendLiteralSelector1ArgBytecode */ + { + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(sendLiteralSelector1ArgBytecode); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = 1; + /* begin internalStackValue: */ + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(rcvr)) & (classIndexMask())); + assert(lkupClassTag != (nilObject())); + goto commonSendOrdinary; + } + break; + case 240: + case 241: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 251: + case 252: + case 253: + case 254: + case 255: + case 416: /*160*/ + case 417: /*161*/ + case 418: /*162*/ + case 419: /*163*/ + case 420: /*164*/ + case 421: /*165*/ + case 422: /*166*/ + case 423: /*167*/ + case 424: /*168*/ + case 425: /*169*/ + case 426: /*170*/ + case 427: /*171*/ + case 428: /*172*/ + case 429: /*173*/ + case 430: /*174*/ + case 431: /*175*/ + /* sendLiteralSelector2ArgsBytecode */ + { + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(sendLiteralSelector2ArgsBytecode); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord()))))); + + GIV(argumentCount) = 2; + /* begin internalStackValue: */ + rcvr = longAtPointer(localSP + (2 * BytesPerOop)); + lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(rcvr)) & (classIndexMask())); + assert(lkupClassTag != (nilObject())); + goto commonSendOrdinary; + } + break; + case 338: /*82*/ + /* extPushPseudoVariable */ + { + sqInt objOop; + sqInt objOop1; + sqInt theThingToPush; + + VM_LABEL(extPushPseudoVariable); + + switch (extB) { + case 0: + /* begin ensureFrameIsMarried:SP: */ + if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(localFP))); + theThingToPush = longAt(localFP + FoxThisContext); + goto l1575; + } + theThingToPush = marryFrameSP(localFP, localSP); + l1575: /* end ensureFrameIsMarried:SP: */; + break; + case 1: + /* begin activeProcess */ + objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + theThingToPush = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + break; + default: + goto respondToUnknownBytecode; + + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), theThingToPush); + extB = 0; + numExtB = 0; + } + break; + case 340: /*84*/ + case 341: /*85*/ + case 342: /*86*/ + case 343: /*87*/ + case 474: /*218*/ + case 475: /*219*/ + case 476: /*220*/ + case 477: /*221*/ + case 478: /*222*/ + case 479: /*223*/ + case 486: /*230*/ + case 492: /*236*/ + case 502: /*246*/ + case 503: /*247*/ + case 511: /*255*/ + /* unknownBytecode */ + { + VM_LABEL(unknownBytecode1); + goto respondToUnknownBytecode; + } + break; + case 344: /*88*/ + /* returnReceiver */ + { + VM_LABEL(returnReceiver1); + /* begin receiver */ + localReturnValue = longAt(localFP + FoxIFReceiver); + goto commonReturn; + } + break; + case 349: /*93*/ + /* returnNilFromBlock */ + { + VM_LABEL(returnNilFromBlock); + /* begin nilObject */ + localReturnValue = GIV(nilObj); + goto commonCallerReturn; + } + break; + case 350: /*94*/ + /* returnTopFromBlock */ + { + VM_LABEL(returnTopFromBlock1); + /* begin internalStackTop */ + localReturnValue = longAtPointer(localSP); + goto commonCallerReturn; + } + break; + case 351: /*95*/ + /* extNopBytecode */ + { + VM_LABEL(extNopBytecode); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + numExtB = (extA = (extB = 0)); + } + break; + case 352: /*96*/ + /* bytecodePrimAdd */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimAdd1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + result = ((rcvr >> 1)) + ((arg >> 1)); + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1585; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatAdd:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1590; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1590; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1590: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1586; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1586; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1586: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1585; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((0 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1585: /* end case */; + break; + case 353: /*97*/ + /* bytecodePrimSubtract */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimSubtract1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + result = ((rcvr >> 1)) - ((arg >> 1)); + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1592; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatSubtract:fromArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1597; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1597; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1597: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1593; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1593; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1593: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1592; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((1 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1592: /* end case */; + break; + case 354: /*98*/ + /* bytecodePrimLessThanSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimLessThanSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheatSistaV1: */ + if (rcvr < arg) { + /* goto booleanCheatTrueSistaV1 */ + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1599; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatLess:thanArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1601; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1601; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1601: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1604; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1604; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1604: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 < arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1599; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((2 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1599: /* end case */; + + booleanCheatTrueSistaV1: + /* booleanCheatTrueSistaV1 */ + { + sqInt bytecode; + sqInt offset; + + VM_LABEL(booleanCheatTrueSistaV1); + + /* assume next bytecode is jumpIfFalse (99%) */ + bytecode = byteAtPointer(++localIP); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + if (bytecode >= 192) { + if (bytecode <= 199) { + + /* short jumpIfFalse 192 - 199 */ + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3221; + } + if (bytecode == 239) { + + /* long jumpIfFalse */ + byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3221; + } + if (bytecode == 238) { + + /* long jumpIfTrue 238 */ + offset = byteAtPointer(++localIP); + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3221; + } + } + currentBytecode = bytecode + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); + } + l3221: /* end case */; + break; + case 355: /*99*/ + /* bytecodePrimGreaterThanSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimGreaterThanSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheatSistaV1: */ + if (rcvr > arg) { + goto booleanCheatTrueSistaV1; + } + else { + /* goto booleanCheatFalseSistaV1 */ + } + goto l1605; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatGreater:thanArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1607; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1607; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1607: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1610; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1610; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1610: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 > arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1605; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((3 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1605: /* end case */; + + booleanCheatFalseSistaV1: + /* booleanCheatFalseSistaV1 */ + { + sqInt bytecode; + sqInt offset; + + VM_LABEL(booleanCheatFalseSistaV1); + + /* assume next bytecode is jumpIfFalse (99%) */ + bytecode = byteAtPointer(++localIP); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + if ((bytecode < 199) + && (bytecode > 191)) { + + /* short jumpIfFalse */ + /* begin jump: */ + localIP = (localIP + (bytecode - 191)) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3224; + } + if (bytecode == 239) { + + /* long jumpIfFalse */ + offset = byteAtPointer(++localIP); + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + goto l3224; + } + currentBytecode = bytecode + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); + } + l3224: /* end case */; + break; + case 356: /*100*/ + /* bytecodePrimLessOrEqualSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimLessOrEqualSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheatSistaV1: */ + if (rcvr <= arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1611; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatLessOrEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1613; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1613; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1613: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1616; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1616; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1616: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 <= arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1611; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((4 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1611: /* end case */; + break; + case 357: /*101*/ + /* bytecodePrimGreaterOrEqualSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimGreaterOrEqualSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + + /* The C code can avoid detagging since tagged integers are still signed. + But this means the simulator must override to do detagging. */ + /* begin booleanCheatSistaV1: */ + if (rcvr >= arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1617; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatGreaterOrEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1619; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1619; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1619: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1622; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1622; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1622: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 >= arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1617; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((5 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1617: /* end case */; + break; + case 358: /*102*/ + /* bytecodePrimEqualSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimEqualSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + /* begin booleanCheatSistaV1: */ + if (rcvr == arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1623; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1625; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1625; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1625: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1628; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1628; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1628: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 == arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1623; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((6 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1623: /* end case */; + break; + case 359: /*103*/ + /* bytecodePrimNotEqualSistaV1 */ + { + sqInt aBool; + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + double result; + double result1; + + VM_LABEL(bytecodePrimNotEqualSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + /* begin booleanCheatSistaV1: */ + if (rcvr != arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1629; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin primitiveFloatEqual:toArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1631; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result); + rcvr1 = result; + goto l1631; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1631: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1634; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1634; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1634: /* end loadFloatOrIntFrom: */; + aBool = rcvr1 == arg1; + if (!GIV(primFailCode)) { + /* begin booleanCheatSistaV1: */ + if (!aBool) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + goto l1629; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((7 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1629: /* end case */; + break; + case 360: /*104*/ + /* bytecodePrimMultiply */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt oop; + int overflow; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimMultiply1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + overflow = (rcvr > 0 + ? (arg > 0 + ? rcvr > ((MaxSmallInteger) / arg) + : arg < ((MinSmallInteger) / rcvr)) + : (arg > 0 + ? rcvr < ((MinSmallInteger) / arg) + : (rcvr < 0) + && (arg < ((MaxSmallInteger) / rcvr)))); + if (!overflow) { + result = rcvr * arg; + oop = (((usqInt)result << 1) | 1); + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), oop); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1635; + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatMultiply:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1640; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1640; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1640: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1636; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1636; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1636: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1635; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((8 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1635: /* end case */; + break; + case 361: /*105*/ + /* bytecodePrimDivide */ + { + sqInt arg; + double arg1; + sqInt isFloat; + sqInt isFloat1; + sqInt objOop; + sqInt rcvr; + double rcvr1; + sqInt result; + double result1; + double result2; + char *sp; + + VM_LABEL(bytecodePrimDivide1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & arg) & 1) != 0) { + rcvr = (rcvr >> 1); + arg = (arg >> 1); + if ((arg != 0) + && ((rcvr % arg) == 0)) { + + /* generates C / operation */ + result = rcvr / arg; + if ((((sqInt)((((usqInt)result)) ^ ((((usqInt)result)) << 1)))) >= 0) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1642; + } + } + } + else { + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveFloatDivide:byArg: */ + if ((rcvr & 1)) { + rcvr1 = ((double) ((rcvr >> 1)) ); + goto l1647; + } + /* begin floatValueOf: */ + isFloat = ((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvr + BaseHeaderSize, result2); + rcvr1 = result2; + goto l1647; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr1 = 0.0; + l1647: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((arg & 1)) { + arg1 = ((double) ((arg >> 1)) ); + goto l1643; + } + /* begin floatValueOf: */ + isFloat1 = ((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(arg + BaseHeaderSize, result1); + arg1 = result1; + goto l1643; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg1 = 0.0; + l1643: /* end loadFloatOrIntFrom: */; + /* begin success: */ + if (!(arg1 != 0.0)) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 / arg1)); + GIV(stackPointer) = sp; + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1642; + } + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((9 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1642: /* end case */; + break; + case 362: /*106*/ + /* bytecodePrimMod */ + { + sqInt mod; + sqInt objOop; + + VM_LABEL(bytecodePrimMod1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + mod = doPrimitiveModby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop))); + if (!GIV(primFailCode)) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)mod << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1649; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((10 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1649: /* end case */; + break; + case 363: /*107*/ + /* bytecodePrimMakePoint */ + { + sqInt objOop; + + VM_LABEL(bytecodePrimMakePoint1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveMakePoint(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1653; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((11 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1653: /* end case */; + break; + case 364: /*108*/ + /* bytecodePrimBitShift */ + { + sqInt integerArgument; + sqInt integerReceiver; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt objOop; + sqInt shifted; + char *sp; + sqInt valueWord; + + VM_LABEL(bytecodePrimBitShift1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin primitiveBitShift */ + integerArgument = longAt(GIV(stackPointer)); + if (!((integerArgument & 1))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1661; + } + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + integerReceiver = positive32BitValueOf(integerReceiver); + + if (!GIV(primFailCode)) { + if (((integerArgument = (integerArgument >> 1))) >= 0) { + + /* Left shift -- must fail bits would be lost */ + if (!(integerArgument <= 0x1F)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1661; + } + shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); + if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1661; + } + } + else { + + /* Right shift -- OK to lose bits */ + if (!(integerArgument >= (-0x1F))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l1661; + } + shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); + } + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { + shifted = (((usqInt)shifted << 1) | 1); + goto l1665; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l1659; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; + l1659: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(shifted); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + shifted = newLargeInteger; + goto l1665; + + l1665: /* end positive32BitIntegerFor: */; + + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); + GIV(stackPointer) = sp; + } + l1661: /* end primitiveBitShift */; + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1657; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((12 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1657: /* end case */; + break; + case 365: /*109*/ + /* bytecodePrimDiv */ + { + sqInt objOop; + sqInt quotient; + + VM_LABEL(bytecodePrimDiv1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + quotient = doPrimitiveDivby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop))); + if (!GIV(primFailCode)) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)quotient << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1667; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((13 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1667: /* end case */; + break; + case 366: /*110*/ + /* bytecodePrimBitAnd */ + { + sqInt arg; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimBitAnd1); + arg = longAtPointer(localSP); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((arg & 1)) + && ((rcvr & 1))) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg & rcvr); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1671; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveBitAnd(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1671; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((14 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1671: /* end case */; + break; + case 367: /*111*/ + /* bytecodePrimBitOr */ + { + sqInt arg; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimBitOr1); + arg = longAtPointer(localSP); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + if (((arg & 1)) + && ((rcvr & 1))) { + /* begin internalPop:thenPush: */ + longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg | rcvr); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1676; + } + /* begin initPrimCall */ + GIV(primFailCode) = 0; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + primitiveBitOr(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1676; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((15 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 1; + goto normalSend; + } + l1676: /* end case */; + break; + case 370: /*114*/ + /* bytecodePrimSize */ + { + sqInt ccIndex; + sqInt ccIndex1; + sqInt classOop; + sqInt classOop1; + sqInt fmt; + sqInt fmt1; + sqInt isArray; + sqInt isString; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots2; + sqInt objOop; + sqInt rcvr; + sqInt sz; + + VM_LABEL(bytecodePrimSize1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + + /* Shortcut the mega-lookup for ByteString and Array, the two big consumers of cycles + here. Both of these have compact class indices and neither has any added fields. */ + rcvr = longAtPointer(localSP); + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isString = 0; + goto l1694; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isString = ClassByteStringCompactIndex == ccIndex; + goto l1694; + + l1694: /* end is:instanceOf:compactClassIndex: */; + if (isString) { + /* begin lengthOf:format: */ + fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + sz = numSlots; + goto l1696; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots << (shiftForWord())) - (fmt & 7); + goto l1696; + } + if (fmt >= (firstShortFormat())) { + sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l1696; + } + if (fmt >= (firstLongFormat())) { + sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l1696; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots) >> 1; + goto l1696; + } + sz = 0; + l1696: /* end lengthOf:format: */; + longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1685; + } + /* begin is:instanceOf:compactClassIndex: */ + classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isArray = 0; + goto l1697; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(rcvr)) & (classIndexMask()); + isArray = ClassArrayCompactIndex == ccIndex1; + goto l1697; + + l1697: /* end is:instanceOf:compactClassIndex: */; + if (isArray) { + /* begin lengthOf:format: */ + fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); + if (fmt1 <= 5) { + sz = numSlots2; + goto l1695; + } + if (fmt1 >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l1695; + } + if (fmt1 >= (firstShortFormat())) { + sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l1695; + } + if (fmt1 >= (firstLongFormat())) { + sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l1695; + } + if (fmt1 == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots2) >> 1; + goto l1695; + } + sz = 0; + l1695: /* end lengthOf:format: */; + longAtPointerput(localSP, (((usqInt)sz << 1) | 1)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1685; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((18 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1685: /* end case */; + break; + case 374: /*118*/ + /* bytecodePrimIdenticalSistaV1 */ + { + sqInt arg; + sqInt rcvr; + + VM_LABEL(bytecodePrimIdenticalSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP); + } + if (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP); + } + /* begin booleanCheatSistaV1: */ + if (rcvr == arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + } + break; + case 376: /*120*/ + /* bytecodePrimNotIdenticalSistaV1 */ + { + sqInt arg; + sqInt rcvr; + + VM_LABEL(bytecodePrimNotIdenticalSistaV1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + arg = longAtPointer(localSP + (0 * BytesPerOop)); + if (((rcvr & (tagMask())) == 0) + && (((longAt(rcvr)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP); + } + if (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP); + } + /* begin booleanCheatSistaV1: */ + if (rcvr != arg) { + goto booleanCheatTrueSistaV1; + } + else { + goto booleanCheatFalseSistaV1; + } + } + break; + case 377: /*121*/ + /* bytecodePrimValue */ + { + sqInt ccIndex; + sqInt classOop; + sqInt isBlock; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimValue1); + rcvr = longAtPointer(localSP); + GIV(argumentCount) = 0; + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isBlock = 0; + goto l1708; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isBlock = ClassBlockClosureCompactIndex == ccIndex; + goto l1708; + + l1708: /* end is:instanceOf:compactClassIndex: */; + if (isBlock) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin initPrimCall */ + GIV(primFailCode) = 0; + primitiveClosureValue(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1706; + } + GIV(primFailCode) = 0; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((25 * 2)) << (shiftForWord()))))); + goto normalSend; + } + l1706: /* end case */; + break; + case 378: /*122*/ + /* bytecodePrimValueWithArg */ + { + sqInt ccIndex; + sqInt classOop; + sqInt isBlock; + sqInt objOop; + sqInt rcvr; + + VM_LABEL(bytecodePrimValueWithArg1); + rcvr = longAtPointer(localSP + (1 * BytesPerOop)); + GIV(argumentCount) = 1; + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))); + if (rcvr & (tagMask())) { + isBlock = 0; + goto l1714; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(rcvr))); + /* begin classIndexOf: */ + ccIndex = (longAt(rcvr)) & (classIndexMask()); + isBlock = ClassBlockClosureCompactIndex == ccIndex; + goto l1714; + + l1714: /* end is:instanceOf:compactClassIndex: */; + if (isBlock) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin initPrimCall */ + GIV(primFailCode) = 0; + primitiveClosureValue(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (!GIV(primFailCode)) { + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1712; + } + GIV(primFailCode) = 0; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((26 * 2)) << (shiftForWord()))))); + goto normalSend; + } + l1712: /* end case */; + break; + case 382: /*126*/ + /* bytecodePrimPointX */ + { + sqInt classOop; + sqInt objOop; + sqInt ok; + sqInt rcvr; + + VM_LABEL(bytecodePrimPointX1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + rcvr = longAtPointer(localSP); + /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassPoint) << (shiftForWord()))))); + /* begin isNonImmediate: */ + ok = (rcvr & (tagMask())) == 0; + if (ok) { + /* begin isClassOfNonImm:equalTo: */ + assert(isNonImmediate(rcvr)); + ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); + } + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1724; + } + GIV(primFailCode) = 0; + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((30 * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1724: /* end case */; + break; + case 383: /*127*/ + /* bytecodePrimPointY */ + { + sqInt classOop; + sqInt objOop; + sqInt ok; + sqInt rcvr; + + VM_LABEL(bytecodePrimPointY1); + /* begin initPrimCall */ + GIV(primFailCode) = 0; + rcvr = longAtPointer(localSP); + /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassPoint) << (shiftForWord()))))); + /* begin isNonImmediate: */ + ok = (rcvr & (tagMask())) == 0; + if (ok) { + /* begin isClassOfNonImm:equalTo: */ + assert(isNonImmediate(rcvr)); + ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); + } + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin internalStackTopPut: */ + longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(YIndex) << (shiftForWord())))))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l1732; + } + GIV(primFailCode) = 0; + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))); + GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)((0x1F * 2)) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + } + l1732: /* end case */; + break; + case 440: /*184*/ + case 441: /*185*/ + case 442: /*186*/ + case 443: /*187*/ + case 444: /*188*/ + case 445: /*189*/ + case 446: /*190*/ + case 447: /*191*/ + /* shortConditionalJumpTrue */ + { + sqInt boolean; + sqInt offset; + + VM_LABEL(shortConditionalJumpTrue); + /* begin jumplfTrueBy: */ + offset = (currentBytecode & 7) + 1; + /* begin internalStackTop */ + boolean = longAtPointer(localSP); + if (boolean == GIV(trueObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(falseObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1748; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1748: /* end jumplfTrueBy: */; + } + break; + case 448: /*192*/ + case 449: /*193*/ + case 450: /*194*/ + case 451: /*195*/ + case 452: /*196*/ + case 453: /*197*/ + case 454: /*198*/ + case 455: /*199*/ + /* shortConditionalJumpFalse */ + { + sqInt boolean; + sqInt offset; + + VM_LABEL(shortConditionalJumpFalse1); + /* begin jumplfFalseBy: */ + offset = (currentBytecode & 7) + 1; + /* begin internalStackTop */ + boolean = longAtPointer(localSP); + if (boolean == GIV(falseObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(trueObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1752; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1752: /* end jumplfFalseBy: */; + } + break; + case 456: /*200*/ + case 457: /*201*/ + case 458: /*202*/ + case 459: /*203*/ + case 460: /*204*/ + case 461: /*205*/ + case 462: /*206*/ + case 463: /*207*/ + /* storeAndPopReceiverVariableBytecode */ + { + sqInt instVarIndex; + sqInt rcvr; + sqInt top; + + VM_LABEL(storeAndPopReceiverVariableBytecode1); + /* begin receiver */ + rcvr = longAt(localFP + FoxIFReceiver); + /* begin internalStackTop */ + top = longAtPointer(localSP); + instVarIndex = currentBytecode & 7; + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(rcvr)))); + if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), rcvr); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), top); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(instVarIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l1754; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(rcvr))); + if ((assert(isNonImmediate(rcvr)), + oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((top & (tagMask())) == 0) + && (oopisLessThan(top, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) { + remember(rcvr); + } + } + } + longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top); + l1754: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 473: /*217*/ + /* unconditionnalTrapBytecode */ + { + VM_LABEL(unconditionnalTrapBytecode); + + respondToSistaTrap: + /* respondToSistaTrap */ + { + sqInt ourContext; + char *theFP; + char *theSP; + + VM_LABEL(respondToSistaTrap); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorSistaTrap) << (shiftForWord()))))); + /* begin ensureFrameIsMarried:SP: */ + theFP = localFP; + theSP = localSP; + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + ourContext = longAt(theFP + FoxThisContext); + goto l3226; + } + ourContext = marryFrameSP(theFP, theSP); + l3226: /* end ensureFrameIsMarried:SP: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), ourContext); + GIV(argumentCount) = 0; + goto normalSend; + } + goto l1762; + + } + l1762: /* end case */; + break; + case 480: /*224*/ + /* extABytecode */ + { + VM_LABEL(extABytecode); + extA = (((usqInt) extA << 8)) + (byteAtPointer(++localIP)); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 481: /*225*/ + /* extBBytecode */ + { + sqInt byte; + + VM_LABEL(extBBytecode); + byte = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + extB = ((numExtB == 0) + && (byte > 0x7F) + ? byte - 256 + : (((usqInt) extB << 8)) + byte); + numExtB += 1; + } + break; + case 482: /*226*/ + /* extPushReceiverVariableBytecode */ + { + sqInt callerContextOrNil; + char *callerFP; + sqInt index; + sqInt obj; + sqInt object; + sqInt object1; + sqInt result; + sqInt senderOop; + char *spouseFP; + StackPage *thePage; + sqInt value; + + VM_LABEL(extPushReceiverVariableBytecode); + index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + extA = 0; + /* begin pushMaybeContextReceiverVariable: */ + obj = longAt(localFP + FoxIFReceiver); + if ((index <= StackPointerIndex) + && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + /* begin internalPush: */ + assert(index < MethodIndex); + assert(isContext(obj)); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!(((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + value = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if ((index == InstructionPointerIndex) + && (((value & 1)) + && ((((int) value)) < 0))) { + /* begin internalMustMapMachineCodePC:context: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + result = mustMapMachineCodePCcontext((value >> 1), obj); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + value = result; + } + object = value; + goto l1765; + } + if (isWidowedContext(obj)) { + object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + goto l1765; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + spouseFP = pointerForOop(senderOop - 1); + + if (index == SenderIndex) { + /* begin ensureCallerContext: */ + callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP)); + if (callerFP == 0) { + + /* base frame, context in saved ip slot (or base of stack in Cog) */ + /* begin frameCallerContext: */ + assert(isBaseFrame(spouseFP)); + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + object = callerContextOrNil; + goto l1765; + } + /* begin ensureFrameIsMarried:SP: */ + if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(callerFP))); + object = longAt(callerFP + FoxThisContext); + goto l1765; + } + object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); + goto l1765; + } + if (index == StackPointerIndex) { + assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj))); + object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l1765; + } + if (index == InstructionPointerIndex) { + object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l1765; + } + error("bad index"); + object = 0; + l1765: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object); + } + else { + /* begin internalPush: */ + object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object1); + } + } + break; + case 483: /*227*/ + /* extPushLiteralVariableBytecode */ + { + sqInt index; + sqInt litVar; + sqInt object; + + VM_LABEL(extPushLiteralVariableBytecode); + index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + extA = 0; + /* begin pushLiteralVariable: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((index + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + litVar = unfollowatIndex(litVar, index); + } + /* begin internalPush: */ + object = longAt((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object); + + } + break; + case 484: /*228*/ + /* extPushLiteralBytecode */ + { + sqInt index; + sqInt object; + + VM_LABEL(extPushLiteralBytecode); + index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + extA = 0; + /* begin pushLiteralConstant: */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((index + LiteralStart)) << (shiftForWord()))))); + + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 485: /*229*/ + /* longPushTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt index; + sqInt object; + + VM_LABEL(longPushTemporaryVariableBytecode); + index = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord))); + longAtPointerput((localSP -= BytesPerOop), object); + } + break; + case 487: /*231*/ + /* pushNewArrayBytecode */ + { + sqInt array; + sqInt i; + usqInt newObj; + usqInt numBytes; + int popValues; + sqInt size; + sqInt valuePointer; + sqInt valuePointer1; + + VM_LABEL(pushNewArrayBytecode1); + /* begin fetchByte */ + size = byteAtPointer(++localIP); + popValues = size > 0x7F; + size = size & 0x7F; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + assert((size >= 0) + && (ClassArrayCompactIndex != 0)); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(size < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((size <= 1 + ? 8 + : (size + (size & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + array = 0; + goto l1778; + } + } + long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex); + GIV(freeStart) += numBytes; + array = newObj; + l1778: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + if (popValues) { + for (i = 0; i < size; i += 1) { + + /* Assume: have just allocated a new Array; it must be young. Thus, can use unchecked stores. */ + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = longAtPointer(localSP + (((size - i) - 1) * BytesPerOop)); + assert(!(isOopForwarded(array))); + longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + /* begin internalPop: */ + localSP += size * BytesPerOop; + } + else { + for (i = 0; i < size; i += 1) { + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer1 = GIV(nilObj); + assert(!(isOopForwarded(array))); + longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer1); + } + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), array); + } + break; + case 488: /*232*/ + /* extPushIntegerBytecode */ + { + sqInt value; + + VM_LABEL(extPushIntegerBytecode); + value = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + extB = 0; + numExtB = 0; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 1) | 1)); + } + break; + case 489: /*233*/ + /* extPushCharacterBytecode */ + { + sqInt object; + sqInt value; + + VM_LABEL(extPushCharacterBytecode); + value = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + object = (((sqInt)((usqInt)(value) << (numTagBits())))) + (characterTag()); + longAtPointerput((localSP -= BytesPerOop), object); + numExtB = (extB = 0); + } + break; + case 490: /*234*/ + /* extSendBytecode */ + { + sqInt byte; + sqInt rcvr; + sqInt tagBits; + + VM_LABEL(extSendBytecode); + byte = byteAtPointer(++localIP); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin literal:ofMethod: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((((((usqInt) byte) >> 3) + (((sqInt)((usqInt)(extA) << 5)))) + LiteralStart)) << (shiftForWord()))))); + + extA = 0; + GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(rcvr)) & (classIndexMask())); + goto commonSendOrdinary; + } + break; + case 491: /*235*/ + /* extSendSuperBytecode */ + { + sqInt byte; + + VM_LABEL(extSendSuperBytecode); + byte = byteAtPointer(++localIP); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin literal:ofMethod: */ + GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((((((usqInt) byte) >> 3) + (((sqInt)((usqInt)(extA) << 5)))) + LiteralStart)) << (shiftForWord()))))); + + extA = 0; + if (extB >= 64) { + GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)((extB - 64)) << 3))); + extB = 0; + /* goto directedSuperclassSend */ + goto l1787; + } + + GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3))); + extB = 0; + numExtB = 0; + goto superclassSend; + } + l1787: /* end case */; + + directedSuperclassSend: + /* directedSuperclassSend */ + { + sqInt aValue; + sqInt class; + sqInt err; + sqInt hash; + sqInt objOop; + sqInt objOop1; + sqInt referent; + sqInt referent1; + sqInt superclass; + sqInt top; + + VM_LABEL(directedSuperclassSend); + /* begin internalPopStack */ + top = longAt(localSP); + localSP += BytesPerOop; + class = top; + if (((longAt(class)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(class)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((class + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + class = referent; + } + /* begin followField:ofObject: */ + objOop = longAt((class + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, class, objOop); + } + superclass = objOop; + + /* To maintain the invariant that all receivers are unforwarded we need an explicit + read barrier in the super send cases. Even though we always follow receivers + on become e.g. super doSomethingWith: (self become: other) forwards the receiver + self pushed on the stack. */ + assert(addressCouldBeClassObj(superclass)); + lkupClassTag = (((hash = (long32At(superclass + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(superclass) + ? (((err = enterIntoClassTable(superclass))) != 0 + ? -err + : (/* begin rawHashBitsOf: */ + (long32At(superclass + 4)) & (identityHashHalfWordMask()))) + : -PrimErrBadReceiver)); + + /* begin ensureReceiverUnforwarded */ + if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & (tagMask())) == 0) + && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin internalStackValue:put: */ + objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)); + assert(isUnambiguouslyForwarder(objOop1)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + } + aValue = referent1; + longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue); + } + assert(lkupClassTag != (nilObject())); + goto commonSendOrdinary; + } + break; + case 493: /*237*/ + /* extUnconditionalJump */ + { + sqInt backwardJumpCountByte; + sqInt byte; + sqInt offset; + sqInt switched; + + VM_LABEL(extUnconditionalJump); + byte = byteAtPointer(++localIP); + offset = byte + (((sqInt)((usqInt)(extB) << 8))); + extB = 0; + numExtB = 0; + localIP += offset; + /* begin ifBackwardsCheckForEvents: */ + if (offset >= 0) { + goto l1790; + } + if (localSP < GIV(stackLimit)) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + switched = checkForEventsMayContextSwitch(1); + returnToExecutivepostContextSwitch(1, switched); + browserPluginReturnIfNeeded(); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + if (switched) { + goto l1790; + } + } + backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN + ? (FoxIFrameFlags + BytesPerWord) - 1 + : FoxIFrameFlags))); + if (((backwardJumpCountByte -= 2)) == 1) { + if (methodWithHeaderShouldBeCogged(methodHeaderOf(GIV(method)))) { + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1); + } + backwardJumpCountByte = 0x7F; + } + else { + if (backwardJumpCountByte == -1) { + + /* initialize the count */ + assert(minBackwardJumpCountForCompile <= 128); + backwardJumpCountByte = (((sqInt)((usqInt)((minBackwardJumpCountForCompile - 1)) << 1))) + 1; + } + } + /* begin iframeBackwardBranchByte:put: */ + byteAtput(localFP + ((VMBIGENDIAN + ? (FoxIFrameFlags + BytesPerWord) - 1 + : FoxIFrameFlags)), backwardJumpCountByte); + l1790: /* end ifBackwardsCheckForEvents: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 494: /*238*/ + /* extJumpIfTrue */ + { + sqInt boolean; + sqInt byte; + sqInt offset; + + VM_LABEL(extJumpIfTrue); + byte = byteAtPointer(++localIP); + offset = byte + (((sqInt)((usqInt)(extB) << 8))); + numExtB = (extB = (extA = 0)); + /* begin jumplfTrueBy: */ + boolean = longAtPointer(localSP); + if (boolean == GIV(trueObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(falseObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1793; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1793: /* end jumplfTrueBy: */; + } + break; + case 495: /*239*/ + /* extJumpIfFalse */ + { + sqInt boolean; + sqInt byte; + sqInt offset; + + VM_LABEL(extJumpIfFalse); + byte = byteAtPointer(++localIP); + offset = byte + (((sqInt)((usqInt)(extB) << 8))); + numExtB = (extB = (extA = 0)); + /* begin jumplfFalseBy: */ + boolean = longAtPointer(localSP); + if (boolean == GIV(falseObj)) { + /* begin jump: */ + localIP = (localIP + offset) + 1; + currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector); + + } + else { + if (!(boolean == GIV(trueObj))) { + /* begin internalMustBeBoolean */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))); + GIV(argumentCount) = 0; + goto normalSend; + goto l1797; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + l1797: /* end jumplfFalseBy: */; + } + break; + case 496: /*240*/ + /* extSistaStoreAndPopReceiverVariableBytecode */ + { + sqInt obj; + int onCurrentPage; + sqInt senderOop; + char * theFP; + StackPage * thePage; + sqInt value; + sqInt variableIndex; + + VM_LABEL(extSistaStoreAndPopReceiverVariableBytecode); + variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + value = longAtPointer(localSP); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin storeMaybeContextReceiverVariable:withValue: */ + obj = longAt(localFP + FoxIFReceiver); + if ((variableIndex <= ReceiverIndex) + && ((((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + /* begin instVar:ofContext:put: */ + assert(isMarriedOrWidowedContext(obj)); + assert(!((isObjImmutable(obj)))); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!((((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(obj))))) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); + if (variableIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); + } + goto l1805; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if (variableIndex == SenderIndex) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + onCurrentPage = thePage == GIV(stackPage); + storeSenderOfFramewithValue(theFP, value); + if (onCurrentPage) { + localFP = (GIV(stackPage)->headFP); + localSP = (GIV(stackPage)->headSP); + } + else { + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + goto l1805; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + externalDivorceFrameandContext(theFP, obj); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); + if (variableIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + markStackPageMostRecentlyUsed(GIV(stackPage)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); + l1805: /* end instVar:ofContext:put: */; + } + else { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(obj)))); + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), obj); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l1807; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value); + l1807: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 497: /*241*/ + /* extSistaStoreAndPopLiteralVariableBytecode */ + { + sqInt litVar; + sqInt referent; + sqInt value; + sqInt variableIndex; + + VM_LABEL(extSistaStoreAndPopLiteralVariableBytecode); + variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + value = longAtPointer(localSP); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + extA = (numExtB = (extB = 0)); + /* begin storeLiteralVariable:withValue: */ + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(litVar)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((litVar + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + litVar = referent; + } + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(litVar)))); + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), value); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l1808; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(litVar))); + if ((assert(isNonImmediate(litVar)), + oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) { + remember(litVar); + } + } + } + longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), value); + l1808: /* end storeLiteralVariable:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 498: /*242*/ + /* longStoreAndPopTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt index; + + VM_LABEL(longStoreAndPopTemporaryVariableBytecode); + /* begin longStoreTemporaryVariableBytecode */ + index = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 499: /*243*/ + /* extSistaStoreReceiverVariableBytecode */ + { + sqInt anObject; + sqInt obj; + int onCurrentPage; + sqInt senderOop; + char * theFP; + StackPage * thePage; + sqInt variableIndex; + + VM_LABEL(extSistaStoreReceiverVariableBytecode); + variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + /* begin storeMaybeContextReceiverVariable:withValue: */ + anObject = longAtPointer(localSP); + /* begin storeMaybeContext:receiverVariable:withValue: */ + obj = longAt(localFP + FoxIFReceiver); + if ((variableIndex <= ReceiverIndex) + && ((((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + /* begin instVar:ofContext:put: */ + assert(isMarriedOrWidowedContext(obj)); + assert(!((isObjImmutable(obj)))); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!((((longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(obj))))) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anObject & (tagMask())) == 0) + && (oopisLessThan(anObject, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); + if (variableIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); + } + goto l1823; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((obj + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if (variableIndex == SenderIndex) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + onCurrentPage = thePage == GIV(stackPage); + storeSenderOfFramewithValue(theFP, anObject); + if (onCurrentPage) { + localFP = (GIV(stackPage)->headFP); + localSP = (GIV(stackPage)->headSP); + } + else { + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + goto l1823; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + externalDivorceFrameandContext(theFP, obj); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anObject & (tagMask())) == 0) + && (oopisLessThan(anObject, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); + if (variableIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(obj); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + markStackPageMostRecentlyUsed(GIV(stackPage)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); + l1823: /* end instVar:ofContext:put: */; + } + else { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(obj)))); + if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), obj); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anObject); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l1825; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(obj))); + if ((assert(isNonImmediate(obj)), + oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anObject & (tagMask())) == 0) + && (oopisLessThan(anObject, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) { + remember(obj); + } + } + } + longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject); + l1825: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 500: /*244*/ + /* extSistaStoreLiteralVariableBytecode */ + { + sqInt anObject; + sqInt litVar; + sqInt referent; + sqInt variableIndex; + + VM_LABEL(extSistaStoreLiteralVariableBytecode); + variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + extA = (numExtB = (extB = 0)); + /* begin storeLiteralVariable:withValue: */ + anObject = longAtPointer(localSP); + + /* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field. + The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in + all methods in the stack zone, and the entire method on return, and global variables are relatively + rare; in my work image 8.7% of literals are globals). */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord()))))); + + if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(litVar)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((litVar + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + litVar = referent; + } + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(litVar)))); + if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), litVar); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anObject); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l1826; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(litVar))); + if ((assert(isNonImmediate(litVar)), + oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anObject & (tagMask())) == 0) + && (oopisLessThan(anObject, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) { + remember(litVar); + } + } + } + longAtput((litVar + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord())))), anObject); + l1826: /* end storeLiteralVariable:withValue: */; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + break; + case 501: /*245*/ + /* longStoreTemporaryVariableBytecode */ + { + sqInt frameNumArgs; + sqInt index; + + VM_LABEL(longStoreTemporaryVariableBytecode); + index = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin itemporary:in:put: */ + if (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP)); + } + } + break; + case 504: /*248*/ + /* callPrimitiveBytecode */ + { + sqInt alignment; + sqInt arg; + float argumentValue; + double argumentValue1; + sqInt aValue; + sqInt aValue1; + char*base; + char*base1; + char*base11; + char*base2; + char*base3; + sqInt baseOffset; + sqInt baseOffset1; + sqInt baseOffset10; + sqInt baseOffset11; + sqInt baseOffset110; + sqInt baseOffset12; + sqInt baseOffset13; + sqInt baseOffset14; + sqInt baseOffset15; + sqInt baseOffset16; + sqInt baseOffset17; + sqInt baseOffset18; + sqInt baseOffset19; + sqInt baseOffset2; + sqInt baseOffset20; + sqInt baseOffset21; + sqInt baseOffset22; + sqInt baseOffset23; + sqInt baseOffset24; + sqInt baseOffset25; + sqInt baseOffset3; + sqInt baseOffset31; + sqInt baseOffset4; + sqInt baseOffset41; + sqInt baseOffset5; + sqInt baseOffset51; + sqInt baseOffset6; + sqInt baseOffset7; + sqInt baseOffset8; + sqInt baseOffset9; + sqInt bool; + sqInt bool1; + sqInt bool2; + sqInt bool3; + sqInt bool4; + sqInt bool5; + sqInt byte1; + sqInt byte2; + sqInt byteIndex; + sqInt byteIndex1; + usqIntptr_t calloutStateSize; + usqIntptr_t calloutStateSize1; + usqIntptr_t calloutStateSize10; + usqIntptr_t calloutStateSize11; + usqIntptr_t calloutStateSize12; + usqIntptr_t calloutStateSize13; + usqIntptr_t calloutStateSize14; + usqIntptr_t calloutStateSize2; + usqIntptr_t calloutStateSize3; + usqIntptr_t calloutStateSize4; + usqIntptr_t calloutStateSize5; + usqIntptr_t calloutStateSize6; + usqIntptr_t calloutStateSize7; + usqIntptr_t calloutStateSize8; + usqIntptr_t calloutStateSize9; + char*check; + sqInt classObj; + sqInt classOop; + sqInt classOop1; + sqInt classOop2; + sqInt code; + sqInt constant; + sqInt constant1; + char*dest; + char*dest1; + char*dest2; + double doubleResult; + double doubleValue; + double doubleValue1; + double doubleValue2; + float dup1; + double dup11; + sqInt dup12; + sqLong dup13; + char*dup14; + float dup2; + double dup21; + sqInt dup22; + sqLong dup23; + char*dup24; + sqInt expectedSession; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt fieldIndex11; + sqInt fieldIndex12; + sqInt fieldIndex2; + sqInt fieldIndex3; + sqInt fieldIndex4; + sqInt fieldValue; + sqInt fieldValue1; + sqInt first; + sqInt first1; + float first10; + sqLong first101; + sqLong first102; + float first11; + sqLong first110; + sqLong first111; + sqLong first112; + sqInt first113; + sqLong first114; + float first12; + sqLong first121; + float first13; + sqLong first131; + float first14; + sqInt first141; + float first15; + sqLong first151; + double first16; + sqLong first161; + double first17; + sqInt first171; + double first18; + sqInt first181; + double first19; + sqLong first191; + sqInt first2; + double first20; + sqInt first201; + double first21; + sqInt first211; + double first22; + sqInt first221; + double first23; + sqInt first231; + double first24; + double first25; + sqInt first26; + sqInt first27; + sqInt first28; + sqLong first3; + sqLong first31; + sqLong first32; + sqLong first33; + sqInt first34; + sqInt first4; + sqInt first41; + char*first42; + sqInt first43; + sqLong first5; + sqLong first51; + char*first52; + sqInt first53; + float first6; + sqInt first61; + sqLong first62; + float first7; + sqInt first71; + sqLong first72; + float first8; + sqInt first81; + sqLong first82; + float first9; + sqInt first91; + sqLong first92; + double floatValue; + double floatValue1; + double floatValue2; + double floatValue3; + double floatValue4; + float floatValue5; + float floatValue6; + float floatValue7; + double floatValue8; + sqInt fmt; + sqInt fmt1; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt function; + sqInt function1; + sqInt function10; + sqInt function11; + sqInt function12; + sqInt function13; + sqInt function14; + char*function2; + char*function3; + char*function4; + char*function5; + char*function6; + char*function7; + char*function8; + sqInt function9; + sqInt hash; + sqInt header; + sqInt header1; + sqInt i; + sqInt index; + sqLong index1; + sqInt indexableSize; + sqInt indexableSize1; + char*initialShadowCallStackPointer; + char*initialShadowCallStackPointer1; + char*initialShadowCallStackPointer10; + char*initialShadowCallStackPointer11; + char*initialShadowCallStackPointer12; + char*initialShadowCallStackPointer13; + char*initialShadowCallStackPointer2; + char*initialShadowCallStackPointer3; + char*initialShadowCallStackPointer4; + char*initialShadowCallStackPointer5; + char*initialShadowCallStackPointer6; + char*initialShadowCallStackPointer7; + char*initialShadowCallStackPointer8; + char*initialShadowCallStackPointer9; + sqInt int32Result; + sqLong int64Result; + sqInt int64Result1; + sqLong int64Result2; + sqInt isFloat; + sqInt isFloat1; + sqInt knownClassIndex; + sqInt longIndex; + sqInt longIndex1; + char*memoryPointer; + sqInt newLargeInteger; + usqInt newObj; + usqInt newObj1; + sqInt newValue; + usqInt numBytes; + usqInt numBytes1; + usqInt numBytes2; + usqInt numBytes3; + sqInt numSlots; + usqInt numSlots1; + usqInt numSlots2; + usqInt numSlots3; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object10; + sqInt object101; + sqInt object11; + sqInt object110; + sqInt object111; + sqInt object12; + sqInt object121; + sqInt object13; + sqInt object131; + sqInt object14; + sqInt object141; + sqInt object15; + sqInt object16; + sqInt object17; + sqInt object18; + sqInt object19; + sqInt object2; + sqInt object20; + sqInt object21; + sqInt object211; + sqInt object22; + sqInt object23; + sqInt object24; + sqInt object25; + sqInt object3; + sqInt object31; + sqInt object32; + sqInt object4; + sqInt object41; + sqInt object42; + sqInt object5; + sqInt object51; + sqInt object6; + sqInt object61; + sqInt object7; + sqInt object71; + sqInt object8; + sqInt object81; + sqInt object9; + sqInt object91; + sqInt objFormat; + sqInt objFormat1; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop12; + sqInt objOop2; + sqInt objOop21; + sqInt objOop22; + sqInt objOop3; + sqInt objOop31; + sqInt objOop4; + sqInt objOop41; + sqInt objOop5; + sqInt offset; + sqLong offset1; + sqInt offset11; + sqLong offset2; + sqInt offset3; + sqInt offset4; + sqInt oldValue; + sqInt oop; + sqInt oop1; + sqInt oop2; + char*pointer; + char*pointer1; + char*pointer10; + char*pointer11; + char*pointer12; + char*pointer13; + char*pointer14; + char*pointer15; + char*pointer16; + char*pointer17; + char*pointer18; + char*pointer2; + char*pointer21; + char*pointer22; + char*pointer23; + char*pointer3; + char*pointer31; + char*pointer32; + char*pointer33; + char*pointer4; + char*pointer41; + char*pointer42; + char*pointer5; + char*pointer51; + char*pointer52; + char*pointer6; + char*pointer61; + char*pointer7; + char*pointer71; + char*pointer8; + char*pointer81; + char*pointer9; + sqInt pointerClassLiteral; + char*pointerResult; + char*pointerResult1; + char*pointerResult2; + char*pointerValue; + char*pointerValue1; + char*pointerValue11; + char*pointerValue12; + char*pointerValue2; + char*pointerValue3; + char*pointerValue4; + sqInt popSize; + sqInt prim; + sqInt primSet; + sqInt rcvr; + sqInt registerID; + sqInt registerID1; + sqInt registerID11; + sqInt registerID2; + sqInt registerID21; + sqInt registerID3; + sqInt registerID31; + sqInt registerID4; + sqInt registerID41; + sqInt registerID5; + sqInt registerID6; + sqInt result; + sqInt result1; + float result10; + sqInt result101; + char*result102; + float result11; + sqLong result110; + sqInt result111; + double result112; + sqLong result113; + sqInt result114; + double result115; + sqLong result116; + double result117; + float result12; + sqLong result121; + sqLong result122; + float result13; + sqLong result131; + sqInt result132; + float result14; + sqLong result141; + sqLong result142; + float result15; + sqInt result151; + char*result152; + sqInt result16; + sqLong result161; + sqInt result162; + sqLong result17; + sqInt result171; + sqLong result172; + sqInt result18; + sqInt result181; + float result182; + sqLong result19; + sqInt result191; + double result192; + usqInt result2; + double result20; + sqInt result201; + float result202; + double result21; + sqInt result210; + sqInt result211; + sqInt result212; + sqInt result213; + double result214; + char*result215; + sqInt result216; + double result22; + sqInt result221; + sqInt result222; + double result23; + sqLong result231; + sqLong result232; + double result24; + float result241; + char*result242; + double result25; + double result251; + char*result252; + sqInt result26; + float result261; + sqLong result27; + double result271; + char*result28; + sqInt result281; + char*result29; + sqLong result291; + sqLong result3; + sqInt result30; + sqLong result31; + float result32; + sqLong result33; + sqLong result34; + sqInt result35; + double result36; + float result37; + sqInt result38; + double result39; + sqInt result4; + sqInt result41; + float result42; + sqInt result43; + double result44; + sqLong result5; + sqInt result51; + double result52; + sqLong result53; + char*result54; + sqInt result6; + sqLong result61; + sqInt result62; + sqInt result63; + sqLong result64; + sqInt result641; + sqLong result7; + sqLong result71; + sqLong result72; + sqLong result73; + sqLong result74; + char*result8; + sqLong result81; + sqInt result82; + char*result83; + char*result9; + sqLong result91; + char*result92; + char*resultPointer; + char*resultPointer1; + sqInt scale; + sqLong scale1; + sqInt second; + sqInt second1; + float second10; + sqLong second101; + sqLong second102; + float second11; + sqLong second110; + sqLong second111; + sqInt second112; + sqLong second113; + sqLong second114; + float second12; + sqLong second121; + float second13; + sqLong second131; + float second14; + sqInt second141; + float second15; + sqLong second151; + double second16; + sqInt second161; + double second17; + sqLong second171; + double second18; + sqInt second181; + double second19; + sqLong second191; + sqInt second2; + double second20; + sqInt second201; + double second21; + sqInt second211; + double second22; + sqInt second221; + double second23; + sqInt second231; + double second24; + double second25; + sqInt second26; + sqInt second27; + sqInt second28; + sqLong second3; + sqLong second31; + sqLong second32; + sqLong second33; + sqInt second34; + sqInt second4; + sqInt second41; + char*second42; + sqInt second43; + sqLong second5; + sqLong second51; + char*second52; + sqInt second53; + float second6; + sqInt second61; + sqLong second62; + float second7; + sqInt second71; + sqLong second72; + float second8; + sqInt second81; + sqLong second82; + float second9; + sqInt second91; + sqLong second92; + sqInt shiftAmount; + sqLong shiftAmount1; + sqLong shiftAmount11; + sqLong shiftAmount12; + sqInt shiftAmount2; + sqInt shiftAmount3; + sqInt shortIndex; + sqInt shortIndex1; + float singleFloatResult; + float singleFloatValue; + float singleFloatValue1; + sqInt size; + sqLong size1; + sqLong size11; + sqInt size2; + sqLong size3; + sqInt size4; + sqInt size5; + sqInt size6; + char*source; + char*source1; + char*source2; + sqInt spaceSize; + char*structurePointer; + sqInt structureSize; + sqInt structureSize1; + sqInt structureSize2; + sqInt tagBits; + sqInt top; + sqInt top1; + sqInt top10; + sqInt top11; + sqInt top110; + sqInt top111; + sqInt top12; + sqInt top121; + sqInt top13; + sqInt top131; + sqInt top14; + sqInt top141; + sqInt top15; + sqInt top16; + sqInt top17; + sqInt top18; + sqInt top19; + sqInt top2; + sqInt top20; + sqInt top21; + sqInt top211; + sqInt top22; + sqInt top23; + sqInt top24; + sqInt top25; + sqInt top3; + sqInt top31; + sqInt top32; + sqInt top4; + sqInt top41; + sqInt top42; + sqInt top5; + sqInt top51; + sqInt top6; + sqInt top7; + sqInt top8; + sqInt top9; + double topDouble; + double topDouble1; + double topDouble10; + double topDouble11; + double topDouble110; + double topDouble111; + double topDouble112; + double topDouble12; + double topDouble121; + double topDouble13; + double topDouble14; + double topDouble15; + double topDouble16; + double topDouble17; + double topDouble18; + double topDouble19; + double topDouble2; + double topDouble20; + double topDouble21; + double topDouble211; + double topDouble22; + double topDouble23; + double topDouble24; + double topDouble25; + double topDouble3; + double topDouble31; + double topDouble4; + double topDouble41; + double topDouble5; + double topDouble51; + double topDouble6; + double topDouble7; + double topDouble8; + double topDouble9; + sqInt topInt32; + sqInt topInt321; + sqInt topInt3210; + sqInt topInt32101; + sqInt topInt3211; + sqInt topInt32110; + sqInt topInt32111; + sqInt topInt321110; + sqInt topInt321111; + sqInt topInt32112; + sqInt topInt32113; + sqInt topInt32114; + sqInt topInt32115; + sqInt topInt32116; + sqInt topInt32117; + sqInt topInt32118; + sqInt topInt32119; + sqInt topInt3212; + sqInt topInt32120; + sqInt topInt32121; + sqInt topInt32122; + sqInt topInt32123; + sqInt topInt32124; + sqInt topInt3213; + sqInt topInt32131; + sqInt topInt32132; + sqInt topInt3214; + sqInt topInt32141; + sqInt topInt32142; + sqInt topInt3215; + sqInt topInt32151; + sqInt topInt32152; + sqInt topInt3216; + sqInt topInt32161; + sqInt topInt3217; + sqInt topInt32171; + sqInt topInt3218; + sqInt topInt32181; + sqInt topInt3219; + sqInt topInt322; + sqInt topInt3220; + sqInt topInt3221; + sqInt topInt32210; + sqInt topInt32211; + sqInt topInt32212; + sqInt topInt32213; + sqInt topInt3222; + sqInt topInt3223; + sqInt topInt3224; + sqInt topInt3225; + sqInt topInt3226; + sqInt topInt3227; + sqInt topInt3228; + sqInt topInt3229; + sqInt topInt323; + sqInt topInt3230; + sqInt topInt3231; + sqInt topInt3232; + sqInt topInt3233; + sqInt topInt3234; + sqInt topInt3235; + sqInt topInt3236; + sqInt topInt3237; + sqInt topInt324; + sqInt topInt3241; + sqInt topInt3242; + sqInt topInt3243; + sqInt topInt3244; + sqInt topInt3245; + sqInt topInt325; + sqInt topInt3251; + sqInt topInt3252; + sqInt topInt3253; + sqInt topInt3254; + sqInt topInt326; + sqInt topInt3261; + sqInt topInt3262; + sqInt topInt3263; + sqInt topInt327; + sqInt topInt3271; + sqInt topInt3272; + sqInt topInt3273; + sqInt topInt328; + sqInt topInt3281; + sqInt topInt3282; + sqInt topInt3283; + sqInt topInt329; + sqInt topInt3291; + sqInt topInt3292; + sqLong topInt64; + sqLong topInt641; + sqLong topInt6410; + sqLong topInt64101; + sqLong topInt6411; + sqLong topInt64110; + sqLong topInt64111; + sqLong topInt64112; + sqLong topInt64113; + sqLong topInt64114; + sqLong topInt64115; + sqLong topInt64116; + sqLong topInt64117; + sqLong topInt64118; + sqLong topInt64119; + sqLong topInt6412; + sqLong topInt64120; + sqLong topInt64121; + sqLong topInt64122; + sqLong topInt64123; + sqLong topInt64124; + sqLong topInt6413; + sqLong topInt64131; + sqLong topInt64132; + sqLong topInt6414; + sqLong topInt64141; + sqLong topInt64142; + sqLong topInt6415; + sqLong topInt64151; + sqLong topInt6416; + sqLong topInt64161; + sqLong topInt6417; + sqLong topInt6418; + sqLong topInt6419; + sqLong topInt642; + sqLong topInt6420; + sqLong topInt6421; + sqLong topInt64210; + sqLong topInt64211; + sqLong topInt64212; + sqLong topInt6422; + sqLong topInt6423; + sqLong topInt6424; + sqLong topInt6425; + sqLong topInt6426; + sqLong topInt6427; + sqLong topInt6428; + sqLong topInt6429; + sqLong topInt643; + sqLong topInt6430; + sqLong topInt6431; + sqLong topInt6432; + sqLong topInt6433; + sqLong topInt6434; + sqLong topInt6435; + sqLong topInt644; + sqLong topInt6441; + sqLong topInt6442; + sqLong topInt6443; + sqLong topInt6444; + sqLong topInt645; + sqLong topInt6451; + sqLong topInt6452; + sqLong topInt6453; + sqLong topInt646; + sqLong topInt6462; + sqLong topInt6463; + sqLong topInt647; + sqLong topInt6471; + sqLong topInt6472; + sqLong topInt6473; + sqLong topInt648; + sqLong topInt6481; + sqLong topInt6482; + sqLong topInt6483; + sqLong topInt649; + sqLong topInt6491; + char*topPointer; + char*topPointer1; + char*topPointer10; + char*topPointer11; + char*topPointer110; + char*topPointer111; + char*topPointer112; + char*topPointer113; + char*topPointer114; + char*topPointer115; + char*topPointer12; + char*topPointer13; + char*topPointer14; + char*topPointer15; + char*topPointer16; + char*topPointer17; + char*topPointer18; + char*topPointer19; + char*topPointer2; + char*topPointer20; + char*topPointer21; + char*topPointer210; + char*topPointer211; + char*topPointer212; + char*topPointer22; + char*topPointer23; + char*topPointer24; + char*topPointer25; + char*topPointer26; + char*topPointer27; + char*topPointer28; + char*topPointer29; + char*topPointer3; + char*topPointer30; + char*topPointer31; + char*topPointer32; + char*topPointer33; + char*topPointer34; + char*topPointer35; + char*topPointer36; + char*topPointer4; + char*topPointer41; + char*topPointer42; + char*topPointer43; + char*topPointer5; + char*topPointer51; + char*topPointer52; + char*topPointer53; + char*topPointer6; + char*topPointer61; + char*topPointer62; + char*topPointer7; + char*topPointer71; + char*topPointer8; + char*topPointer9; + float topSingle; + float topSingle1; + float topSingle10; + float topSingle11; + float topSingle110; + float topSingle111; + float topSingle112; + float topSingle113; + float topSingle12; + float topSingle13; + float topSingle14; + float topSingle15; + float topSingle16; + float topSingle17; + float topSingle18; + float topSingle19; + float topSingle2; + float topSingle20; + float topSingle21; + float topSingle22; + float topSingle23; + float topSingle24; + float topSingle25; + float topSingle26; + float topSingle27; + float topSingle28; + float topSingle29; + float topSingle3; + float topSingle4; + float topSingle5; + float topSingle6; + float topSingle7; + float topSingle8; + float topSingle9; + sqInt value; + sqInt value1; + sqInt value10; + sqInt value101; + sqInt value102; + sqInt value103; + sqLong value104; + sqLong value11; + sqInt value110; + double value111; + sqLong value112; + sqLong value113; + sqInt value114; + sqInt value115; + sqInt value116; + sqInt value117; + sqLong value118; + float value119; + sqInt value12; + sqInt value120; + sqInt value121; + sqInt value122; + sqInt value123; + double value124; + sqInt value13; + sqInt value131; + sqInt value132; + sqInt value133; + sqInt value134; + sqInt value14; + sqLong value141; + float value142; + sqInt value143; + sqLong value144; + float value15; + sqInt value151; + double value152; + sqLong value153; + sqInt value154; + sqInt value16; + float value161; + sqInt value162; + sqLong value163; + sqLong value164; + float value17; + double value171; + sqLong value172; + sqLong value173; + sqInt value174; + float value18; + sqInt value181; + sqInt value182; + float value19; + sqInt value191; + sqLong value192; + sqInt value2; + float value20; + sqInt value201; + sqInt value202; + sqInt value21; + sqLong value210; + sqInt value211; + sqLong value212; + sqInt value213; + sqInt value214; + sqInt value215; + sqInt value216; + float value217; + sqInt value218; + sqInt value22; + sqInt value221; + sqLong value222; + sqInt value23; + sqLong value231; + sqInt value232; + sqInt value24; + sqLong value241; + sqInt value242; + sqInt value25; + sqLong value251; + sqInt value252; + sqInt value26; + sqInt value261; + sqLong value262; + double value27; + sqInt value271; + sqInt value272; + sqInt value28; + sqInt value281; + float value282; + double value29; + sqInt value291; + double value292; + sqInt value3; + sqInt value30; + sqInt value301; + sqLong value31; + sqLong value310; + sqInt value311; + sqInt value312; + sqInt value313; + sqLong value314; + sqInt value315; + sqInt value316; + sqLong value32; + sqInt value321; + sqInt value33; + sqInt value331; + sqInt value34; + sqInt value341; + sqInt value35; + sqInt value351; + sqLong value36; + sqLong value361; + sqInt value37; + sqLong value371; + sqInt value38; + sqInt value381; + sqInt value39; + sqInt value391; + sqInt value4; + sqLong value40; + float value401; + sqInt value41; + sqLong value411; + sqInt value42; + float value43; + sqInt value44; + sqInt value45; + sqInt value46; + sqInt value47; + sqInt value48; + sqInt value49; + sqInt value5; + sqInt value50; + sqInt value51; + double value52; + sqInt value53; + sqInt value54; + sqInt value55; + sqLong value6; + sqLong value61; + sqInt value62; + sqInt value63; + float value64; + sqInt value65; + sqInt value7; + sqInt value71; + sqLong value72; + sqInt value73; + double value74; + sqInt value75; + sqInt value8; + sqInt value81; + sqInt value82; + sqInt value83; + sqLong value84; + sqLong value9; + sqLong value91; + sqLong value92; + sqInt value93; + sqInt value94; + sqInt valueOop; + char *valueOopPointer; + char *valueOopPointer1; + char *valueOopPointer10; + char *valueOopPointer101; + char *valueOopPointer102; + char *valueOopPointer103; + char *valueOopPointer104; + char *valueOopPointer11; + char *valueOopPointer110; + char *valueOopPointer1101; + char *valueOopPointer1102; + char *valueOopPointer1103; + char *valueOopPointer111; + char *valueOopPointer1110; + char *valueOopPointer1111; + char *valueOopPointer1112; + char *valueOopPointer1113; + char *valueOopPointer1114; + char *valueOopPointer1115; + char *valueOopPointer1116; + char *valueOopPointer1117; + char *valueOopPointer112; + char *valueOopPointer1121; + char *valueOopPointer1122; + char *valueOopPointer1123; + char *valueOopPointer113; + char *valueOopPointer1131; + char *valueOopPointer1132; + char *valueOopPointer1133; + char *valueOopPointer114; + char *valueOopPointer1141; + char *valueOopPointer1142; + char *valueOopPointer1143; + char *valueOopPointer115; + char *valueOopPointer1151; + char *valueOopPointer1152; + char *valueOopPointer1153; + char *valueOopPointer116; + char *valueOopPointer1161; + char *valueOopPointer1162; + char *valueOopPointer1163; + char *valueOopPointer117; + char *valueOopPointer1171; + char *valueOopPointer1172; + char *valueOopPointer1173; + char *valueOopPointer118; + char *valueOopPointer1181; + char *valueOopPointer119; + char *valueOopPointer1191; + char *valueOopPointer12; + char *valueOopPointer120; + char *valueOopPointer1201; + char *valueOopPointer121; + char *valueOopPointer1210; + char *valueOopPointer1211; + char *valueOopPointer1212; + char *valueOopPointer1213; + char *valueOopPointer122; + char *valueOopPointer1221; + char *valueOopPointer123; + char *valueOopPointer1231; + char *valueOopPointer124; + char *valueOopPointer1241; + char *valueOopPointer125; + char *valueOopPointer1251; + char *valueOopPointer126; + char *valueOopPointer1261; + char *valueOopPointer127; + char *valueOopPointer1271; + char *valueOopPointer128; + char *valueOopPointer1281; + char *valueOopPointer129; + char *valueOopPointer1291; + char *valueOopPointer13; + char *valueOopPointer130; + char *valueOopPointer1301; + char *valueOopPointer131; + char *valueOopPointer1311; + char *valueOopPointer132; + char *valueOopPointer1321; + char *valueOopPointer133; + char *valueOopPointer1331; + char *valueOopPointer134; + char *valueOopPointer135; + char *valueOopPointer136; + char *valueOopPointer137; + char *valueOopPointer14; + char *valueOopPointer141; + char *valueOopPointer142; + char *valueOopPointer143; + char *valueOopPointer15; + char *valueOopPointer151; + char *valueOopPointer152; + char *valueOopPointer153; + char *valueOopPointer16; + char *valueOopPointer161; + char *valueOopPointer162; + char *valueOopPointer163; + char *valueOopPointer17; + char *valueOopPointer171; + char *valueOopPointer172; + char *valueOopPointer173; + char *valueOopPointer18; + char *valueOopPointer181; + char *valueOopPointer182; + char *valueOopPointer183; + char *valueOopPointer19; + char *valueOopPointer191; + char *valueOopPointer192; + char *valueOopPointer193; + char *valueOopPointer2; + char *valueOopPointer20; + char *valueOopPointer201; + char *valueOopPointer202; + char *valueOopPointer203; + char *valueOopPointer21; + char *valueOopPointer210; + char *valueOopPointer2101; + char *valueOopPointer211; + char *valueOopPointer2111; + char *valueOopPointer212; + char *valueOopPointer213; + char *valueOopPointer214; + char *valueOopPointer215; + char *valueOopPointer216; + char *valueOopPointer217; + char *valueOopPointer22; + char *valueOopPointer221; + char *valueOopPointer222; + char *valueOopPointer223; + char *valueOopPointer23; + char *valueOopPointer231; + char *valueOopPointer232; + char *valueOopPointer233; + char *valueOopPointer24; + char *valueOopPointer241; + char *valueOopPointer242; + char *valueOopPointer243; + char *valueOopPointer25; + char *valueOopPointer251; + char *valueOopPointer252; + char *valueOopPointer253; + char *valueOopPointer26; + char *valueOopPointer261; + char *valueOopPointer262; + char *valueOopPointer263; + char *valueOopPointer27; + char *valueOopPointer272; + char *valueOopPointer273; + char *valueOopPointer28; + char *valueOopPointer281; + char *valueOopPointer282; + char *valueOopPointer283; + char *valueOopPointer29; + char *valueOopPointer291; + char *valueOopPointer292; + char *valueOopPointer293; + char *valueOopPointer3; + char *valueOopPointer30; + char *valueOopPointer301; + char *valueOopPointer302; + char *valueOopPointer303; + char *valueOopPointer31; + char *valueOopPointer310; + char *valueOopPointer311; + char *valueOopPointer312; + char *valueOopPointer313; + char *valueOopPointer314; + char *valueOopPointer315; + char *valueOopPointer316; + char *valueOopPointer317; + char *valueOopPointer32; + char *valueOopPointer321; + char *valueOopPointer322; + char *valueOopPointer323; + char *valueOopPointer33; + char *valueOopPointer331; + char *valueOopPointer332; + char *valueOopPointer333; + char *valueOopPointer34; + char *valueOopPointer341; + char *valueOopPointer342; + char *valueOopPointer343; + char *valueOopPointer35; + char *valueOopPointer351; + char *valueOopPointer352; + char *valueOopPointer353; + char *valueOopPointer36; + char *valueOopPointer361; + char *valueOopPointer362; + char *valueOopPointer363; + char *valueOopPointer37; + char *valueOopPointer371; + char *valueOopPointer372; + char *valueOopPointer373; + char *valueOopPointer38; + char *valueOopPointer381; + char *valueOopPointer382; + char *valueOopPointer383; + char *valueOopPointer39; + char *valueOopPointer391; + char *valueOopPointer392; + char *valueOopPointer393; + char *valueOopPointer4; + char *valueOopPointer40; + char *valueOopPointer401; + char *valueOopPointer402; + char *valueOopPointer41; + char *valueOopPointer410; + char *valueOopPointer411; + char *valueOopPointer412; + char *valueOopPointer413; + char *valueOopPointer414; + char *valueOopPointer415; + char *valueOopPointer416; + char *valueOopPointer42; + char *valueOopPointer421; + char*valueOopPointer422; + char *valueOopPointer43; + char *valueOopPointer431; + char *valueOopPointer432; + char *valueOopPointer44; + char *valueOopPointer441; + char *valueOopPointer442; + char *valueOopPointer45; + char *valueOopPointer451; + char *valueOopPointer452; + char *valueOopPointer46; + char *valueOopPointer461; + char *valueOopPointer462; + char *valueOopPointer47; + char *valueOopPointer471; + char *valueOopPointer472; + char *valueOopPointer48; + char *valueOopPointer481; + char *valueOopPointer482; + char *valueOopPointer49; + char *valueOopPointer491; + char *valueOopPointer492; + char *valueOopPointer5; + char *valueOopPointer50; + char *valueOopPointer501; + char *valueOopPointer502; + char *valueOopPointer51; + char *valueOopPointer510; + char *valueOopPointer511; + char *valueOopPointer512; + char *valueOopPointer52; + char *valueOopPointer521; + char *valueOopPointer53; + char *valueOopPointer531; + char *valueOopPointer54; + char *valueOopPointer541; + char *valueOopPointer55; + char *valueOopPointer551; + char *valueOopPointer56; + char *valueOopPointer561; + char *valueOopPointer57; + char *valueOopPointer571; + char *valueOopPointer58; + char *valueOopPointer581; + char *valueOopPointer59; + char *valueOopPointer591; + char *valueOopPointer6; + char *valueOopPointer60; + char *valueOopPointer61; + char *valueOopPointer611; + char *valueOopPointer62; + char *valueOopPointer621; + char *valueOopPointer63; + char *valueOopPointer631; + char *valueOopPointer64; + char *valueOopPointer65; + char *valueOopPointer66; + char *valueOopPointer67; + char *valueOopPointer68; + char *valueOopPointer7; + char *valueOopPointer71; + char *valueOopPointer72; + char *valueOopPointer73; + char *valueOopPointer74; + char *valueOopPointer75; + char *valueOopPointer8; + char *valueOopPointer81; + char *valueOopPointer82; + char *valueOopPointer83; + char *valueOopPointer84; + char *valueOopPointer85; + char *valueOopPointer9; + char *valueOopPointer91; + char *valueOopPointer92; + char *valueOopPointer93; + char *valueOopPointer94; + char *valueOopPointer95; + sqInt valuePointer; + sqInt valueWord; + + VM_LABEL(callPrimitiveBytecode1); + code = 0; + value54 = 0; + byte1 = byteAtPointer(++localIP); + byte2 = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if (byte2 < 128) { + /* begin methodHeaderOf: */ + assert(isCompiledMethod(GIV(method))); + header1 = longAt((GIV(method) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + if (((/* begin alternateHeaderHasPrimitiveFlag: */ + header & AlternateHeaderHasPrimFlag)) + && (((((usqInt)localIP)) == ((GIV(method) + ((LiteralStart + ((assert((header & 1)), +((header >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize)) + (3))) { + goto l1835; + } + localIP -= 3; + goto respondToUnknownBytecode; + goto l1835; + } + prim = (((sqInt)((usqInt)((byte2 - 128)) << 8))) + byte1; + primSet = (((usqInt) prim) >> 13) & 3; + prim = prim & 0x1FFF; + if (primSet == 0) { + if (prim < 1000) { + /* begin nullaryInlinePrimitive: */ + localIP -= 3; + goto respondToUnknownBytecode; + goto l1835; + } + if (prim < 2000) { + /* begin unaryInlinePrimitive: */ + + switch (prim - 1000) { + case 0: + /* begin fetchClassOf: */ + oop2 = longAtPointer(localSP); + result2 = (((tagBits = oop2 & (tagMask()))) != 0 + ? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))) + : fetchClassOfNonImm(oop2)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result2); + break; + case 1: + /* begin numSlotsOf: */ + objOop5 = longAtPointer(localSP); + assert((classIndexOf(objOop5)) > (isForwardedObjectClassIndexPun())); + numSlots1 = byteAt(objOop5 + 7); + result2 = (numSlots1 == (numSlotsMask()) + ? longAt(objOop5 - BaseHeaderSize) + : numSlots1); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 2: + result2 = (numSlotsOf(longAtPointer(localSP))) - (fixedFieldsOfClass(fetchClassOfNonImm(longAtPointer(localSP)))); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 3: + /* begin numBytesOf: */ + objOop12 = longAtPointer(localSP); + fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(objOop12)) > (isForwardedObjectClassIndexPun())); + numSlots2 = byteAt(objOop12 + 7); + numBytes = (numSlots2 == (numSlotsMask()) + ? longAt(objOop12 - BaseHeaderSize) + : numSlots2); + numBytes = numBytes << (shiftForWord()); + if (fmt >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + result2 = numBytes - (fmt & 7); + goto l2023; + } + if (fmt <= (sixtyFourBitIndexableFormat())) { + result2 = numBytes; + goto l2023; + } + if (fmt >= (firstShortFormat())) { + result2 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); + goto l2023; + } + result2 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); + l2023: /* end numBytesOf: */; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 4: + /* begin num16BitUnitsOf: */ + objOop22 = longAtPointer(localSP); + result2 = ((sqInt) (((usqInt) (numBytesOf(objOop22))) >> 1)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 5: + /* begin num32BitUnitsOf: */ + objOop31 = longAtPointer(localSP); + result2 = ((usqInt) (numBytesOf(objOop31))) >> 2; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 6: + /* begin num64BitUnitsOf: */ + objOop41 = longAtPointer(localSP); + result2 = ((sqInt) (((usqInt) (numBytesOf(objOop41))) >> 3)); + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + case 11: + /* begin internalStackTop */ + classObj = longAtPointer(localSP); + /* begin instanceSizeOf: */ + assert(addressCouldBeClassObj(classObj)); + numSlots = (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1)) & ((1U << (fixedFieldsFieldWidth())) - 1); + assert((rawHashBitsOf(classObj)) != 0); + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + /* begin instSpecOfClassFormat: */ + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); + assert((numSlots >= 0) + && (knownClassIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + goto l2059; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); + GIV(freeStart) += numBytes1; + result2 = newObj; + l2059: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + if ((extB & 1) == 0) { + for (i = 0; i < numSlots; i += 1) { + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(result2))); + longAtput((result2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + } + extB = 0; + numExtB = 0; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result2); + break; + case 20: + /* begin hashBitsOf: */ + hash = (long32At((longAtPointer(localSP)) + 4)) & (identityHashHalfWordMask()); + if (hash == 0) { + + /* would like to assert + self assert: (coInterpreter addressCouldBeClassObj: objOop) not + but instance-specific behaviors that are instances of themselves may + fail this test. */ + hash = (newObjectHash()) & (identityHashHalfWordMask()); + /* begin setHashBitsOf:to: */ + assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); + long32Atput((longAtPointer(localSP)) + 4, ((((long32At((longAtPointer(localSP)) + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); + } + result2 = hash; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, ((result2 << 1) | 1)); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1835; + } + if (prim < 3000) { + /* begin binaryInlinePrimitive: */ + + switch (prim - 2000) { + case 0: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) + (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 1: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 2: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) * (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 3: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) / (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 4: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) / (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 5: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) % (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 6: + rcvr = ((longAtPointer(localSP + (1 * BytesPerOop))) >> 1); + arg = ((longAtPointer(localSP)) >> 1); + /* begin quot:ient: */ + result = (rcvr > 0 + ? (arg > 0 + ? rcvr / arg + : 0 - (rcvr / (0 - arg))) + : (arg > 0 + ? 0 - ((0 - rcvr) / arg) + : (0 - rcvr) / (0 - arg))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 16: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) & (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 17: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) | (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 18: + result = (((usqInt)((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) ^ (((longAtPointer(localSP)) >> 1))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 19: + result = (((usqInt)((((((longAtPointer(localSP)) >> 1)) < 0) ? ((usqInt) (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) >> -(((longAtPointer(localSP)) >> 1))) : ((usqInt) (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) << (((longAtPointer(localSP)) >> 1))))) << 1) | 1); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 32: + /* begin booleanObjectOf: */ + bool = (longAtPointer(localSP + (1 * BytesPerOop))) > (longAtPointer(localSP)); + result = (bool + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 33: + /* begin booleanObjectOf: */ + bool1 = (longAtPointer(localSP + (1 * BytesPerOop))) < (longAtPointer(localSP)); + result = (bool1 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 34: + /* begin booleanObjectOf: */ + bool2 = (longAtPointer(localSP + (1 * BytesPerOop))) >= (longAtPointer(localSP)); + result = (bool2 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 35: + /* begin booleanObjectOf: */ + bool3 = (longAtPointer(localSP + (1 * BytesPerOop))) <= (longAtPointer(localSP)); + result = (bool3 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 36: + /* begin booleanObjectOf: */ + bool4 = (longAtPointer(localSP + (1 * BytesPerOop))) == (longAtPointer(localSP)); + result = (bool4 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 37: + /* begin booleanObjectOf: */ + bool5 = (longAtPointer(localSP + (1 * BytesPerOop))) != (longAtPointer(localSP)); + result = (bool5 + ? GIV(trueObj) + : GIV(falseObj)); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 64: + /* begin fetchPointer:ofObject: */ + fieldIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop = longAtPointer(localSP + (1 * BytesPerOop)); + result = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, result); + break; + case 65: + /* begin fetchByte:ofObject: */ + byteIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop1 = longAtPointer(localSP + (1 * BytesPerOop)); + result = byteAt((objOop1 + BaseHeaderSize) + byteIndex); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 66: + /* begin fetchShort16:ofObject: */ + shortIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop2 = longAtPointer(localSP + (1 * BytesPerOop)); + result = shortAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(shortIndex) << 1)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + longAtPointerput(localSP, (((usqInt)result << 1) | 1)); + break; + case 67: + /* begin fetchLong32:ofObject: */ + fieldIndex1 = (((longAtPointer(localSP)) >> 1)) - 1; + oop = longAtPointer(localSP + (1 * BytesPerOop)); + result = long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << 2)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin internalStackTopPut: */ + aValue = ((sqInt) (signed64BitValueOf(result))); + longAtPointerput(localSP, aValue); + break; + case 68: + /* begin fetchLong64:ofObject: */ + longIndex = (((longAtPointer(localSP)) >> 1)) - 1; + objOop3 = longAtPointer(localSP + (1 * BytesPerOop)); + result64 = long64At((objOop3 + BaseHeaderSize) + (((sqInt)((usqInt)(longIndex) << 3)))); + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + /* begin internalStackTopPut: */ + aValue1 = ((sqInt) (signed64BitValueOf(result))); + longAtPointerput(localSP, aValue1); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1835; + } + if (prim < 4000) { + /* begin trinaryInlinePrimitive: */ + + switch (prim - 3000) { + case 0: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storePointer:ofObject:withValue: */ + objOop21 = longAtPointer(localSP + (2 * BytesPerOop)); + assert(!(isForwarded(objOop21))); + if ((assert(isNonImmediate(objOop21)), + oopisGreaterThanOrEqualTo(objOop21, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((result1 & (tagMask())) == 0) + && (oopisLessThan(result1, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop21))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop21); + } + } + } + longAtput((objOop21 + BaseHeaderSize) + (((sqInt)((usqInt)(((((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1)) << (shiftForWord())))), result1); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 1: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeByte:ofObject:withValue: */ + byteIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + oop1 = longAtPointer(localSP + (2 * BytesPerOop)); + byteAtput((oop1 + BaseHeaderSize) + byteIndex1, (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 2: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeShort16:ofObject:withValue: */ + shortIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + objOop4 = longAtPointer(localSP + (2 * BytesPerOop)); + shortAtput((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(shortIndex1) << 1))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 3: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeLong32:ofObject:withValue: */ + fieldIndex2 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + obj = longAtPointer(localSP + (2 * BytesPerOop)); + long32Atput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << 2))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + case 4: + /* begin internalStackTop */ + result1 = longAtPointer(localSP); + /* begin storeLong64:ofObject:withValue: */ + longIndex1 = (((longAtPointer(localSP + (1 * BytesPerOop))) >> 1)) - 1; + objOop11 = longAtPointer(localSP + (2 * BytesPerOop)); + long64Atput((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(longIndex1) << 3))), (result1 >> 1)); + /* begin internalPop: */ + localSP += 2 * BytesPerOop; + /* begin internalStackTopPut: */ + longAtPointerput(localSP, result1); + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + + } + goto l1835; + } + } + if (primSet == 1) { + if (prim < 1000) { + /* begin lowcodeNullaryInlinePrimitive: */ + + switch (prim) { + case 0: + /* begin lowcodePrimitiveBoolean32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt324 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer11 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer11) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer11)))); + value7 = topInt324; + if (value7 != 0) { + /* begin trueObject */ + object12 = GIV(trueObj); + } + else { + /* begin falseObject */ + object12 = GIV(falseObj); + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object12); + goto l3059; + break; + case 1: + /* begin lowcodePrimitiveBoolean64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1)))); + value11 = topInt64; + if (value11 != 0) { + /* begin trueObject */ + object11 = GIV(trueObj); + } + else { + /* begin falseObject */ + object11 = GIV(falseObj); + } + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object11); + goto l3059; + break; + case 2: + /* begin lowcodePrimitiveFloat32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2)))); + singleFloatValue = topSingle; + object2 = floatObjectOf(singleFloatValue); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object2); + goto l3059; + break; + case 3: + /* begin lowcodePrimitiveFloat64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer3 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer3) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer3)))); + floatValue = topDouble; + object3 = floatObjectOf(floatValue); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object3); + goto l3059; + break; + case 4: + /* begin lowcodePrimitiveInt32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer4 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer4) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer4)))); + value21 = topInt321; + /* begin signed32BitIntegerFor: */ + if ((((sqInt)((((usqInt)value21)) ^ ((((usqInt)value21)) << 1)))) >= 0) { + object4 = (((usqInt)value21 << 1) | 1); + goto l2224; + } + object4 = noInlineSigned32BitIntegerGutsFor(value21); + goto l2224; + + l2224: /* end signed32BitIntegerFor: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object4); + goto l3059; + break; + case 5: + /* begin lowcodePrimitiveInt64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt641 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer5 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer5) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer5)))); + value31 = topInt641; + object5 = signed64BitIntegerFor(value31); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object5); + goto l3059; + break; + case 6: + /* begin lowcodePrimitivePointerToOop */ + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + pointerClassLiteral = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((extA + LiteralStart)) << (shiftForWord()))))); + + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer1 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer8 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer8) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer8)))); + pointer1 = topPointer1; + object8 = instantiateClassindexableSize(pointerClassLiteral, BytesPerWord); + pointerAtPointerput(firstIndexableField(object8), pointer1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object8); + extA = 0; + goto l3059; + break; + case 7: + /* begin lowcodePrimitivePointerToOopReinterprer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer6 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer6) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer6)))); + pointer = topPointer; + object6 = ((sqInt) pointer); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object6); + goto l3059; + break; + case 8: + /* begin lowcodePrimitiveSmallInt32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt322 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer7 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer7) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer7)))); + value4 = topInt322; + object7 = (((usqInt)value4 << 1) | 1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object7); + goto l3059; + break; + case 9: + /* begin lowcodePrimitiveUint32ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt323 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer9 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer9) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer9)))); + value5 = topInt323; + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) value5)) <= (MaxSmallInteger)) { + object9 = (((usqInt)value5 << 1) | 1); + goto l2727; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj1 = GIV(freeStart); + numBytes2 = BaseHeaderSize + (8); + assert((numBytes2 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes2) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes2) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l2323; + } + } + long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes2; + newLargeInteger = newObj1; + l2323: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(value5); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + object9 = newLargeInteger; + goto l2727; + + l2727: /* end positive32BitIntegerFor: */; + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object9); + goto l3059; + break; + case 10: + /* begin lowcodePrimitiveUint64ToOop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt642 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer10 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer10) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer10)))); + value6 = topInt642; + object10 = positive64BitIntegerFor(value6); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object10); + goto l3059; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l3059; + + } + l3059: /* end lowcodeNullaryInlinePrimitive: */; + goto l1835; + } + if (prim < 2000) { + /* begin lowcodeUnaryInlinePrimitive: */ + + switch (prim - 1000) { + case 0: + /* begin lowcodePrimitiveAdd32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3236 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer67 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer67) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer67)))); + second28 = topInt3236; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32124 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer137 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer137) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer137)))); + first28 = topInt32124; + result38 = first28 + second28; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result38); + goto l2096; + break; + case 1: + /* begin lowcodePrimitiveAdd64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6435 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer217 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer217) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer217)))); + second114 = topInt6435; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64124 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1117 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1117) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1117)))); + first114 = topInt64124; + result116 = first114 + second114; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result116); + goto l2096; + break; + case 2: + /* begin lowcodePrimitiveAlloca32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32213 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer317 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer317) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer317)))); + size = topInt32213; + GIV(nativeStackPointer) = ((char*) ((((size_t) (GIV(nativeStackPointer) - size))) & -16)); + pointer15 = GIV(nativeStackPointer); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer15); + goto l2096; + break; + case 3: + /* begin lowcodePrimitiveAlloca64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64212 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer416 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer416) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer416)))); + size1 = topInt64212; + GIV(nativeStackPointer) -= size1; + pointer16 = GIV(nativeStackPointer); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer16); + goto l2096; + break; + case 4: + /* begin lowcodePrimitiveAnd32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3237 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer512 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer512) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer512)))); + second2 = topInt3237; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3211 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer12 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer12) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer12)))); + first2 = topInt3211; + result216 = first2 & second2; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result216); + goto l2096; + break; + case 5: + /* begin lowcodePrimitiveAnd64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt643 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer68 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer68) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer68)))); + second3 = topInt643; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6411 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer13 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer13) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer13)))); + first3 = topInt6411; + result3 = first3 & second3; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result3); + goto l2096; + break; + case 6: + /* begin lowcodePrimitiveArithmeticRightShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3245 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer75 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer75) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer75)))); + shiftAmount = topInt3245; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3212 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer14 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer14) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer14)))); + value48 = topInt3212; + result4 = ((usqInt) value48) >> shiftAmount; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result4); + goto l2096; + break; + case 7: + /* begin lowcodePrimitiveArithmeticRightShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt644 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer85 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer85) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer85)))); + shiftAmount1 = topInt644; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6412 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer15 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer15) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer15)))); + value118 = topInt6412; + result5 = ((unsigned sqLong)value118) >> shiftAmount1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result5); + goto l2096; + break; + case 8: + /* begin lowcodePrimitiveBeginCall */ + + /* Store the shadow stack pointer */ + alignment = extA; + valueOopPointer95 = ((char *) (GIV(shadowCallStackPointer) + 1)); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer95); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer95); + } + /* begin allocateLowcodeCalloutState */ + calloutStateSize = sizeof(sqLowcodeCalloutState); + GIV(shadowCallStackPointer) = ((char*) ((((size_t) (GIV(shadowCallStackPointer) - calloutStateSize))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) GIV(shadowCallStackPointer)); + extA = 0; + goto l2096; + break; + case 9: + /* begin lowcodePrimitiveCallArgumentFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle29 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer104 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer104) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer104)))); + argumentValue = topSingle29; + /* begin internalPushShadowCallStackFloat32: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 4; + singleFloatAtPointerput(GIV(shadowCallStackPointer), argumentValue); + goto l2096; + break; + case 10: + /* begin lowcodePrimitiveCallArgumentFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble25 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer16 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer16) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer16)))); + argumentValue1 = topDouble25; + /* begin internalPushShadowCallStackFloat64: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 8; + singleFloatAtPointerput(GIV(shadowCallStackPointer), argumentValue1); + goto l2096; + break; + case 11: + /* begin lowcodePrimitiveCallArgumentInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt325 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer17 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer17) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer17)))); + value216 = topInt325; + /* begin internalPushShadowCallStackInt32: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 4; + int32AtPointerput(GIV(shadowCallStackPointer), value216); + goto l2096; + break; + case 12: + /* begin lowcodePrimitiveCallArgumentInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt645 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer18 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer18) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer18)))); + value314 = topInt645; + /* begin internalPushShadowCallStackInt64: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= 8; + int64AtPointerput(GIV(shadowCallStackPointer), value314); + goto l2096; + break; + case 13: + /* begin lowcodePrimitiveCallArgumentPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer36 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer19 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer19) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer19)))); + pointerValue = topPointer36; + /* begin internalPushShadowCallStackPointer: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), pointerValue); + goto l2096; + break; + case 14: + /* begin lowcodePrimitiveCallArgumentSpace */ + spaceSize = extA; + /* begin internalPushShadowCallStackSpace: */ + GIV(shadowCallStackPointer) -= spaceSize; + extA = 0; + goto l2096; + break; + case 15: + /* begin lowcodePrimitiveCallArgumentStructure */ + structureSize = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer115 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer20 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer20) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer20)))); + structurePointer = topPointer115; + /* begin internalPushShadowCallStackStructure:size: */ + GIV(shadowCallStackPointer) -= structureSize; + memcpy(GIV(shadowCallStackPointer), structurePointer, structureSize); + extA = 0; + goto l2096; + break; + case 16: + /* begin lowcodePrimitiveCallInstruction */ + function = extA; + abort(); + extA = 0; + goto l2096; + break; + case 17: + /* begin lowcodePrimitiveCallPhysical */ + registerID = extA; + abort(); + extA = 0; + goto l2096; + break; + case 18: + /* begin lowcodePrimitiveCheckSessionIdentifier */ + expectedSession = extA; + value47 = (expectedSession == (getThisSessionID()) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value47); + extA = 0; + goto l2096; + break; + case 19: + /* begin lowcodePrimitiveCompareAndSwap32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt326 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer21 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer21) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer21)))); + newValue = topInt326; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3213 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer110 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer110) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer110)))); + oldValue = topInt3213; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer2 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer22 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer22) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer22)))); + check = topPointer2; + abort(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value54); + goto l2096; + break; + case 20: + /* begin lowcodePrimitiveDiv32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt327 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer23 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer23) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer23)))); + second4 = topInt327; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3214 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer111 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer111)))); + first4 = topInt3214; + result6 = first4 / second4; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result6); + goto l2096; + break; + case 21: + /* begin lowcodePrimitiveDiv64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt646 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer24 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer24) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer24)))); + second5 = topInt646; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6413 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer112 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer112) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer112)))); + first5 = topInt6413; + result7 = first5 / second5; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result7); + goto l2096; + break; + case 22: + /* begin lowcodePrimitiveDuplicateFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle1 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer25 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer25) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer25)))); + value64 = topSingle1; + dup1 = value64; + dup2 = value64; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, dup1); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, dup2); + goto l2096; + break; + case 23: + /* begin lowcodePrimitiveDuplicateFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble1 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer26 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer26) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer26)))); + value74 = topDouble1; + dup11 = value74; + dup21 = value74; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, dup11); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, dup21); + goto l2096; + break; + case 24: + /* begin lowcodePrimitiveDuplicateInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt328 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer27 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer27) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer27)))); + value8 = topInt328; + dup12 = value8; + dup22 = value8; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, dup12); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, dup22); + goto l2096; + break; + case 25: + /* begin lowcodePrimitiveDuplicateInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt647 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer28 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer28) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer28)))); + value9 = topInt647; + dup13 = value9; + dup23 = value9; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, dup13); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, dup23); + goto l2096; + break; + case 26: + /* begin lowcodePrimitiveDuplicatePointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer3 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer29 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer29) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer29)))); + pointerValue1 = topPointer3; + dup14 = pointerValue1; + dup24 = pointerValue1; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, dup14); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, dup24); + goto l2096; + break; + case 27: + /* begin lowcodePrimitiveEffectiveAddress32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt329 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer30 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer30) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer30)))); + offset = topInt329; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3215 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer113 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer113) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer113)))); + scale = topInt3215; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3221 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer210 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer210) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer210)))); + index = topInt3221; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer4 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer31 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer31) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer31)))); + base = topPointer4; + result8 = (base + (index * scale)) + offset; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result8); + goto l2096; + break; + case 28: + /* begin lowcodePrimitiveEffectiveAddress64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt648 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer32 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer32) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer32)))); + offset1 = topInt648; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6414 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer114 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer114) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer114)))); + scale1 = topInt6414; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6421 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer211 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer211) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer211)))); + index1 = topInt6421; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer5 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer33 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer33) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer33)))); + base1 = topPointer5; + result9 = (base1 + (index1 * scale1)) + offset1; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result9); + goto l2096; + break; + case 29: + /* begin lowcodePrimitiveEndCall */ + GIV(shadowCallStackPointer) = (shadowCallStackPointerIn(localFP)) - 1; + /* begin shadowCallStackPointerIn:put: */ + valueOopPointer34 = ((char *) (((char*) 1))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer34); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer34); + } + goto l2096; + break; + case 30: + /* begin lowcodePrimitiveEndCallNoCleanup */ + GIV(shadowCallStackPointer) = (shadowCallStackPointerIn(localFP)) - 1; + /* begin shadowCallStackPointerIn:put: */ + valueOopPointer35 = ((char *) (((char*) 1))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 5), valueOopPointer35); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 5), valueOopPointer35); + } + goto l2096; + break; + case 0x1F: + /* begin lowcodePrimitiveFloat32Add */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle2 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer36 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer36) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer36)))); + second6 = topSingle2; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle11 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer115 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer115) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer115)))); + first6 = topSingle11; + result10 = first6 + second6; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result10); + goto l2096; + break; + case 32: + /* begin lowcodePrimitiveFloat32Div */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle3 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer37 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer37) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer37)))); + second7 = topSingle3; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle12 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer116 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer116) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer116)))); + first7 = topSingle12; + result11 = first7 / second7; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result11); + goto l2096; + break; + case 33: + /* begin lowcodePrimitiveFloat32Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle4 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer38 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer38) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer38)))); + second8 = topSingle4; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle13 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer117 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer117) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer117)))); + first8 = topSingle13; + value10 = (first8 == second8 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value10); + goto l2096; + break; + case 34: + /* begin lowcodePrimitiveFloat32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle5 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer39 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer39) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer39)))); + second9 = topSingle5; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle14 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer118 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer118) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer118)))); + first9 = topSingle14; + value117 = (first9 > second9 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value117); + goto l2096; + break; + case 35: + /* begin lowcodePrimitiveFloat32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle6 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer40 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer40) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer40)))); + second10 = topSingle6; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle15 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer119 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer119) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer119)))); + first10 = topSingle15; + value12 = (first10 >= second10 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value12); + goto l2096; + break; + case 36: + /* begin lowcodePrimitiveFloat32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle7 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer41 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer41) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer41)))); + second11 = topSingle7; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle16 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer120 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer120) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer120)))); + first11 = topSingle16; + value13 = (first11 < second11 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value13); + goto l2096; + break; + case 37: + /* begin lowcodePrimitiveFloat32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle8 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer42 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer42) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer42)))); + second12 = topSingle8; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle17 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer121 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer121) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer121)))); + first12 = topSingle17; + value14 = (first12 <= second12 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value14); + goto l2096; + break; + case 38: + /* begin lowcodePrimitiveFloat32Mul */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle9 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer43 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer43) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer43)))); + second13 = topSingle9; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle18 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer122 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer122) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer122)))); + first13 = topSingle18; + result12 = first13 * second13; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result12); + goto l2096; + break; + case 39: + /* begin lowcodePrimitiveFloat32Neg */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle10 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer44 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer44) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer44)))); + value15 = topSingle10; + result13 = -value15; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result13); + goto l2096; + break; + case 40: + /* begin lowcodePrimitiveFloat32NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle19 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer45 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer45) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer45)))); + second14 = topSingle19; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle110 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer123 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer123) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer123)))); + first14 = topSingle110; + value16 = (first14 != second14 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value16); + goto l2096; + break; + case 41: + /* begin lowcodePrimitiveFloat32Sqrt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle20 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer46 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer46) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer46)))); + value17 = topSingle20; + result14 = sqrt(value17); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result14); + goto l2096; + break; + case 42: + /* begin lowcodePrimitiveFloat32Sub */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle21 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer47 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer47) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer47)))); + second15 = topSingle21; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle111 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer124 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer124) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer124)))); + first15 = topSingle111; + result15 = first15 - second15; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result15); + goto l2096; + break; + case 43: + /* begin lowcodePrimitiveFloat32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle22 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer48 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer48) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer48)))); + singleFloatValue1 = topSingle22; + doubleResult = ((double) singleFloatValue1); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleResult); + goto l2096; + break; + case 44: + /* begin lowcodePrimitiveFloat32ToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle23 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer49 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer49) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer49)))); + value18 = topSingle23; + result16 = ((sqInt) value18); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result16); + goto l2096; + break; + case 45: + /* begin lowcodePrimitiveFloat32ToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle24 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer50 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer50) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer50)))); + value19 = topSingle24; + result17 = ((sqLong) value19); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result17); + goto l2096; + break; + case 46: + /* begin lowcodePrimitiveFloat32ToUInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle25 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer51 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer51) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer51)))); + value20 = topSingle25; + result18 = ((uint32_t) value20); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result18); + goto l2096; + break; + case 47: + /* begin lowcodePrimitiveFloat32ToUInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle26 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer52 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer52) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer52)))); + value217 = topSingle26; + result19 = ((uint64_t) value217); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result19); + goto l2096; + break; + case 48: + /* begin lowcodePrimitiveFloat64Add */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble2 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer53 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer53) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer53)))); + second16 = topDouble2; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble11 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer125 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer125) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer125)))); + first16 = topDouble11; + result20 = first16 + second16; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result20); + goto l2096; + break; + case 49: + /* begin lowcodePrimitiveFloat64Div */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble3 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer54 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer54) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer54)))); + second17 = topDouble3; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble12 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer126 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer126) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer126)))); + first17 = topDouble12; + result21 = first17 / second17; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result21); + goto l2096; + break; + case 50: + /* begin lowcodePrimitiveFloat64Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble4 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer55 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer55) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer55)))); + second18 = topDouble4; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble13 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer127 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer127) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer127)))); + first18 = topDouble13; + value22 = (first18 == second18 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value22); + goto l2096; + break; + case 51: + /* begin lowcodePrimitiveFloat64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble5 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer56 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer56) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer56)))); + second19 = topDouble5; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble14 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer128 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer128) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer128)))); + first19 = topDouble14; + value23 = (first19 > second19 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value23); + goto l2096; + break; + case 52: + /* begin lowcodePrimitiveFloat64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble6 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer57 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer57) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer57)))); + second20 = topDouble6; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble15 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer129 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer129) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer129)))); + first20 = topDouble15; + value24 = (first20 >= second20 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value24); + goto l2096; + break; + case 53: + /* begin lowcodePrimitiveFloat64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble7 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer58 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer58) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer58)))); + second21 = topDouble7; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble16 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer130 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer130) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer130)))); + first21 = topDouble16; + value25 = (first21 < second21 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value25); + goto l2096; + break; + case 54: + /* begin lowcodePrimitiveFloat64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble8 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer59 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer59) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer59)))); + second22 = topDouble8; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble17 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer131 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer131) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer131)))); + first22 = topDouble17; + value26 = (first22 <= second22 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value26); + goto l2096; + break; + case 55: + /* begin lowcodePrimitiveFloat64Mul */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble9 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer60 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer60) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer60)))); + second23 = topDouble9; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble18 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer132 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer132) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer132)))); + first23 = topDouble18; + result22 = first23 * second23; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result22); + goto l2096; + break; + case 56: + /* begin lowcodePrimitiveFloat64Neg */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble10 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer61 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer61) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer61)))); + value27 = topDouble10; + result23 = -value27; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result23); + goto l2096; + break; + case 57: + /* begin lowcodePrimitiveFloat64NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble20 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer62 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer62) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer62)))); + second24 = topDouble20; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble19 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer133 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer133) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer133)))); + first24 = topDouble19; + value28 = (first24 != second24 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value28); + goto l2096; + break; + case 58: + /* begin lowcodePrimitiveFloat64Sqrt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble21 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer63 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer63) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer63)))); + value29 = topDouble21; + result24 = sqrt(value29); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result24); + goto l2096; + break; + case 59: + /* begin lowcodePrimitiveFloat64Sub */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble22 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer64 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer64) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer64)))); + second25 = topDouble22; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble110 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer134 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer134) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer134)))); + first25 = topDouble110; + result25 = first25 - second25; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result25); + goto l2096; + break; + default: + /* begin lowcodeUnaryInlinePrimitive2: */ + + switch (prim - 1000) { + case 60: + /* begin lowcodePrimitiveFloat64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble24 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer65 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer65) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer65)))); + floatValue8 = topDouble24; + singleFloatResult = ((float) floatValue8); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, singleFloatResult); + goto l2105; + break; + case 61: + /* begin lowcodePrimitiveFloat64ToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble112 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer136 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer136) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer136)))); + floatValue1 = topDouble112; + int32Result = ((sqInt) floatValue1); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, int32Result); + goto l2105; + break; + case 0x3E: + /* begin lowcodePrimitiveFloat64ToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble23 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer215 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer215) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer215)))); + floatValue2 = topDouble23; + int64Result = ((sqLong) floatValue2); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, int64Result); + goto l2105; + break; + case 0x3F: + /* begin lowcodePrimitiveFloat64ToUInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble31 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer316 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer316) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer316)))); + floatValue3 = topDouble31; + int64Result1 = ((uint32_t) floatValue3); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, int64Result1); + goto l2105; + break; + case 64: + /* begin lowcodePrimitiveFloat64ToUInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble41 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer414 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer414) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer414)))); + floatValue4 = topDouble41; + int64Result2 = ((uint64_t) floatValue4); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, int64Result2); + goto l2105; + break; + case 65: + /* begin lowcodePrimitiveFree */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer34 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer510 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer510) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer510)))); + pointer13 = topPointer34; + free(pointer13); + goto l2105; + break; + case 66: + /* begin lowcodePrimitiveInstantiateIndexable32Oop */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3218 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer393 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer393) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer393)))); + indexableSize = topInt3218; + /* begin internalPopStack */ + top14 = longAt(localSP); + localSP += BytesPerOop; + classOop = top14; + object14 = instantiateClassindexableSize(classOop, indexableSize); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object14); + goto l2105; + break; + case 67: + /* begin lowcodePrimitiveInstantiateIndexableOop */ + indexableSize1 = extA; + /* begin internalPopStack */ + top21 = longAt(localSP); + localSP += BytesPerOop; + classOop1 = top21; + object21 = instantiateClassindexableSize(classOop1, indexableSize1); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object21); + extA = 0; + goto l2105; + break; + case 68: + /* begin lowcodePrimitiveInstantiateOop */ + top31 = longAt(localSP); + localSP += BytesPerOop; + classOop2 = top31; + object31 = instantiateClassindexableSize(classOop2, 0); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), object31); + goto l2105; + break; + case 69: + /* begin lowcodePrimitiveInt32Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3234 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer66 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer66) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer66)))); + second26 = topInt3234; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32120 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1116 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1116) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1116)))); + first27 = topInt32120; + value46 = (first27 == second26 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value46); + goto l2105; + break; + case 70: + /* begin lowcodePrimitiveInt32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32211 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer74 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer74) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer74)))); + second112 = topInt32211; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321111 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1212 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1212) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1212)))); + first113 = topInt321111; + value116 = (first113 > second112 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value116); + goto l2105; + break; + case 71: + /* begin lowcodePrimitiveInt32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3235 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer84 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer84) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer84)))); + second27 = topInt3235; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32123 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer135 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer135) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer135)))); + first26 = topInt32123; + value214 = (first26 >= second27 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value214); + goto l2105; + break; + case 72: + /* begin lowcodePrimitiveInt32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3244 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer94 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer94) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer94)))); + second34 = topInt3244; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32132 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer143 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer143) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer143)))); + first34 = topInt32132; + value313 = (first34 < second34 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value313); + goto l2105; + break; + case 73: + /* begin lowcodePrimitiveInt32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3254 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer103 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer103) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer103)))); + second43 = topInt3254; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32142 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer153 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer153) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer153)))); + first43 = topInt32142; + value45 = (first43 <= second43 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value45); + goto l2105; + break; + case 74: + /* begin lowcodePrimitiveInt32NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3263 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer173 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer173) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer173)))); + second53 = topInt3263; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32152 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer163 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer163) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer163)))); + first53 = topInt32152; + value53 = (first53 != second53 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value53); + goto l2105; + break; + case 75: + /* begin lowcodePrimitiveInt32ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3273 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer183 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer183) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer183)))); + value63 = topInt3273; + result37 = ((float) value63); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result37); + goto l2105; + break; + case 76: + /* begin lowcodePrimitiveInt32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3283 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer193 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer193) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer193)))); + value73 = topInt3283; + result115 = ((double) value73); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result115); + goto l2105; + break; + case 77: + /* begin lowcodePrimitiveInt32ToPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3292 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer203 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer203) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer203)))); + value83 = topInt3292; + result215 = ((uintptr_t) value83); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result215); + goto l2105; + break; + case 78: + /* begin lowcodePrimitiveInt64Equal */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6430 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer216 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer216) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer216)))); + second62 = topInt6430; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64120 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1103 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1103) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1103)))); + first62 = topInt64120; + value93 = (first62 == second62 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value93); + goto l2105; + break; + case 79: + /* begin lowcodePrimitiveInt64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64210 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer223 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer223) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer223)))); + second72 = topInt64210; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64119 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1115 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1115) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1115)))); + first72 = topInt64119; + value103 = (first72 > second72 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value103); + goto l2105; + break; + case 80: + /* begin lowcodePrimitiveInt64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6434 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer233 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer233) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer233)))); + second82 = topInt6434; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64123 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1123 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1123) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1123)))); + first82 = topInt64123; + value115 = (first82 >= second82 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value115); + goto l2105; + break; + case 81: + /* begin lowcodePrimitiveInt64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6444 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer243 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer243) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer243)))); + second92 = topInt6444; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64132 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1133 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1133) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1133)))); + first92 = topInt64132; + value123 = (first92 < second92 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value123); + goto l2105; + break; + case 82: + /* begin lowcodePrimitiveInt64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6453 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer253 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer253) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer253)))); + second102 = topInt6453; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64142 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1143 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1143) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1143)))); + first102 = topInt64142; + value133 = (first102 <= second102 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value133); + goto l2105; + break; + case 83: + /* begin lowcodePrimitiveInt64NotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6463 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer263 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer263) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer263)))); + second113 = topInt6463; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6415 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1153 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1153) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1153)))); + first112 = topInt6415; + value143 = (first112 != second113 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value143); + goto l2105; + break; + case 84: + /* begin lowcodePrimitiveInt64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6473 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer273 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer273) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer273)))); + value153 = topInt6473; + result36 = ((float) value153); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result36); + goto l2105; + break; + case 85: + /* begin lowcodePrimitiveInt64ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6483 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer283 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer283) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer283)))); + value163 = topInt6483; + result44 = ((double) value163); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result44); + goto l2105; + break; + case 86: + /* begin lowcodePrimitiveInt64ToPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt649 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer293 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer293) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer293)))); + value173 = topInt649; + result54 = ((char*) (((intptr_t) value173))); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result54); + goto l2105; + break; + case 87: + /* begin lowcodePrimitiveLeftShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3210 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer303 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer303) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer303)))); + shiftAmount3 = topInt3210; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3216 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1163 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1163) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1163)))); + value182 = topInt3216; + result641 = ((sqInt)((usqInt)(value182) << shiftAmount3)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result641); + goto l2105; + break; + case 88: + /* begin lowcodePrimitiveLeftShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6410 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer315 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer315) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer315)))); + shiftAmount12 = topInt6410; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6416 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1173 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1173) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1173)))); + value192 = topInt6416; + result74 = ((sqLong)((usqLong)(value192) << shiftAmount12)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result74); + goto l2105; + break; + case 89: + /* begin lowcodePrimitiveLoadArgumentAddress */ + baseOffset = extA; + pointer14 = framePointerOfNativeArgumentin(baseOffset, localFP); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer14); + extA = 0; + goto l2105; + break; + case 90: + /* begin lowcodePrimitiveLoadArgumentFloat32 */ + baseOffset1 = extA; + floatValue5 = singleFloatAtPointer(framePointerOfNativeArgumentin(baseOffset1, localFP)); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, floatValue5); + extA = 0; + goto l2105; + break; + case 91: + /* begin lowcodePrimitiveLoadArgumentFloat64 */ + baseOffset2 = extA; + doubleValue = floatAtPointer(framePointerOfNativeArgumentin(baseOffset2, localFP)); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleValue); + extA = 0; + goto l2105; + break; + case 92: + /* begin lowcodePrimitiveLoadArgumentInt16 */ + baseOffset3 = extA; + value202 = int16AtPointer(framePointerOfNativeArgumentin(baseOffset3, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value202); + extA = 0; + goto l2105; + break; + case 93: + /* begin lowcodePrimitiveLoadArgumentInt32 */ + baseOffset4 = extA; + value215 = int32AtPointer(framePointerOfNativeArgumentin(baseOffset4, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value215); + extA = 0; + goto l2105; + break; + case 94: + /* begin lowcodePrimitiveLoadArgumentInt64 */ + baseOffset5 = extA; + value222 = int64AtPointer(framePointerOfNativeArgumentin(baseOffset5, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value222); + extA = 0; + goto l2105; + break; + case 95: + /* begin lowcodePrimitiveLoadArgumentInt8 */ + baseOffset6 = extA; + value232 = int8AtPointer(framePointerOfNativeArgumentin(baseOffset6, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value232); + extA = 0; + goto l2105; + break; + case 96: + /* begin lowcodePrimitiveLoadArgumentPointer */ + baseOffset7 = extA; + pointerResult = pointerAtPointer(framePointerOfNativeArgumentin(baseOffset7, localFP)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult); + extA = 0; + goto l2105; + break; + case 97: + /* begin lowcodePrimitiveLoadArgumentUInt16 */ + baseOffset8 = extA; + value242 = uint16AtPointer(framePointerOfNativeArgumentin(baseOffset8, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value242); + extA = 0; + goto l2105; + break; + case 98: + /* begin lowcodePrimitiveLoadArgumentUInt32 */ + baseOffset9 = extA; + value252 = uint32AtPointer(framePointerOfNativeArgumentin(baseOffset9, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value252); + extA = 0; + goto l2105; + break; + case 99: + /* begin lowcodePrimitiveLoadArgumentUInt64 */ + baseOffset10 = extA; + value262 = uint64AtPointer(framePointerOfNativeArgumentin(baseOffset10, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value262); + extA = 0; + goto l2105; + break; + case 100: + /* begin lowcodePrimitiveLoadArgumentUInt8 */ + baseOffset11 = extA; + value272 = uint8AtPointer(framePointerOfNativeArgumentin(baseOffset11, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value272); + extA = 0; + goto l2105; + break; + case 101: + /* begin lowcodePrimitiveLoadFloat32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer114 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer323 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer323) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer323)))); + pointer2 = topPointer114; + value282 = singleFloatAtPointer(pointer2); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value282); + goto l2105; + break; + case 102: + /* begin lowcodePrimitiveLoadFloat64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer212 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer333 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer333) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer333)))); + pointer3 = topPointer212; + value292 = floatAtPointer(pointer3); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value292); + goto l2105; + break; + case 103: + /* begin lowcodePrimitiveLoadInt16FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer35 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer343 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer343) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer343)))); + pointer4 = topPointer35; + value30 = int16AtPointer(pointer4); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value30); + goto l2105; + break; + case 104: + /* begin lowcodePrimitiveLoadInt32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer43 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer353 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer353) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer353)))); + pointer5 = topPointer43; + value315 = int32AtPointer(pointer5); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value315); + goto l2105; + break; + case 105: + /* begin lowcodePrimitiveLoadInt64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer53 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer363 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer363) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer363)))); + pointer6 = topPointer53; + value32 = int64AtPointer(pointer6); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value32); + goto l2105; + break; + case 106: + /* begin lowcodePrimitiveLoadInt8FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer6 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer373 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer373) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer373)))); + pointer7 = topPointer6; + value33 = int8AtPointer(pointer7); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value33); + goto l2105; + break; + case 107: + /* begin lowcodePrimitiveLoadLocalAddress */ + baseOffset12 = extA; + pointer8 = framePointerOfNativeLocalin(baseOffset12, localFP); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer8); + extA = 0; + goto l2105; + break; + case 108: + /* begin lowcodePrimitiveLoadLocalFloat32 */ + baseOffset13 = extA; + floatValue6 = singleFloatAtPointer(framePointerOfNativeLocalin(baseOffset13, localFP)); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, floatValue6); + extA = 0; + goto l2105; + break; + case 109: + /* begin lowcodePrimitiveLoadLocalFloat64 */ + baseOffset14 = extA; + doubleValue1 = floatAtPointer(framePointerOfNativeLocalin(baseOffset14, localFP)); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, doubleValue1); + extA = 0; + goto l2105; + break; + case 110: + /* begin lowcodePrimitiveLoadLocalInt16 */ + baseOffset15 = extA; + value34 = int16AtPointer(framePointerOfNativeLocalin(baseOffset15, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value34); + extA = 0; + goto l2105; + break; + case 111: + /* begin lowcodePrimitiveLoadLocalInt32 */ + baseOffset16 = extA; + value35 = int32AtPointer(framePointerOfNativeLocalin(baseOffset16, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value35); + extA = 0; + goto l2105; + break; + case 112: + /* begin lowcodePrimitiveLoadLocalInt64 */ + baseOffset17 = extA; + value36 = int64AtPointer(framePointerOfNativeLocalin(baseOffset17, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value36); + extA = 0; + goto l2105; + break; + case 113: + /* begin lowcodePrimitiveLoadLocalInt8 */ + baseOffset18 = extA; + value37 = int8AtPointer(framePointerOfNativeLocalin(baseOffset18, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value37); + extA = 0; + goto l2105; + break; + case 114: + /* begin lowcodePrimitiveLoadLocalPointer */ + baseOffset19 = extA; + pointerResult1 = pointerAtPointer(framePointerOfNativeLocalin(baseOffset19, localFP)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult1); + extA = 0; + goto l2105; + break; + case 115: + /* begin lowcodePrimitiveLoadLocalUInt16 */ + baseOffset20 = extA; + value38 = uint16AtPointer(framePointerOfNativeLocalin(baseOffset20, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value38); + extA = 0; + goto l2105; + break; + case 116: + /* begin lowcodePrimitiveLoadLocalUInt32 */ + baseOffset21 = extA; + value39 = uint32AtPointer(framePointerOfNativeLocalin(baseOffset21, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value39); + extA = 0; + goto l2105; + break; + case 117: + /* begin lowcodePrimitiveLoadLocalUInt64 */ + baseOffset22 = extA; + value40 = uint64AtPointer(framePointerOfNativeLocalin(baseOffset22, localFP)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value40); + extA = 0; + goto l2105; + break; + case 118: + /* begin lowcodePrimitiveLoadLocalUInt8 */ + baseOffset23 = extA; + value41 = uint8AtPointer(framePointerOfNativeLocalin(baseOffset23, localFP)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value41); + extA = 0; + goto l2105; + break; + case 119: + /* begin lowcodePrimitiveLoadObjectAt */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3217 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer383 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer383) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer383)))); + fieldIndex4 = topInt3217; + /* begin internalPopStack */ + top5 = longAt(localSP); + localSP += BytesPerOop; + object13 = top5; + /* begin fetchPointer:ofObject: */ + fieldValue = longAt((object13 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex4) << (shiftForWord()))))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), fieldValue); + goto l2105; + break; + default: + /* begin lowcodeUnaryInlinePrimitive3: */ + + switch (prim - 1000) { + case 120: + /* begin lowcodePrimitiveLoadObjectField */ + fieldIndex12 = extA; + /* begin internalPopStack */ + top41 = longAt(localSP); + localSP += BytesPerOop; + object41 = top41; + /* begin fetchPointer:ofObject: */ + fieldValue1 = longAt((object41 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord()))))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), fieldValue1); + extA = 0; + goto l3060; + break; + case 121: + /* begin lowcodePrimitiveLoadPointerFromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer32 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer591 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer591) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer591)))); + pointer10 = topPointer32; + pointerResult2 = pointerAtPointer(pointer10); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerResult2); + goto l3060; + break; + case 122: + /* begin lowcodePrimitiveLoadUInt16FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer113 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1301 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1301) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1301)))); + pointer12 = topPointer113; + value44 = uint16AtPointer(pointer12); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value44); + goto l3060; + break; + case 123: + /* begin lowcodePrimitiveLoadUInt32FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer211 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer213 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer213) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer213)))); + pointer22 = topPointer211; + value114 = uint32AtPointer(pointer22); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value114); + goto l3060; + break; + case 0x7C: + /* begin lowcodePrimitiveLoadUInt64FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer33 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer314 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer314) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer314)))); + pointer32 = topPointer33; + value212 = uint64AtPointer(pointer32); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value212); + goto l3060; + break; + case 125: + /* begin lowcodePrimitiveLoadUInt8FromMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer42 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer413 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer413) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer413)))); + pointer42 = topPointer42; + value312 = uint8AtPointer(pointer42); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value312); + goto l3060; + break; + case 0x7E: + /* begin lowcodePrimitiveLocalFrameSize */ + + /* Mark the frame */ + size5 = extA; + offset3 = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(localFP))->cmNumArgs) + : byteAt((localFP + FoxIFrameFlags) + 1)); + /* begin splObj: */ + valueOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(LowcodeContextMark) << (shiftForWord()))))); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + longAtput((offset3 < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? (localFP + FoxCallerSavedIP) + ((frameNumArgs - offset3) * BytesPerWord) + : ((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - offset3) * BytesPerWord)), valueOop); + } + else { + if (offset3 < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1)))) { + longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - offset3) * BytesPerWord), valueOop); + } + else { + longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - offset3) * BytesPerWord), valueOop); + } + } + /* begin nativePreviousStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 2), GIV(nativeStackPointer) + 1); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 2), GIV(nativeStackPointer) + 1); + } + GIV(nativeStackPointer) -= size5; + /* begin nativeFramePointerIn:put: */ + valueOopPointer422 = ((char*) (GIV(nativeStackPointer) + 1)); + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 3), valueOopPointer422); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 3), valueOopPointer422); + } + nativeSP = GIV(nativeStackPointer) + 1; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), GIV(nativeStackPointer) + 1); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), GIV(nativeStackPointer) + 1); + } + GIV(nativeStackPointer) -= 256; + extA = 0; + goto l3060; + break; + case 0x7F: + /* begin lowcodePrimitiveLockRegisters */ + abort(); + goto l3060; + break; + case 128: + /* begin lowcodePrimitiveLockVM */ + abort(); + goto l3060; + break; + case 129: + /* begin lowcodePrimitiveMalloc32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3230 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer581 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer581) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer581)))); + size6 = topInt3230; + pointer52 = malloc(size6); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer52); + goto l3060; + break; + case 130: + /* begin lowcodePrimitiveMalloc64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6429 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer631 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer631) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer631)))); + size11 = topInt6429; + pointer61 = malloc(size11); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer61); + goto l3060; + break; + case 131: + /* begin lowcodePrimitiveMemcpy32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32119 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer73 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer73) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer73)))); + size2 = topInt32119; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer52 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1113 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1113) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1113)))); + source = topPointer52; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer11 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer214 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer214) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer214)))); + dest = topPointer11; + memcpy(dest, source, size2); + goto l3060; + break; + case 132: + /* begin lowcodePrimitiveMemcpy64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64117 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer83 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer83) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer83)))); + size3 = topInt64117; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer62 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1211 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1211) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1211)))); + source1 = topPointer62; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer12 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer222 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer222) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer222)))); + dest1 = topPointer12; + memcpy(dest1, source1, size3); + goto l3060; + break; + case 133: + /* begin lowcodePrimitiveMemcpyFixed */ + size4 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer7 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer93 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer93) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer93)))); + source2 = topPointer7; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer13 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1331 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1331) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1331)))); + dest2 = topPointer13; + memcpy(dest2, source2, size4); + extA = 0; + goto l3060; + break; + case 134: + /* begin lowcodePrimitiveMoveFloat32ToPhysical */ + registerID6 = extA; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle28 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer102 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer102) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer102)))); + value43 = topSingle28; + lowcodeCalloutStatefloat32Registervalue(lowcodeCalloutState, registerID6, value43); + extA = 0; + goto l3060; + break; + case 135: + /* begin lowcodePrimitiveMoveFloat64ToPhysical */ + registerID1 = extA; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble51 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer142 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer142) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer142)))); + value52 = topDouble51; + lowcodeCalloutStatefloat64Registervalue(lowcodeCalloutState, registerID1, value52); + extA = 0; + goto l3060; + break; + case 136: + /* begin lowcodePrimitiveMoveInt32ToPhysical */ + registerID2 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32210 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer152 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer152) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer152)))); + value62 = topInt32210; + lowcodeCalloutStateint32Registervalue(lowcodeCalloutState, registerID2, value62); + extA = 0; + goto l3060; + break; + case 137: + /* begin lowcodePrimitiveMoveInt64ToPhysical */ + registerID3 = extA; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6428 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer162 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer162) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer162)))); + value72 = topInt6428; + lowcodeCalloutStateint64Registervalue(lowcodeCalloutState, registerID3, value72); + extA = 0; + goto l3060; + break; + case 138: + /* begin lowcodePrimitiveMovePointerToPhysical */ + registerID4 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer8 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer172 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer172) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer172)))); + pointerValue4 = topPointer8; + lowcodeCalloutStatepointerRegistervalue(lowcodeCalloutState, registerID4, pointerValue4); + extA = 0; + goto l3060; + break; + case 139: + /* begin lowcodePrimitiveMul32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3233 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer192 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer192) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer192)))); + second201 = topInt3233; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt321110 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer182 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer182) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer182)))); + first201 = topInt321110; + result35 = first201 * second201; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result35); + goto l3060; + break; + case 140: + /* begin lowcodePrimitiveMul64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6433 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer202 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer202) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer202)))); + second110 = topInt6433; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64118 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1102 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1102) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1102)))); + first110 = topInt64118; + result113 = first110 * second110; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result113); + goto l3060; + break; + case 141: + /* begin lowcodePrimitiveNeg32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3243 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer232 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer232) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer232)))); + value82 = topInt3243; + result213 = -value82; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result213); + goto l3060; + break; + case 142: + /* begin lowcodePrimitiveNeg64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6443 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer242 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer242) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer242)))); + value92 = topInt6443; + result34 = -value92; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result34); + goto l3060; + break; + case 143: + /* begin lowcodePrimitiveNot32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3253 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer252 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer252) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer252)))); + value102 = topInt3253; + result43 = value102 ^ -1; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result43); + goto l3060; + break; + case 144: + /* begin lowcodePrimitiveNot64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6452 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer262 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer262) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer262)))); + value113 = topInt6452; + result53 = value113 ^ -1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result53); + goto l3060; + break; + case 145: + /* begin lowcodePrimitiveOr32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3262 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer272 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer272) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer272)))); + second231 = topInt3262; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32122 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1114 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1114) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1114)))); + first231 = topInt32122; + result63 = first231 | second231; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result63); + goto l3060; + break; + case 146: + /* begin lowcodePrimitiveOr64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6462 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer282 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer282) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer282)))); + second33 = topInt6462; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64122 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1122 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1122) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1122)))); + first33 = topInt64122; + result73 = first33 | second33; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result73); + goto l3060; + break; + case 147: + /* begin lowcodePrimitivePerformCallFloat32 */ + function14 = extA; + /* begin lowcodeCalloutFloat32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function14)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize14 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer = ((char*) ((((size_t) (initialShadowCallStackPointer - calloutStateSize14))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer); + result182 = lowcodeCalloutStateFetchResultFloat32(lowcodeCalloutState); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result182); + extA = 0; + goto l3060; + break; + case 148: + /* begin lowcodePrimitivePerformCallFloat64 */ + function1 = extA; + /* begin lowcodeCalloutFloat64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function1)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize1 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer1 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer1 = ((char*) ((((size_t) (initialShadowCallStackPointer1 - calloutStateSize1))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer1); + result192 = lowcodeCalloutStateFetchResultFloat64(lowcodeCalloutState); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result192); + extA = 0; + goto l3060; + break; + case 149: + /* begin lowcodePrimitivePerformCallIndirectFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer22 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer432 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer432) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer432)))); + function2 = topPointer22; + /* begin lowcodeCalloutFloat32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function2); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize2 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer2 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer2 = ((char*) ((((size_t) (initialShadowCallStackPointer2 - calloutStateSize2))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer2); + result202 = lowcodeCalloutStateFetchResultFloat32(lowcodeCalloutState); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result202); + goto l3060; + break; + case 150: + /* begin lowcodePrimitivePerformCallIndirectFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer23 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer442 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer442) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer442)))); + function3 = topPointer23; + /* begin lowcodeCalloutFloat64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function3); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize3 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer3 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer3 = ((char*) ((((size_t) (initialShadowCallStackPointer3 - calloutStateSize3))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer3); + result214 = lowcodeCalloutStateFetchResultFloat64(lowcodeCalloutState); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result214); + goto l3060; + break; + case 151: + /* begin lowcodePrimitivePerformCallIndirectInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer24 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer452 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer452) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer452)))); + function4 = topPointer24; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function4); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize4 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer4 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer4 = ((char*) ((((size_t) (initialShadowCallStackPointer4 - calloutStateSize4))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer4); + result222 = lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result222); + goto l3060; + break; + case 152: + /* begin lowcodePrimitivePerformCallIndirectInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer25 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer462 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer462) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer462)))); + function5 = topPointer25; + /* begin lowcodeCalloutInt64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function5); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize5 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer5 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer5 = ((char*) ((((size_t) (initialShadowCallStackPointer5 - calloutStateSize5))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer5); + result232 = lowcodeCalloutStateFetchResultInt64(lowcodeCalloutState); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result232); + goto l3060; + break; + case 153: + /* begin lowcodePrimitivePerformCallIndirectPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer26 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer472 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer472) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer472)))); + function6 = topPointer26; + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function6); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize6 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer6 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer6 = ((char*) ((((size_t) (initialShadowCallStackPointer6 - calloutStateSize6))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer6); + result242 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result242); + goto l3060; + break; + case 154: + /* begin lowcodePrimitivePerformCallIndirectStructure */ + structureSize2 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer27 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer482 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer482) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer482)))); + result252 = topPointer27; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer110 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1172 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1172) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1172)))); + function7 = topPointer110; + /* begin lowcodeCallout:structureResult: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), result252); + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function7); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize7 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer7 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer7 = ((char*) ((((size_t) (initialShadowCallStackPointer7 - calloutStateSize7))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer7); + resultPointer = lowcodeCalloutStateFetchResultStructure(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, resultPointer); + extA = 0; + goto l3060; + break; + case 155: + /* begin lowcodePrimitivePerformCallIndirectVoid */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer28 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer492 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer492) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer492)))); + function8 = topPointer28; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), function8); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize8 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer8 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer8 = ((char*) ((((size_t) (initialShadowCallStackPointer8 - calloutStateSize8))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer8); + lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + goto l3060; + break; + case 156: + /* begin lowcodePrimitivePerformCallInt32 */ + function9 = extA; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function9)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize9 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer9 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer9 = ((char*) ((((size_t) (initialShadowCallStackPointer9 - calloutStateSize9))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer9); + result26 = lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result26); + extA = 0; + goto l3060; + break; + case 157: + /* begin lowcodePrimitivePerformCallInt64 */ + function10 = extA; + /* begin lowcodeCalloutInt64Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function10)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize10 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer10 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer10 = ((char*) ((((size_t) (initialShadowCallStackPointer10 - calloutStateSize10))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer10); + result27 = lowcodeCalloutStateFetchResultInt64(lowcodeCalloutState); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result27); + extA = 0; + goto l3060; + break; + case 158: + /* begin lowcodePrimitivePerformCallPointer */ + function11 = extA; + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function11)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize11 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer11 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer11 = ((char*) ((((size_t) (initialShadowCallStackPointer11 - calloutStateSize11))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer11); + result28 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result28); + extA = 0; + goto l3060; + break; + case 159: + /* begin lowcodePrimitivePerformCallStructure */ + function12 = extA; + structureSize1 = extB; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer29 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer502 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer502) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer502)))); + result29 = topPointer29; + /* begin internalPushShadowCallStackPointer: */ + + /* In the StackInterpreter stacks grow down. */ + GIV(shadowCallStackPointer) -= BytesPerOop; + pointerAtPointerput(GIV(shadowCallStackPointer), result29); + /* begin lowcodeCalloutPointerResult: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function12)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize12 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer12 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer12 = ((char*) ((((size_t) (initialShadowCallStackPointer12 - calloutStateSize12))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer12); + resultPointer1 = lowcodeCalloutStateFetchResultPointer(lowcodeCalloutState); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, resultPointer1); + extA = 0; + extB = 0; + numExtB = 0; + goto l3060; + break; + case 160: + /* begin lowcodePrimitivePerformCallVoid */ + function13 = extA; + /* begin lowcodeCalloutInt32Result: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + /* begin lowcodeCalloutState:callFunction: */ + lowcodeCalloutStatestackPointerstackSizecallFunction(lowcodeCalloutState, GIV(shadowCallStackPointer), (((char*) lowcodeCalloutState)) - GIV(shadowCallStackPointer), ((char*) function13)); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + /* begin reloadLowcodeStateAfterCallout */ + calloutStateSize13 = sizeof(sqLowcodeCalloutState); + initialShadowCallStackPointer13 = (shadowCallStackPointerIn(localFP)) - 1; + initialShadowCallStackPointer13 = ((char*) ((((size_t) (initialShadowCallStackPointer13 - calloutStateSize13))) & -16)); + lowcodeCalloutState = ((sqLowcodeCalloutState*) initialShadowCallStackPointer13); + lowcodeCalloutStateFetchResultInt32(lowcodeCalloutState); + extA = 0; + goto l3060; + break; + case 161: + /* begin lowcodePrimitivePlaftormCode */ + abort(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, code); + goto l3060; + break; + case 162: + /* begin lowcodePrimitivePointerAddConstantOffset */ + offset4 = extB; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer9 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer292 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer292) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer292)))); + base3 = topPointer9; + result83 = base3 + offset4; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result83); + extB = 0; + numExtB = 0; + goto l3060; + break; + case 163: + /* begin lowcodePrimitivePointerAddOffset32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3272 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer302 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer302) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer302)))); + offset11 = topInt3272; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer10 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1132 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1132) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1132)))); + base11 = topPointer10; + result92 = base11 + offset11; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result92); + goto l3060; + break; + case 164: + /* begin lowcodePrimitivePointerAddOffset64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6472 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer313 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer313) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer313)))); + offset2 = topInt6472; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer14 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1142 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1142) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1142)))); + base2 = topPointer14; + result102 = base2 + offset2; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result102); + goto l3060; + break; + case 165: + /* begin lowcodePrimitivePointerEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer16 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer322 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer322) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer322)))); + second42 = topPointer16; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer15 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1152 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1152) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1152)))); + first42 = topPointer15; + value122 = (first42 == second42 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value122); + goto l3060; + break; + case 166: + /* begin lowcodePrimitivePointerNotEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer18 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer332 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer332) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer332)))); + second52 = topPointer18; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer17 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1162 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1162) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1162)))); + first52 = topPointer17; + value132 = (first52 != second52 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value132); + goto l3060; + break; + case 167: + /* begin lowcodePrimitivePointerToInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer19 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer342 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer342) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer342)))); + pointer71 = topPointer19; + result114 = ((uintptr_t) pointer71); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result114); + goto l3060; + break; + case 168: + /* begin lowcodePrimitivePointerToInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer20 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer352 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer352) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer352)))); + pointer81 = topPointer20; + result122 = ((uintptr_t) pointer81); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result122); + goto l3060; + break; + case 169: + /* begin lowcodePrimitivePopFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle112 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer362 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer362) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer362)))); + value142 = topSingle112; + goto l3060; + break; + case 170: + /* begin lowcodePrimitivePopFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble121 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer372 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer372) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer372)))); + value152 = topDouble121; + goto l3060; + break; + case 171: + /* begin lowcodePrimitivePopInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3282 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer382 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer382) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer382)))); + value162 = topInt3282; + goto l3060; + break; + case 172: + /* begin lowcodePrimitivePopInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6482 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer392 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer392) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer392)))); + value172 = topInt6482; + goto l3060; + break; + case 173: + /* begin lowcodePrimitivePopMultipleNative */ + popSize = extA; + /* begin internalPopStackNativeSize: */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + /* begin nativeStackPointerIn:put: */ + valueOopPointer402 = nativeSP + popSize; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer402) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer402)))); + extA = 0; + goto l3060; + break; + case 174: + /* begin lowcodePrimitivePopPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer21 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer415 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer415) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer415)))); + pointerValue12 = topPointer21; + goto l3060; + break; + case 175: + /* begin lowcodePrimitivePushConstantUInt32 */ + constant = extA; + result132 = constant; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result132); + extA = 0; + goto l3060; + break; + case 176: + /* begin lowcodePrimitivePushConstantUInt64 */ + constant1 = extA; + result142 = constant1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result142); + extA = 0; + goto l3060; + break; + case 177: + /* begin lowcodePrimitivePushNullPointer */ + result152 = 0; + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, result152); + goto l3060; + break; + case 178: + /* begin lowcodePrimitivePushOne32 */ + result162 = 1; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result162); + goto l3060; + break; + case 179: + /* begin lowcodePrimitivePushOne64 */ + result172 = 1; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result172); + goto l3060; + break; + default: + /* begin lowcodeUnaryInlinePrimitive4: */ + + switch (prim - 1000) { + case 180: + /* begin lowcodePrimitivePushOneFloat32 */ + result32 = 1.0; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result32); + goto l2184; + break; + case 181: + /* begin lowcodePrimitivePushOneFloat64 */ + result112 = 1.0; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result112); + goto l2184; + break; + case 182: + /* begin lowcodePrimitivePushPhysicalFloat32 */ + registerID5 = extA; + value401 = lowcodeCalloutStatefloat32Register(lowcodeCalloutState, registerID5); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value401); + extA = 0; + goto l2184; + break; + case 183: + /* begin lowcodePrimitivePushPhysicalFloat64 */ + registerID11 = extA; + value111 = lowcodeCalloutStatefloat64Register(lowcodeCalloutState, registerID11); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value111); + extA = 0; + goto l2184; + break; + case 184: + /* begin lowcodePrimitivePushPhysicalInt32 */ + registerID21 = extA; + value211 = lowcodeCalloutStateint32Register(lowcodeCalloutState, registerID21); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value211); + extA = 0; + goto l2184; + break; + case 185: + /* begin lowcodePrimitivePushPhysicalInt64 */ + registerID31 = extA; + value310 = lowcodeCalloutStateint64Register(lowcodeCalloutState, registerID31); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value310); + extA = 0; + goto l2184; + break; + case 186: + /* begin lowcodePrimitivePushPhysicalPointer */ + registerID41 = extA; + pointerValue3 = lowcodeCalloutStatepointerRegister(lowcodeCalloutState, registerID41); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointerValue3); + extA = 0; + goto l2184; + break; + case 187: + /* begin lowcodePrimitivePushSessionIdentifier */ + value42 = getThisSessionID(); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value42); + goto l2184; + break; + case 188: + /* begin lowcodePrimitivePushZero32 */ + result212 = 0; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result212); + goto l2184; + break; + case 189: + /* begin lowcodePrimitivePushZero64 */ + result33 = 0; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result33); + goto l2184; + break; + case 190: + /* begin lowcodePrimitivePushZeroFloat32 */ + result42 = 0.0; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result42); + goto l2184; + break; + case 191: + /* begin lowcodePrimitivePushZeroFloat64 */ + result52 = 0.0; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result52); + goto l2184; + break; + case 192: + /* begin lowcodePrimitiveRem32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3229 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer571 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer571) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer571)))); + second181 = topInt3229; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32117 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1291 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1291) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1291)))); + first181 = topInt32117; + result62 = first181 % second181; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result62); + goto l2184; + break; + case 193: + /* begin lowcodePrimitiveRem64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6426 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2111 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2111)))); + second191 = topInt6426; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64116 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1112 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1112) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1112)))); + first191 = topInt64116; + result72 = first191 % second191; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result72); + goto l2184; + break; + case 194: + /* begin lowcodePrimitiveRightShift32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3228 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer311 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer311) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer311)))); + shiftAmount2 = topInt3228; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32118 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1210 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1210) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1210)))); + value51 = topInt32118; + result82 = ((usqInt) value51) >> shiftAmount2; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result82); + goto l2184; + break; + case 195: + /* begin lowcodePrimitiveRightShift64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6427 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer411 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer411) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer411)))); + shiftAmount11 = topInt6427; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64115 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1321 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1321) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1321)))); + value61 = topInt64115; + result91 = ((unsigned sqLong)value61) >> shiftAmount11; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result91); + goto l2184; + break; + case 196: + /* begin lowcodePrimitiveSignExtend32From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3232 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer561 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer561) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer561)))); + value71 = topInt3232; + result101 = ((signed short) value71); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result101); + goto l2184; + break; + case 197: + /* begin lowcodePrimitiveSignExtend32From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3242 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer621 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer621) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer621)))); + value81 = topInt3242; + result111 = ((signed char) value81); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result111); + goto l2184; + break; + case 198: + /* begin lowcodePrimitiveSignExtend64From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6432 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer72 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer72) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer72)))); + value91 = topInt6432; + result121 = ((int16_t) value91); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result121); + goto l2184; + break; + case 199: + /* begin lowcodePrimitiveSignExtend64From32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3252 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer82 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer82) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer82)))); + value101 = topInt3252; + result131 = ((int32_t) value101); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result131); + goto l2184; + break; + case 200: + /* begin lowcodePrimitiveSignExtend64From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6442 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer92 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer92) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer92)))); + value112 = topInt6442; + result141 = ((signed char) value112); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result141); + goto l2184; + break; + case 201: + /* begin lowcodePrimitiveStoreFloat32ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer30 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer101 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer101)))); + pointer9 = topPointer30; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle27 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer141 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer141) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer141)))); + floatValue7 = topSingle27; + singleFloatAtPointerput(pointer9, floatValue7); + goto l2184; + break; + case 202: + /* begin lowcodePrimitiveStoreFloat64ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer112 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer161 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer161) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer161)))); + pointer11 = topPointer112; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble211 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer151 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer151) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer151)))); + doubleValue2 = topDouble211; + floatAtPointerput(pointer11, doubleValue2); + goto l2184; + break; + case 203: + /* begin lowcodePrimitiveStoreInt16ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer210 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer181 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer181) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer181)))); + pointer21 = topPointer210; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3261 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer171 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer171) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer171)))); + value121 = topInt3261; + int16AtPointerput(pointer21, value121); + goto l2184; + break; + case 204: + /* begin lowcodePrimitiveStoreInt32ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer31 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer201 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer201) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer201)))); + pointer31 = topPointer31; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3271 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer191 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer191) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer191)))); + value131 = topInt3271; + int32AtPointerput(pointer31, value131); + goto l2184; + break; + case 205: + /* begin lowcodePrimitiveStoreInt64ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer41 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer212 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer212) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer212)))); + pointer41 = topPointer41; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6451 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1101 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1101)))); + value141 = topInt6451; + int64AtPointerput(pointer41, value141); + goto l2184; + break; + case 206: + /* begin lowcodePrimitiveStoreInt8ToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer51 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer221 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer221) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer221)))); + pointer51 = topPointer51; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3281 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1111 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1111) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1111)))); + value151 = topInt3281; + int8AtPointerput(pointer51, value151); + goto l2184; + break; + case 207: + /* begin lowcodePrimitiveStoreLocalFloat32 */ + baseOffset25 = extA; + /* begin internalPopStackFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topSingle113 = singleFloatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer231 = nativeSP + 4; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer231) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer231)))); + value161 = topSingle113; + singleFloatAtPointerput(framePointerOfNativeLocalin(baseOffset25, localFP), value161); + extA = 0; + goto l2184; + break; + case 208: + /* begin lowcodePrimitiveStoreLocalFloat64 */ + baseOffset110 = extA; + /* begin internalPopStackFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topDouble111 = floatAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer241 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer241) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer241)))); + value171 = topDouble111; + floatAtPointerput(framePointerOfNativeLocalin(baseOffset110, localFP), value171); + extA = 0; + goto l2184; + break; + case 209: + /* begin lowcodePrimitiveStoreLocalInt16 */ + baseOffset24 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3291 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer251 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer251) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer251)))); + value181 = topInt3291; + int16AtPointerput(framePointerOfNativeLocalin(baseOffset24, localFP), value181); + extA = 0; + goto l2184; + break; + case 210: + /* begin lowcodePrimitiveStoreLocalInt32 */ + baseOffset31 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32101 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer261 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer261) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer261)))); + value191 = topInt32101; + int32AtPointerput(framePointerOfNativeLocalin(baseOffset31, localFP), value191); + extA = 0; + goto l2184; + break; + case 211: + /* begin lowcodePrimitiveStoreLocalInt64 */ + lowcodeStoreLocalInt64Workaroundinsp(extA, localFP, localSP); + + extA = 0; + goto l2184; + break; + case 212: + /* begin lowcodePrimitiveStoreLocalInt8 */ + baseOffset41 = extA; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32121 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer281 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer281) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer281)))); + value201 = topInt32121; + int8AtPointerput(framePointerOfNativeLocalin(baseOffset41, localFP), value201); + extA = 0; + goto l2184; + break; + case 213: + /* begin lowcodePrimitiveStoreLocalPointer */ + baseOffset51 = extA; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer61 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer291 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer291) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer291)))); + pointerValue11 = topPointer61; + pointerAtPointerput(framePointerOfNativeLocalin(baseOffset51, localFP), pointerValue11); + extA = 0; + goto l2184; + break; + case 214: + /* begin lowcodePrimitiveStorePointerToMemory */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer71 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer301 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer301) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer301)))); + memoryPointer = topPointer71; + /* begin internalPopStackPointer */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topPointer111 = pointerAtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1121 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1121) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1121)))); + pointerValue2 = topPointer111; + pointerAtPointerput(memoryPointer, pointerValue2); + goto l2184; + break; + case 215: + /* begin lowcodePrimitiveSub32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32131 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer312 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer312) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer312)))); + second221 = topInt32131; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32141 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1131 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1131) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1131)))); + first221 = topInt32141; + result151 = first221 - second221; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result151); + goto l2184; + break; + case 216: + /* begin lowcodePrimitiveSub64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6471 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer321 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer321) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer321)))); + second32 = topInt6471; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64121 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1141 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1141) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1141)))); + first32 = topInt64121; + result161 = first32 - second32; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result161); + goto l2184; + break; + case 217: + /* begin lowcodePrimitiveTruncate32To16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32151 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer331 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer331) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer331)))); + value213 = topInt32151; + result171 = value213 & 0xFFFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result171); + goto l2184; + break; + case 218: + /* begin lowcodePrimitiveTruncate32To8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32161 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer341 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer341) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer341)))); + value221 = topInt32161; + result181 = value221 & 0xFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result181); + goto l2184; + break; + case 219: + /* begin lowcodePrimitiveTruncate64To16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6481 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer351 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer351) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer351)))); + value231 = topInt6481; + result191 = value231 & 0xFFFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result191); + goto l2184; + break; + case 220: + /* begin lowcodePrimitiveTruncate64To32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6491 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer361 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer361) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer361)))); + value241 = topInt6491; + result201 = value241 & 0xFFFFFFFFU; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result201); + goto l2184; + break; + case 221: + /* begin lowcodePrimitiveTruncate64To8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64101 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer371 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer371) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer371)))); + value251 = topInt64101; + result211 = value251 & 0xFF; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result211); + goto l2184; + break; + case 222: + /* begin lowcodePrimitiveUdiv32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32171 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer381 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer381) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer381)))); + second41 = topInt32171; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32181 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1151 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1151) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1151)))); + first41 = topInt32181; + result221 = (((unsigned int) first41)) / (((unsigned int) second41)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result221); + goto l2184; + break; + case 223: + /* begin lowcodePrimitiveUdiv64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64131 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer391 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer391) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer391)))); + second51 = topInt64131; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64141 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1161 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1161) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1161)))); + first51 = topInt64141; + result231 = (((uint64_t) first51)) / (((uint64_t) second51)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result231); + goto l2184; + break; + case 224: + /* begin lowcodePrimitiveUint32Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3219 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer401 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer401) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer401)))); + second61 = topInt3219; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32110 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1171 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1171) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1171)))); + first61 = topInt32110; + value261 = ((((unsigned int) first61)) > (((unsigned int) second61)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value261); + goto l2184; + break; + case 225: + /* begin lowcodePrimitiveUint32GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3220 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer412 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer412) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer412)))); + second71 = topInt3220; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32111 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1181 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1181) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1181)))); + first71 = topInt32111; + value271 = ((((unsigned int) first71)) >= (((unsigned int) second71)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value271); + goto l2184; + break; + case 226: + /* begin lowcodePrimitiveUint32Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32212 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer421 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer421) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer421)))); + second81 = topInt32212; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32112 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1191 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1191) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1191)))); + first81 = topInt32112; + value281 = ((((unsigned int) first81)) < (((unsigned int) second81)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value281); + goto l2184; + break; + case 227: + /* begin lowcodePrimitiveUint32LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3222 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer431 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer431) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer431)))); + second91 = topInt3222; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32113 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1201 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1201) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1201)))); + first91 = topInt32113; + value291 = ((((unsigned int) first91)) <= (((unsigned int) second91)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value291); + goto l2184; + break; + case 228: + /* begin lowcodePrimitiveUint32ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3223 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer441 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer441) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer441)))); + value301 = topInt3223; + result241 = ((float) (((unsigned int) value301))); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result241); + goto l2184; + break; + case 229: + /* begin lowcodePrimitiveUint32ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3224 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer451 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer451) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer451)))); + value311 = topInt3224; + result251 = ((double) (((unsigned int) value311))); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result251); + goto l2184; + break; + case 230: + /* begin lowcodePrimitiveUint64Great */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64151 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer461 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer461) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer461)))); + second101 = topInt64151; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64161 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1213 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1213) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1213)))); + first101 = topInt64161; + value321 = ((((uint64_t) first101)) > (((uint64_t) second101)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value321); + goto l2184; + break; + case 231: + /* begin lowcodePrimitiveUint64GreatEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6417 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer471 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer471) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer471)))); + second111 = topInt6417; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6418 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1221 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1221) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1221)))); + first111 = topInt6418; + value331 = ((((uint64_t) first111)) >= (((uint64_t) second111)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value331); + goto l2184; + break; + case 232: + /* begin lowcodePrimitiveUint64Less */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6419 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer481 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer481) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer481)))); + second121 = topInt6419; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64110 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1231 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1231) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1231)))); + first121 = topInt64110; + value341 = ((((uint64_t) first121)) < (((uint64_t) second121)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value341); + goto l2184; + break; + case 233: + /* begin lowcodePrimitiveUint64LessEqual */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6420 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer491 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer491) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer491)))); + second131 = topInt6420; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64111 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1241 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1241) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1241)))); + first131 = topInt64111; + value351 = ((((uint64_t) first131)) <= (((uint64_t) second131)) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value351); + goto l2184; + break; + case 234: + /* begin lowcodePrimitiveUint64ToFloat32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64211 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer501 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer501) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer501)))); + value361 = topInt64211; + result261 = ((float) (((uint64_t) value361))); + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, result261); + goto l2184; + break; + case 235: + /* begin lowcodePrimitiveUint64ToFloat64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6422 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer511 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer511) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer511)))); + value371 = topInt6422; + result271 = ((double) (((uint64_t) value371))); + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, result271); + goto l2184; + break; + case 236: + /* begin lowcodePrimitiveUmul32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3225 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer521 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer521) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer521)))); + second141 = topInt3225; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32114 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1251 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1251) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1251)))); + first141 = topInt32114; + result281 = (((unsigned int) first141)) * (((unsigned int) second141)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result281); + goto l2184; + break; + case 237: + /* begin lowcodePrimitiveUmul64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6423 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer531 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer531) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer531)))); + second151 = topInt6423; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64112 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1261 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1261) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1261)))); + first151 = topInt64112; + result291 = (((uint64_t) first151)) * (((uint64_t) second151)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result291); + goto l2184; + break; + case 238: + /* begin lowcodePrimitiveUnlockRegisters */ + abort(); + goto l2184; + break; + case 239: + /* begin lowcodePrimitiveUnlockVM */ + abort(); + goto l2184; + break; + default: + /* begin lowcodeUnaryInlinePrimitive5: */ + + switch (prim - 1000) { + case 240: + /* begin lowcodePrimitiveUrem32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3227 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer541 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer541) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer541)))); + second161 = topInt3227; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32115 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1271 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1271) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1271)))); + first171 = topInt32115; + result30 = (((unsigned int) first171)) % (((unsigned int) second161)); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result30); + goto l2391; + break; + case 241: + /* begin lowcodePrimitiveUrem64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6425 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer2101 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer2101) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer2101)))); + second171 = topInt6425; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64113 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1110 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1110) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1110)))); + first161 = topInt64113; + result110 = (((unsigned int) first161)) % (((unsigned int) second171)); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result110); + goto l2391; + break; + case 242: + /* begin lowcodePrimitiveXor32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3226 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer310 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer310) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer310)))); + second211 = topInt3226; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32116 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1281 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1281) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1281)))); + first211 = topInt32116; + result210 = first211 ^ second211; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result210); + goto l2391; + break; + case 243: + /* begin lowcodePrimitiveXor64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6424 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer410 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer410) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer410)))); + second31 = topInt6424; + /* begin internalPopStackInt64 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt64114 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer1311 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer1311) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer1311)))); + first31 = topInt64114; + result31 = first31 ^ second31; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result31); + goto l2391; + break; + case 244: + /* begin lowcodePrimitiveZeroExtend32From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3231 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer551 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer551) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer551)))); + value391 = topInt3231; + result41 = ((uint16_t) value391); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result41); + goto l2391; + break; + case 245: + /* begin lowcodePrimitiveZeroExtend32From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3241 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer611 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer611) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer611)))); + value110 = topInt3241; + result51 = ((uint8_t) value110); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, result51); + goto l2391; + break; + case 246: + /* begin lowcodePrimitiveZeroExtend64From16 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6431 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer71 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer71) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer71)))); + value210 = topInt6431; + result61 = ((uint16_t) value210); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result61); + goto l2391; + break; + case 247: + /* begin lowcodePrimitiveZeroExtend64From32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt3251 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer81 = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer81) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer81)))); + value381 = topInt3251; + result71 = ((uint32_t) value381); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result71); + goto l2391; + break; + case 0xF8: + /* begin lowcodePrimitiveZeroExtend64From8 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt6441 = long64AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer91 = nativeSP + 8; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer91) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer91)))); + value411 = topInt6441; + result81 = ((uint8_t) value411); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, result81); + goto l2391; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l2391; + + } + l2391: /* end lowcodeUnaryInlinePrimitive5: */; + goto l2184; + + } + l2184: /* end lowcodeUnaryInlinePrimitive4: */; + goto l3060; + + } + l3060: /* end lowcodeUnaryInlinePrimitive3: */; + goto l2105; + + } + l2105: /* end lowcodeUnaryInlinePrimitive2: */; + goto l2096; + + } + l2096: /* end lowcodeUnaryInlinePrimitive: */; + goto l1835; + } + if (prim < 3000) { + /* begin lowcodeBinaryInlinePrimitive: */ + + switch (prim - 2000) { + case 0: + /* begin lowcodePrimitiveByteSizeOf */ + top211 = longAt(localSP); + localSP += BytesPerOop; + object211 = top211; + /* begin byteSizeOf: */ + if (object211 & (tagMask())) { + value154 = 0; + goto l2206; + } + /* begin numBytesOf: */ + fmt1 = (((usqInt) (longAt(object211))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(object211)) > (isForwardedObjectClassIndexPun())); + numSlots3 = byteAt(object211 + 7); + numBytes3 = (numSlots3 == (numSlotsMask()) + ? longAt(object211 - BaseHeaderSize) + : numSlots3); + numBytes3 = numBytes3 << (shiftForWord()); + if (fmt1 >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + value154 = numBytes3 - (fmt1 & 7); + goto l2206; + } + if (fmt1 <= (sixtyFourBitIndexableFormat())) { + value154 = numBytes3; + goto l2206; + } + if (fmt1 >= (firstShortFormat())) { + value154 = numBytes3 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); + goto l2206; + } + value154 = numBytes3 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); + l2206: /* end byteSizeOf: */; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value154); + goto l2088; + break; + case 1: + /* begin lowcodePrimitiveFirstFieldPointer */ + top110 = longAt(localSP); + localSP += BytesPerOop; + object110 = top110; + /* begin firstFixedField: */ + pointer17 = ((void *) (pointerForOop(object110 + BaseHeaderSize))); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer17); + goto l2088; + break; + case 2: + /* begin lowcodePrimitiveFirstIndexableFieldPointer */ + top25 = longAt(localSP); + localSP += BytesPerOop; + object25 = top25; + pointer18 = firstIndexableField(object25); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer18); + goto l2088; + break; + case 3: + /* begin lowcodePrimitiveIsBytes */ + top32 = longAt(localSP); + localSP += BytesPerOop; + object32 = top32; + value50 = (((object32 & (tagMask())) == 0) + && (((((usqInt) (longAt(object32))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value50); + goto l2088; + break; + case 4: + /* begin lowcodePrimitiveIsFloatObject */ + top42 = longAt(localSP); + localSP += BytesPerOop; + object42 = top42; + value120 = (((object42 & (tagMask())) == 0) + && (((longAt(object42)) & (classIndexMask())) == ClassFloatCompactIndex) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value120); + goto l2088; + break; + case 5: + /* begin lowcodePrimitiveIsIndexable */ + top51 = longAt(localSP); + localSP += BytesPerOop; + object51 = top51; + value218 = (isIndexable(object51) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value218); + goto l2088; + break; + case 6: + /* begin lowcodePrimitiveIsIntegerObject */ + top6 = longAt(localSP); + localSP += BytesPerOop; + object61 = top6; + value316 = ((object61 & 1) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value316); + goto l2088; + break; + case 7: + /* begin lowcodePrimitiveIsPointers */ + top7 = longAt(localSP); + localSP += BytesPerOop; + object71 = top7; + value49 = (((object71 & (tagMask())) == 0) + && (((((usqInt) (longAt(object71))) >> (formatShift())) & (formatMask())) <= 5) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value49); + goto l2088; + break; + case 8: + /* begin lowcodePrimitiveIsWords */ + top8 = longAt(localSP); + localSP += BytesPerOop; + object81 = top8; + value55 = (((object81 & (tagMask())) == 0) + && (((((usqInt) (longAt(object81))) >> (formatShift())) & (formatMask())) == (firstLongFormat())) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value55); + goto l2088; + break; + case 9: + /* begin lowcodePrimitiveIsWordsOrBytes */ + top9 = longAt(localSP); + localSP += BytesPerOop; + object91 = top9; + value65 = (((object91 & (tagMask())) == 0) + && (isPureBitsFormat((((usqInt) (longAt(object91))) >> (formatShift())) & (formatMask()))) + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value65); + goto l2088; + break; + case 10: + /* begin lowcodePrimitiveOopSmallIntegerToInt32 */ + top10 = longAt(localSP); + localSP += BytesPerOop; + object101 = top10; + value75 = (object101 >> 1); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value75); + goto l2088; + break; + case 11: + /* begin lowcodePrimitiveOopSmallIntegerToInt64 */ + top111 = longAt(localSP); + localSP += BytesPerOop; + object111 = top111; + value84 = (object111 >> 1); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value84); + goto l2088; + break; + case 12: + /* begin lowcodePrimitiveOopToBoolean32 */ + top121 = longAt(localSP); + localSP += BytesPerOop; + object121 = top121; + /* begin booleanValueOf: */ + if (object121 == GIV(trueObj)) { + value94 = 1; + goto l2202; + } + if (object121 == GIV(falseObj)) { + value94 = 0; + goto l2202; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + value94 = null; + l2202: /* end booleanValueOf: */; + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value94); + goto l2088; + break; + case 13: + /* begin lowcodePrimitiveOopToBoolean64 */ + top131 = longAt(localSP); + localSP += BytesPerOop; + object131 = top131; + /* begin booleanValueOf: */ + if (object131 == GIV(trueObj)) { + value104 = ((sqInt) 1); + goto l2549; + } + if (object131 == GIV(falseObj)) { + value104 = ((sqInt) 0); + goto l2549; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + value104 = null; + l2549: /* end booleanValueOf: */; + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value104); + goto l2088; + break; + case 14: + /* begin lowcodePrimitiveOopToFloat32 */ + top141 = longAt(localSP); + localSP += BytesPerOop; + object141 = top141; + /* begin floatValueOf: */ + isFloat = ((object141 & (tagMask())) == 0) + && (((longAt(object141)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(object141 + BaseHeaderSize, result39); + value119 = result39; + goto l2162; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + value119 = 0.0; + l2162: /* end floatValueOf: */; + /* begin internalPushFloat32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + singleFloatAtPointerput(nativeSP - 1, value119); + goto l2088; + break; + case 15: + /* begin lowcodePrimitiveOopToFloat64 */ + top15 = longAt(localSP); + localSP += BytesPerOop; + object15 = top15; + /* begin floatValueOf: */ + isFloat1 = ((object15 & (tagMask())) == 0) + && (((longAt(object15)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(object15 + BaseHeaderSize, result117); + value124 = result117; + goto l2079; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + value124 = 0.0; + l2079: /* end floatValueOf: */; + /* begin internalPushFloat64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + floatAtPointerput(nativeSP - 1, value124); + goto l2088; + break; + case 16: + /* begin lowcodePrimitiveOopToInt32 */ + top16 = longAt(localSP); + localSP += BytesPerOop; + object16 = top16; + value134 = signed32BitValueOf(object16); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value134); + goto l2088; + break; + case 17: + /* begin lowcodePrimitiveOopToInt64 */ + top17 = longAt(localSP); + localSP += BytesPerOop; + object17 = top17; + value144 = signed64BitValueOf(object17); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value144); + goto l2088; + break; + case 18: + /* begin lowcodePrimitiveOopToPointer */ + top18 = longAt(localSP); + localSP += BytesPerOop; + object18 = top18; + pointer23 = pointerAtPointer(firstIndexableField(object18)); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer23); + goto l2088; + break; + case 19: + /* begin lowcodePrimitiveOopToPointerReinterpret */ + top19 = longAt(localSP); + localSP += BytesPerOop; + object19 = top19; + pointer33 = ((char*) object19); + /* begin internalPushPointer: */ + nativeSP = (nativeStackPointerIn(localFP)) - BytesPerOop; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + pointerAtPointerput(nativeSP - 1, pointer33); + goto l2088; + break; + case 20: + /* begin lowcodePrimitiveOopToUInt32 */ + top23 = longAt(localSP); + localSP += BytesPerOop; + object23 = top23; + value174 = positive32BitValueOf(object23); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value174); + goto l2088; + break; + case 21: + /* begin lowcodePrimitiveOopToUInt64 */ + top22 = longAt(localSP); + localSP += BytesPerOop; + object22 = top22; + value164 = positive64BitValueOf(object22); + /* begin internalPushInt64: */ + nativeSP = (nativeStackPointerIn(localFP)) - 8; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + long64AtPointerput(nativeSP - 1, value164); + goto l2088; + break; + case 22: + /* begin lowcodePrimitivePin */ + top24 = longAt(localSP); + localSP += BytesPerOop; + object24 = top24; + pinObject(object24); + goto l2088; + break; + case 23: + /* begin lowcodePrimitiveUnpin */ + top20 = longAt(localSP); + localSP += BytesPerOop; + object20 = top20; + /* begin unpinObject: */ + assert(isNonImmediate(object20)); + /* begin setIsPinnedOf:to: */ + longAtput(object20, (longAt(object20)) & ((unsigned int)~(1U << (pinnedBitShift())))); + goto l2088; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l2088; + + } + l2088: /* end lowcodeBinaryInlinePrimitive: */; + goto l1835; + } + if (prim < 4000) { + /* begin lowcodeTrinaryInlinePrimitive: */ + + switch (prim - 3000) { + case 0: + /* begin lowcodePrimitiveOopEqual */ + top = longAt(localSP); + localSP += BytesPerOop; + second = top; + /* begin internalPopStack */ + top1 = longAt(localSP); + localSP += BytesPerOop; + first = top1; + value = (first == second + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value); + goto l2103; + break; + case 1: + /* begin lowcodePrimitiveOopNotEqual */ + top2 = longAt(localSP); + localSP += BytesPerOop; + second1 = top2; + /* begin internalPopStack */ + top11 = longAt(localSP); + localSP += BytesPerOop; + first1 = top11; + value1 = (first1 != second1 + ? 1 + : 0); + /* begin internalPushInt32: */ + nativeSP = (nativeStackPointerIn(localFP)) - 4; + /* begin nativeStackPointerIn:put: */ + if ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())) { + pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), nativeSP); + } + else { + pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), nativeSP); + } + int32AtPointerput(nativeSP - 1, value1); + goto l2103; + break; + case 2: + /* begin lowcodePrimitiveStoreObjectField */ + fieldIndex3 = extA; + /* begin internalPopStack */ + top3 = longAt(localSP); + localSP += BytesPerOop; + value2 = top3; + /* begin internalPopStack */ + top12 = longAt(localSP); + localSP += BytesPerOop; + object = top12; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value2 & (tagMask())) == 0) + && (oopisLessThan(value2, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))), value2); + extA = 0; + goto l2103; + break; + case 3: + /* begin lowcodePrimitiveStoreObjectFieldAt */ + top4 = longAt(localSP); + localSP += BytesPerOop; + value3 = top4; + /* begin internalPopStackInt32 */ + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((localFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((localFP + FoxIFReceiver) - (BytesPerWord * 4))))); + topInt32 = int32AtPointer(nativeSP - 1); + /* begin nativeStackPointerIn:put: */ + valueOopPointer = nativeSP + BytesPerOop; + nativeSP = ((char*) (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointerput((localFP + FoxMFReceiver) - (BytesPerWord * 4), valueOopPointer) + : pointerAtPointerput((localFP + FoxIFReceiver) - (BytesPerWord * 4), valueOopPointer)))); + fieldIndex11 = topInt32; + /* begin internalPopStack */ + top13 = longAt(localSP); + localSP += BytesPerOop; + object1 = top13; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object1))); + if ((assert(isNonImmediate(object1)), + oopisGreaterThanOrEqualTo(object1, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value3 & (tagMask())) == 0) + && (oopisLessThan(value3, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object1))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object1); + } + } + } + longAtput((object1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord())))), value3); + goto l2103; + break; + default: + localIP -= 3; + goto respondToUnknownBytecode; + goto l2103; + + } + l2103: /* end lowcodeTrinaryInlinePrimitive: */; + goto l1835; + } + } + + localIP -= 3; + goto respondToUnknownBytecode; + goto l1835; + + } + l1835: /* end case */; + break; + case 505: /*249*/ + /* extPushFullClosureBytecode */ + { + sqInt byte; + sqInt compiledBlock; + sqInt compiledBlockLiteralIndex; + sqInt context; + sqInt header; + sqInt header1; + sqInt i; + int ignoreContext; + sqInt newClosure; + sqInt newClosure1; + usqInt newObj; + sqInt numArgs; + usqInt numBytes; + sqInt numCopied; + sqInt numCopied1; + sqInt numSlots; + sqInt objFormat; + int receiverIsOnStack; + sqInt startIndex; + char *theFP; + char *theSP; + + VM_LABEL(extPushFullClosureBytecode); + compiledBlockLiteralIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8))); + extA = 0; + assert(GIV(method) == (iframeMethod(localFP))); + /* begin literal:ofMethod: */ + compiledBlock = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((compiledBlockLiteralIndex + LiteralStart)) << (shiftForWord()))))); + + assert(isOopCompiledMethod(compiledBlock)); + /* begin argumentCountOf: */ + assert(isCompiledMethod(compiledBlock)); + header1 = longAt((compiledBlock + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + numArgs = (((usqInt) header) >> MethodHeaderArgCountShift) & 15; + byte = byteAtPointer(++localIP); + numCopied = byte & ((1U << 6) - 1); + receiverIsOnStack = byte & (1U << 7); + ignoreContext = byte & (1U << 6); + /* begin pushFullClosureNumArgs:copiedValues:compiledBlock:receiverIsOnStack:ignoreContext: */ + if (ignoreContext) { + /* begin nilObject */ + context = GIV(nilObj); + } + else { + /* begin ensureFrameIsMarried:SP: */ + theFP = localFP; + theSP = localSP + (numCopied * BytesPerOop); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + context = longAt(theFP + FoxThisContext); + goto l3093; + } + context = marryFrameSP(theFP, theSP); + l3093: /* end ensureFrameIsMarried:SP: */; + } + /* begin fullClosureIn:numArgs:numCopiedValues:compiledBlock: */ + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = indexablePointersFormat(); + numSlots = FullClosureFirstCopiedValueIndex + numCopied; + assert((numSlots >= 0) + && (ClassFullBlockClosureCompactIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassFullBlockClosureCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newClosure1 = 0; + goto l3087; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFullBlockClosureCompactIndex); + GIV(freeStart) += numBytes; + newClosure1 = newObj; + l3087: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord())))), compiledBlock); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 1) | 1)); + newClosure = newClosure1; + if (recordSendTrace()) { + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation; + GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure; + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + if (receiverIsOnStack) { + startIndex = FullClosureReceiverIndex; + numCopied1 = numCopied + 1; + } + else { + startIndex = FullClosureFirstCopiedValueIndex; + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure))); + longAtput((newClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureReceiverIndex) << (shiftForWord())))), longAt(localFP + FoxIFReceiver)); + numCopied1 = numCopied; + } + if (numCopied1 > 0) { + for (i = 0; i < numCopied1; i += 1) { + + /* Assume: have just allocated a new BlockClosure; it must be young. + Thus, can use unchecked stores. */ + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure))); + longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + startIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied1 - i) - 1) * BytesPerOop))); + } + /* begin internalPop: */ + localSP += numCopied1 * BytesPerOop; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), newClosure); + } + break; + case 506: /*250*/ + /* extPushClosureBytecode */ + { + sqInt blockSize; + sqInt byte; + sqInt context; + sqInt i; + sqInt initialIP; + sqInt newClosure; + sqInt newClosure1; + usqInt newObj; + sqInt numArgs; + usqInt numBytes; + sqInt numCopied; + sqInt numSlots; + sqInt objFormat; + char *theFP; + char *theSP; + + VM_LABEL(extPushClosureBytecode); + byte = byteAtPointer(++localIP); + numArgs = (byte & 7) + ((extA % 16) * 8); + numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8); + extA = 0; + blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8))); + numExtB = (extB = 0); + /* begin pushClosureNumArgs:copiedValues:blockSize: */ + theFP = localFP; + theSP = localSP + (numCopied * BytesPerOop); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + context = longAt(theFP + FoxThisContext); + goto l3103; + } + context = marryFrameSP(theFP, theSP); + l3103: /* end ensureFrameIsMarried:SP: */; + /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ + initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize); + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = indexablePointersFormat(); + numSlots = ClosureFirstCopiedValueIndex + numCopied; + assert((numSlots >= 0) + && (ClassBlockClosureCompactIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newClosure1 = 0; + goto l3099; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex); + GIV(freeStart) += numBytes; + newClosure1 = newObj; + l3099: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 1) | 1)); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure1))); + longAtput((newClosure1 + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 1) | 1)); + newClosure = newClosure1; + if (recordSendTrace()) { + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation; + GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure; + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + if (numCopied > 0) { + for (i = 0; i < numCopied; i += 1) { + + /* Assume: have just allocated a new BlockClosure; it must be young. + Thus, can use unchecked stores. */ + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newClosure))); + longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied - i) - 1) * BytesPerOop))); + } + /* begin internalPop: */ + localSP += numCopied * BytesPerOop; + } + localIP += blockSize; + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), newClosure); + } + break; + case 507: /*251*/ + /* extPushRemoteTempOrInstVarLongBytecode */ + { + sqInt callerContextOrNil; + char *callerFP; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt frameNumArgs2; + sqInt object; + sqInt object1; + sqInt object2; + sqInt result; + sqInt senderOop; + sqInt slotIndex; + char *spouseFP; + sqInt tempIndex; + sqInt tempVector; + StackPage *thePage; + sqInt value; + + VM_LABEL(extPushRemoteTempOrInstVarLongBytecode); + slotIndex = byteAtPointer(++localIP); + tempIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if ((tempIndex & (remoteIsInstVarAccess())) == 0) { + /* begin pushRemoteTemp:inVectorAt: */ + tempVector = (tempIndex < ((frameNumArgs2 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs2 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs2 - tempIndex) * BytesPerWord))); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), longAt((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))))); + } + else { + slotIndex += ((sqInt)((usqInt)(extA) << 8)); + tempIndex -= remoteIsInstVarAccess(); + numExtB = (extA = (extB = 0)); + object = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? (tempIndex < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - tempIndex) * BytesPerWord))) + : (tempIndex < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - tempIndex) * BytesPerWord)))); + /* begin pushMaybeContext:receiverVariable: */ + if ((slotIndex <= StackPointerIndex) + && (((longAt(object)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + /* begin internalPush: */ + assert(slotIndex < MethodIndex); + assert(isContext(object)); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!(((longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + value = longAt((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord()))))); + if ((slotIndex == InstructionPointerIndex) + && (((value & 1)) + && ((((int) value)) < 0))) { + /* begin internalMustMapMachineCodePC:context: */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + result = mustMapMachineCodePCcontext((value >> 1), object); + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + value = result; + } + object2 = value; + goto l3109; + } + if (isWidowedContext(object)) { + object2 = longAt((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord()))))); + goto l3109; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + spouseFP = pointerForOop(senderOop - 1); + + if (slotIndex == SenderIndex) { + /* begin ensureCallerContext: */ + callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP)); + if (callerFP == 0) { + + /* base frame, context in saved ip slot (or base of stack in Cog) */ + /* begin frameCallerContext: */ + assert(isBaseFrame(spouseFP)); + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + object2 = callerContextOrNil; + goto l3109; + } + /* begin ensureFrameIsMarried:SP: */ + if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(callerFP))); + object2 = longAt(callerFP + FoxThisContext); + goto l3109; + } + object2 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))), + (spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord)); + goto l3109; + } + if (slotIndex == StackPointerIndex) { + assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(object))); + object2 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 1) | 1); + goto l3109; + } + if (slotIndex == InstructionPointerIndex) { + object2 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP)); + goto l3109; + } + error("bad index"); + object2 = 0; + l3109: /* end instVar:ofContext: */; + longAtPointerput((localSP -= BytesPerOop), object2); + } + else { + /* begin internalPush: */ + object1 = longAt((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord()))))); + longAtPointerput((localSP -= BytesPerOop), object1); + } + } + } + break; + case 508: /*252*/ + /* extStoreRemoteTempOrInstVarLongBytecode */ + { + sqInt anOop; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt frameNumArgs2; + sqInt object; + int onCurrentPage; + sqInt senderOop; + sqInt slotIndex; + sqInt tempIndex; + sqInt tempVector; + char * theFP; + StackPage * thePage; + + VM_LABEL(extStoreRemoteTempOrInstVarLongBytecode); + slotIndex = byteAtPointer(++localIP); + tempIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if ((tempIndex & (remoteIsInstVarAccess())) == 0) { + /* begin storeRemoteTemp:inVectorAt: */ + tempVector = (tempIndex < ((frameNumArgs2 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs2 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs2 - tempIndex) * BytesPerWord))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(tempVector))); + if ((assert(isNonImmediate(tempVector)), + oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { + remember(tempVector); + } + } + } + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), longAtPointer(localSP)); + } + else { + slotIndex += ((sqInt)((usqInt)(extA) << 8)); + tempIndex -= remoteIsInstVarAccess(); + extA = (numExtB = (extB = 0)); + object = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? (tempIndex < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - tempIndex) * BytesPerWord))) + : (tempIndex < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - tempIndex) * BytesPerWord)))); + /* begin storeMaybeContext:receiverVariable:withValue: */ + anOop = longAtPointer(localSP); + if ((slotIndex <= ReceiverIndex) + && ((((longAt(object)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + /* begin instVar:ofContext:put: */ + assert(isMarriedOrWidowedContext(object)); + assert(!((isObjImmutable(object)))); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!((((longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(object))))) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + if (slotIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(object); + } + goto l3121; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if (slotIndex == SenderIndex) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + onCurrentPage = thePage == GIV(stackPage); + storeSenderOfFramewithValue(theFP, anOop); + if (onCurrentPage) { + localFP = (GIV(stackPage)->headFP); + localSP = (GIV(stackPage)->headSP); + } + else { + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + goto l3121; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + externalDivorceFrameandContext(theFP, object); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + if (slotIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(object); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + markStackPageMostRecentlyUsed(GIV(stackPage)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); + l3121: /* end instVar:ofContext:put: */; + } + else { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(object)))); + if (((((usqInt) (longAt(object))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), object); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(slotIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l3124; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + l3124: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + } + } + } + break; + case 509: /*253*/ + /* extStoreAndPopRemoteTempOrInstVarLongBytecode */ + { + sqInt anOop; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt frameNumArgs2; + sqInt object; + int onCurrentPage; + sqInt senderOop; + sqInt slotIndex; + sqInt tempIndex; + sqInt tempVector; + char * theFP; + StackPage * thePage; + + VM_LABEL(extStoreAndPopRemoteTempOrInstVarLongBytecode); + /* begin extStoreRemoteTempOrInstVarLongBytecode */ + slotIndex = byteAtPointer(++localIP); + tempIndex = byteAtPointer(++localIP); + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + if ((tempIndex & (remoteIsInstVarAccess())) == 0) { + /* begin storeRemoteTemp:inVectorAt: */ + tempVector = (tempIndex < ((frameNumArgs2 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs2 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs2 - tempIndex) * BytesPerWord))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(tempVector))); + if ((assert(isNonImmediate(tempVector)), + oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAtPointer(localSP)) & (tagMask())) == 0) + && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) { + remember(tempVector); + } + } + } + longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), longAtPointer(localSP)); + } + else { + slotIndex += ((sqInt)((usqInt)(extA) << 8)); + tempIndex -= remoteIsInstVarAccess(); + extA = (numExtB = (extB = 0)); + object = ((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) + ? (tempIndex < ((frameNumArgs = ((mframeCogMethod(localFP))->cmNumArgs))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - tempIndex) * BytesPerWord))) + : (tempIndex < ((frameNumArgs1 = byteAt((localFP + FoxIFrameFlags) + 1))) + ? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs1 - tempIndex) * BytesPerWord)) + : longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - tempIndex) * BytesPerWord)))); + /* begin storeMaybeContext:receiverVariable:withValue: */ + anOop = longAtPointer(localSP); + if ((slotIndex <= ReceiverIndex) + && ((((longAt(object)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + /* begin instVar:ofContext:put: */ + assert(isMarriedOrWidowedContext(object)); + assert(!((isObjImmutable(object)))); + /* begin writeBackHeadFramePointers */ + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(localSP < localFP); + assert((localSP < ((GIV(stackPage)->baseAddress))) + && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((localFP < ((GIV(stackPage)->baseAddress))) + && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = localFP); + (GIV(stackPage)->headSP = localSP); + assert(pageListIsWellFormed()); + if (!((((longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(object))))) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + if (slotIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(object); + } + goto l3131; + } + /* begin frameOfMarriedContext: */ + senderOop = longAt((object + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if (slotIndex == SenderIndex) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + onCurrentPage = thePage == GIV(stackPage); + storeSenderOfFramewithValue(theFP, anOop); + if (onCurrentPage) { + localFP = (GIV(stackPage)->headFP); + localSP = (GIV(stackPage)->headSP); + } + else { + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + goto l3131; + } + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + externalDivorceFrameandContext(theFP, object); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + if (slotIndex == StackPointerIndex) { + ensureContextIsExecutionSafeAfterAssignToStackPointer(object); + } + /* begin internalizeIPandSP */ + assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); + localIP = pointerForOop(GIV(instructionPointer)); + localSP = pointerForOop(GIV(stackPointer)); + localFP = pointerForOop(GIV(framePointer)); + nativeSP = 0; + + markStackPageMostRecentlyUsed(GIV(stackPage)); + assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__); + l3131: /* end instVar:ofContext:put: */; + } + else { + /* begin storePointerImmutabilityCheck:ofObject:withValue: */ + +# if IMMUTABILITY + assert(!((isImmediate(object)))); + if (((((usqInt) (longAt(object))) >> (immutableBitShift())) & 1) != 0) { + /* begin cannotAssign:to:withIndex: */ + longAtPointerput((localSP -= BytesPerOop), object); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), anOop); + /* begin internalPush: */ + longAtPointerput((localSP -= BytesPerOop), (((usqInt)(slotIndex + 1) << 1) | 1)); + /* begin splObj: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))); + GIV(argumentCount) = 2; + goto normalSend; + goto l3134; + } + +# endif /* IMMUTABILITY */ + + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(object))); + if ((assert(isNonImmediate(object)), + oopisGreaterThanOrEqualTo(object, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(object))) >> (rememberedBitShift())) & 1) != 0)) { + remember(object); + } + } + } + longAtput((object + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + l3134: /* end storePointerImmutabilityCheck:ofObject:withValue: */; + } + } + /* begin internalPop: */ + localSP += 1 * BytesPerOop; + } + break; + case 510: /*254*/ + /* extJumpIfNotInstanceOfBehaviorsBytecode */ + { + sqInt distance; + sqInt i; + sqInt iLimiT; + sqInt inverse; + sqInt literal; + sqInt oop; + sqInt tagBits; + sqInt top; + sqInt tosClassTag; + + VM_LABEL(extJumpIfNotInstanceOfBehaviorsBytecode); + if (extB < 0) { + extB += 128; + inverse = 1; + } + else { + inverse = 0; + } + /* begin fetchClassTagOf: */ + top = longAt(localSP); + localSP += BytesPerOop; + oop = top; + tosClassTag = (((tagBits = oop & (tagMask()))) != 0 + ? ((tagBits & 1) != 0 + ? 1 + : tagBits) + : (longAt(oop)) & (classIndexMask())); + assert(GIV(method) == (iframeMethod(localFP))); + /* begin fetchPointer:ofObject: */ + literal = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((((((sqInt)((usqInt)(extA) << 8))) + (byteAtPointer(++localIP))) + LiteralStart)) << (shiftForWord()))))); + + distance = (((sqInt)((usqInt)(extB) << 8))) + (byteAtPointer(++localIP)); + extA = 0; + extB = 0; + numExtB = 0; + if (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) == 2) { + for (i = 0, iLimiT = ((((sqInt)(numSlotsOf(literal)))) - 1); i <= iLimiT; i += 1) { + if (tosClassTag == (rawClassTagForClass(longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))))))) { + if (inverse) { + localIP += distance; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3135; + } + } + if (!inverse) { + localIP += distance; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3135; + } + else { + if (tosClassTag != ((long32At(literal + 4)) & (identityHashHalfWordMask()))) { + if (!inverse) { + localIP += distance; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + goto l3135; + } + } + if (inverse) { + localIP += distance; + } + /* begin fetchNextBytecode */ + currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector); + + } + l3135: /* end case */; + break; + } + } + + /* undo the pre-increment of IP before returning */ + localIP -= 1; + /* begin externalizeIPandSP */ + assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); + GIV(instructionPointer) = oopForPointer(localIP); + GIV(stackPointer) = localSP; + GIV(framePointer) = localFP; + return null; +} + + /* CogBlockMethod>>#cmHomeMethod */ +static CogMethod * NoDbgRegParms +cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) +{ + return ((self_in_cmHomeMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) self_in_cmHomeMethod) + : ((CogMethod *) ((((usqInt)self_in_cmHomeMethod)) - ((self_in_cmHomeMethod->homeOffset))))); +} + + +/* For assert-checking */ + + /* CogStackPage>>#addressIsInPage: */ +static sqInt NoDbgRegParms +addressIsInPage(StackPage * self_in_addressIsInPage, char *address) +{ + return (((self_in_addressIsInPage->lastAddress)) < address) + && (address < ((self_in_addressIsInPage->baseAddress))); +} + + /* CogStackPage>>#isFree */ +static sqInt NoDbgRegParms +isFree(StackPage * self_in_isFree) +{ + return ((self_in_isFree->baseFP)) == 0; +} + + +/* */ +/* MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#freeStackPageNoAssert: */ +static void NoDbgRegParms +freeStackPageNoAssert(StackPage *aPage) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + StackPage *prev; + + (aPage->baseFP = 0); + if (aPage == GIV(mostRecentlyUsedPage)) { + GIV(mostRecentlyUsedPage) = (GIV(mostRecentlyUsedPage)->prevPage); + return; + } + if ((((prev = (aPage->prevPage))->baseFP)) == 0) { + return; + } + (prev->nextPage = (aPage->nextPage)); + (((aPage->nextPage))->prevPage = prev); + (aPage->nextPage = (GIV(mostRecentlyUsedPage)->nextPage)); + (((GIV(mostRecentlyUsedPage)->nextPage))->prevPage = aPage); + (aPage->prevPage = GIV(mostRecentlyUsedPage)); + (GIV(mostRecentlyUsedPage)->nextPage = aPage); +} + + +/* */ +/* MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#freeStackPage: */ +static sqInt NoDbgRegParms +freeStackPage(StackPage *aPage) +{ + freeStackPageNoAssert(aPage); + assert(pageListIsWellFormed()); + return 0; +} + + +/* */ +/* MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#markStackPageMostRecentlyUsed: */ +static void NoDbgRegParms +markStackPageMostRecentlyUsed(StackPage *page) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (page == GIV(mostRecentlyUsedPage)) { + return; + } + if (((page->prevPage)) == GIV(mostRecentlyUsedPage)) { + GIV(mostRecentlyUsedPage) = page; + assert(pageListIsWellFormed()); + return; + } + (((page->prevPage))->nextPage = (page->nextPage)); + (((page->nextPage))->prevPage = (page->prevPage)); + (((GIV(mostRecentlyUsedPage)->nextPage))->prevPage = page); + (page->prevPage = GIV(mostRecentlyUsedPage)); + (page->nextPage = (GIV(mostRecentlyUsedPage)->nextPage)); + (GIV(mostRecentlyUsedPage)->nextPage = page); + GIV(mostRecentlyUsedPage) = page; + assert(pageListIsWellFormed()); +} + + +/* */ +/* This method is used to move a page to a position in the list such that it + cannot be deallocated when a new page is allocated, without changing the + most recently + used page. There must be at least 3 pages in the system. So making the + page the MRU's prevPage is sufficient to ensure it won't be deallocated. */ +/* MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#markStackPageNextMostRecentlyUsed: */ +static void NoDbgRegParms +markStackPageNextMostRecentlyUsed(StackPage *page) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + assert(page != GIV(mostRecentlyUsedPage)); + if (((page->nextPage)) == GIV(mostRecentlyUsedPage)) { + return; + } + (((page->prevPage))->nextPage = (page->nextPage)); + (((page->nextPage))->prevPage = (page->prevPage)); + (((GIV(mostRecentlyUsedPage)->prevPage))->nextPage = page); + (page->prevPage = (GIV(mostRecentlyUsedPage)->prevPage)); + (page->nextPage = GIV(mostRecentlyUsedPage)); + (GIV(mostRecentlyUsedPage)->prevPage = page); + assert(pageListIsWellFormed()); +} + + +/* MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#newStackPage */ +static StackPage * +newStackPage(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + StackPage *lruOrFree; + + lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); + if (((lruOrFree->baseFP)) == 0) { + return lruOrFree; + } + divorceFramesIn(lruOrFree); + return lruOrFree; +} + + +/* Answer if the stack page list is well-formed. + MRUP-->used page<->used page<->used page<->used page<--LRUP + ^ <-next-prev-> ^ + | | + v <-prev-next-> v + free page<->free page<->free page<->free page */ + + /* CogStackPages>>#pageListIsWellFormed */ +static sqInt +pageListIsWellFormed(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt count; + sqInt limit; + sqInt ok; + StackPage *page; + + ok = 1; + page = (GIV(mostRecentlyUsedPage)->nextPage); + count = 1; + limit = GIV(numStackPages) * 2; + while ((((page->baseFP)) == 0) + && ((page != GIV(mostRecentlyUsedPage)) + && (count <= limit))) { + if (!(asserta(((((page->nextPage))->prevPage)) == page))) { + ok = 0; + } + page = (page->nextPage); + count += 1; + } + while ((page != GIV(mostRecentlyUsedPage)) + && (count <= limit)) { + if (!(asserta(((((page->nextPage))->prevPage)) == page))) { + ok = 0; + } + if (asserta(!(isFree(page)))) { + if (!(asserta((addressIsInPage(page, (page->baseFP))) + && (addressIsInPage(page, (page->headSP)))))) { + ok = 0; + } + } + else { + ok = 0; + } + page = (page->nextPage); + count += 1; + } + if (!(asserta(count == (numStkPages())))) { + ok = 0; + } + return ok; +} + + +/* Answer the page for a page index. + N.B. This is a zero-relative index. */ + + /* CogStackPages>>#stackPageAt: */ +static StackPage * NoDbgRegParms +stackPageAt(sqInt index) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return stackPageAtpages(index, GIV(pages)); +} + + +/* */ + + /* CogStackPages>>#stackPageFor: */ +static StackPage * NoDbgRegParms +stackPageFor(void *pointer) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin stackPageAt: */ + return stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); +} + + /* CogStackPages>>#statAverageLivePagesWhenMapping */ +static double +statAverageLivePagesWhenMapping(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((double) GIV(statPageCountWhenMappingSum) )) / GIV(statNumMaps); +} + + /* CoInterpreter>>#accessorDepthForPrimitiveIndex: */ +signed char +accessorDepthForPrimitiveIndex(sqInt primIndex) +{ + return primitiveAccessorDepthTable[primIndex]; +} + + +/* Activate newMethod when newMethod has been cogged, i.e. create a + machine-code frame and (re)enter machine-code. + */ + + /* CoInterpreter>>#activateCoggedNewMethod: */ +static void NoDbgRegParms +activateCoggedNewMethod(sqInt inInterpreter) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogMethod *cogMethod; + sqInt errorCode; + usqInt i; + sqInt initialPC; + sqInt methodHeader; + sqInt numTemps; + sqInt object; + sqInt object1; + sqInt offset; + sqInt rcvr; + char *sp; + char *sp1; + char *sp2; + char *sp3; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt table; + + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert(isCogMethodReference(methodHeader)); + cogMethod = ((CogMethod *) methodHeader); + methodHeader = (cogMethod->methodHeader); + /* begin stackValue: */ + offset = (cogMethod->cmNumArgs); + rcvr = longAt(GIV(stackPointer) + (offset * BytesPerWord)); + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp5; + if (((cogMethod->stackCheckOffset)) == 0) { + + /* frameless method; nothing to activate... */ + + /* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */ + if (((cogMethod->cmNumArgs)) <= (numRegArgs())) { + callRegisterArgCogMethodatreceiver(cogMethod, noCheckEntryOffset(), rcvr); + } + + /* begin push: */ + object = (((sqInt)cogMethod)) + (noCheckEntryOffset()); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp1; + ceCallCogCodePopReceiverReg(); + error("should not be reached"); + } + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp6; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), ((sqInt)cogMethod)); + GIV(stackPointer) = sp7; + /* begin push: */ + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp8; + /* begin push: */ + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp9; + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + for (i = (((cogMethod->cmNumArgs)) + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp2; + } + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Store the error code if the method starts with a long store temp. No instructionPointer skip because we're heading for machine code. */ + initialPC = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) + (3); + if (GIV(primFailCode) != 0) { + if ((byteAt(initialPC)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + if (GIV(stackPointer) >= GIV(stackLimit)) { + assert(((cogMethod->stackCheckOffset)) > (noCheckEntryOffset())); + /* begin push: */ + object1 = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp4; + ceEnterCogCodePopReceiverReg(); + error("should not be reached"); + } + GIV(instructionPointer) = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); + returnToExecutivepostContextSwitch(inInterpreter, switched); +} + + /* CoInterpreter>>#activateNewMethod */ +static void +activateNewMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt errorCode; + sqInt header; + sqInt i; + int inInterpreter; + sqInt methodHeader; + sqInt numArgs; + sqInt numTemps; + sqInt object; + sqInt rcvr; + char *sp; + char *sp1; + char *sp2; + char *sp3; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + sqInt switched; + sqInt table; + + /* begin methodHeaderOf: */ + assert(isCompiledMethod(GIV(newMethod))); + header = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; + + /* could new rcvr be set at point of send? */ + rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); + assert(!(isOopForwarded(rcvr))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp2; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp3; + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp4; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp5; + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp6; + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp7; + for (i = (numArgs + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp; + } + GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + GIV(instructionPointer) += 3; + if (GIV(primFailCode) != 0) { + if ((byteAt(GIV(instructionPointer) + 1)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + switched = 1; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader)); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +} + + +/* Add the given entry to the method cache. + The policy is as follows: + Look for an empty entry anywhere in the reprobe chain. + If found, install the new entry there. + If not found, then install the new entry at the first probe position + and delete the entries in the rest of the reprobe chain. + This has two useful purposes: + If there is active contention over the first slot, the second + or third will likely be free for reentry after ejection. + Also, flushing is good when reprobe chains are getting full. */ +/* Override to refuse to cache other than compiled methods. + This protects open PICs against having to test for compiled methods. */ + + /* CoInterpreter>>#addNewMethodToCache: */ +static void NoDbgRegParms +addNewMethodToCache(sqInt classObj) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classTag; + sqInt err; + sqInt err1; + sqInt err2; + sqInt firstBytecode; + sqInt hash; + sqInt hash1; + sqInt hash2; + sqInt hash3; + sqInt header; + sqInt methodHeader; + sqInt p; + sqInt primitiveIndex; + sqInt probe; + + if (!(((GIV(newMethod) & (tagMask())) == 0) + && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + primitiveFunctionPointer = primitiveInvokeObjectAsMethod; + return; + } + /* begin methodCacheHashOf:with: */ + assert(addressCouldBeClassObj(classObj)); + classTag = (((hash1 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash1 + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + + hash = GIV(messageSelector) ^ (((sqInt)((usqInt)(classTag) << 2))); + if (((GIV(newMethod) & (tagMask())) == 0) + && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { + /* begin primitiveIndexOfMethod:header: */ + assert(isCompiledMethod(GIV(newMethod))); + header = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ + firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; + primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); + } + else { + primitiveIndex = 0; + } + + /* begin functionPointerFor:inClass: */ + primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex + ? 0 + : primitiveTable[primitiveIndex]))); + } + else { + assert(!((isNonImmediate(GIV(newMethod))) + && (isForwarded(GIV(newMethod))))); + primitiveFunctionPointer = primitiveInvokeObjectAsMethod; + } + for (p = 0; p < CacheProbeMax; p += 1) { + probe = (((usqInt) hash) >> p) & MethodCacheMask; + if ((GIV(methodCache)[probe + MethodCacheSelector]) == 0) { + + /* Found an empty entry -- use it */ + GIV(methodCache)[probe + MethodCacheSelector] = GIV(messageSelector); + GIV(methodCache)[probe + MethodCacheClass] = ((assert(addressCouldBeClassObj(classObj)), +(((hash2 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash2 + : (objCouldBeClassObj(classObj) + ? (((err1 = enterIntoClassTable(classObj))) != 0 + ? -err1 + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)))); + GIV(methodCache)[probe + MethodCacheMethod] = GIV(newMethod); + GIV(methodCache)[probe + MethodCachePrimFunction] = (((sqIntptr_t) primitiveFunctionPointer)); + + /* this for primitiveExternalMethod */ + GIV(lastMethodCacheProbeWrite) = probe; + return; + } + } + + /* first probe */ + probe = hash & MethodCacheMask; + GIV(methodCache)[probe + MethodCacheSelector] = GIV(messageSelector); + GIV(methodCache)[probe + MethodCacheClass] = ((assert(addressCouldBeClassObj(classObj)), +(((hash3 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash3 + : (objCouldBeClassObj(classObj) + ? (((err2 = enterIntoClassTable(classObj))) != 0 + ? -err2 + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)))); + GIV(methodCache)[probe + MethodCacheMethod] = GIV(newMethod); + GIV(methodCache)[probe + MethodCachePrimFunction] = (((sqIntptr_t) primitiveFunctionPointer)); + + /* this for primitiveExternalMethod */ + /* ...and zap the following entries */ + GIV(lastMethodCacheProbeWrite) = probe; + for (p = 1; p < CacheProbeMax; p += 1) { + probe = (((usqInt) hash) >> p) & MethodCacheMask; + GIV(methodCache)[probe + MethodCacheSelector] = 0; + } +} + + /* CoInterpreter>>#argumentCountAddress */ +usqInt +argumentCountAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(argumentCount)))); +} + + +/* Coerce either a CMMethod or a CMBlock to the home CMMethod */ + + /* CoInterpreter>>#asCogHomeMethod: */ +static CogMethod * NoDbgRegParms +asCogHomeMethod(CogBlockMethod *aCogMethod) +{ + return (((aCogMethod->cmType)) == CMMethod + ? ((CogMethod *) aCogMethod) + : ((aCogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) aCogMethod) + : ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset)))))); +} + + /* CoInterpreter>>#assertValidExecutionPointe:r:s:imbar:line: */ +static void NoDbgRegParms +assertValidExecutionPointersimbarline(usqInt lip, char *lifp, char *lisp, sqInt inInterpreter, sqInt ln) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogMethod *cogMethod; + sqInt methodField; + sqInt methodField1; + usqInt theIP; + + assertl(GIV(stackPage) == (mostRecentlyUsedPage()), ln); + assertl(addressIsInPage(GIV(stackPage), lifp), ln); + assert(deferStackLimitSmashAroundwith(assertValidStackLimits, ln)); + assertl(lisp < lifp, ln); + assertl(lifp > lisp, ln); + assertl(lisp >= (((GIV(stackPage)->realStackLimit)) - (stackLimitOffset())), ln); + assertl(((lifp - lisp) / BytesPerOop) < LargeContextSlots, ln); + methodField = longAt(lifp + FoxMethod); + if (inInterpreter) { + assertl(!(isMachineCodeFrame(lifp)), ln); + assertl(GIV(method) == methodField, ln); + assertl((methodUsesAlternateBytecodeSet(GIV(method))) == (GIV(bytecodeSetSelector) == 256), ln); + + if (assertal(cheapAddressCouldBeInHeap(methodField), ln)) { + if (lip == (ceReturnToInterpreterPC())) { + /* begin iframeSavedIP: */ + theIP = longAt(lifp + FoxIFSavedIP); + } + else { + theIP = lip; + } + assertl((theIP >= (methodField + (lastPointerOf(methodField)))) + && (theIP < (((methodField + (numBytesOfBytes(methodField))) + BaseHeaderSize) - 1)), ln); + } + assertl((iframeIsBlockActivation(lifp)) + || ((pushedReceiverOrClosureOfFrame(lifp)) == (iframeReceiver(lifp))), ln); + } + else { + assertl(isMachineCodeFrame(lifp), ln); + if ((assertal((((usqInt)methodField)) >= (minCogMethodAddress()), ln)) + && (assertal((((usqInt)methodField)) < (maxCogMethodAddress()), ln))) { + /* begin mframeHomeMethod: */ + methodField1 = longAt(lifp + FoxMethod); + if ((methodField1 & MFMethodFlagIsBlockFlag) != 0) { + cogMethod = (((((CogBlockMethod *) (methodField1 & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField1 & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField1 & MFMethodMask))))) - (((((CogBlockMethod *) (methodField1 & MFMethodMask)))->homeOffset))))); + goto l3; + } + cogMethod = ((CogMethod *) (methodField1 & MFMethodMask)); + l3: /* end mframeHomeMethod: */; + assertl((lip > (methodField + ((mframeIsBlockActivation(lifp) + ? sizeof(CogBlockMethod) + : sizeof(CogMethod))))) + && (lip < (methodField + ((cogMethod->blockSize)))), ln); + } + assertl((mframeIsBlockActivation(lifp)) + || ((pushedReceiverOrClosureOfFrame(lifp)) == (mframeReceiver(lifp))), ln); + } + if ((longAt(lifp + FoxSavedFP)) == 0) { + assertl(frameHasContext(lifp), ln); + assertl((frameContext(lifp)) == (longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord)), ln); + } +} + + /* CoInterpreter>>#assertValidMachineCodeFrame: */ +void +assertValidMachineCodeFrame(sqInt instrPtr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogBlockMethod *cogMethod; + CogMethod *homeMethod; + + assert(isMachineCodeFrame(GIV(framePointer))); + /* begin mframeCogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ + homeMethod = (((cogMethod->cmType)) == CMMethod + ? ((CogMethod *) cogMethod) + : ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) cogMethod) + : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset)))))); + assert((methodFor(cogMethod)) == homeMethod); + assert((instrPtr > (((sqInt)cogMethod))) + && (instrPtr < ((((sqInt)homeMethod)) + ((homeMethod->blockSize))))); +} + + +/* Check that the stacked instruction pointers in the given page are correct. + Checks the interpreter sender/machine code callee contract. */ + + /* CoInterpreter>>#assertValidStackedInstructionPointersIn:line: */ +static sqInt NoDbgRegParms +assertValidStackedInstructionPointersInline(StackPage *aStackPage, sqInt ln) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + sqInt methodField; + usqInt methodObj; + sqInt prevFrameWasCogged; + char *theFP; + usqInt theIP; + CogMethod *theMethod; + + if (!(assertal(!(isFree(aStackPage)), ln))) { + return 0; + } + + /* The top of stack of an inactive page is always the instructionPointer. + The top of stack of the active page may be the instructionPointer if it has been pushed, + which is indicated by a 0 instructionPointer. */ + prevFrameWasCogged = 0; + if ((GIV(stackPage) == aStackPage) + && (GIV(instructionPointer) != 0)) { + theIP = GIV(instructionPointer); + theFP = GIV(framePointer); + } + else { + theIP = ((usqInt)(longAt((aStackPage->headSP)))); + theFP = (aStackPage->headFP); + if (GIV(stackPage) == aStackPage) { + assertl(GIV(framePointer) == theFP, ln); + } + } + while (1) { + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin mframeHomeMethod: */ + methodField = longAt(theFP + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + theMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + goto l2; + } + theMethod = ((CogMethod *) (methodField & MFMethodMask)); + l2: /* end mframeHomeMethod: */; + assertl((theIP == (ceCannotResumePC())) + || ((theIP >= (((usqInt)theMethod))) + && (theIP < ((((usqInt)theMethod)) + ((theMethod->blockSize))))), ln); + prevFrameWasCogged = 1; + } + else { + + /* assert-check the interpreter frame. */ + methodObj = longAt(theFP + FoxMethod); + if (prevFrameWasCogged) { + assertl(theIP == (ceReturnToInterpreterPC()), ln); + } + if (theIP == (ceReturnToInterpreterPC())) { + theIP = longAt(theFP + FoxIFSavedIP); + } + assertl((theIP >= (methodObj + (lastPointerOf(methodObj)))) + && (theIP < (((methodObj + (numBytesOfBytes(methodObj))) + BaseHeaderSize) - 1)), ln); + prevFrameWasCogged = 0; + } + theIP = ((usqInt)(longAt(theFP + FoxCallerSavedIP))); + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theFP = callerFP; + } + assertl(theIP == (ceBaseFrameReturnPC()), ln); + return 1; +} + + +/* Check that the stacked instruction pointers in all pages are correct. + Checks the interpreter sender/machine code callee contract. + Written so it will be optimized away if not in an assert VM. */ + + /* CoInterpreter>>#assertValidStackedInstructionPointers: */ +static void NoDbgRegParms +assertValidStackedInstructionPointers(sqInt ln) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + StackPage *thePage; + + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(isFree(thePage))) { + assertl(assertValidStackedInstructionPointersInline(thePage, ln), ln); + } + } +} + + +/* Attempt to convert the current interpreted activation into a machine code + activation, and if this is popssible, jump into machine code. bcpc is the + 0-relative pc of the backward branch bytecode (not any preceding + extension). */ + + /* CoInterpreter>>#attemptToSwitchToMachineCode: */ +static void NoDbgRegParms +attemptToSwitchToMachineCode(sqInt bcpc) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aCompiledMethodHeader; + sqInt aCompiledMethodHeader1; + sqInt closure; + sqInt cls; + CogMethod *cogMethod; + CogBlockMethod *cogMethod1; + CogBlockMethod *cogMethod2; + CogMethod *homeMethod; + sqInt methodField; + sqInt methodHeader; + char *p; + usqInt pc; + usqInt pc1; + char *sp; + char *sp1; + sqInt startBcpc; + char *theFP; + + if (!((assert(isNonImmediate(GIV(method))), + isCogMethodReference(longAt((GIV(method) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + if (((byteAt((GIV(framePointer) + FoxIFrameFlags) + 3)) != 0) + && (!(isVanillaBlockClosure((cls = frameStackedReceivernumArgs(GIV(framePointer), ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(GIV(framePointer)))->cmNumArgs) + : byteAt((GIV(framePointer) + FoxIFrameFlags) + 1)))))))) { + + /* Compiled block / full closure */ + cogFullBlockMethodnumCopied(GIV(method), (numPointerSlotsOf(cls)) - FullClosureFirstCopiedValueIndex); + } + else { + + /* Compiled method */ + cogselector(GIV(method), GIV(nilObj)); + } + + } + if ((assert(isNonImmediate(GIV(method))), + isCogMethodReference(longAt((GIV(method) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin cogMethodOf: */ + methodHeader = longAt((GIV(method) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + /* begin convertToMachineCodeFrame:bcpc: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + if ((longAt(GIV(framePointer) + FoxSavedFP)) == 0) { + longAtput(GIV(framePointer) + FoxCallerSavedIP, ceBaseFrameReturnPC()); + } + else { + if (!((((usqInt)(longAt((pointerForOop(longAt(GIV(framePointer) + FoxSavedFP))) + FoxMethod)))) < (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + theFP = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP)); + assert(!(isMachineCodeFrame(theFP))); + longAtput(theFP + FoxIFSavedIP, ((sqInt)(pointerForOop(longAt(GIV(framePointer) + FoxCallerSavedIP))))); + longAtput(GIV(framePointer) + FoxCallerSavedIP, ceReturnToInterpreterPC()); + } + } + if ((byteAt((GIV(framePointer) + FoxIFrameFlags) + 3)) != 0) { + closure = longAt(GIV(framePointer) + (frameStackedReceiverOffset(GIV(framePointer)))); + if (((longAt((closure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) & 1)) { + startBcpc = (((longAt((closure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 1)) - 1; + cogMethod2 = findMethodForStartBcpcinHomeMethod(startBcpc, cogMethod); + } + else { + /* begin startPCOfMethodHeader: */ + aCompiledMethodHeader = (cogMethod->methodHeader); + startBcpc = (((assert((aCompiledMethodHeader & 1)), +/* begin literalCountOfAlternateHeader: */ +((aCompiledMethodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + cogMethod2 = ((CogBlockMethod *) cogMethod); + } + methodField = (((sqInt)cogMethod2)) + MFMethodFlagIsBlockFlag; + } + else { + /* begin startPCOfMethodHeader: */ + aCompiledMethodHeader1 = (cogMethod->methodHeader); + startBcpc = (((assert((aCompiledMethodHeader1 & 1)), +/* begin literalCountOfAlternateHeader: */ +((aCompiledMethodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; + cogMethod2 = ((CogBlockMethod *) cogMethod); + methodField = ((sqInt)cogMethod); + } + pc1 = mcPCForBackwardBranchstartBcpcin(bcpc, startBcpc, cogMethod2); + assert(pc1 > ((((usqInt)cogMethod2)) + (noCheckEntryOffset()))); + assert(bcpc == (bytecodePCForstartBcpcin(pc1, startBcpc, cogMethod2))); + longAtput(GIV(framePointer) + FoxMethod, methodField + (((byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0 + ? MFMethodFlagHasContextFlag + : 0))); + for (p = (GIV(framePointer) + FoxIFReceiver); p >= GIV(stackPointer); p += (-BytesPerWord)) { + longAtput((p + FoxMFReceiver) - FoxIFReceiver, longAt(p)); + } + GIV(stackPointer) = (GIV(stackPointer) + FoxMFReceiver) - FoxIFReceiver; + pc = pc1; + /* begin assertValidMachineCodeFrame: */ + assert(isMachineCodeFrame(GIV(framePointer))); + /* begin mframeCogMethod: */ + cogMethod1 = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ + homeMethod = (((cogMethod1->cmType)) == CMMethod + ? ((CogMethod *) cogMethod1) + : ((cogMethod1->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) cogMethod1) + : ((CogMethod *) ((((usqInt)cogMethod1)) - ((cogMethod1->homeOffset)))))); + assert((methodFor(cogMethod1)) == homeMethod); + assert((pc > (((sqInt)cogMethod1))) + && (pc < ((((sqInt)homeMethod)) + ((homeMethod->blockSize))))); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), pc); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp1; + ceEnterCogCodePopReceiverReg(); + } +} + + +/* Re-enter the interpreter for executing a callback */ + + /* CoInterpreter>>#callbackEnter: */ +EXPORT(sqInt) +callbackEnter(sqInt *callbackID) +{ DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT + volatile int calledFromMachineCode; + volatile void *currentCFramePointer; + volatile void *currentCStackPointer; + volatile sqInt header; + volatile sqInt header1; + volatile jmp_buf savedReenterInterpreter; + volatile sqInt wasInMachineCode; + + + /* For now, do not allow a callback unless we're in a primitiveResponse */ + if (!(asserta(primitiveFunctionPointer != 0))) { + return 0; + } + assert(GIV(primFailCode) == 0); + if (!(asserta(GIV(jmpDepth) < MaxJumpBuf))) { + return 0; + } + GIV(jmpDepth) += 1; + wasInMachineCode = (((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()); + + /* Suspend the currently active process */ + calledFromMachineCode = GIV(instructionPointer) <= (startOfMemory()); + GIV(suspendedCallbacks)[GIV(jmpDepth)] = (fetchPointerofObject(ActiveProcessIndex, schedulerPointer())); + GIV(suspendedMethods)[GIV(jmpDepth)] = GIV(newMethod); + flag("need to debug this properly. Conceptually it is the right thing to do but it crashes in practice"); + transferTofrom(wakeHighestPriority(), CSCallbackLeave); + + forceInterruptCheck(); + currentCStackPointer = getCStackPointer(); + currentCFramePointer = getCFramePointer(); + memcpy(((void *)savedReenterInterpreter), reenterInterpreter, sizeof(jmp_buf)); + assertCStackWellAligned(); + if ((setjmp(GIV(jmpBuf)[GIV(jmpDepth)])) == 0) { + + /* Fill in callbackID */ + callbackID[0] = GIV(jmpDepth); + enterSmalltalkExecutive(); + assert(0); + } + setCStackPointer(currentCStackPointer); + setCFramePointer(currentCFramePointer); + memcpy(reenterInterpreter, ((void *) savedReenterInterpreter), sizeof(jmp_buf)); + putToSleepyieldingIf(fetchPointerofObject(ActiveProcessIndex, schedulerPointer()), GIV(preemptionYields)); + transferTofrom(GIV(suspendedCallbacks)[GIV(jmpDepth)], CSCallbackLeave); + + /* see comment above */ + GIV(newMethod) = GIV(suspendedMethods)[GIV(jmpDepth)]; + /* begin argumentCountOfMethodHeader: */ + assert(isCompiledMethod(GIV(newMethod))); + header1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + GIV(argumentCount) = (((usqInt) header) >> MethodHeaderArgCountShift) & 15; + assert(wasInMachineCode == (isMachineCodeFrame(GIV(framePointer)))); + if (calledFromMachineCode) { + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + } + else { + + /* Even if the context was flushed to the heap and rebuilt in transferTo:from: + above it will remain an interpreted frame because the context's pc would + remain a bytecode pc. So the instructionPointer must also be a bytecode pc. */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + assert(GIV(instructionPointer) > (startOfMemory())); + } + assert(GIV(primFailCode) == 0); + GIV(jmpDepth) -= 1; + return 1; +} + + /* CoInterpreter>>#callForCogCompiledCodeCompaction */ +void +callForCogCompiledCodeCompaction(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + GIV(cogCompiledCodeCompactionCalledFor) = 1; + forceInterruptCheck(); +} + + +/* convert + rcvr base + arg(s) + retpc <- sp + to + retpc base + entrypc + rcvr + arg(s) <- sp + and then enter at either the checked or the unchecked entry-point. */ + + /* CoInterpreter>>#callRegisterArgCogMethod:at:receiver: */ +static void NoDbgRegParms +callRegisterArgCogMethodatreceiver(CogMethod *cogMethod, sqInt entryOffset, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + sqInt object1; + char *sp; + char *sp1; + char *sp2; + + assert(((cogMethod->cmNumArgs)) <= (numRegArgs())); + if (((cogMethod->cmNumArgs)) == 2) { + /* begin stackValue:put: */ + longAtput(GIV(stackPointer) + (3 * BytesPerWord), longAt(GIV(stackPointer))); + /* begin push: */ + object = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin stackValue:put: */ + longAtput(GIV(stackPointer) + (1 * BytesPerWord), longAt(GIV(stackPointer) + (3 * BytesPerWord))); + longAtput(GIV(stackPointer) + (2 * BytesPerWord), rcvr); + longAtput(GIV(stackPointer) + (3 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset); + ceCallCogCodePopReceiverArg1Arg0Regs(); + } + if (((cogMethod->cmNumArgs)) == 1) { + /* begin stackValue:put: */ + longAtput(GIV(stackPointer) + (2 * BytesPerWord), longAt(GIV(stackPointer))); + /* begin push: */ + object1 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp1; + longAtput(GIV(stackPointer) + (1 * BytesPerWord), rcvr); + longAtput(GIV(stackPointer) + (2 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset); + ceCallCogCodePopReceiverArg0Regs(); + } + assert(((cogMethod->cmNumArgs)) == 0); + /* begin stackValue:put: */ + longAtput(GIV(stackPointer) + (1 * BytesPerWord), longAt(GIV(stackPointer))); + longAtput(GIV(stackPointer) + (0 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset); + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp2; + ceCallCogCodePopReceiverReg(); +} + + +/* An external call or FFI primitive has failed. Build the frame and + activate as appropriate. Enter either the interpreter or machine + code depending on whether aPrimitiveMethod has been or is still + cogged. Note that we could always interpret but want the efficiency + of executing machine code if it is available. */ + + /* CoInterpreter>>#ceActivateFailingPrimitiveMethod: */ +void +ceActivateFailingPrimitiveMethod(sqInt aPrimitiveMethod) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt methodHeader; + sqInt result; + char *sp; + + assert(GIV(primFailCode) != 0); + assert(GIV(newMethod) == aPrimitiveMethod); + retryPrimitiveOnFailure(); + if (!GIV(primFailCode)) { + result = longAt(GIV(stackPointer)); + longAtPointerput(GIV(stackPointer), GIV(instructionPointer)); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), result); + GIV(stackPointer) = sp; + ceEnterCogCodePopReceiverReg(); + } + + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aPrimitiveMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + activateCoggedNewMethod(0); + } + else { + activateNewMethod(); + } +} + + +/* Return across a page boundary. The context to return to (which may be + married) is stored in the first word of the stack. We get here when a + return instruction jumps + to the ceBaseFrameReturn: address that is the return pc for base frames. A + consequence of this is that the current frame is no longer valid since an + interrupt may have overwritten + its state as soon as the stack pointer has been cut-back beyond the return + pc. So to have + a context to send the cannotReturn: message to we also store the base + frame's context + in the second word of the stack page. */ + + /* CoInterpreter>>#ceBaseFrameReturn: */ +sqInt +ceBaseFrameReturn(sqInt returnValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aMethodObj; + char *callerFP; + sqInt contextToReturnFrom; + sqInt contextToReturnTo; + char *fp; + char *frameAbove; + sqInt isAContext; + StackPage *lruOrFree; + StackPage *newPage; + sqInt senderOop; + char *sp; + char *sp1; + char *sp2; + char *sp3; + StackPage *thePage; + + assert((stackPageFor(GIV(stackPointer))) == GIV(stackPage)); + assert((mostRecentlyUsedPage()) == GIV(stackPage)); + assertCStackWellAligned(); + assert(GIV(framePointer) == 0); + assert(GIV(stackPointer) <= (((GIV(stackPage)->baseAddress)) - BytesPerWord)); + assert((((GIV(stackPage)->baseFP)) + (2 * BytesPerWord)) < ((GIV(stackPage)->baseAddress))); + assert((addressCouldBeObj(longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord))) + && (isContext(longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord)))); + contextToReturnTo = longAt((GIV(stackPage)->baseAddress)); + assert(addressCouldBeObj(contextToReturnTo)); + freeStackPageNoAssert(GIV(stackPage)); + isAContext = ((contextToReturnTo & (tagMask())) == 0) + && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex); + if (isAContext + && ((((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(contextToReturnTo))))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + GIV(framePointer) = pointerForOop(senderOop - 1); + + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (GIV(framePointer) == ((thePage->headFP))) { + GIV(stackPointer) = (thePage->headSP); + } + else { + + /* Returning to some interior frame, presumably because of a sender assignment. + Move the frames above to another page (they may be in use, e.g. via coroutining). + Make the interior frame the top frame. */ + /* begin findFrameAbove:inPage: */ + fp = (thePage->headFP); + if (fp == GIV(framePointer)) { + frameAbove = 0; + goto l2; + } + while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { + if (callerFP == GIV(framePointer)) { + frameAbove = fp; + goto l2; + } + fp = callerFP; + } + error("did not find theFP in stack page"); + frameAbove = 0; + l2: /* end findFrameAbove:inPage: */; + /* begin newStackPage */ + lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); + if (((lruOrFree->baseFP)) == 0) { + newPage = lruOrFree; + goto l1; + } + divorceFramesIn(lruOrFree); + newPage = lruOrFree; + l1: /* end newStackPage */; + assert(newPage == GIV(stackPage)); + moveFramesInthroughtoPage(thePage, frameAbove, newPage); + markStackPageMostRecentlyUsed(newPage); + GIV(framePointer) = (thePage->headFP); + GIV(stackPointer) = (thePage->headSP); + } + } + else { + if (!(isAContext + && (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))) & 1)))) { + contextToReturnFrom = longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord); + tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(contextToReturnFrom, contextToReturnTo, returnValue); + /* begin externalCannotReturn:from: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), contextToReturnFrom); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1); + } + GIV(instructionPointer) = 0; + thePage = makeBaseFrameFor(contextToReturnTo); + GIV(framePointer) = (thePage->headFP); + GIV(stackPointer) = (thePage->headSP); + } + /* begin setStackPageAndLimit: */ + assert(thePage != 0); + GIV(stackPage) = thePage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(thePage); + assert((stackPageFor(GIV(framePointer))) == GIV(stackPage)); + if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp; + ceEnterCogCodePopReceiverReg(); + } + GIV(instructionPointer) = longAt(GIV(stackPointer)); + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + longAtPointerput(GIV(stackPointer), returnValue); + assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, GIV(framePointer))); + siglongjmp(reenterInterpreter, ReturnToInterpreter); + return null; +} + + +/* index is unboxed. */ + + /* CoInterpreter>>#ceCannotAssignTo:withIndex:valueToAssign: */ +#if IMMUTABILITY +sqInt +ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + char *sp1; + char *sp2; + char *sp3; + sqInt top; + + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), immutableObject); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), valueToAssign); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), (((usqInt)index << 1) | 1)); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp3; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))), immutableObject, 2); +} +#endif /* IMMUTABILITY */ + + +/* A context that has been returned from, or otherwise has an invalid pc has + been reentered. + Until we have a cannotResume: selector, simply resend cannotReturn:. */ + + /* CoInterpreter>>#ceCannotResume */ +sqInt +ceCannotResume(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + sqInt resultOop; + char *sp; + char *sp1; + char *sp2; + + assert(isMachineCodeFrame(GIV(framePointer))); + assert(frameHasContext(GIV(framePointer))); + resultOop = longAt(GIV(stackPointer)); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt(GIV(framePointer) + FoxThisContext)); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), resultOop); + GIV(stackPointer) = sp1; + /* begin push: */ + object = ceCannotResumePC(); + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp2; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), longAt(GIV(framePointer) + FoxThisContext), 1); +} + + +/* Log failure and then retry if there's an accessorDepth or failure due to + no memory. + */ + + /* CoInterpreter>>#ceCheckAndMaybeRetryPrimitive: */ +void +ceCheckAndMaybeRetryPrimitive(sqInt primIndex) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt retried; + + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveFailure; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + retried = retryPrimitiveOnFailure(); + if (retried + && (recordPrimTrace())) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveRetry; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } +} + + /* CoInterpreter>>#ceCheckForInterrupts */ +void +ceCheckForInterrupts(void) +{ + sqInt switched; + + switched = checkForEventsMayContextSwitch(1); + returnToExecutivepostContextSwitch(0, switched); +} + + +/* Check if the profile timer has expired and if so take a sample. + If the primitive has failed sample the profileMethod as nil. + As a courtesy to compileInterpreterPrimitive: map NULL to nilObj. */ + + /* CoInterpreter>>#ceCheckProfileTick */ +void +ceCheckProfileTick(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (!(GIV(newMethod))) { + GIV(newMethod) = GIV(nilObj); + } + checkProfileTick(GIV(newMethod)); +} + + /* CoInterpreter>>#ceContext:instVar: */ +sqInt +ceContextinstVar(sqInt maybeContext, sqInt slotIndex) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt result; + char *sp; + sqInt top; + + if (((longAt(maybeContext)) & (classIndexMask())) == ClassMethodContextCompactIndex) { + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + result = externalInstVarofContext(slotIndex, maybeContext); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + } + else { + result = longAt((maybeContext + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord()))))); + } + return result; +} + + +/* genStorePop:MaybeContextReceiverVariable: filters out unmarried contexts + but not arbitrary objects in subclasses. It answers maybeMarriedContext so + that the StackToRegisterMappingCogit can keep ReceiverResultReg live. */ + + /* CoInterpreter>>#ceContext:instVar:value: */ +sqInt +ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + sqInt top; + + if ((((longAt(maybeMarriedContext)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && (((longAt((maybeMarriedContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + externalInstVarofContextput(slotIndex, maybeMarriedContext, anOop); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + } + else { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(maybeMarriedContext))); + if ((assert(isNonImmediate(maybeMarriedContext)), + oopisGreaterThanOrEqualTo(maybeMarriedContext, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((anOop & (tagMask())) == 0) + && (oopisLessThan(anOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(maybeMarriedContext))) >> (rememberedBitShift())) & 1) != 0)) { + remember(maybeMarriedContext); + } + } + } + longAtput((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop); + } + return maybeMarriedContext; +} + + /* CoInterpreter>>#ceInterpretMethodFromPIC:receiver: */ +sqInt +ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt firstBytecode; + sqInt header; + sqInt methodHeader; + CogMethod *pic; + sqInt primitiveIndex; + sqInt top; + + + /* pop off inner return and locate open or closed PIC */ + pic = ((CogMethod *) ((popStack()) - (interpretOffset()))); + assert((((pic->cmType)) == CMOpenPIC) + || (((pic->cmType)) == CMClosedPIC)); + if (((pic->cmType)) == CMOpenPIC) { + assert(!(methodHasCogMethod(aMethodObj))); + if (methodShouldBeCogged(aMethodObj)) { + cogselector(aMethodObj, (pic->selector)); + } + } + if ((assert(isNonImmediate(aMethodObj)), + isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(aMethodObj), rcvr); + } + GIV(messageSelector) = (pic->selector); + GIV(newMethod) = aMethodObj; + /* begin primitiveIndexOfMethod:header: */ + assert(isCompiledMethod(aMethodObj)); + header = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ + firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; + primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); + } + else { + primitiveIndex = 0; + } + + /* begin functionPointerFor:inClass: */ + primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex + ? 0 + : primitiveTable[primitiveIndex]))); + GIV(argumentCount) = (pic->cmNumArgs); + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + return interpretMethodFromMachineCode(); +} + + /* CoInterpreter>>#ceMNUFromPICMNUMethod:receiver: */ +sqInt +ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogMethod *cPIC; + sqInt firstBytecode; + sqInt header; + sqInt methodHeader; + sqInt primitiveIndex; + char *sp; + sqInt tagBits; + sqInt tagBits1; + sqInt top; + + assert(addressCouldBeOop(rcvr)); + assert((aMethodObj == 0) + || ((addressCouldBeObj(aMethodObj)) + && (isOopCompiledMethod(aMethodObj)))); + cPIC = ((CogMethod *) ((popStack()) - (mnuOffset()))); + assert((((cPIC->cmType)) == CMClosedPIC) + || (((cPIC->cmType)) == CMOpenPIC)); + GIV(argumentCount) = (cPIC->cmNumArgs); + GIV(messageSelector) = (cPIC->selector); + if (aMethodObj != 0) { + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + createActualMessageTo((((tagBits = rcvr & (tagMask()))) != 0 + ? (/* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))) + : fetchClassOfNonImm(rcvr))); + if (((aMethodObj & (tagMask())) == 0) + && ((((((usqInt) (longAt(aMethodObj))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(aMethodObj), rcvr); + assert(0); + } + GIV(newMethod) = aMethodObj; + /* begin primitiveIndexOfMethod:header: */ + assert(isCompiledMethod(aMethodObj)); + header = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ + firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; + primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); + } + else { + primitiveIndex = 0; + } + + /* begin functionPointerFor:inClass: */ + primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex + ? 0 + : primitiveTable[primitiveIndex]))); + return interpretMethodFromMachineCode(); + } + handleMNUInMachineCodeToclassForMessage(SelectorDoesNotUnderstand, rcvr, (((tagBits1 = rcvr & (tagMask()))) != 0 + ? (/* begin fetchPointer:ofObject: */ + (GIV(lkupClass) = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord()))))))) + : (GIV(lkupClass) = fetchClassOfNonImm(rcvr)))); + assert(0); + return 0; +} + + /* CoInterpreter>>#ceNonLocalReturn: */ +sqInt +ceNonLocalReturn(sqInt returnValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt callerContextOrNil; + sqInt callerContextOrNil1; + sqInt callerContextOrNil2; + char *callerFP; + sqInt closure; + sqInt contextToReturnTo; + sqInt currentCtx; + char *frameToReturnTo; + sqInt home; + StackPage *newPage; + sqInt nextCntx; + sqInt objOop; + sqInt objOop1; + sqInt ourContext; + sqInt ourContext1; + sqInt senderOop; + sqInt senderOop1; + char *sp; + char *sp1; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp4; + char *theFP; + char *theFP1; + char *theFP2; + char *theFP3; + char *theFP4; + char *theFP5; + StackPage *thePage; + StackPage *thePage1; + StackPage *thePage2; + StackPage *thePage3; + char *theSP; + char *theSP1; + char *theSP2; + sqInt top; + sqInt unwindContextOrNilOrZero; + sqInt valuePointer; + sqInt valuePointer1; + + + /* self shortPrintFrameAndCallers: framePointer. + self printOop: returnValue. + self halt. */ + frameToReturnTo = 0; + assert(isMachineCodeFrame(GIV(framePointer))); + assert(frameIsBlockActivation(GIV(framePointer))); + closure = longAt(GIV(framePointer) + (frameStackedReceiverOffset(GIV(framePointer)))); + + /* Walk the closure's lexical chain to find the context or frame to return from (home). */ + home = null; + while (closure != GIV(nilObj)) { + /* begin followField:ofObject: */ + objOop = longAt((closure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(ClosureOuterContextIndex, closure, objOop); + } + home = objOop; + /* begin followField:ofObject: */ + objOop1 = longAt((home + BaseHeaderSize) + (((int)((usqInt)(ClosureIndex) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, home, objOop1); + } + closure = objOop1; + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + unwindContextOrNilOrZero = findUnwindThroughContext(home); + if (unwindContextOrNilOrZero == GIV(nilObj)) { + + /* error: can't find home on chain; cannot return */ + /* begin ensureFrameIsMarried:SP: */ + theFP1 = GIV(framePointer); + theSP = GIV(stackPointer); + if (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP1))); + ourContext = longAt(theFP1 + FoxThisContext); + goto l14; + } + ourContext = marryFrameSP(theFP1, theSP); + l14: /* end ensureFrameIsMarried:SP: */; + /* begin externalCannotReturn:from: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), ourContext); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1); + } + if (unwindContextOrNilOrZero != 0) { + /* begin externalAboutToReturn:through: */ + theFP5 = GIV(framePointer); + theSP2 = GIV(stackPointer); + if (((((usqInt)(longAt(theFP5 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP5 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP5 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP5))); + ourContext1 = longAt(theFP5 + FoxThisContext); + goto l22; + } + ourContext1 = marryFrameSP(theFP5, theSP2); + l22: /* end ensureFrameIsMarried:SP: */; + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), ourContext1); + GIV(stackPointer) = sp4; + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp12; + /* begin push: */ + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp31; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))), ourContext1, 2); + } + contextToReturnTo = null; + if (((longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + assert(checkIsStillMarriedContextcurrentFP(home, GIV(framePointer))); + /* begin frameOfMarriedContext: */ + senderOop = longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if ((longAt(theFP + FoxSavedFP)) == 0) { + /* begin frameCallerContext: */ + assert(isBaseFrame(theFP)); + /* begin stackPageFor: */ + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage1->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + contextToReturnTo = callerContextOrNil; + } + else { + frameToReturnTo = pointerForOop(longAt(theFP + FoxSavedFP)); + } + } + else { + contextToReturnTo = longAt((home + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + if ((((contextToReturnTo & (tagMask())) == 0) + && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex)) + && (((longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1))) { + assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, GIV(framePointer))); + /* begin frameOfMarriedContext: */ + senderOop1 = longAt((contextToReturnTo + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + frameToReturnTo = pointerForOop(senderOop1 - 1); + + contextToReturnTo = null; + } + } + if (contextToReturnTo != null) { + frameToReturnTo = establishFrameForContextToReturnTo(contextToReturnTo); + if (frameToReturnTo == 0) { + + /* error: home's sender is dead; cannot return */ + /* begin ensureFrameIsMarried:SP: */ + theFP2 = GIV(framePointer); + theSP1 = GIV(stackPointer); + if (((((usqInt)(longAt(theFP2 + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP2 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP2 + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP2))); + ourContext = longAt(theFP2 + FoxThisContext); + goto l17; + } + ourContext = marryFrameSP(theFP2, theSP1); + l17: /* end ensureFrameIsMarried:SP: */; + /* begin externalCannotReturn:from: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), ourContext); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp11; + /* begin push: */ + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp21; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1); + } + } + assert(pageListIsWellFormed()); + /* begin stackPageFor: */ + newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (newPage != GIV(stackPage)) { + /* begin frameCallerContext: */ + theFP4 = (GIV(stackPage)->baseFP); + assert(isBaseFrame(theFP4)); + /* begin stackPageFor: */ + thePage3 = stackPageAtpages((assert((((((char *) theFP4)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP4)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP4, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil2 = longAt((thePage3->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil2)); + assert((callerContextOrNil2 == (nilObject())) + || (isContext(callerContextOrNil2))); + currentCtx = callerContextOrNil2; + assert(isContext(currentCtx)); + freeStackPage(GIV(stackPage)); + while (1) { + assert(isContext(currentCtx)); + if ((((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break; + if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + /* begin frameCallerContext: */ + theFP3 = (thePage->baseFP); + assert(isBaseFrame(theFP3)); + /* begin stackPageFor: */ + thePage2 = stackPageAtpages((assert((((((char *) theFP3)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP3)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP3, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil1 = longAt((thePage2->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil1)); + assert((callerContextOrNil1 == (nilObject())) + || (isContext(callerContextOrNil1))); + currentCtx = callerContextOrNil1; + freeStackPage(thePage); + } + else { + nextCntx = longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + /* begin markContextAsDead: */ + assert(isContext(currentCtx)); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer1 = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1); + currentCtx = nextCntx; + } + } + /* begin setStackPageAndLimit: */ + assert(newPage != 0); + GIV(stackPage) = newPage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(newPage); + GIV(stackPointer) = (GIV(stackPage)->headSP); + GIV(framePointer) = (GIV(stackPage)->headFP); + } + if (GIV(framePointer) == frameToReturnTo) { + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + } + else { + do { + callerFP = GIV(framePointer); + GIV(framePointer) = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP)); + } while(GIV(framePointer) != frameToReturnTo); + GIV(instructionPointer) = ((usqInt)(pointerForOop(longAt(callerFP + FoxCallerSavedIP)))); + assert(!(isBaseFrame(callerFP))); + GIV(stackPointer) = (callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord; + + } + return returntoExecutive(returnValue, 0); +} + + +/* Perform a return from a machine code frame to an interpreted frame. + The machine code has executed a return instruction when the return address + is set to ceReturnToInterpreterPC. Return the result and switch to the + interpreter. */ + + /* CoInterpreter>>#ceReturnToInterpreter: */ +sqInt +ceReturnToInterpreter(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aMethodObj; + char *sp; + StackPage *thePage; + + assert(addressCouldBeOop(anOop)); + flag("are you really sure setStackPageAndLimit: is needed?"); + /* begin setStackPageAndLimit: */ + thePage = GIV(stackPage); + assert(thePage != 0); + GIV(stackPage) = thePage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(thePage); + assert(!(isMachineCodeFrame(GIV(framePointer)))); + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + assertValidExecutionPointersimbarline(longAt(GIV(framePointer) + FoxIFSavedIP), GIV(framePointer), GIV(stackPointer), 1, __LINE__); + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), anOop); + GIV(stackPointer) = sp; + siglongjmp(reenterInterpreter, ReturnToInterpreter); + return null; +} + + +/* Entry-point for an abort send in a CogMethod (aboutToReturn:through:, + cannotReturn: et al). + Try and dispatch the send, but the send may turn into an MNU in which case + defer to + handleMNUInMachineCodeTo:... which will dispatch the MNU. + + Continue execution via either executeMethod or + interpretMethodFromMachineCode: depending on whether the target method is + cogged or not. */ + + /* CoInterpreter>>#ceSendAbort:to:numArgs: */ +sqInt +ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + sqInt classObj; + sqInt classTablePage; + sqInt classTag; + CogMethod *cogMethod; + sqInt errSelIdx; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt methodHeader; + sqInt tagBits; + sqInt top; + + + /* self printExternalHeadFrame */ + /* self printStringOf: selector */ + assertCStackWellAligned(); + assert(addressCouldBeOop(rcvr)); + /* begin sendBreakpoint:receiver: */ + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + GIV(argumentCount) = numArgs; + if (((tagBits = rcvr & (tagMask()))) != 0) { + classTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + classTag = (longAt(rcvr)) & (classIndexMask()); + } + if (lookupInMethodCacheSelclassTag(selector, classTag)) { + + /* check for coggability because method is in the cache */ + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + } + else { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + GIV(messageSelector) = selector; + /* begin classAtIndex: */ + assert((classTag <= (tagMask())) + || (classTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + classObj = null; + goto l4; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); + classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l4: /* end classAtIndex: */; + if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { + handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); + assert(0); + } + addNewMethodToCache(classObj); + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + if (((GIV(newMethod) & (tagMask())) == 0) + && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + executeNewMethod(); + assert(0); + } + return interpretMethodFromMachineCode(); +} + + +/* Send from an Open PIC when the first-level method lookup probe has failed, + or to continue when PIC creation has failed (e.g. because we're out of + code space), + or when a send has failed due to a forwarded receiver. */ +/* self printFrame: stackPage headFP WithSP: stackPage headSP */ +/* self printStringOf: selector */ + + /* CoInterpreter>>#ceSendFromInLineCacheMiss: */ +sqInt +ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + sqInt classObj; + sqInt classTablePage; + sqInt classTag; + CogMethod *cogMethod; + sqInt errSelIdx; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt methodHeader; + usqInt numArgs; + sqInt rcvr; + sqInt selector; + sqInt tagBits; + sqInt top; + + numArgs = (cogMethodOrPIC->cmNumArgs); + + /* skip return pc */ + rcvr = longAt(GIV(stackPointer) + ((numArgs + 1) * BytesPerWord)); + assert(addressCouldBeOop(rcvr)); + if (((tagBits = rcvr & (tagMask()))) != 0) { + classTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + classTag = (longAt(rcvr)) & (classIndexMask()); + } + GIV(argumentCount) = numArgs; + if (lookupInMethodCacheSelclassTag((cogMethodOrPIC->selector), classTag)) { + + /* check for coggability because method is in the cache */ + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = (cogMethodOrPIC->selector); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + } + else { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + if (isOopForwarded((cogMethodOrPIC->selector))) { + handleForwardedSelectorFaultFor((cogMethodOrPIC->selector)); + return ceSendFromInLineCacheMiss(cogMethodOrPIC); + } + if (classTag == (isForwardedObjectClassIndexPun())) { + handleForwardedSendFaultForReceiverstackDelta(rcvr, 1); + return ceSendFromInLineCacheMiss(cogMethodOrPIC); + } + GIV(messageSelector) = (cogMethodOrPIC->selector); + /* begin classAtIndex: */ + assert((classTag <= (tagMask())) + || (classTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + classObj = null; + goto l4; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); + classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l4: /* end classAtIndex: */; + if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { + handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); + assert(0); + } + addNewMethodToCache(classObj); + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + if (((GIV(newMethod) & (tagMask())) == 0) + && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + executeNewMethod(); + assert(0); + } + return interpretMethodFromMachineCode(); +} + + +/* For RegisterAllocatingCogit we want the address following a conditional + branch not to be reachable, so we + don't have to generate code to reload registers. Instead simply convert to + an interpreter frame, + backup the pc to the branch, reenter the interpreter and hence retry the + mustBeBoolean send therein. */ + + /* CoInterpreter>>#ceSendMustBeBooleanTo:interpretingAtDelta: */ +void +ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogBlockMethod *cogMethod; + sqInt methodHeader; + sqInt methodObj; + sqInt oop; + char *p; + char *sp; + unsigned short startBcpc; + sqInt top; + + assert(addressCouldBeOop(aNonBooleanObject)); + /* begin mframeCogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + if ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0) + && (!((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)))) { + methodHeader = ((((CogMethod *) (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) cogMethod) + : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))))))->methodHeader); + methodObj = ((((CogMethod *) (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) cogMethod) + : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))))))->methodObject); + startBcpc = (cogMethod->startpc); + } + else { + methodHeader = ((((CogMethod *) cogMethod))->methodHeader); + methodObj = ((((CogMethod *) cogMethod))->methodObject); + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + GIV(instructionPointer) = bytecodePCForstartBcpcin(GIV(instructionPointer), startBcpc, cogMethod); + + /* pre-decrement */ + /* Make space for the two extra fields in an interpreter frame */ + GIV(instructionPointer) = (((methodObj + BaseHeaderSize) + GIV(instructionPointer)) - jumpSize) - 1; + for (p = GIV(stackPointer); p <= (GIV(framePointer) + FoxMFReceiver); p += BytesPerWord) { + oop = longAt(p); + longAtput((p - BytesPerWord) - BytesPerWord, longAt(p)); + } + GIV(stackPointer) = (GIV(stackPointer) - BytesPerWord) - BytesPerWord; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), aNonBooleanObject); + GIV(stackPointer) = sp; + longAtput(GIV(framePointer) + FoxIFrameFlags, encodeFrameFieldHasContextisBlocknumArgs(((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0, ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0, (cogMethod->cmNumArgs))); + longAtput(GIV(framePointer) + FoxIFSavedIP, 0); + longAtput(GIV(framePointer) + FoxMethod, methodObj); + /* begin setMethod:methodHeader: */ + GIV(method) = methodObj; + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + siglongjmp(reenterInterpreter, ReturnToInterpreter); +} + + /* CoInterpreter>>#ceSendMustBeBoolean: */ +sqInt +ceSendMustBeBoolean(sqInt anObject) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + char *sp1; + sqInt top; + + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), anObject); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))), anObject, 0); +} + + +/* Entry-point for an unlinked directed super send in a CogMethod. Smalltalk + stack looks like + receiver + args + head sp -> sender return pc + startAssociation is an association whose value is the class above which to + start the lookup. + + If an MNU then defer to handleMNUInMachineCodeTo:... which will dispatch + the MNU and + may choose to allocate a closed PIC with a fast MNU dispatch for this + send. Otherwise + attempt to link the send site as efficiently as possible. All link + attempts may fail; e.g. + because we're out of code memory. + + Continue execution via either executeMethod or + interpretMethodFromMachineCode: depending on whether the target method is + cogged or not. */ + + /* CoInterpreter>>#ceSend:above:to:numArgs: */ +sqInt +ceSendabovetonumArgs(sqInt selector, sqInt startAssociationArg, sqInt rcvr, sqInt numArgs) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + sqInt classObj; + sqInt classObj1; + sqInt classPointer; + sqInt classTablePage; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt err; + sqInt errSelIdx; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt hash; + sqInt methodHeader; + sqInt methodHeader1; + CogMethod *newCogMethod; + sqInt objOop; + sqInt startAssociation; + sqInt top; + sqInt top1; + + + /* self printExternalHeadFrame */ + /* self printStringOf: selector */ + assertCStackWellAligned(); + assert(addressCouldBeOop(rcvr)); + /* begin sendBreakpoint:receiver: */ + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + startAssociation = (((startAssociationArg & (tagMask())) == 0) + && (((longAt(startAssociationArg)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) + ? noInlineFollowForwarded(startAssociationArg) + : startAssociationArg); + /* begin classTagForClass: */ + classPointer = longAt((startAssociation + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + /* begin followField:ofObject: */ + objOop = longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop); + } + classObj1 = objOop; + assert(addressCouldBeClassObj(classObj1)); + classTag = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj1) + ? (((err = enterIntoClassTable(classObj1))) != 0 + ? -err + : (/* begin rawHashBitsOf: */ + (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) + : -PrimErrBadReceiver)); + + GIV(argumentCount) = numArgs; + if (lookupInMethodCacheSelclassTag(selector, classTag)) { + + /* check for coggability because method is in the cache */ + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + assert(!((isForwardedClassTag(classTag)))); + if (((selector & (tagMask())) == 0) + && (((longAt(selector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + return ceSendabovetonumArgs(handleForwardedSelectorFaultFor(selector), startAssociation, rcvr, numArgs); + } + GIV(messageSelector) = selector; + /* begin classAtIndex: */ + assert((classTag <= (tagMask())) + || (classTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + classObj = null; + goto l4; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); + classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l4: /* end classAtIndex: */; + if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { + if ((errSelIdx == SelectorDoesNotUnderstand) + && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) { + linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, noCheckEntryOffset(), rcvr); + } + handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); + assert(0); + } + addNewMethodToCache(classObj); + } + if (((GIV(newMethod) & (tagMask())) == 0) + && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + /* begin cogMethodOf: */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + else { + + /* Deal with anonymous accessors, e.g. in Newspeak. The cogMethod may not have the + correct selector. If not, try and compile a new method with the correct selector. */ + if (((cogMethod->selector)) != selector) { + newCogMethod = cogselector(GIV(newMethod), selector); + if (!(newCogMethod == null)) { + cogMethod = newCogMethod; + } + } + } + if (((cogMethod->selector)) == selector) { + linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, noCheckEntryOffset(), rcvr); + } + else { + + /* If patchToOpenPICFor:.. returns we're out of code memory */ + patchToOpenPICFornumArgsreceiver(selector, numArgs, rcvr); + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + executeNewMethod(); + assert(0); + } + /* begin popStack */ + top1 = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top1; + return interpretMethodFromMachineCode(); +} + + +/* Entry-point for an unlinked send in a CogMethod. Smalltalk stack looks + like receiver + args + head sp -> sender return pc + + If an MNU then defer to handleMNUInMachineCodeTo:... which will dispatch + the MNU and + may choose to allocate a closed PIC with a fast MNU dispatch for this + send. Otherwise + attempt to link the send site as efficiently as possible. All link + attempts may fail; e.g. + because we're out of code memory. + + Continue execution via either executeMethod or + interpretMethodFromMachineCode: depending on whether the target method is + cogged or not. */ + + /* CoInterpreter>>#ceSend:super:to:numArgs: */ +sqInt +ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + sqInt classObj; + sqInt classObj1; + sqInt classPointer; + sqInt classTablePage; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt err; + sqInt errSelIdx; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt hash; + sqInt methodHeader; + sqInt methodHeader1; + CogMethod *newCogMethod; + sqInt objOop; + sqInt tagBits; + sqInt top; + sqInt top1; + + + /* self printExternalHeadFrame */ + /* self printStringOf: selector */ + assertCStackWellAligned(); + assert(addressCouldBeOop(rcvr)); + /* begin sendBreakpoint:receiver: */ + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr); + if (superNormalBar == 0) { + if (((tagBits = rcvr & (tagMask()))) != 0) { + classTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + classTag = (longAt(rcvr)) & (classIndexMask()); + } + } + else { + /* begin classTagForClass: */ + classPointer = methodClassOf(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()) + ? ((mframeHomeMethod(GIV(framePointer)))->methodObject) + : (/* begin iframeMethod: */ + longAt(GIV(framePointer) + FoxMethod)))); + /* begin followField:ofObject: */ + objOop = longAt((classPointer + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop); + } + classObj1 = objOop; + assert(addressCouldBeClassObj(classObj1)); + classTag = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj1) + ? (((err = enterIntoClassTable(classObj1))) != 0 + ? -err + : (/* begin rawHashBitsOf: */ + (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) + : -PrimErrBadReceiver)); + + } + GIV(argumentCount) = numArgs; + if (lookupInMethodCacheSelclassTag(selector, classTag)) { + + /* check for coggability because method is in the cache */ + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + if (((selector & (tagMask())) == 0) + && (((longAt(selector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + return ceSendsupertonumArgs(handleForwardedSelectorFaultFor(selector), superNormalBar, rcvr, numArgs); + } + if (classTag == (isForwardedObjectClassIndexPun())) { + assert(superNormalBar == 0); + return ceSendsupertonumArgs(selector, superNormalBar, handleForwardedSendFaultForReceiverstackDelta(rcvr, 1), numArgs); + } + GIV(messageSelector) = selector; + /* begin classAtIndex: */ + assert((classTag <= (tagMask())) + || (classTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + classObj = null; + goto l8; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); + classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l8: /* end classAtIndex: */; + if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) { + if ((errSelIdx == SelectorDoesNotUnderstand) + && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) { + linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, (superNormalBar == 0 + ? entryOffset() + : noCheckEntryOffset()), rcvr); + } + handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj); + assert(0); + } + addNewMethodToCache(classObj); + } + if (((GIV(newMethod) & (tagMask())) == 0) + && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + /* begin cogMethodOf: */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + else { + + /* Deal with anonymous accessors, e.g. in Newspeak. The cogMethod may not have the + correct selector. If not, try and compile a new method with the correct selector. */ + if (((cogMethod->selector)) != selector) { + newCogMethod = cogselector(GIV(newMethod), selector); + if (!(newCogMethod == null)) { + cogMethod = newCogMethod; + } + } + } + if (((cogMethod->selector)) == selector) { + linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, (superNormalBar == 0 + ? entryOffset() + : noCheckEntryOffset()), rcvr); + } + else { + + /* If patchToOpenPICFor:.. returns we're out of code memory */ + patchToOpenPICFornumArgsreceiver(selector, numArgs, rcvr); + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + executeNewMethod(); + assert(0); + } + /* begin popStack */ + top1 = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top1; + return interpretMethodFromMachineCode(); +} + + +/* When we arrive here, the value that trapped is pushed on stack */ + + /* CoInterpreter>>#ceSistaTrap */ +sqInt +ceSistaTrap(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt context; + char *sp; + char *sp1; + char *theFP; + char *theSP; + sqInt top; + + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin ensureFrameIsMarried:SP: */ + theFP = GIV(framePointer); + theSP = GIV(stackPointer); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + context = longAt(theFP + FoxThisContext); + goto l2; + } + context = marryFrameSP(theFP, theSP); +l2: /* end ensureFrameIsMarried:SP: */; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), context); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorSistaTrap) << (shiftForWord()))))), context, 0); +} + + +/* If contextSwitchIfNotNil is nil we can't context switch. + contextSwitchIfNotNil is set to nil by + - the special primitiveClosureValueNoContextSwitch entry-point in block + dispatch - the stack check in methods with primitive 198. + In a normal method contextSwitchIfNotNil will be the method (see e.g. + SimpleStackBasedCogit>>compileFrameBuild). In a block it will be the + closure (see e.g. SimpleStackBasedCogit>>compileMethodBody). */ + + /* CoInterpreter>>#ceStackOverflow: */ +void +ceStackOverflow(sqInt contextSwitchIfNotNil) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt cesoRetAddr; + CogBlockMethod *cogMethod; + sqInt switched; + sqInt top; + + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + cesoRetAddr = top; + /* begin mframeCogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + assert((cesoRetAddr - (abortOffset())) == (((sqInt)(asCogHomeMethod(cogMethod))))); + GIV(instructionPointer) = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + GIV(method) = (GIV(newMethod) = (GIV(messageSelector) = GIV(nilObj))); + switched = handleStackOverflowOrEventAllowContextSwitch(contextSwitchIfNotNil != 0); + returnToExecutivepostContextSwitch(0, switched); + error("should not be reached"); +} + + /* CoInterpreter>>#ceTraceBlockActivation */ +void +ceTraceBlockActivation(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt selector; + + if (recordBlockTrace()) { + /* begin recordTrace:thing:source: */ + selector = ((mframeHomeMethod(GIV(framePointer)))->methodObject); + GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockActivation; + GIV(traceLog)[GIV(traceLogIndex) + 1] = selector; + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromMachineCode; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + if (printOnTrace()) { + printActivationNameForreceiverisBlockfirstTemporary(((mframeHomeMethod(GIV(framePointer)))->methodObject), ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()) + ? (/* begin mframeReceiver: */ + longAt(GIV(framePointer) + FoxMFReceiver)) + : (/* begin iframeReceiver: */ + longAt(GIV(framePointer) + FoxIFReceiver))), 1, null); + /* begin cr */ + printf("\n"); + } + } +} + + /* CoInterpreter>>#ceTraceLinkedSend: */ +void +ceTraceLinkedSend(sqInt theReceiver) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOrInteger; + CogMethod *cogMethod; + sqInt selector; + sqInt selector1; + sqInt tagBits; + + cogMethod = ((CogMethod *) ((longAt(GIV(stackPointer))) - (traceLinkedSendOffset()))); + /* begin recordTrace:thing:source: */ + if (((tagBits = theReceiver & (tagMask()))) != 0) { + /* begin fetchPointer:ofObject: */ + classOrInteger = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))); + } + else { + classOrInteger = fetchClassOfNonImm(theReceiver); + } + selector = (cogMethod->selector); + GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger; + GIV(traceLog)[GIV(traceLogIndex) + 1] = selector; + GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromMachineCode; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + if (printOnTrace()) { + printActivationNameForreceiverisBlockfirstTemporary((cogMethod->methodObject), theReceiver, 0, null); + /* begin cr */ + printf("\n"); + } + /* begin sendBreakpoint:receiver: */ + selector1 = (cogMethod->selector); + sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), theReceiver); +} + + +/* For assertion checking. */ + + /* CoInterpreter>>#ceTraceStoreOf:into: */ +void +ceTraceStoreOfinto(sqInt aValue, sqInt anObject) +{ + assert((isImmediate(aValue)) + || (addressCouldBeObj(aValue))); + assert(addressCouldBeObj(anObject)); +} + + /* CoInterpreter>>#checkAssertsEnabledInCoInterpreter */ +void +checkAssertsEnabledInCoInterpreter(void) +{ + sqInt assertsAreEnabledInCoInterpreter; + + assertsAreEnabledInCoInterpreter = 0; + assert(assertsAreEnabledInCoInterpreter); +} + + +/* Perform an integrity/leak check using the heapMap. Assume + clearLeakMapAndMapAccessibleObjects has set a bit at each + object's header. Check that all object references in machine + code are valid. Answer if all checks pass. */ + + /* CoInterpreter>>#checkCodeIntegrity: */ +static sqInt NoDbgRegParms +checkCodeIntegrity(sqInt gcModes) +{ + return checkIntegrityOfObjectReferencesInCode(gcModes); +} + + +/* Check the log for leaks. The trace log is a circular buffer of pairs of + entries. If there is an entry at traceLogIndex - 3 \\ TraceBufferSize it + has entries. If + there is something at traceLogIndex it has wrapped. */ + + /* CoInterpreter>>#checkLogIntegrity */ +static sqInt +checkLogIntegrity(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt limit; + sqInt ok; + sqInt oop; + sqInt remainder; + + limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0 + ? remainder + TraceBufferSize + : remainder); + if ((GIV(traceLog)[limit]) == 0) { + return 1; + } + if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) { + limit = TraceBufferSize - 3; + } + ok = 1; + for (i = 0; i <= limit; i += 3) { + oop = GIV(traceLog)[i]; + if (!(oop & (tagMask()))) { + if (!(checkOopIntegritynamedindex(oop, "traceLog", i))) { + ok = 0; + } + } + oop = GIV(traceLog)[i + 1]; + if (!(oop & (tagMask()))) { + if (!(checkOopIntegritynamedindex(oop, "traceLog", i + 1))) { + ok = 0; + } + } + } + return ok; +} + + +/* Check if the argument is an ok object. + If this is a pointers object, check that its fields are all okay oops. */ + + /* CoInterpreter>>#checkOkayFields: */ +static sqInt NoDbgRegParms +checkOkayFields(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt fieldOop; + sqInt hasYoung; + sqInt i; + + if ((oop == null) + || (oop == 0)) { + return 1; + } + if ((oop & 1)) { + return 1; + } + if (!(checkOkayOop(oop))) { + return 0; + } + if (!(checkOopHasOkayClass(oop))) { + return 0; + } + if (!((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5) + || (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + return 1; + } + hasYoung = 0; + if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { + i = ((literalCountOfMethodHeader(methodHeaderOf(oop))) + LiteralStart) - 1; + } + else { + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + i = (CtxtTempFrameStart + (fetchStackPointerOf(oop))) - 1; + } + else { + i = (lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) - 1; + } + } + while (i >= 0) { + fieldOop = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + if ((fieldOop & 1) == 0) { + if ((i == 0) + && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) { + if ((methodFor(pointerForOop(fieldOop))) == 0) { + print("method "); + printHex(oop); + print(" has an invalid cog method reference"); + return 0; + } + } + else { + hasYoung = hasYoung + || (((fieldOop & (tagMask())) == 0) + && (oopisLessThan(fieldOop, GIV(newSpaceLimit)))); + if (!(checkOkayOop(fieldOop))) { + return 0; + } + if (!(checkOopHasOkayClass(fieldOop))) { + return 0; + } + } + } + i -= 1; + } + if (hasYoung) { + /* begin checkOkayYoungReferrer: */ + if (oopisLessThan(oop, GIV(newSpaceLimit))) { + return 1; + } + if (!(((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0)) { + print("remembered bit is not set in "); + printHex(oop); + /* begin cr */ + printf("\n"); + return 0; + } + if (isInRememberedSet(oop)) { + return 1; + } + printHex(oop); + print(" has remembered bit set but is not in remembered set"); + /* begin cr */ + printf("\n"); + return 0; + } + return 1; +} + + +/* Perform an integrity/leak check using the heapMap. Assume + clearLeakMapAndMapAccesibleObjects has set a bit at each + object's header. Scan all objects accessible from the stack + checking that every pointer points to a header. Answer if no + dangling pointers were detected. */ + + /* CoInterpreter>>#checkStackIntegrity */ +static sqInt +checkStackIntegrity(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + CogMethod *cogMethod; + char *frameRcvrOffset; + sqInt i; + sqInt methodField; + sqInt ok; + usqInt oop; + char *theFP; + StackPage *thePage; + char *theSP; + + ok = 1; + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(isFree(thePage))) { + if (thePage == GIV(stackPage)) { + theSP = GIV(stackPointer); + theFP = GIV(framePointer); + } + else { + theSP = (thePage->headSP); + theFP = (thePage->headFP); + } + if (!(thePage == GIV(stackPage))) { + theSP += BytesPerWord; + } + while (1) { + frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? theFP + FoxMFReceiver + : theFP + FoxIFReceiver); + while (theSP <= frameRcvrOffset) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && ((heapMapAtWord(pointerForOop(oop))) == 0)) { + printFrameThingandFrameat("object leak in frame temp", theFP, theSP); + ok = 0; + } + theSP += BytesPerWord; + } + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) + : (/* begin iframeHasContext: */ + (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) { + oop = longAt(theFP + FoxThisContext); + if ((oop & (tagMask())) + || ((heapMapAtWord(pointerForOop(oop))) == 0)) { + printFrameThingandFrameat("object leak in frame ctxt", theFP, theFP + FoxThisContext); + ok = 0; + } + if (!(((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { + printFrameThingandFrameat("frame ctxt should be context", theFP, theFP + FoxThisContext); + ok = 0; + } + if (!((((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) + && (((longAt((oop + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)))) { + printFrameThingandFrameat("frame ctxt should be married", theFP, theFP + FoxThisContext); + ok = 0; + } + if (!((((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) + && ((frameOfMarriedContext(oop)) == theFP))) { + printFrameThingandFrameat("frame ctxt should be married to this frame ", theFP, theFP + FoxThisContext); + ok = 0; + } + } + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin mframeHomeMethod: */ + methodField = longAt(theFP + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + cogMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + goto l4; + } + cogMethod = ((CogMethod *) (methodField & MFMethodMask)); + l4: /* end mframeHomeMethod: */; + if ((heapMapAtWord(pointerForOop(cogMethod))) == 0) { + printFrameThingandFrameat("object leak in mframe mthd", theFP, theFP + FoxMethod); + ok = 0; + } + } + else { + oop = longAt(theFP + FoxMethod); + if ((oop & (tagMask())) + || ((heapMapAtWord(pointerForOop(oop))) == 0)) { + printFrameThingandFrameat("object leak in iframe mthd", theFP, theFP + FoxMethod); + ok = 0; + } + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theSP = (theFP + FoxCallerSavedIP) + BytesPerWord; + theFP = callerFP; + } + theSP = (theFP + FoxCallerSavedIP) + BytesPerWord; + while (theSP <= ((thePage->baseAddress))) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && ((heapMapAtWord(pointerForOop(oop))) == 0)) { + printFrameThingandFrameat("object leak in frame arg", theFP, theSP); + ok = 0; + } + theSP += BytesPerWord; + } + } + } + return ok; +} + + /* CoInterpreter>>#clearTraceLog */ +void +clearTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + + GIV(traceLogIndex) = 0; + for (i = 0; i < TraceBufferSize; i += 1) { + GIV(traceLog)[i] = 0; + } +} + + /* CoInterpreter>>#cogMethodOf: */ +CogMethod * +cogMethodOf(sqInt aMethodOop) +{ + sqInt methodHeader; + + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + return ((CogMethod *) methodHeader); +} + + /* CoInterpreter>>#commenceCogCompiledCodeCompaction */ +static void +commenceCogCompiledCodeCompaction(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + usqLong startTime; + sqInt top; + + GIV(cogCompiledCodeCompactionCalledFor) = 0; + if (recordEventTrace()) { + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = TraceCodeCompaction; + GIV(traceLog)[GIV(traceLogIndex) + 1] = TraceCodeCompaction; + GIV(traceLog)[GIV(traceLogIndex) + 2] = 0; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = TraceCodeCompaction; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + + /* This can be called in a number of circumstances. The instructionPointer + may contain a native pc that must be relocated. There may already be a + pushed instructionPointer on stack. Clients ensure that instructionPointer + is 0 if it should not be pushed and/or relocated. Pushing twice is a mistake + because only the top one will be relocated. */ + startTime = ioUTCMicrosecondsNow(); + if (GIV(instructionPointer) != 0) { + + /* better not have already been pushed */ + assert((((usqInt)(stackTop()))) != GIV(instructionPointer)); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + /* begin externalWriteBackHeadStackPointer */ + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + (GIV(stackPage)->headSP = GIV(stackPointer)); + } + assertValidStackedInstructionPointers(__LINE__); + compactCogCompiledCode(); + /* begin nilUncoggableMethods */ + GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null); + if (GIV(instructionPointer) != 0) { + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin externalWriteBackHeadStackPointer */ + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + (GIV(stackPage)->headSP = GIV(stackPointer)); + } + assertValidStackedInstructionPointers(__LINE__); + GIV(statCodeCompactionCount) += 1; + GIV(statCodeCompactionUsecs) += (ioUTCMicrosecondsNow()) - startTime; + if (checkForLeaks != 0) { + clearLeakMapAndMapAccessibleObjects(); + asserta(checkCodeIntegrity(0)); + } +} + + /* CoInterpreter>>#compilationBreakpointFor: */ +void +compilationBreakpointFor(sqInt selectorOop) +{ + suppressHeartbeatFlag = 1; + warning("compilation send break (heartbeat suppressed)"); +} + + +/* Answer a value to store in the InstructionPointer index of a context + object for theIP and theFP. + Mapping native pcs to bytecode pcs is quite expensive, requiring a search + through the method + map. We mitigate this cost by deferring mapping until we really have to, + which is when a context's + instruction pointer is accessed by Smalltalk code (either direct inst var + access or through the + instVarAt: primitive). But to defer mapping we have to be able to + distinguish machine code from + bytecode pcs, which we do by using negative values for machine code pcs. + So if the frame is a + machine code one answer the negation of the offset in the cog method. + + As a whorish performance hack we also include the block method offset in + the pc of a block. + The least significant 16 bits are the native pc and the most significant + 14 bits are the block + start, in block alignment units. So when mapping back we can find the + start of the block. + + See mustMapMachineCodePC:context: for the code that does the actual + mapping. */ + + /* CoInterpreter>>#contextInstructionPointer:frame: */ +static sqInt NoDbgRegParms +contextInstructionPointerframe(sqInt theIP, char *theFP) +{ + sqInt blockOffset; + CogBlockMethod *cogMethod; + CogMethod *homeMethod; + + assert(validInstructionPointerinFrame(theIP, theFP)); + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin encodedNativePCOf:cogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); + if (theIP == (ceCannotResumePC())) { + return HasBeenReturnedFromMCPCOop; + } + if (((cogMethod->cmType)) == CMMethod) { + return (((usqInt)((((sqInt)cogMethod)) - theIP) << 1) | 1); + } + homeMethod = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) cogMethod) + : ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))); + blockOffset = ((((sqInt)homeMethod)) - (((sqInt)cogMethod))) / (blockAlignment()); + return (((usqInt)((((usqInt) blockOffset << 16)) | (((((sqInt)cogMethod)) - theIP) & 0xFFFF)) << 1) | 1); + } + return (((usqInt)(((((theIP == (ceReturnToInterpreterPC()) + ? longAt(theFP + FoxIFSavedIP) + : theIP)) - (longAt(theFP + FoxMethod))) - BaseHeaderSize) + 2) << 1) | 1); +} + + +/* default native stack frame size */ + + /* CoInterpreter>>#defaultNativeStackFrameSize */ +sqInt +defaultNativeStackFrameSize(void) +{ + return 256; +} + + +/* Defer smashes of the stackLimit around the call of functionSymbol (for + assert checks) + */ + + /* CoInterpreter>>#deferStackLimitSmashAround:with: */ +static sqInt NoDbgRegParms +deferStackLimitSmashAroundwith(void (*functionSymbol)(sqInt), sqInt arg) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + GIV(deferSmash) = 1; + sqLowLevelMFence(); + functionSymbol(arg); + GIV(deferSmash) = 0; + sqLowLevelMFence(); + if (GIV(deferredSmash)) { + GIV(deferredSmash) = 0; + sqLowLevelMFence(); + forceInterruptCheck(); + } + return 1; +} + + +/* Divorce at most one frame in the current page (since the divorce may cause + the page to be split) + and answer whether a frame was divorced. */ + + /* CoInterpreter>>#divorceAMachineCodeFrameWithCogMethod:in: */ +static sqInt NoDbgRegParms +divorceAMachineCodeFrameWithCogMethodin(CogMethod *cogMethod, StackPage *aStackPage) +{ + char *calleeFP; + sqInt theContext; + char *theFP; + char *theSP; + + theFP = (aStackPage->headFP); + theSP = (aStackPage->headSP); + + /* theSP points at hottest item on frame's stack */ + theSP += BytesPerWord; + while (1) { + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) + && (cogMethod == (mframeHomeMethod(theFP)))) { + /* begin ensureFrameIsMarried:SP: */ + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + theContext = longAt(theFP + FoxThisContext); + goto l1; + } + theContext = marryFrameSP(theFP, theSP); + l1: /* end ensureFrameIsMarried:SP: */; + externalDivorceFrameandContext(theFP, theContext); + return 1; + } + calleeFP = theFP; + theFP = pointerForOop(longAt(theFP + FoxSavedFP)); + if (!(theFP != 0)) break; + + /* theSP points at stacked hottest item on frame's stack */ + assert(!(isBaseFrame(calleeFP))); + theSP = (calleeFP + (frameStackedReceiverOffset(calleeFP))) + BytesPerWord; + + } + return 0; +} + + +/* The prim trace log is a circular buffer of entries. If there is + an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries. + If there is something at primTraceLogIndex it has wrapped. */ + + /* CoInterpreter>>#dumpPrimTraceLog */ +void +dumpPrimTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt remainder; + + if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0 + ? remainder + PrimTraceLogSize + : remainder)]) == 0) { + return; + } + if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) { + for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) { + printPrimLogEntryAt(i); + /* begin cr */ + printf("\n"); + } + } + for (i = 0; i < GIV(primTraceLogIndex); i += 1) { + printPrimLogEntryAt(i); + /* begin cr */ + printf("\n"); + } +} + + +/* The trace log is a circular buffer of pairs of entries. If there is + an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries. + If there is something at traceLogIndex it has wrapped. */ + + /* CoInterpreter>>#dumpTraceLog */ +void +dumpTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt remainder; + + if ((GIV(traceLog)[(((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0 + ? remainder + TraceBufferSize + : remainder)]) == 0) { + return; + } + if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) { + for (i = GIV(traceLogIndex); i <= (TraceBufferSize - 3); i += 3) { + printLogEntryAt(i); + } + } + for (i = 0; i <= (GIV(traceLogIndex) - 3); i += 3) { + printLogEntryAt(i); + } +} + + +/* Safety to give the JIT lattitude in calling convention. Conceptually, + returning a value to a context involves pushing that value onto the stack. + This is used + in Squeak methods such as ContextPart>>jump + jump + | top | + thisContext sender push: nil. + stackp = 0 ifTrue: [self stepToSendOrReturn]. + stackp = 0 ifTrue: [self push: nil]. + top := self pop. + thisContext privSender: self. + ^top + Here jump may pop the value of a temporary variable off the stack which + will, conceptually and, in the interpreter, actually, get pushed back on + return. But + if the JIT is mapping the stack to registers disaster may ensue since the + value may not get pushed to the stack and code may access an invalid value + (e.g. a pc). + + The solution is to fall back on the interpreter. If the stack pointer is + changed we + also ensure the pc is a bytecode pc (+ive) which will cause + makeBaseFrameFor: to create an interpreter frame if the context is + executed again. */ + + /* CoInterpreter>>#ensureContextIsExecutionSafeAfterAssignToStackPointer: */ +static void NoDbgRegParms +ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext) +{ + sqInt pc; + + /* begin ensureContextHasBytecodePC: */ + assert(!(isMarriedOrWidowedContext(aContext))); + pc = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + if (((pc & 1)) + && (((pc = (pc >> 1))) < 0)) { + pc = mustMapMachineCodePCcontext(pc, aContext); + assert(!(isOopForwarded(aContext))); + longAtput((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), pc); + + } +} + + +/* Main entry-point into the interpreter at each execution level, where an + execution level is either the start of execution or reentry for a + callback. Capture the C stack + pointers so that calls from machine-code into the C run-time occur at this + level. This is the actual implementation, separated from + enterSmalltalkExecutive so the + simulator can wrap it in an exception handler and hence simulate the + setjmp/longjmp. */ + + /* CoInterpreter>>#enterSmalltalkExecutiveImplementation */ +static sqInt +enterSmalltalkExecutiveImplementation(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aMethodObj; + + assertCStackWellAligned(); + ceCaptureCStackPointers(); + sigsetjmp(reenterInterpreter, 0); + if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) { + returnToExecutivepostContextSwitch(0, 1); + } + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__); + interpret(); + return 0; +} + + +/* Execute a CogMethod from a linked send. The receiver, + arguments and return address are on the Smalltalk stack. First + push the entry-point and finally the register argument(s). Then write + back the frame pointers and call the routine that will pop off the + register argument(s) and jump to the entry by executing a return + instruction. + In the simple jit only the receiver gets passed in registers, so only the + receiver gets pushed. */ + + /* CoInterpreter>>#executeCogMethod:fromLinkedSendWithReceiver: */ +void +executeCogMethodfromLinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + char *sp; + char *sp1; + + assertCStackWellAligned(); + assert(isMachineCodeFrame(GIV(framePointer))); + assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + + /* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */ + if (((cogMethod->cmNumArgs)) <= (numRegArgs())) { + callRegisterArgCogMethodatreceiver(cogMethod, entryOffset(), rcvr); + } + + /* begin push: */ + object = (((sqInt)cogMethod)) + (entryOffset()); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp1; + ceCallCogCodePopReceiverReg(); +} + + +/* Execute a CogMethod from an unlinked send. The receiver, + arguments and return address are on the Smalltalk stack. First + push the entry-point and finally the register argument(s). Then write + back the frame pointers and call the routine that will pop off the + register argument(s) and jump to the entry by executing a return + instruction. + In the simple jit only the receiver gets passed in registers, so only the + receiver gets pushed. */ + + /* CoInterpreter>>#executeCogMethod:fromUnlinkedSendWithReceiver: */ +static void NoDbgRegParms +executeCogMethodfromUnlinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + char *sp; + char *sp1; + + assertCStackWellAligned(); + assert(isMachineCodeFrame(GIV(framePointer))); + assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + + /* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */ + if (((cogMethod->cmNumArgs)) <= (numRegArgs())) { + callRegisterArgCogMethodatreceiver(cogMethod, noCheckEntryOffset(), rcvr); + } + + /* begin push: */ + object = (((sqInt)cogMethod)) + (noCheckEntryOffset()); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp1; + ceCallCogCodePopReceiverReg(); +} + + +/* Execute a closed PIC from a linked send, to redispatch based on the rcvr. + The receiver, arguments and return address are on the Smalltalk stack. + First push the entry-point and finally the register argument(s). Then + write back the frame pointers and call the routine that will pop off the + register argument(s) and jump to the entry by executing a return + instruction. + In the simple jit only the receiver gets passed in registers, so only the + receiver gets pushed. */ + + /* CoInterpreter>>#executeCogPIC:fromLinkedSendWithReceiver:andCacheTag: */ +void +executeCogPICfromLinkedSendWithReceiverandCacheTag(CogMethod *cogPIC, sqInt rcvr, sqInt cacheTag) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + char *sp; + char *sp1; + char *sp2; + char *sp3; + + assertCStackWellAligned(); + assert(isMachineCodeFrame(GIV(framePointer))); + assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + /* begin push: */ + object = (((sqInt)cogPIC)) + (entryOffset()); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp1; + + /* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */ + if (((cogPIC->cmNumArgs)) <= (numRegArgs())) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), cacheTag); + GIV(stackPointer) = sp; + + switch ((cogPIC->cmNumArgs)) { + case 0: + ceCall0ArgsPIC(); + break; + case 1: + ceCall1ArgsPIC(); + break; + case 2: + ceCall2ArgsPIC(); + break; + default: + ; + } + error("not reached"); + } + + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), cacheTag); + GIV(stackPointer) = sp3; + ceCallCogCodePopReceiverAndClassRegs(); +} + + +/* Execute newMethod - either primitiveFunctionPointer must be set directly + (i.e. from primitiveExecuteMethod et al), or it would have been set + probing the method cache (i.e. primitivePerform et al). + Eagerly compile it if appropriate so that doits are fast. */ + + /* CoInterpreter>>#executeNewMethod */ +static sqInt +executeNewMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + int inInterpreter; + sqInt methodHeader; + + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + if (primitiveFunctionPointer != 0) { + if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { + externalQuickPrimitiveResponse(); + returntoExecutive(popStack(), inInterpreter); + return null; + } + if (slowPrimitiveResponse()) { + returntoExecutive(popStack(), inInterpreter); + return null; + } + } + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if (!((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0))) { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(GIV(newMethod), GIV(nilObj)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + } + else { + maybeFlagMethodAsInterpreted(GIV(newMethod)); + } + } + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, ((sqInt)GIV(instructionPointer))); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + activateCoggedNewMethod(inInterpreter); + } + else { + activateNewMethod(); + } + return 0; +} + + +/* Fetch an instance variable from a maybe married context. + If the context is still married compute the value of the + relevant inst var from the spouse frame's state. + + If the context is single but has a negative instruction pointer + recognise that the instruction pointer is actually into machine + code and convert it to the corresponding bytecode pc. */ + + /* CoInterpreter>>#externalInstVar:ofContext: */ +static sqInt NoDbgRegParms +externalInstVarofContext(sqInt offset, sqInt aContext) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt value; + + assert(isContext(aContext)); + assert(offset <= (ReceiverIndex + (checkStackPointerForMaybeMarriedContext(aContext)))); + if (!(offset <= StackPointerIndex)) { + return longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(offset) << (shiftForWord()))))); + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + if ((((longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(aContext)))) { + return fetchPointerofMarriedContext(offset, aContext); + } + value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(offset) << (shiftForWord()))))); + if ((offset == InstructionPointerIndex) + && (((value & 1)) + && ((((int) value)) < 0))) { + return mustMapMachineCodePCcontext((value >> 1), aContext); + } + return value; +} + + +/* Find the compiled method to be run when the current messageSelector is + sent to the given classTag, setting the values of newMethod and + primitiveIndex. + */ + + /* CoInterpreter>>#findNewMethodInClassTag: */ +static void NoDbgRegParms +findNewMethodInClassTag(sqInt classTagArg) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + usqInt aMethodObj1; + sqInt classTablePage; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt methodHeader; + sqInt methodHeader1; + sqInt ok; + sqInt selector; + sqInt selector1; + + ok = lookupInMethodCacheSelclassTag(GIV(messageSelector), classTagArg); + if (ok) { + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + } + else { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + + /* entry was not found in the cache; perhaps soemthing was forwarded. */ + classTag = classTagArg; + if ((((GIV(messageSelector) & (tagMask())) == 0) + && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) + || (classTag == (isForwardedObjectClassIndexPun()))) { + if (((GIV(messageSelector) & (tagMask())) == 0) + && (((longAt(GIV(messageSelector))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + GIV(messageSelector) = handleForwardedSelectorFaultFor(GIV(messageSelector)); + } + if (classTag == (isForwardedObjectClassIndexPun())) { + classTag = handleForwardedSendFaultForTag(classTag); + } + ok = lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag); + if (ok) { + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj1 = GIV(newMethod); + selector1 = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj1 + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector1); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj1, selector1); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj1); + } + } + return; + } + } + /* begin classAtIndex: */ + assert((classTag <= (tagMask())) + || (classTag >= (arrayClassIndexPun()))); + /* begin fetchPointer:ofObject: */ + fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift()); + classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord()))))); + if (classTablePage == GIV(nilObj)) { + GIV(lkupClass) = null; + goto l2; + } + /* begin fetchPointer:ofObject: */ + fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1); + GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord()))))); + l2: /* end classAtIndex: */; + lookupMethodInClass(GIV(lkupClass)); + + addNewMethodToCache(GIV(lkupClass)); + } +} + + +/* methodObj is a CompiledMethod. If it contains an external primitive, + flush the function address and session ID of the CM. Answer the prim + index for the benefit of subclass overrides. */ +/* methodObj is a CompiledMethod containing an external primitive. + Flush the function address and session ID of the CM. Override + to also flush the machine code call if one exists. */ + + /* CoInterpreter>>#flushExternalPrimitiveOf: */ +void +flushExternalPrimitiveOf(sqInt methodObj) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt firstBytecode; + sqInt header; + sqInt header1; + sqInt lit; + sqInt methodHeader; + sqInt primIdx; + sqInt primIdx1; + + /* begin methodHeaderOf: */ + assert(isCompiledMethod(methodObj)); + header1 = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + if (header & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ + firstBytecode = (methodObj + ((LiteralStart + (((header >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; + primIdx1 = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); + } + else { + primIdx1 = 0; + } + + if ((primIdx1 == PrimitiveExternalCallIndex) + && (((assert((header & 1)), + /* begin literalCountOfAlternateHeader: */ + ((header >> 1)) & AlternateHeaderNumLiteralsMask)) > 0)) { + + /* If not, something's broken */ + /* begin fetchPointer:ofObject: */ + lit = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)((0 + LiteralStart)) << (shiftForWord()))))); + if ((((lit & (tagMask())) == 0) + && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) + && ((numSlotsOf(lit)) == 4)) { + + /* If not, something's broken */ + assert(!(isOopForwarded(lit))); + longAtput((lit + BaseHeaderSize) + (2U << (shiftForWord())), ConstZero); + + assert(!(isOopForwarded(lit))); + longAtput((lit + BaseHeaderSize) + (3U << (shiftForWord())), ConstZero); + + } + } + primIdx = primIdx1; + if ((primIdx == PrimitiveExternalCallIndex) + && ((assert(isNonImmediate(methodObj)), + /* begin isCogMethodReference: */ + (methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))), + assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0))) { + rewritePrimInvocationInto(cogMethodOf(methodObj), primitiveExternalCall); + } +} + + +/* Flush the method cache. The method cache is flushed on every programming + change and garbage collect. + */ +/* Flush the method cache. The method cache is flushed on every programming + change and garbage collect. + */ + + /* CoInterpreter>>#flushMethodCache */ +static void +flushMethodCache(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + + for (i = 1; i <= MethodCacheSize; i += 1) { + GIV(methodCache)[i] = 0; + } + + /* this for primitiveExternalMethod */ + GIV(lastMethodCacheProbeWrite) = 0; + unlinkAllSends(); +} + + /* CoInterpreter>>#followForwardedFieldsInCurrentMethod */ +static void +followForwardedFieldsInCurrentMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogMethod *cogMethod; + sqInt methodField; + + if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) { + /* begin mframeHomeMethod: */ + methodField = longAt(GIV(framePointer) + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + cogMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + goto l2; + } + cogMethod = ((CogMethod *) (methodField & MFMethodMask)); + l2: /* end mframeHomeMethod: */; + followForwardedObjectFieldstoDepth((cogMethod->methodObject), 0); + followForwardedLiteralsIn(cogMethod); + } + else { + followForwardedObjectFieldstoDepth(GIV(method), 0); + } +} + + +/* Spur's become: is lazy, turning the becommed object into a forwarding + object to the other. + The read-barrier is minimised by arranging that forwarding pointers will + fail a method cache + probe, since notionally objects' internals are accessed only via sending + messages to them, + the exception is primitives that access the internals of the non-receiver + argument(s). + To avoid a read barrier on bytecode, literal and inst var fetch and + non-local return, we scan + the receivers (including the stacked receiver for non-local return) and + method references + in the stack zone and follow any forwarded ones. This is of course way + cheaper than + scanning all of memory as in the old become. + + Override to handle machine code frames */ + + /* CoInterpreter>>#followForwardingPointersInStackZone: */ +static void NoDbgRegParms +followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + sqInt i; + sqInt newOop; + sqInt numArgs; + usqInt offset; + usqInt oop; + sqInt referent; + sqInt referent1; + sqInt referent2; + char *theFP; + usqInt theIPPtr; + StackPage *thePage; + char *theSP; + + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + if (theBecomeEffectsFlags & BecameCompiledMethodFlag) { + if (((longAt(GIV(method))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + theIPPtr = GIV(instructionPointer) - GIV(method); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(GIV(method))); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((GIV(method) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + GIV(method) = referent; + GIV(instructionPointer) = GIV(method) + theIPPtr; + } + if (((GIV(newMethod) & (tagMask())) == 0) + && (((longAt(GIV(newMethod))) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(GIV(newMethod))); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((GIV(newMethod) + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + } + GIV(newMethod) = referent1; + } + } + assert(GIV(stackPage) != 0); + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(((thePage->baseFP)) == 0)) { + assert(ifCurrentStackPageHasValidHeadPointers(thePage)); + + /* Skip the instruction pointer on top of stack of inactive pages. */ + theFP = (thePage->headFP); + theIPPtr = (thePage == GIV(stackPage) + ? 0 + : ((usqInt)((thePage->headSP)))); + while (1) { + assert(addressIsInPage(thePage, theFP)); + assert((theIPPtr == 0) + || (addressIsInPage(thePage, ((void *)theIPPtr)))); + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + oop = longAt(theFP + FoxMFReceiver); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + longAtput(theFP + FoxMFReceiver, followForwarded(oop)); + } + assert(!(isForwarded(((mframeHomeMethod(theFP))->methodObject)))); + } + else { + oop = longAt(theFP + FoxIFReceiver); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + longAtput(theFP + FoxIFReceiver, followForwarded(oop)); + } + oop = longAt(theFP + FoxMethod); + if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(oop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent2 = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent2 & (tagMask())) == 0) + && (((longAt(referent2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord()))); + } + newOop = referent2; + offset = newOop - oop; + if ((theIPPtr != 0) + && ((longAt(theIPPtr)) > oop)) { + longAtput(theIPPtr, (longAt(theIPPtr)) + offset); + } + longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + offset); + longAtput(theFP + FoxMethod, (oop = newOop)); + } + } + if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? (/* begin mframeHasContext: */ + ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0) + : (/* begin iframeHasContext: */ + (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) + && (((longAt(longAt(theFP + FoxThisContext))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext))); + } + /* begin frameStackedReceiverOffsetNumArgs: */ + numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1)); + offset = ((sqInt) ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord())))))); + oop = longAt(theFP + offset); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + longAtput(theFP + offset, followForwarded(oop)); + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP)); + theFP = callerFP; + } + theSP = ((thePage->baseAddress)) - BytesPerWord; + while (theSP <= ((thePage->baseAddress))) { + oop = longAt(theSP); + if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + longAtput(theSP, followForwarded(oop)); + } + theSP += BytesPerWord; + } + } + } +} + + +/* Force an interrupt check ASAP. This version is the + entry-point to forceInterruptCheck for the heartbeat + timer to allow for repeatable debugging. */ + + /* CoInterpreter>>#forceInterruptCheckFromHeartbeat */ +void +forceInterruptCheckFromHeartbeat(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (!suppressHeartbeatFlag) { + /* begin checkForLongRunningPrimitive */ + if (GIV(longRunningPrimitiveCheckSemaphore) == null) { + goto l1; + } + if ((GIV(longRunningPrimitiveStartUsecs) > 0) + && ((GIV(longRunningPrimitiveCheckMethod) == GIV(newMethod)) + && (GIV(longRunningPrimitiveCheckSequenceNumber) == GIV(statCheckForEvents)))) { + GIV(longRunningPrimitiveStopUsecs) = ioUTCMicroseconds(); + assert(GIV(longRunningPrimitiveStopUsecs) > GIV(longRunningPrimitiveStartUsecs)); + goto l1; + } + if (GIV(longRunningPrimitiveStopUsecs) == 0) { + GIV(longRunningPrimitiveCheckSequenceNumber) = GIV(statCheckForEvents); + GIV(longRunningPrimitiveCheckMethod) = GIV(newMethod); + GIV(longRunningPrimitiveStartUsecs) = ioUTCMicroseconds(); + sqLowLevelMFence(); + } + l1: /* end checkForLongRunningPrimitive */; + sqLowLevelMFence(); + if (GIV(deferSmash)) { + GIV(deferredSmash) = 1; + sqLowLevelMFence(); + } + else { + forceInterruptCheck(); + } + } +} + + +/* In the StackInterpreter the saved ip field of a base frame holds the + base frame's caller context. But in the Cog VM the first word on the + stack holds the base frame's caller context, which is immediately + above the stacked receiver. */ + + /* CoInterpreter>>#frameCallerContext: */ +static sqInt NoDbgRegParms +frameCallerContext(char *theFP) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt callerContextOrNil; + StackPage *thePage; + + assert(isBaseFrame(theFP)); + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + return callerContextOrNil; +} + + +/* In the StackInterpreter the saved ip field of a base frame holds the + base frame's caller context. But in the Cog VM the first word on the + stack holds the base frame's caller context, which is immediately + above the stacked receiver. */ + + /* CoInterpreter>>#frameCallerContext:put: */ +static sqInt NoDbgRegParms +frameCallerContextput(char *theFP, sqInt aValue) +{ + assert(isBaseFrame(theFP)); + assert(((theFP + (frameStackedReceiverOffset(theFP))) + (2 * BytesPerWord)) == (((stackPageFor(theFP))->baseAddress))); + assert((longAt((theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)) == (frameContext(theFP))); + return longAtput((theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord), aValue); +} + + /* CoInterpreter>>#frameHasContext: */ +static sqInt NoDbgRegParms +frameHasContext(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0); +} + + +/* */ + + /* CoInterpreter>>#frameIsBlockActivation: */ +static sqInt NoDbgRegParms +frameIsBlockActivation(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0); +} + + /* CoInterpreter>>#frameMethodObject: */ +static sqInt NoDbgRegParms +frameMethodObject(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeHomeMethod(theFP))->methodObject) + : longAt(theFP + FoxMethod)); +} + + +/* See encodeFrameFieldHasContext:numArgs: */ + + /* CoInterpreter>>#frameNumArgs: */ +static sqInt NoDbgRegParms +frameNumArgs(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1)); +} + + /* CoInterpreter>>#framePointerAddress */ +usqInt +framePointerAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(framePointer)))); +} + + /* CoInterpreter>>#frameReceiver: */ +static sqInt NoDbgRegParms +frameReceiver(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? longAt(theFP + FoxMFReceiver) + : longAt(theFP + FoxIFReceiver)); +} + + /* CoInterpreter>>#functionPointerForCompiledMethod:primitiveIndex: */ +void (*functionPointerForCompiledMethodprimitiveIndex(sqInt methodObj, sqInt primIndex))(void) + +{ + static void *function = (void *)-1; + void (*functionPointer)(void); + void (*functionPointer1)(void); + sqInt index; + sqInt lit; + + /* begin functionPointerFor:inClass: */ + functionPointer = ((void (*)(void)) ((primIndex > MaxPrimitiveIndex + ? 0 + : primitiveTable[primIndex]))); + if (functionPointer == primitiveCalloutToFFI) { + /* begin functionForPrimitiveCallout */ + if ((((sqInt)function)) == -1) { + function = ioLoadFunctionFrom("primitiveCallout", "SqueakFFIPrims"); + } + return ((void (*)(void)) function); + } + if (functionPointer == primitiveExternalCall) { + /* begin functionForPrimitiveExternalCall: */ + setPostCompileHook(recordCallOffsetIn); + if (!((literalCountOfMethodHeader(methodHeaderOf(methodObj))) > 0)) { + return ((void (*)(void)) primitiveExternalCall); + } + /* begin fetchPointer:ofObject: */ + lit = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)((0 + LiteralStart)) << (shiftForWord()))))); + if (!((((lit & (tagMask())) == 0) + && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2)) + && ((lengthOfformat(lit, (((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask()))) == 4))) { + return ((void (*)(void)) primitiveExternalCall); + } + index = longAt((lit + BaseHeaderSize) + (3U << (shiftForWord()))); + if (!(((index & 1)) + && ((((index = (index >> 1))) > 0) + && (index <= MaxExternalPrimitiveTableSize)))) { + return ((void (*)(void)) primitiveExternalCall); + } + functionPointer1 = externalPrimitiveTable[index - 1]; + if (functionPointer1 == 0) { + return ((void (*)(void)) primitiveExternalCall); + } + return functionPointer1; + } + return functionPointer; +} + + /* CoInterpreter>>#getCheckAllocFiller */ +sqInt +getCheckAllocFiller(void) +{ + return checkAllocFiller; +} + + +/* currentBytecode will be private to the main dispatch loop in the generated + code. This method allows the currentBytecode to be retrieved from global + variables. Override to answer -1 if we're not in an interpreter frame. */ + + /* CoInterpreter>>#getCurrentBytecode */ +sqInt +getCurrentBytecode(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((((((usqInt)GIV(framePointer))) & (BytesPerWord - 1)) == 0) + && ((((((usqInt)GIV(framePointer))) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)GIV(framePointer))) <= (((usqInt)GIV(pages))))))) + && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) + ? byteAt(GIV(instructionPointer)) + : -1); +} + + +/* Handle a send fault that may be due to a send to a forwarded object. + Unforward the receiver on the stack and answer it. */ + + /* CoInterpreter>>#handleForwardedSendFaultForReceiver:stackDelta: */ +static sqInt NoDbgRegParms +handleForwardedSendFaultForReceiverstackDelta(sqInt forwardedReceiver, sqInt stackDelta) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + sqInt rcvrStackIndex; + sqInt referent; + + + /* should *not* be a super send, so the receiver should be forwarded. */ + assert(isOopForwarded(forwardedReceiver)); + rcvrStackIndex = GIV(argumentCount) + stackDelta; + assert((stackValue(rcvrStackIndex)) == forwardedReceiver); + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(forwardedReceiver)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((forwardedReceiver + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + rcvr = referent; + longAtput(GIV(stackPointer) + (rcvrStackIndex * BytesPerWord), rcvr); + followForwardedFrameContentsstackPointer(GIV(framePointer), GIV(stackPointer) + ((rcvrStackIndex + 1) * BytesPerWord)); + if (isPointers(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()) + ? longAt(GIV(framePointer) + FoxMFReceiver) + : longAt(GIV(framePointer) + FoxIFReceiver)))) { + followForwardedObjectFieldstoDepth(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()) + ? longAt(GIV(framePointer) + FoxMFReceiver) + : longAt(GIV(framePointer) + FoxIFReceiver)), 0); + } + followForwardedFieldsInCurrentMethod(); + return rcvr; +} + + +/* A message send from either an open PIC or an unlinked send has not been + understood. Create a message and execute the relevant resulting MNU + method. messageSelector is an implicit argument (yuck). */ + + /* CoInterpreter>>#handleMNU:InMachineCodeTo:classForMessage: */ +static sqInt NoDbgRegParms +handleMNUInMachineCodeToclassForMessage(sqInt selectorIndex, sqInt rcvr, sqInt classForMessage) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt aMethodObj; + sqInt classForThisMessage; + CogMethod *cogMethod; + sqInt err; + sqInt errSelIdx; + sqInt hash; + sqInt methodHeader; + sqInt selector; + char *sp; + char *sp1; + sqInt top; + + assert(addressCouldBeOop(rcvr)); + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + createActualMessageTo(classForMessage); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(selectorIndex) << (shiftForWord()))))); + if (lookupInMethodCacheSelclassTag(GIV(messageSelector), (assert(addressCouldBeClassObj(GIV(lkupClass))), + (((hash = (long32At(GIV(lkupClass) + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(GIV(lkupClass)) + ? (((err = enterIntoClassTable(GIV(lkupClass)))) != 0 + ? -err + : (long32At(GIV(lkupClass) + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver))))) { + + /* check for coggability because method is in the cache */ + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod = ((CogMethod *) methodHeader); + if (((cogMethod->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod, selector); + } + } + else { + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + } + else { + errSelIdx = lookupMNUInClass((classForThisMessage = GIV(lkupClass))); + if (errSelIdx != 0) { + if (selectorIndex == SelectorDoesNotUnderstand) { + error("Recursive not understood error encountered"); + } + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + return handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classForThisMessage); + } + } + if (((GIV(newMethod) & (tagMask())) == 0) + && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(GIV(newMethod)), rcvr); + assert(0); + } + return interpretMethodFromMachineCode(); +} + + +/* */ + + /* CoInterpreter>>#iframeIsBlockActivation: */ +static sqInt NoDbgRegParms +iframeIsBlockActivation(char *theFP) +{ + return (byteAt((theFP + FoxIFrameFlags) + 3)) != 0; +} + + /* CoInterpreter>>#iframeReceiver: */ +static sqInt NoDbgRegParms +iframeReceiver(char *theFP) +{ + return longAt(theFP + FoxIFReceiver); +} + + /* CoInterpreter>>#iframeSavedIP: */ +static sqInt NoDbgRegParms +iframeSavedIP(char *theFP) +{ + return longAt(theFP + FoxIFSavedIP); +} + + +/* This is for low-level error reporting. If either of the C stack pointers + are pointing into the stack zone then write them back to framePointer + and/or stackPointer so that the stack backtrace will be up to date. Write + their original values through savedFPP & savedSPP if non-null. */ + + /* CoInterpreter>>#ifValidWriteBackStack:Pointers:Save:To: */ +void +ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (savedFPP != 0) { + savedFPP[0] = GIV(framePointer); + } + if (savedSPP != 0) { + savedSPP[0] = GIV(stackPointer); + } + if ((((((usqInt)theCFP)) & (BytesPerWord - 1)) == 0) + && ((((((usqInt)theCFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theCFP)) <= (((usqInt)GIV(pages))))))) { + GIV(framePointer) = theCFP; + } + if ((((((usqInt)theCSP)) & (BytesPerWord - 1)) == 0) + && ((((((usqInt)theCSP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theCSP)) <= (((usqInt)GIV(pages))))))) { + GIV(stackPointer) = theCSP; + } +} + + /* CoInterpreter>>#instructionPointerAddress */ +usqInt +instructionPointerAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(instructionPointer)))); +} + + +/* Answer the bytecode pc object (i.e. SmallInteger) for an active frame. The + bytecode pc is derived from the frame's pc. If the frame is the top frame + on the current stack + the frame pc is whatever the current instruction pointer is. If the frame + is the top + frame on some other stack the frame pc is the value on top of stack. + Otherwise the + frame pc is the saved pc of the frame above. Once the frame pc is found it + must be + mapped to a bytecode pc. */ + + /* CoInterpreter>>#instructionPointerForFrame:currentFP:currentIP: */ +static sqInt NoDbgRegParms +instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + char *fp; + char *theFPAbove; + sqInt theIP; + StackPage *thePage; + sqInt value; + + if (spouseFP == currentFP) { + theIP = oopForPointer(instrPtr); + } + else { + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + /* begin findFrameAbove:inPage: */ + fp = (thePage->headFP); + if (fp == spouseFP) { + theFPAbove = 0; + goto l2; + } + while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { + if (callerFP == spouseFP) { + theFPAbove = fp; + goto l2; + } + fp = callerFP; + } + error("did not find theFP in stack page"); + theFPAbove = 0; + l2: /* end findFrameAbove:inPage: */; + theIP = (theFPAbove == 0 + ? longAt((thePage->headSP)) + : oopForPointer(pointerForOop(longAt(theFPAbove + FoxCallerSavedIP)))); + } + value = contextInstructionPointerframe(theIP, spouseFP); + return ((((int) value)) < 0 + ? mustMapMachineCodePCcontext((value >> 1), longAt(spouseFP + FoxThisContext)) + : value); +} + + +/* This is used for asserts that check that inline cache editing results in + valid addresses. + In the C VM interpret is presumed to come before any primitives and so it + constitutes the lowest address in C code that machine code should be + linked. In the simulator + we just answer something not low. */ + + /* CoInterpreter>>#interpretAddress */ +usqInt +interpretAddress(void) +{ + return ((usqInt)((&interpret))); +} + + +/* At a rough approximation we may need to allocate up to a couple + of page's worth of contexts when switching stack pages, assigning + to senders, etc. But the snapshot primitive voids all stack pages. + So a safe margin is the size of a large context times the maximum + number of frames per page times the number of pages. */ + + /* CoInterpreter>>#interpreterAllocationReserveBytes */ +static sqInt NeverInline +interpreterAllocationReserveBytes(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt maxFramesPerPage; + sqInt maxUsedBytesPerPage; + + maxUsedBytesPerPage = (stackPageFrameBytes()) + ((IFrameSlots + 64) * BytesPerWord); + maxFramesPerPage = (maxUsedBytesPerPage / BytesPerWord) / MFrameSlots; + return ((maxFramesPerPage * LargeContextSlots) * BytesPerOop) * GIV(numStackPages); +} + + +/* Execute a method interpretively from machine code. We assume (require) + that newMethod + messageSelector, primitiveFunctionPointer and argumentCount have been set + in the caller. + Once evaluated either continue in the interpreter via a jongjmp or in + machine code via an + enilopmart (a form of longjmp - a stinking rose by any other name). */ + + /* CoInterpreter>>#interpretMethodFromMachineCode */ +static sqInt +interpretMethodFromMachineCode(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt nArgs; + char *savedFramePointer; + char *savedStackPointer; + + nArgs = 0; + savedFramePointer = 0; + savedStackPointer = 0; + assertCStackWellAligned(); + assert(validInstructionPointerinFrame(GIV(instructionPointer), GIV(framePointer))); + if (primitiveFunctionPointer != 0) { + if (primitiveFunctionPointer == primitiveInvokeObjectAsMethod) { + assert(!(isOopCompiledMethod(GIV(newMethod)))); + } + else { + assert((isOopCompiledMethod(GIV(newMethod))) + && ((primitiveIndexOf(GIV(newMethod))) != 0)); + } + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) { + externalQuickPrimitiveResponse(); + GIV(primFailCode) = 0; + } + else { + /* begin slowPrimitiveResponse */ + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector); + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); + assert((remapBufferCount()) == 0); + nArgs = GIV(argumentCount); + savedStackPointer = GIV(stackPointer); + savedFramePointer = GIV(framePointer); + + /* begin initPrimCall */ + GIV(primFailCode) = 0; + dispatchFunctionPointer(primitiveFunctionPointer); + assert(maybeLeakCheckExternalPrimCall(GIV(newMethod))); + /* begin maybeRetryPrimitiveOnFailure */ + if (GIV(primFailCode)) { + retryPrimitiveOnFailure(); + } + /* begin maybeFailForLastObjectOverwrite */ + if (checkAllocFiller) { + if (((freeStart()) < GIV(scavengeThreshold)) + && ((longAt(freeStart())) != (freeStart()))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrWritePastObject; + } + } + if ((!GIV(primFailCode)) + && ((GIV(framePointer) == savedFramePointer) + && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) { + + /* Don't fail if primitive has done something radical, e.g. perform: */ + if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) { + flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context"); + failUnbalancedPrimitive(); + GIV(stackPointer) = savedStackPointer; + } + } + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + !GIV(primFailCode); + } + if (!GIV(primFailCode)) { + returntoExecutive(popStack(), 0); + } + } + else { + assert((isOopCompiledMethod(GIV(newMethod))) + && (((primitiveIndexOf(GIV(newMethod))) == 0) + || (((functionPointerForinClass(primitiveIndexOf(GIV(newMethod)), nilObject())) == 0) + || (isNullExternalPrimitiveCall(GIV(newMethod)))))); + } + activateNewMethod(); + siglongjmp(reenterInterpreter, ReturnToInterpreter); + return null; +} + + /* CoInterpreter>>#isCogMethodReference: */ +sqInt +isCogMethodReference(sqInt methodHeader) +{ + assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))); + return (methodHeader & 1) == 0; +} + + /* CoInterpreter>>#isMachineCodeFrame: */ +static sqInt NoDbgRegParms +isMachineCodeFrame(char *theFP) +{ + return (((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()); +} + + +/* Lookup selector in rcvr, without doing MNU processing, and answer either a + method or an error code if the message was not understood. Used to + populate closed PICs. */ +/* self printFrame: stackPage headFP WithSP: stackPage headSP */ +/* self printStringOf: selector */ + + /* CoInterpreter>>#lookupMNU:receiver: */ +sqInt +lookupMNUreceiver(sqInt selector, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classTag; + sqInt erridx; + sqInt inCache; + sqInt tagBits; + + if (((tagBits = rcvr & (tagMask()))) != 0) { + classTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + classTag = (longAt(rcvr)) & (classIndexMask()); + } + inCache = lookupInMethodCacheSelclassTag(selector, classTag); + + if (!inCache) { + GIV(messageSelector) = selector; + erridx = lookupMNUInClass(classAtIndex(classTag)); + if (erridx != 0) { + assert(erridx <= (maxLookupNoMNUErrorCode())); + return erridx; + } + } + return GIV(newMethod); +} + + +/* Lookup selector in rcvr, without doing MNU processing, and answer either a + method or an error code if the message was not understood. Used to + populate closed PICs. */ +/* self printFrame: stackPage headFP WithSP: stackPage headSP */ +/* self printStringOf: selector */ + + /* CoInterpreter>>#lookupOrdinary:receiver: */ +sqInt +lookupOrdinaryreceiver(sqInt selector, sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classTag; + sqInt erridx; + sqInt tagBits; + + if (((tagBits = rcvr & (tagMask()))) != 0) { + classTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + classTag = (longAt(rcvr)) & (classIndexMask()); + } + if (!(lookupInMethodCacheSelclassTag(selector, classTag))) { + GIV(messageSelector) = selector; + if (((erridx = lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag)))) != 0) { + assert(erridx <= (maxLookupNoMNUErrorCode())); + return erridx; + } + } + return GIV(newMethod); +} + + +/* */ +/* Marry aContext with the base frame of a new stack page. Build the base + frame to reflect the context's state. Answer the new page. Override to + hold the caller context in a different place, In the StackInterpreter we + use the caller saved ip, but in the Cog VM caller saved ip is the + ceBaseReturn: trampoline. Simply hold the caller context in the first word + of the stack. */ + + /* CoInterpreter>>#makeBaseFrameFor: */ +static StackPage * NoDbgRegParms +makeBaseFrameFor(sqInt aContext) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt header; + sqInt header1; + sqInt i; + StackPage *lruOrFree; + sqInt maybeClosure; + sqInt numArgs; + sqInt objOop; + sqInt objOop1; + sqInt oop; + sqInt oop1; + StackPage *page; + char *pointer; + sqInt rawHeader; + sqInt rcvr; + sqInt stackPtrIndex; + sqInt theIP; + sqInt theMethod; + char *value; + sqInt valuePointer; + sqInt yetToCompact; + + + /* theIP must be typed as signed because it is assigned ceCannotResumePC and so maybe implicitly typed as unsigned. */ + assert(isContext(aContext)); + assert(isSingleContext(aContext)); + assert(goodContextSize(aContext)); + theIP = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + assert(HasBeenReturnedFromMCPC < 0); + theIP = ((theIP & 1) + ? (theIP >> 1) + : HasBeenReturnedFromMCPC); + /* begin followObjField:ofObject: */ + objOop = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop = fixFollowedFieldofObjectwithInitialValue(MethodIndex, aContext, objOop); + } + theMethod = objOop; + /* begin newStackPage */ + lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); + if (((lruOrFree->baseFP)) == 0) { + page = lruOrFree; + goto l1; + } + divorceFramesIn(lruOrFree); + page = lruOrFree; +l1: /* end newStackPage */; + longAtput((pointer = (page->baseAddress)), followObjFieldofObject(SenderIndex, aContext)); + longAtput((pointer -= BytesPerWord), aContext); + /* begin followField:ofObject: */ + objOop1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(ReceiverIndex) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, aContext, objOop1); + } + rcvr = objOop1; + maybeClosure = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(ClosureIndex) << (shiftForWord()))))); + if (maybeClosure != GIV(nilObj)) { + if (((longAt(maybeClosure)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + maybeClosure = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, aContext, maybeClosure); + } + /* begin quickFetchInteger:ofObject: */ + oop = longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + longAtput((pointer -= BytesPerWord), maybeClosure); + } + else { + /* begin methodHeaderOf: */ + assert(isCompiledMethod(theMethod)); + header1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header1 & 1)) { + header = header1; + } + else { + assert((((usqInt)header1)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header = ((((CogMethod *) header1))->methodHeader); + } + + /* If this is a synthetic context its IP could be pointing at the CallPrimitive opcode. If so, skip it. */ + numArgs = (((usqInt) header) >> MethodHeaderArgCountShift) & 15; + if (((/* begin alternateHeaderHasPrimitiveFlag: */ + header & AlternateHeaderHasPrimFlag)) + && (theIP == (1 + ((((assert((header & 1)), +((header >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop)))) { + theIP += 3; + } + longAtput((pointer -= BytesPerWord), rcvr); + } + for (i = 1; i <= numArgs; i += 1) { + longAtput((pointer -= BytesPerWord), longAt((aContext + BaseHeaderSize) + (((int)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))))); + } + longAtput((pointer -= BytesPerWord), ceBaseFrameReturnPC()); + longAtput((pointer -= BytesPerWord), 0); + (page->headFP = pointer); + if (theIP < 0) { + + /* Since we would have to generate a machine-code method to be able to map + the native pc anyway we should create a native method and native frame. */ + /* begin ensureMethodIsCogged:maybeClosure: */ + rawHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0)) { + cogMethod = ((CogMethod *) rawHeader); + goto l12; + } + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) & 1)))) { + cogMethod1 = cogFullBlockMethodnumCopied(theMethod, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(theMethod, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; + commenceCogCompiledCodeCompaction(); + } + if (!(asserta(cogMethod1 != null))) { + error("could not compile method that should have been compiled"); + } + cogMethod = cogMethod1; + l12: /* end ensureMethodIsCogged:maybeClosure: */; + theMethod = ((sqInt)cogMethod); + if (maybeClosure != GIV(nilObj)) { + if (((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) & 1)) { + + /* If the pc is the special HasBeenReturnedFromMCPC pc set the pc + appropriately so that the frame stays in the cannotReturn: state. */ + if (theIP == HasBeenReturnedFromMCPC) { + theMethod = ((sqInt)(findMethodForStartBcpcinHomeMethod((((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 1)) - 1, ((CogMethod *) theMethod)))); + if (theMethod == 0) { + error("cannot find machine code block matching closure's startpc"); + } + theIP = ceCannotResumePC(); + } + else { + assert((((signed)theIP >> 16)) < -1); + theMethod -= (((signed)theIP >> 16)) * (blockAlignment()); + theIP = theMethod - (((short)theIP)); + } + } + else { + assert((((signed)theIP >> 16)) >= -1); + theIP = (theIP == HasBeenReturnedFromMCPC + ? ceCannotResumePC() + : (((sqInt)theMethod)) - theIP); + } + longAtput((pointer -= BytesPerWord), (theMethod + MFMethodFlagHasContextFlag) + MFMethodFlagIsBlockFlag); + } + else { + assert((((signed)theIP >> 16)) >= -1); + theIP = (theIP == HasBeenReturnedFromMCPC + ? ceCannotResumePC() + : (((sqInt)theMethod)) - theIP); + longAtput((pointer -= BytesPerWord), theMethod + MFMethodFlagHasContextFlag); + } + longAtput((pointer -= BytesPerWord), aContext); + } + else { + longAtput((pointer -= BytesPerWord), theMethod); + longAtput((pointer -= BytesPerWord), aContext); + longAtput((pointer -= BytesPerWord), (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (1U << ((BytesPerWord * 8) - 16))) + ((maybeClosure != GIV(nilObj) + ? 1U << ((BytesPerWord * 8) - 24) + : 0)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (1U << 16)) + ((maybeClosure != GIV(nilObj) + ? 1U << 24 + : 0)))); + longAtput((pointer -= BytesPerWord), 0); + assert(((theIP >= (((LiteralStart + (literalCountOf(theMethod))) * BytesPerOop) + 1)) && (theIP <= (lengthOf(theMethod))))); + theIP = ((theMethod + theIP) + BaseHeaderSize) - 2; + + } + (page->baseFP = (page->headFP)); + assert(frameHasContext((page->baseFP))); + assert((frameNumArgs((page->baseFP))) == numArgs); + longAtput((pointer -= BytesPerWord), rcvr); + /* begin quickFetchInteger:ofObject: */ + oop1 = longAt((aContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + assert((oop1 & 1)); + stackPtrIndex = (oop1 >> 1); + assert((ReceiverIndex + stackPtrIndex) < (lengthOf(aContext))); + for (i = (numArgs + 1); i <= stackPtrIndex; i += 1) { + longAtput((pointer -= BytesPerWord), longAt((aContext + BaseHeaderSize) + (((int)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))))); + } + longAtput((pointer -= BytesPerWord), theIP); + (page->headSP = pointer); + assert(contexthasValidInversePCMappingOfin(aContext, theIP, (page->baseFP))); + /* begin storePointerUnchecked:ofObject:withValue: */ + value = (page->baseFP); + assert(((oopForPointer(value)) & (BytesPerWord - 1)) == 0); + valuePointer = (oopForPointer(value)) + (smallIntegerTag()); + assert(!(isOopForwarded(aContext))); + longAtput((aContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(aContext))); + longAtput((aContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(0)) & (BytesPerWord - 1)) == 0), + (oopForPointer(0)) + (smallIntegerTag()))); + assert(((fetchPointerofObject(SenderIndex, aContext)) & 1)); + assert((frameOfMarriedContext(aContext)) == ((page->baseFP))); + assert(validStackPageBaseFrame(page)); + return page; +} + + +/* The prim trace log is a circular buffer of selectors. If there is + an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries. + If there is something at primTraceLogIndex it has wrapped. */ + + /* CoInterpreter>>#mapPrimTraceLog */ +static void +mapPrimTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt remainder; + sqInt selector; + + if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0 + ? remainder + PrimTraceLogSize + : remainder)]) == 0) { + return; + } + if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) { + for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) { + selector = GIV(primTraceLog)[i]; + if ((selector != 0) + && (((selector & (tagMask())) == 0) + && ((((longAt(selector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(selector)), + (oopisLessThan(selector, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(selector, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(selector, ((futureSpace()).start), futureSurvivorStart()))))))) { + GIV(primTraceLog)[i] = (remapObj(selector)); + } + } + } + for (i = 0; i < GIV(primTraceLogIndex); i += 1) { + selector = GIV(primTraceLog)[i]; + if ((selector != 0) + && (((selector & (tagMask())) == 0) + && ((((longAt(selector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(selector)), + (oopisLessThan(selector, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(selector, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(selector, ((futureSpace()).start), futureSurvivorStart()))))))) { + GIV(primTraceLog)[i] = (remapObj(selector)); + } + } +} + + /* CoInterpreter>>#mapStackPages */ +static void NeverInline +mapStackPages(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + char *frameRcvrOffset; + sqInt i; + sqInt numLivePages; + sqInt oop; + char *theFP; + usqInt theIP; + char *theIPPtr; + StackPage *thePage; + char *theSP; + + theIP = 0; + numLivePages = 0; + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(((thePage->baseFP)) == 0)) { + assert(ifCurrentStackPageHasValidHeadPointers(thePage)); + numLivePages += 1; + theSP = (thePage->headSP); + + /* Skip the instruction pointer on top of stack of inactive pages. */ + theFP = (thePage->headFP); + if (thePage == GIV(stackPage)) { + theIPPtr = (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) + || ((longAt(theFP + FoxIFSavedIP)) == 0) + ? 0 + : theFP + FoxIFSavedIP); + } + else { + theIPPtr = theSP; + theSP += BytesPerWord; + } + while (1) { + assert(addressIsInPage(thePage, theFP)); + assert(addressIsInPage(thePage, theSP)); + assert((theIPPtr == 0) + || (addressIsInPage(thePage, theIPPtr))); + frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? theFP + FoxMFReceiver + : theFP + FoxIFReceiver); + while (theSP <= frameRcvrOffset) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && ((((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(oop)), + (oopisLessThan(oop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(oop, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(oop, ((futureSpace()).start), futureSurvivorStart())))))) { + longAtput(theSP, remapObj(oop)); + } + theSP += BytesPerWord; + } + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + if ((((longAt(longAt(theFP + FoxThisContext))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(longAt(theFP + FoxThisContext))), + (oopisLessThan(longAt(theFP + FoxThisContext), GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(longAt(theFP + FoxThisContext), GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxThisContext), ((futureSpace()).start), futureSurvivorStart()))))) { + longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext))); + } + if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) { + assert((isMarriedOrWidowedContext(frameContext(theFP))) + && ((frameOfMarriedContext(frameContext(theFP))) == theFP)); + } + } + if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) { + if ((((longAt(longAt(theFP + FoxMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(longAt(theFP + FoxMethod))), + (oopisLessThan(longAt(theFP + FoxMethod), GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(longAt(theFP + FoxMethod), GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(longAt(theFP + FoxMethod), ((futureSpace()).start), futureSurvivorStart()))))) { + if (theIPPtr != 0) { + theIP = longAt(theIPPtr); + if (theIP == (ceReturnToInterpreterPC())) { + assert((iframeSavedIP(theFP)) > (iframeMethod(theFP))); + theIPPtr = theFP + FoxIFSavedIP; + theIP = longAt(theIPPtr); + } + else { + assert(theIP > (iframeMethod(theFP))); + } + theIP -= longAt(theFP + FoxMethod); + } + longAtput(theFP + FoxMethod, remapObj(longAt(theFP + FoxMethod))); + if (theIPPtr != 0) { + longAtput(theIPPtr, theIP + (longAt(theFP + FoxMethod))); + } + } + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theSP = ((theIPPtr = theFP + FoxCallerSavedIP)) + BytesPerWord; + theFP = callerFP; + } + theSP = (theFP + FoxCallerSavedIP) + BytesPerWord; + while (theSP <= ((thePage->baseAddress))) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && ((((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(oop)), + (oopisLessThan(oop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(oop, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(oop, ((futureSpace()).start), futureSurvivorStart())))))) { + longAtput(theSP, remapObj(oop)); + } + theSP += BytesPerWord; + } + } + } + /* begin recordLivePagesOnMapping: */ + GIV(statNumMaps) += 1; + GIV(statPageCountWhenMappingSum) += numLivePages; + GIV(statMaxPageCountWhenMapping) = ((GIV(statMaxPageCountWhenMapping) < numLivePages) ? numLivePages : GIV(statMaxPageCountWhenMapping)); +} + + +/* The trace log is a circular buffer of pairs of entries. If there is + an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries. + If there is something at traceLogIndex it has wrapped. */ + + /* CoInterpreter>>#mapTraceLog */ +static void +mapTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt intOrClass; + sqInt limit; + sqInt remainder; + sqInt selectorOrMethod; + + limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0 + ? remainder + TraceBufferSize + : remainder); + if ((GIV(traceLog)[limit]) == 0) { + return; + } + if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) { + limit = TraceBufferSize - 3; + } + for (i = 0; i <= limit; i += 3) { + intOrClass = GIV(traceLog)[i]; + if (((intOrClass & (tagMask())) == 0) + && ((((longAt(intOrClass)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(intOrClass)), + (oopisLessThan(intOrClass, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(intOrClass, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(intOrClass, ((futureSpace()).start), futureSurvivorStart())))))) { + GIV(traceLog)[i] = (remapObj(intOrClass)); + } + selectorOrMethod = GIV(traceLog)[i + 1]; + if (((selectorOrMethod & (tagMask())) == 0) + && ((((longAt(selectorOrMethod)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) + || (((assert(isNonImmediate(selectorOrMethod)), + (oopisLessThan(selectorOrMethod, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(selectorOrMethod, GIV(newSpaceStart))))) + && (!(oopisGreaterThanOrEqualToandLessThan(selectorOrMethod, ((futureSpace()).start), futureSurvivorStart())))))) { + GIV(traceLog)[i + 1] = (remapObj(selectorOrMethod)); + } + } +} + + /* CoInterpreter>>#markActiveMethodsAndReferents */ +void +markActiveMethodsAndReferents(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + StackPage *thePage; + + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(isFree(thePage))) { + markCogMethodsAndReferentsOnPage(thePage); + } + } +} + + +/* The prim trace log is a circular buffer of selectors. If there is + an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries. + If there is something at primTraceLogIndex it has wrapped. */ + + /* CoInterpreter>>#markAndTracePrimTraceLog */ +static void +markAndTracePrimTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt remainder; + sqInt selector; + + if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0 + ? remainder + PrimTraceLogSize + : remainder)]) == 0) { + return; + } + if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) { + for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) { + selector = GIV(primTraceLog)[i]; + if ((selector != 0) + && ((selector & (tagMask())) == 0)) { + markAndTrace(selector); + } + } + } + for (i = 0; i < GIV(primTraceLogIndex); i += 1) { + selector = GIV(primTraceLog)[i]; + if ((selector != 0) + && ((selector & (tagMask())) == 0)) { + markAndTrace(selector); + } + } +} + + /* CoInterpreter>>#markAndTraceStackPage: */ +static void NoDbgRegParms +markAndTraceStackPage(StackPage *thePage) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + CogBlockMethod *aCogMethod; + char *callerFP; + char *frameRcvrOffset; + CogMethod *homeMethod; + sqInt oop; + sqInt referent; + sqInt referent1; + char *theFP; + char *theSP; + + assert(!(isFree(thePage))); + assert(ifCurrentStackPageHasValidHeadPointers(thePage)); + assert(((thePage->trace)) != StackPageTraced); + (thePage->trace = StackPageTraced); + theSP = (thePage->headSP); + + /* Skip the instruction pointer on top of stack of inactive pages. */ + theFP = (thePage->headFP); + if (!(thePage == GIV(stackPage))) { + theSP += BytesPerWord; + } + while (1) { + frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? theFP + FoxMFReceiver + : theFP + FoxIFReceiver); + while (theSP <= frameRcvrOffset) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(oop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + oop = referent; + longAtput(theSP, oop); + } + if (!(oop & (tagMask()))) { + markAndTrace(oop); + } + theSP += BytesPerWord; + } + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + markAndTrace(longAt(theFP + FoxThisContext)); + } + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin markAndTraceMachineCodeMethod: */ + aCogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); + /* begin asCogHomeMethod: */ + homeMethod = (((aCogMethod->cmType)) == CMMethod + ? ((CogMethod *) aCogMethod) + : ((aCogMethod->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) aCogMethod) + : ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset)))))); + markAndTrace((homeMethod->methodObject)); + } + else { + markAndTrace(longAt(theFP + FoxMethod)); + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theSP = (theFP + FoxCallerSavedIP) + BytesPerWord; + theFP = callerFP; + } + + /* caller ip is ceBaseReturnPC */ + theSP = (theFP + FoxCallerSavedIP) + BytesPerWord; + while (theSP <= ((thePage->baseAddress))) { + oop = longAt(theSP); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(oop)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent1 & (tagMask())) == 0) + && (((longAt(referent1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord()))); + } + oop = referent1; + longAtput(theSP, oop); + } + if (!(oop & (tagMask()))) { + markAndTrace(oop); + } + theSP += BytesPerWord; + } +} + + +/* The trace log is a circular buffer of pairs of entries. If there is an + entry at + traceLogIndex - 3 \\ TraceBufferSize it has entries. If there is something + at traceLogIndex it has wrapped. */ + + /* CoInterpreter>>#markAndTraceTraceLog */ +static void +markAndTraceTraceLog(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt limit; + sqInt oop; + sqInt remainder; + + limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0 + ? remainder + TraceBufferSize + : remainder); + if ((GIV(traceLog)[limit]) == 0) { + return; + } + if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) { + limit = TraceBufferSize - 3; + } + for (i = 0; i <= limit; i += 3) { + oop = GIV(traceLog)[i]; + if (!(oop & (tagMask()))) { + markAndTrace(oop); + } + oop = GIV(traceLog)[i + 1]; + if (!(oop & (tagMask()))) { + markAndTrace(oop); + } + } +} + + /* CoInterpreter>>#markCogMethodsAndReferentsOnPage: */ +static void NoDbgRegParms +markCogMethodsAndReferentsOnPage(StackPage *thePage) +{ + char *callerFP; + char *theFP; + + assert(!(isFree(thePage))); + assert(ifCurrentStackPageHasValidHeadPointers(thePage)); + + /* Skip the instruction pointer on top of stack of inactive pages. */ + theFP = (thePage->headFP); + while (1) { + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + markMethodAndReferents(mframeCogMethod(theFP)); + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theFP = callerFP; + } +} + + +/* Answer whether marryFrame:SP: copies non-argument temporaries. */ + + /* CoInterpreter>>#marryFrameCopiesTemps */ +sqInt +marryFrameCopiesTemps(void) +{ + return 0; +} + + /* CoInterpreter>>#maxLookupNoMNUErrorCode */ +sqInt +maxLookupNoMNUErrorCode(void) +{ + return ((SelectorCannotInterpret < SelectorDoesNotUnderstand) ? SelectorDoesNotUnderstand : SelectorCannotInterpret); +} + + +/* The flag bit can be used to flag methods that are interpreted, if it has + been requested + from the image header flags. */ + + /* CoInterpreter>>#maybeFlagMethodAsInterpreted: */ +static void NoDbgRegParms +maybeFlagMethodAsInterpreted(sqInt aMethod) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rawHeader; + sqInt realHeader; + + if (GIV(flagInterpretedMethods)) { + /* begin fetchPointer:ofObject: */ + rawHeader = longAt((aMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + realHeader = ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0) + ? ((((CogMethod *) rawHeader))->methodHeader) + : rawHeader); + realHeader = realHeader | ((((usqInt)(1U << MethodHeaderFlagBitPosition) << 1) | 1)); + if ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0)) { + ((((CogMethod *) rawHeader))->methodHeader = realHeader); + } + else { + assert(!(isOopForwarded(aMethod))); + longAtput((aMethod + BaseHeaderSize) + (0U << (shiftForWord())), realHeader); + + } + } +} + + /* CoInterpreter>>#methodCacheAddress */ +void * +methodCacheAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return GIV(methodCache); +} + + /* CoInterpreter>>#methodHasCogMethod: */ +sqInt +methodHasCogMethod(sqInt aMethodOop) +{ + sqInt methodHeader; + + assert(isNonImmediate(aMethodOop)); + /* begin isCogMethodReference: */ + methodHeader = longAt((aMethodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))); + return (methodHeader & 1) == 0; +} + + /* CoInterpreter>>#methodNeedsLargeContext: */ +sqInt +methodNeedsLargeContext(sqInt methodObj) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt header; + sqInt methodHeader; + + /* begin methodHeaderIndicatesLargeFrame: */ + assert(isCompiledMethod(methodObj)); + header = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + return (methodHeader & LargeContextBit) != 0; +} + + /* CoInterpreter>>#methodShouldBeCogged: */ +sqInt +methodShouldBeCogged(sqInt aMethodObj) +{ + if (methodWithHeaderShouldBeCogged(methodHeaderOf(aMethodObj))) { + return 1; + } + maybeFlagMethodAsInterpreted(aMethodObj); + return 0; +} + + +/* At the moment jit any method with less than N literals, where N defaults + to 60. + See e.g. SimpleStackBasedCogit class>>initialize. + In my dev image eem 2/22/2009 13:39 + (30 to: 100 by: 5) collect: + [:n| n -> (SystemNavigation default allSelect: [:m| m numLiterals > n]) + size] #(30->1681 35->1150 40->765 45->523 50->389 55->289 60->206 + 65->151 70->124 75->99 80->73 85->63 90->54 95->42 100->38). + And running the CogVMSimulator with flagging of interpreted methods turned + on reveals + the following sizes of interpreted methods. + | sizes | + sizes := Bag new. + SystemNavigation default allSelect: [:m| m flag ifTrue: [sizes add: m + numLiterals]. false]. + sizes sortedElements asArray + #( 40->4 41->1 42->2 44->1 45->3 46->1 47->2 48->1 + 50->2 51->1 53->1 55->1 56->1 + 87->1 108->1 171->1) + literalCountOfHeader: does not include the header word. */ + + /* CoInterpreter>>#methodWithHeaderShouldBeCogged: */ +static sqInt NoDbgRegParms +methodWithHeaderShouldBeCogged(sqInt methodHeader) +{ + return ((assert((methodHeader & 1)), + /* begin literalCountOfAlternateHeader: */ + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile; +} + + +/* Answer the Cog method for a machine code frame. This may be + either a full CogMethod or merely a CogBlockMethod rump header. */ + + /* CoInterpreter>>#mframeCogMethod: */ +static CogBlockMethod * NoDbgRegParms +mframeCogMethod(char *theFP) +{ + return ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); +} + + /* CoInterpreter>>#mframeHomeMethodExport */ +CogMethod * +mframeHomeMethodExport(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt methodField; + + /* begin mframeHomeMethod: */ + methodField = longAt(GIV(framePointer) + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + return (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + } + return ((CogMethod *) (methodField & MFMethodMask)); +} + + +/* Answer the home method for a machine code frame. From a block frame we + find the home method through the block's homeOffset field which is the + delta to it. + In both cases we need to strip the isBlock and isContext flags from the + method field. */ + + /* CoInterpreter>>#mframeHomeMethod: */ +CogMethod * +mframeHomeMethod(char *theFP) +{ + sqInt methodField; + + /* begin frameMethodField: */ + methodField = longAt(theFP + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + return (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + } + return ((CogMethod *) (methodField & MFMethodMask)); +} + + +/* */ + + /* CoInterpreter>>#mframeIsBlockActivation: */ +static sqInt NoDbgRegParms +mframeIsBlockActivation(char *theFP) +{ + return ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0; +} + + /* CoInterpreter>>#mframeReceiver: */ +static sqInt NoDbgRegParms +mframeReceiver(char *theFP) +{ + return longAt(theFP + FoxMFReceiver); +} + + +/* Traverse all stack pages looking for non-zero bytes in the headroom part + of each page. + Answer the minimum size of unused headroom (zero bytes) in the pages. This + is for + checking that there is enough headroom allocated in stack pages. */ + + /* CoInterpreter>>#minimumUnusedHeadroom */ +static sqInt +minimumUnusedHeadroom(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + int minUnused; + char *p; + StackPage *page; + int unused; + + minUnused = (((stackPageAt(0))->baseAddress)) - (((stackPageAt(0))->lastAddress)); + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + page = stackPageAtpages(i, GIV(pages)); + p = (page->lastAddress); + do { + p += BytesPerWord; + } while(((longAtPointer(p)) == 0) + && (p <= ((page->baseAddress)))); + unused = (p - BytesPerWord) - ((page->lastAddress)); + if (unused < minUnused) { + minUnused = unused; + } + } + return minUnused; +} + + /* CoInterpreter>>#mMethodClass */ +sqInt +mMethodClass(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)); +} + + /* CoInterpreter>>#mnuCompilationBreakpointFor: */ +void +mnuCompilationBreakpointFor(sqInt selectorOop) +{ + suppressHeartbeatFlag = 1; + warning("compilation MNU break (heartbeat suppressed)"); +} + + +/* Lookup the doesNotUnderstand: selector in the class of the argument rcvr. + Answer either the matching method (cogged if appropriate), or nil, if not + found. + */ + + /* CoInterpreter>>#mnuMethodOrNilFor: */ +static sqInt NoDbgRegParms +mnuMethodOrNilFor(sqInt rcvr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt currentClass; + sqInt dictionary; + sqInt hash; + sqInt index; + usqInt length; + usqInt mask; + sqInt methodArray; + sqInt methodHeader; + sqInt mnuMethod; + sqInt mnuSelector; + sqInt nextSelector; + usqInt numSlots; + sqInt objOop; + sqInt objOop1; + sqInt objOop2; + sqInt tagBits; + sqInt wrapAround; + + assert(!((isOopForwarded(rcvr)))); + if (((tagBits = rcvr & (tagMask()))) != 0) { + /* begin fetchPointer:ofObject: */ + currentClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))); + } + else { + currentClass = fetchClassOfNonImm(rcvr); + } + /* begin fetchPointer:ofObject: */ + mnuSelector = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord()))))); + while (currentClass != GIV(nilObj)) { + dictionary = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(MethodDictionaryIndex) << (shiftForWord()))))); + if (dictionary == GIV(nilObj)) { + return null; + } + /* begin lookupMethodFor:InDictionary: */ + assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(dictionary + 7); + length = (numSlots == (numSlotsMask()) + ? longAt(dictionary - BaseHeaderSize) + : numSlots); + mask = (length - SelectorStart) - 1; + + /* It is assumed that there are some nils in this dictionary, and search will + stop when one is encountered. However, if there are no nils, then wrapAround + will be detected the second time the loop gets to the end of the table. */ + index = SelectorStart + (mask & ((mnuSelector & (tagMask()) + ? ((mnuSelector & 1) + ? (mnuSelector >> 1) + : ((usqInt) (((usqInt)mnuSelector))) >> (numTagBits())) + : (/* begin hashBitsOf: */ + (hash = (long32At(mnuSelector + 4)) & (identityHashHalfWordMask())), + (hash == 0 + ? ((hash = (newObjectHash()) & (identityHashHalfWordMask())), + /* begin setHashBitsOf:to: */ + assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))), + long32Atput(mnuSelector + 4, ((((long32At(mnuSelector + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash)) + : 0), + hash)))); + wrapAround = 0; + while (1) { + /* begin fetchPointer:ofObject: */ + nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + if (nextSelector == GIV(nilObj)) { + mnuMethod = null; + goto l11; + } + if (((nextSelector & (tagMask())) == 0) + && (((longAt(nextSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector); + } + if (nextSelector == mnuSelector) { + /* begin followObjField:ofObject: */ + objOop = longAt((dictionary + BaseHeaderSize) + (((int)((usqInt)(MethodArrayIndex) << (shiftForWord()))))); + assert(isNonImmediate(objOop)); + if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + objOop = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop); + } + methodArray = objOop; + /* begin followField:ofObject: */ + objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + if (((objOop1 & (tagMask())) == 0) + && (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); + } + mnuMethod = objOop1; + goto l11; + } + index += 1; + if (index == length) { + if (wrapAround) { + mnuMethod = null; + goto l11; + } + wrapAround = 1; + index = SelectorStart; + } + } + mnuMethod = null; + l11: /* end lookupMethodFor:InDictionary: */; + if (!(mnuMethod == null)) { + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((mnuMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((!((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0))) + && (((assert((methodHeader & 1)), + /* begin literalCountOfAlternateHeader: */ + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile)) { + cogselector(mnuMethod, mnuSelector); + } + return mnuMethod; + } + /* begin followField:ofObject: */ + objOop2 = longAt((currentClass + BaseHeaderSize) + (((int)((usqInt)(SuperclassIndex) << (shiftForWord()))))); + if (((objOop2 & (tagMask())) == 0) + && (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2); + } + currentClass = objOop2; + } + return null; +} + + +/* Move frames from the hot end of oldPage through to theFP to newPage. + This has the effect of making theFP a base frame which can be stored into. + Answer theFP's new location. */ + + /* CoInterpreter>>#moveFramesIn:through:toPage: */ +static char * NoDbgRegParms +moveFramesInthroughtoPage(StackPage *oldPage, char *theFP, StackPage *newPage) +{ + char *callerFP; + usqInt callerIP; + int delta; + char *fpInNewPage; + char *newFP; + char *newSP; + sqInt numArgs; + char *offsetCallerFP; + char *source; + sqInt stackedReceiverOffset; + sqInt theContext; + char *theFP1; + char *theSP; + + + /* A base frame must have a context for cannotReturn: processing. */ + assert(!(isBaseFrame(theFP))); + assert(validStackPageBaseFrames()); + callerFP = pointerForOop(longAt(theFP + FoxSavedFP)); + assert(frameHasContext(callerFP)); + assert(isContext(frameContext(callerFP))); + /* begin ensureFrameIsMarried:SP: */ + theSP = theFP + (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? FoxMFReceiver + : FoxIFReceiver)); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + theContext = longAt(theFP + FoxThisContext); + goto l4; + } + theContext = marryFrameSP(theFP, theSP); +l4: /* end ensureFrameIsMarried:SP: */; + longAtput((newSP = (newPage->baseAddress)), longAt(callerFP + FoxThisContext)); + longAtput((newSP -= BytesPerWord), theContext); + /* begin frameStackedReceiverOffsetNumArgs: */ + numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1)); + stackedReceiverOffset = (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord())))); + for (source = (theFP + stackedReceiverOffset); source >= ((oldPage->headSP)); source += (-BytesPerWord)) { + newSP -= BytesPerWord; + longAtput(newSP, longAt(source)); + } + delta = newSP - ((oldPage->headSP)); + newFP = (((newPage->baseAddress)) - stackedReceiverOffset) - (2 * BytesPerWord); + /* begin setHeadFP:andSP:inPage: */ + theFP1 = ((oldPage->headFP)) + delta; + assert(newSP < theFP1); + assert((newSP < ((newPage->baseAddress))) + && (newSP > (((newPage->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((theFP1 < ((newPage->baseAddress))) + && (theFP1 > (((newPage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (newPage->headFP = theFP1); + (newPage->headSP = newSP); + (newPage->baseFP = newFP); + callerIP = oopForPointer(pointerForOop(longAt(theFP + FoxCallerSavedIP))); + if ((((usqInt)callerIP)) >= (startOfMemory())) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(callerFP))); + longAtput(callerFP + FoxIFSavedIP, callerIP); + callerIP = ceReturnToInterpreterPC(); + } + longAtput(theFP + stackedReceiverOffset, callerIP); + assert((callerFP < ((oldPage->baseAddress))) + && (callerFP > (((oldPage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (oldPage->headFP = callerFP); + (oldPage->headSP = theFP + stackedReceiverOffset); + longAtput(newFP + FoxCallerSavedIP, ceBaseFrameReturnPC()); + longAtput(newFP + FoxSavedFP, 0); + fpInNewPage = (newPage->headFP); + do { + offsetCallerFP = pointerForOop(longAt(fpInNewPage + FoxSavedFP)); + if (offsetCallerFP != 0) { + offsetCallerFP += delta; + } + longAtput(fpInNewPage + FoxSavedFP, oopForPointer(offsetCallerFP)); + if (((((usqInt)(longAt(fpInNewPage + FoxMethod)))) < (startOfMemory()) + ? ((longAt(fpInNewPage + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((fpInNewPage + FoxIFrameFlags) + 2)) != 0)) { + theContext = longAt(fpInNewPage + FoxThisContext); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(theContext))); + longAtput((theContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer(fpInNewPage)) & (BytesPerWord - 1)) == 0), + (oopForPointer(fpInNewPage)) + (smallIntegerTag()))); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(theContext))); + longAtput((theContext + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(offsetCallerFP)) & (BytesPerWord - 1)) == 0), + (oopForPointer(offsetCallerFP)) + (smallIntegerTag()))); + } + fpInNewPage = offsetCallerFP; + } while(fpInNewPage != 0); + assert(validStackPageBaseFrames()); + return newFP; +} + + +/* Map the native pc theIP into a bytecode pc integer object and answer it. + See contextInstructionPointer:frame: for the explanation. */ + + /* CoInterpreter>>#mustMapMachineCodePC:context: */ +static sqInt NoDbgRegParms +mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt bcpc; + CogMethod *cogMethod; + CogMethod *cogMethod1; + CogBlockMethod *cogMethodForIP; + sqInt maybeClosure; + sqInt mcpc; + sqInt methodObj; + sqInt rawHeader; + sqInt startBcpc; + sqInt yetToCompact; + + if (theIP == HasBeenReturnedFromMCPC) { + return GIV(nilObj); + } + maybeClosure = longAt((aOnceMarriedContext + BaseHeaderSize) + (((int)((usqInt)(ClosureIndex) << (shiftForWord()))))); + methodObj = longAt((aOnceMarriedContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + if ((maybeClosure != GIV(nilObj)) + && (((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) & 1))) { + assert((((signed)theIP >> 16)) < -1); + startBcpc = (((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 1)) - 1; + } + else { + assert((((signed)theIP >> 16)) == -1); + startBcpc = ((literalCountOf(methodObj)) + LiteralStart) * BytesPerOop; + } + /* begin ensureMethodIsCogged:maybeClosure: */ + rawHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0)) { + cogMethod = ((CogMethod *) rawHeader); + goto l3; + } + yetToCompact = 1; + while (1) { + if ((maybeClosure != GIV(nilObj)) + && (!(((longAt((maybeClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) & 1)))) { + cogMethod1 = cogFullBlockMethodnumCopied(methodObj, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex); + } + else { + cogMethod1 = cogselector(methodObj, GIV(nilObj)); + } + if (!((cogMethod1 == null) + && (GIV(cogCompiledCodeCompactionCalledFor) + && (yetToCompact)))) break; + yetToCompact = 0; + commenceCogCompiledCodeCompaction(); + } + if (!(asserta(cogMethod1 != null))) { + error("could not compile method that should have been compiled"); + } + cogMethod = cogMethod1; +l3: /* end ensureMethodIsCogged:maybeClosure: */; + /* begin bytecodePCFor:cogMethod:startBcpc: */ + assert(theIP < 0); + if ((((signed)theIP >> 16)) < -1) { + + /* See contextInstructionPointer:frame: */ + cogMethodForIP = ((CogBlockMethod *) ((((sqInt)cogMethod)) - ((((signed)theIP >> 16)) * (blockAlignment())))); + assert(((cogMethodForIP->cmType)) == CMBlock); + assert((cmHomeMethod(cogMethodForIP)) == cogMethod); + mcpc = (((sqInt)cogMethodForIP)) - (((short)theIP)); + } + else { + cogMethodForIP = ((CogBlockMethod *) cogMethod); + assert(((cogMethodForIP->cmType)) == CMMethod); + + /* map any pcs in primitive code (i.e. return addresses for interpreter primitive calls) to the initial pc */ + mcpc = (((sqInt)cogMethod)) - theIP; + if ((((usqInt)mcpc)) < ((cogMethod->stackCheckOffset))) { + bcpc = startBcpc; + goto l1; + } + } + assert(((mcpc >= (((sqInt)cogMethod))) && (mcpc <= ((((sqInt)cogMethod)) + ((cogMethod->blockSize)))))); + bcpc = bytecodePCForstartBcpcin(mcpc, startBcpc, cogMethodForIP); +l1: /* end bytecodePCFor:cogMethod:startBcpc: */; + assert(bcpc >= (startPCOfMethod(methodObj))); + if ((bcpc == startBcpc) + && ((maybeClosure == GIV(nilObj)) + && (methodHeaderHasPrimitive((cogMethod->methodHeader))))) { + bcpc += sizeOfCallPrimitiveBytecode((cogMethod->methodHeader)); + } + return (((usqInt)(bcpc + 1) << 1) | 1); +} + + +/* See StackInterpreter class>>initializeFrameIndices */ + + /* CoInterpreter>>#nativeFramePointerIn: */ +static char* NoDbgRegParms +nativeFramePointerIn(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((theFP + FoxMFReceiver) - (BytesPerWord * 3)) + : pointerAtPointer((theFP + FoxIFReceiver) - (BytesPerWord * 3))); +} + + +/* See StackInterpreter class>>initializeFrameIndices */ + + /* CoInterpreter>>#nativePreviousStackPointerIn: */ +static char* NoDbgRegParms +nativePreviousStackPointerIn(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((theFP + FoxMFReceiver) - (BytesPerWord * 2)) + : pointerAtPointer((theFP + FoxIFReceiver) - (BytesPerWord * 2))); +} + + /* CoInterpreter>>#nativeStackPointerAddress */ +usqInt +nativeStackPointerAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(nativeStackPointer)))); +} + + +/* See StackInterpreter class>>initializeFrameIndices */ + + /* CoInterpreter>>#nativeStackPointerIn: */ +static char* NoDbgRegParms +nativeStackPointerIn(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((theFP + FoxMFReceiver) - (BytesPerWord * 4)) + : pointerAtPointer((theFP + FoxIFReceiver) - (BytesPerWord * 4))); +} + + /* CoInterpreter>>#newMethodAddress */ +usqInt +newMethodAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(newMethod)))); +} + + +/* Answer if classTag x messageSelector => newMethod is in the lookup cache. + This is for assert checking to check that open PICs find entries. */ + + /* CoInterpreter>>#newMethodInLookupCacheAt:and: */ +static sqInt NoDbgRegParms +newMethodInLookupCacheAtand(sqInt selector, sqInt classTag) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt hash; + sqInt p; + sqInt probe; + + hash = selector ^ (((sqInt)((usqInt)(classTag) << 2))); + for (p = 0; p < CacheProbeMax; p += 1) { + probe = (((usqInt) hash) >> p) & MethodCacheMask; + if (((GIV(methodCache)[probe + MethodCacheSelector]) == selector) + && (((GIV(methodCache)[probe + MethodCacheClass]) == classTag) + && ((GIV(methodCache)[probe + MethodCacheMethod]) == GIV(newMethod)))) { + return 1; + } + } + return 0; +} + + +/* N.B. nextProfileTick is 64-bits */ + + /* CoInterpreter>>#nextProfileTickAddress */ +usqInt +nextProfileTickAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(nextProfileTick)))); +} + + /* CoInterpreter>>#noAssertHeaderOf: */ +sqInt +noAssertHeaderOf(sqInt methodPointer) +{ + sqInt methodHeader; + + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + return ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0) + ? ((((CogMethod *) methodHeader))->methodHeader) + : methodHeader); +} + + +/* integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:. + N.B. Returning in each arm separately enables Slang inlining. + /Don't/ return the ifTrue:ifFalse: unless Slang inlining of conditionals + is fixed. */ + + /* CoInterpreter>>#positive32BitIntegerFor: */ +sqInt +positive32BitIntegerFor(unsigned int integerValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt valueWord; + + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { + return ((integerValue << 1) | 1); + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(integerValue); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + return newLargeInteger; + +} + + +/* Convert the given object into an integer value. + The object may be either a positive SmallInteger or a four-byte + LargePositiveInteger. + */ + + /* CoInterpreter>>#positive32BitValueOf: */ +unsigned int +positive32BitValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt fmt; + sqInt ok; + usqInt sz; + sqInt value; + + /* begin maybeInlinePositive32BitValueOf: */ + if ((oop & 1)) { + value = (oop >> 1); + if (value < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + value = 0; + } + return value; + } + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + else { + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7); + if (sz > 4) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + return ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + } + +} + + +/* Answer a Large Positive Integer object for the given integer value. N.B. + will *not* cause a GC. */ + + /* CoInterpreter>>#positive64BitIntegerFor: */ +sqInt +positive64BitIntegerFor(usqLong integerValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + unsigned int highWord; + sqInt newLargeInteger; + sqInt newLargeInteger1; + usqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numBytes1; + sqInt numSlots; + sqInt objFormat; + sqInt objFormat1; + sqInt sz; + sqInt valueWord; + + if (((highWord = integerValue >> 32)) == 0) { + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) (((unsigned int) integerValue)))) <= (MaxSmallInteger)) { + return (((((unsigned int) integerValue)) << 1) | 1); + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger1 = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger1 = newObj; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN((((unsigned int) integerValue))); + long32Atput((newLargeInteger1 + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); + + return newLargeInteger1; + + } + sz = 5; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + } + } + } + + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat1 = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + numSlots = 8 / BytesPerOop; + assert((numSlots >= 0) + && (ClassLargePositiveIntegerCompactIndex != 0)); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj1 = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l5; + } + } + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes1; + newLargeInteger = newObj1; +l5: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue)); + return newLargeInteger; +} + + +/* Convert the given object into an integer value. + The object may be either a positive SmallInteger or an eight-byte + LargePositiveInteger. + */ + + /* CoInterpreter>>#positive64BitValueOf: */ +usqLong +positive64BitValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt fmt; + sqInt ok; + usqInt sz; + usqLong value; + + if ((oop & 1)) { + if (((oop >> 1)) < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + return (oop >> 1); + } + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + +l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7); + if (sz > (sizeof(sqLong))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (sz > 4) { + value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3)))); + } + else { + + /* ] */ + value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + } + return value; +} + + +/* Signal the gc semaphore */ +/* Attempt to shrink free memory, signal the gc semaphore and let the Cogit + do its post GC thang + */ + + /* CoInterpreter>>#postGCAction: */ +static void NoDbgRegParms +postGCAction(sqInt gcModeArg) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + assert(gcModeArg == GIV(gcMode)); + signalSemaphoreWithIndex(GIV(gcSemaphoreIndex)); + cogitPostGCAction(gcModeArg); + /* begin nilUncoggableMethods */ + GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null); + GIV(gcMode) = 0; +} + + +/* Need to write back the frame pointers unless all pages are free (as in + snapshot) + */ +/* Need to write back the frame pointers unless all pages are free (as in + snapshot). Need to set gcMode var (to avoid passing the flag through a lot + of the updating code) */ + + /* CoInterpreter>>#preGCAction: */ +static void NoDbgRegParms +preGCAction(sqInt gcModeArg) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt traceType; + + if (GIV(stackPage) != 0) { + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + } + if ((gcModeArg == GCModeFull) + && (1)) { + flushMethodCache(); + } + GIV(gcMode) = gcModeArg; + if (recordEventTrace()) { + traceType = (gcModeArg == GCModeFull + ? TraceFullGC + : TraceIncrementalGC); + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = traceType; + GIV(traceLog)[GIV(traceLogIndex) + 1] = traceType; + GIV(traceLog)[GIV(traceLogIndex) + 2] = 0; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + if (recordPrimTrace()) { + traceType = (gcModeArg == GCModeFull + ? TraceFullGC + : TraceIncrementalGC); + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = traceType; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } +} + + /* CoInterpreter>>#primErrTable */ +sqInt +primErrTable(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin fetchPointer:ofObject: */ + return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); +} + + /* CoInterpreter>>#primFailCodeAddress */ +usqInt +primFailCodeAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(primFailCode)))); +} + + +/* This is used for asserts that check that inline cache editing results in + valid addresses. + In the C VM interpret is presumed to come before any primitives and so it + constitutes the lowest address in C code that machine code should be + linked, but optimizing + compilers change things around. In the simulator we just answer something + not low. */ + + /* CoInterpreter>>#primitiveFailAddress */ +usqInt +primitiveFailAddress(void) +{ + return ((usqInt)((&primitiveFail))); +} + + +/* Answer any special requirements of the given primitive */ + + /* CoInterpreter>>#primitivePropertyFlags: */ +sqInt +primitivePropertyFlags(sqInt primIndex) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt baseFlags; + + /* begin primitivePropertyFlagsForSpur: */ + baseFlags = PrimCallNeedsPrimitiveFunction + PrimCallNeedsNewMethod; + if (GIV(profileSemaphore) != GIV(nilObj)) { + baseFlags = baseFlags | PrimCallCollectsProfileSamples; + } + if ((primIndex == PrimNumberExternalCall) + || (primIndex == PrimNumberFFICall)) { + + /* For callbacks */ + baseFlags = baseFlags | PrimCallMayCallBack; + if (checkAllocFiller) { + baseFlags = baseFlags | CheckAllocationFillerAfterPrimCall; + } + } + return baseFlags; + +} + + /* CoInterpreter>>#primTraceLogAddress */ +void * +primTraceLogAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return GIV(primTraceLog); +} + + +/* N.B. primTraceLogIndex is 8-bits */ + + /* CoInterpreter>>#primTraceLogIndexAddress */ +usqInt +primTraceLogIndexAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(primTraceLogIndex)))); +} + + /* CoInterpreter>>#printCogMethod: */ +void +printCogMethod(CogMethod *cogMethod) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt firstBytecode; + sqInt methodHeader; + sqInt primitive; + sqInt s; + sqInt theMethod; + + address = ((sqInt)cogMethod); + printHex(address); + print(" <-> "); + printHex(address + ((cogMethod->blockSize))); + if (((cogMethod->cmType)) == CMMethod) { + print(": method: "); + printHex((cogMethod->methodObject)); + /* begin primitiveIndexOfMethod:header: */ + theMethod = (cogMethod->methodObject); + methodHeader = (cogMethod->methodHeader); + if (methodHeader & AlternateHeaderHasPrimFlag) { + /* begin firstBytecodeOfAlternateHeader:method: */ + firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize; + primitive = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))); + } + else { + primitive = 0; + } + + if (primitive != 0) { + print(" prim "); + printNum(primitive); + } + } + if (((cogMethod->cmType)) == CMBlock) { + print(": block home: "); + printHex(((usqInt)((((((CogBlockMethod *) cogMethod))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) cogMethod))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) cogMethod)))) - (((((CogBlockMethod *) cogMethod))->homeOffset)))))))); + } + if (((cogMethod->cmType)) == CMClosedPIC) { + print(": Closed PIC N: "); + printHex((cogMethod->cPICNumCases)); + } + if (((cogMethod->cmType)) == CMOpenPIC) { + print(": Open PIC "); + } + print(" selector: "); + printHex((cogMethod->selector)); + if (((cogMethod->selector)) == GIV(nilObj)) { + if ((((cogMethod->cmType)) == CMMethod) + && (((s = maybeSelectorOfMethod((cogMethod->methodObject)))) != null)) { + print(" (nil: "); + printStringOf(s); + print(")"); + } + else { + print(" (nil)"); + } + } + else { + /* begin space */ + putchar(' '); + printStringOf((cogMethod->selector)); + } + /* begin cr */ + printf("\n"); +} + + /* CoInterpreter>>#printFrameFlagsForFP: */ +static void NoDbgRegParms +printFrameFlagsForFP(char *theFP) +{ + char *address; + sqInt it; + + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + address = theFP + FoxMethod; + it = (longAt(address)) & 7; + } + else { + address = theFP + FoxIFrameFlags; + it = longAt(address); + } + /* begin printHexPtr: */ + printHex(oopForPointer(address)); + print(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ": mcfrm flags: " + : ":intfrm flags: ")); + printHex(it); + if (it != 0) { + /* begin printChar: */ + putchar('='); + printNum(it); + } + print(" numArgs: "); + printNum(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1))); + print((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0) + ? " hasContext" + : " noContext")); + print((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0) + ? " isBlock" + : " notBlock")); + /* begin cr */ + printf("\n"); +} + + /* CoInterpreter>>#printFrameMethodFor: */ +static void NoDbgRegParms +printFrameMethodFor(char *theFP) +{ + char *address; + CogMethod *homeMethod; + sqInt it; + sqInt methodField; + sqInt obj; + + address = theFP + FoxMethod; + it = longAt(address); + printHex(((sqInt)address)); + /* begin printChar: */ + putchar(':'); + print(" method: "); + printHex(it); + /* begin tab */ + putchar(' '); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) + && (((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0)) { + /* begin mframeHomeMethod: */ + methodField = longAt(theFP + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + homeMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + goto l2; + } + homeMethod = ((CogMethod *) (methodField & MFMethodMask)); + l2: /* end mframeHomeMethod: */; + print("hm: "); + printHex(((sqInt)homeMethod)); + /* begin tab */ + putchar(' '); + } + obj = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeHomeMethod(theFP))->methodObject) + : longAt(theFP + FoxMethod)); + shortPrintOop(obj); +} + + /* CoInterpreter>>#printFrameThing:at:extraString: */ +static void NoDbgRegParms +printFrameThingatextraString(char *name, char *address, char *extraStringOrNil) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt it; + sqInt len; + + it = longAt(address); + /* begin printHexPtr: */ + printHex(oopForPointer(address)); + /* begin printChar: */ + putchar(':'); + len = strlen(name); + for (i = 1; i <= (12 - len); i += 1) { + /* begin space */ + putchar(' '); + } + print(name); + print(": "); + printHex(it); + if (it != 0) { + /* begin printChar: */ + putchar('='); + if (it == GIV(nilObj)) { + print("nil"); + } + else { + printNum(it); + } + } + if (!(extraStringOrNil == null)) { + /* begin space */ + putchar(' '); + print(extraStringOrNil); + } + /* begin cr */ + printf("\n"); +} + + /* CoInterpreter>>#printFrameThing:at:extra: */ +static void NoDbgRegParms +printFrameThingatextra(char *name, char *address, sqInt extraValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt it; + sqInt len; + + it = longAt(address); + /* begin printHexPtr: */ + printHex(oopForPointer(address)); + /* begin printChar: */ + putchar(':'); + len = strlen(name); + for (i = 1; i <= (12 - len); i += 1) { + /* begin space */ + putchar(' '); + } + print(name); + print(": "); + printHex(it); + if (it != 0) { + /* begin printChar: */ + putchar('='); + if (it == GIV(nilObj)) { + print("nil"); + } + else { + printNum(it); + } + } + /* begin space */ + putchar(' '); + printNum(extraValue); + /* begin cr */ + printf("\n"); +} + + /* CoInterpreter>>#printFrame:WithSP: */ +sqInt +printFrameWithSP(char *theFP, char *theSP) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *addr; + CogBlockMethod *cogMethod; + sqInt header; + sqInt header1; + sqInt header2; + CogMethod *homeMethod; + usqInt i; + usqInt index; + sqInt methodField; + usqInt numArgs; + sqInt numTemps; + char *rcvrAddress; + sqInt rcvrOrClosure; + sqInt theMethod; + sqInt theMethodEnd; + sqInt topThing; + + if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0) + && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) { + /* begin printHexPtr: */ + printHex(oopForPointer(theFP)); + print(" is not in the stack zone?!"); + /* begin cr */ + printf("\n"); + return null; + } + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin mframeCogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask)); + /* begin mframeHomeMethod: */ + methodField = longAt(theFP + FoxMethod); + if ((methodField & MFMethodFlagIsBlockFlag) != 0) { + homeMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset))))); + goto l2; + } + homeMethod = ((CogMethod *) (methodField & MFMethodMask)); + l2: /* end mframeHomeMethod: */; + theMethod = ((sqInt)homeMethod); + theMethodEnd = (((sqInt)homeMethod)) + ((homeMethod->blockSize)); + numArgs = (cogMethod->cmNumArgs); + /* begin temporaryCountOfMethodHeader: */ + header = (homeMethod->methodHeader); + numTemps = (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F; + } + else { + theMethod = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeHomeMethod(theFP))->methodObject) + : longAt(theFP + FoxMethod)); + theMethodEnd = theMethod + (((numSlotsOf(theMethod)) << (shiftForWord())) + BaseHeaderSize); + /* begin iframeNumArgs: */ + numArgs = byteAt((theFP + FoxIFrameFlags) + 1); + /* begin temporaryCountOfMethodHeader: */ + assert(isCompiledMethod(theMethod)); + header2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header2 & 1)) { + header1 = header2; + } + else { + assert((((usqInt)header2)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + header1 = ((((CogMethod *) header2))->methodHeader); + } + numTemps = (((usqInt) header1) >> MethodHeaderTempCountShift) & 0x3F; + } + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)) { + + /* No BlockLocalTempCounter in the Cogit's C code, so quick hack is to use numCopied + numArgs */ + rcvrOrClosure = longAt(theFP + (frameStackedReceiverOffset(theFP))); + if (((rcvrOrClosure & (tagMask())) == 0) + && ((addressCouldBeObj(rcvrOrClosure)) + && ((fetchClassOfNonImm(rcvrOrClosure)) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord()))))))))) { + numTemps = numArgs + (stSizeOf(rcvrOrClosure)); + } + else { + numTemps = numArgs; + } + } + shortPrintFrame(theFP); + if ((longAt(theFP + FoxSavedFP)) == 0) { + printFrameOopat("(caller ctxt", (theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord)); + printFrameOopat("(saved ctxt", (theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1))))) + (1 * BytesPerWord)); + } + printFrameOopat("rcvr/clsr", (theFP + FoxCallerSavedIP) + ((numArgs + 1) * BytesPerWord)); + for (i = numArgs; i >= 1; i += -1) { + printFrameOopindexat("arg", numArgs - i, (theFP + FoxCallerSavedIP) + (i * BytesPerWord)); + } + printFrameThingatextraString("caller ip", theFP + FoxCallerSavedIP, ((longAt(theFP + FoxCallerSavedIP)) == (ceReturnToInterpreterPC()) + ? "ceReturnToInterpreter" + : 0)); + printFrameThingat("saved fp", theFP + FoxSavedFP); + printFrameMethodFor(theFP); + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + printFrameFlagsForFP(theFP); + } + printFrameOopat("context", theFP + FoxThisContext); + if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) { + printFrameFlagsForFP(theFP); + } + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + rcvrAddress = theFP + FoxMFReceiver; + } + else { + printFrameThingatextra("saved ip", theFP + FoxIFSavedIP, ((longAt(theFP + FoxIFSavedIP)) == 0 + ? 0 + : (((longAt(theFP + FoxIFSavedIP)) - theMethod) + 2) - BaseHeaderSize)); + rcvrAddress = theFP + FoxIFReceiver; + } + printFrameOopat("receiver", rcvrAddress); + topThing = longAt(theSP); + if (oopisGreaterThanOrEqualToandLessThan(topThing, theMethod, theMethodEnd)) { + for (addr = (rcvrAddress - BytesPerWord); addr >= (theSP + BytesPerWord); addr += (-BytesPerWord)) { + index = ((rcvrAddress - addr) / BytesPerWord) + numArgs; + if (index <= numTemps) { + printFrameOopindexat("temp", index - 1, addr); + } + else { + printFrameOopat((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0) + ? "temp/stck" + : "stck"), addr); + } + } + printFrameThingatextra("frame ip", theSP, ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? topThing - theMethod + : ((topThing - theMethod) + 2) - BaseHeaderSize)); + } + else { + for (addr = (rcvrAddress - BytesPerWord); addr >= theSP; addr += (-BytesPerWord)) { + index = ((rcvrAddress - addr) / BytesPerWord) + numArgs; + if (index <= numTemps) { + printFrameOopindexat("temp", index - 1, addr); + } + else { + printFrameOopat((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0) + ? "temp/stck" + : "stck"), addr); + } + } + } + return 0; +} + + /* CoInterpreter>>#printLogEntryAt: */ +static void NoDbgRegParms +printLogEntryAt(sqInt i) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt intOrClass; + sqInt selectorMethodOrProcess; + sqInt source; + char * traceSources[] = { + "?", "m", "i", "callbackEnter", "callbackLeave", "enterCritical", "exitCritical", + "resume", "signal", "suspend", "wait", "yield", "eventcheck", "threadsched", + "ownVM", "bindToThread", "switchIfNecessary" + }; + + intOrClass = GIV(traceLog)[i]; + selectorMethodOrProcess = GIV(traceLog)[i + 1]; + source = GIV(traceLog)[i + 2]; + if (source <= TraceIsFromInterpreter) { + print(traceSources[source]); + /* begin space */ + putchar(' '); + } + if ((intOrClass & 1)) { + if (intOrClass == TraceStackOverflow) { + print("stack overflow"); + } + if (intOrClass == TraceContextSwitch) { + print("context switch from "); + printHex(selectorMethodOrProcess); + } + if (intOrClass == TraceBlockActivation) { + print(" [] in "); + printHex(selectorMethodOrProcess); + } + if (intOrClass == TraceBlockCreation) { + print("create [] "); + printHex(selectorMethodOrProcess); + } + if (intOrClass == TraceIncrementalGC) { + print("incrementalGC"); + } + if (intOrClass == TraceFullGC) { + print("fullGC"); + } + if (intOrClass == TraceCodeCompaction) { + print("compactCode"); + } + if (intOrClass == TraceVMCallback) { + print("callback"); + } + if (intOrClass == TraceVMCallbackReturn) { + print("return from callback"); + } + } + else { + /* begin space */ + putchar(' '); + printNameOfClasscount(intOrClass, 5); + print(">>"); + printStringOf(selectorMethodOrProcess); + } + if (source > TraceIsFromInterpreter) { + /* begin space */ + putchar(' '); + print(traceSources[source]); + } + /* begin cr */ + printf("\n"); +} + + /* CoInterpreter>>#printMethodCacheFor: */ +void +printMethodCacheFor(sqInt thing) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqIntptr_t c; + sqInt i; + sqIntptr_t m; + sqInt n; + sqIntptr_t p; + sqIntptr_t s; + + n = 0; + for (i = 0; i < MethodCacheSize; i += MethodCacheEntrySize) { + s = GIV(methodCache)[i + MethodCacheSelector]; + c = GIV(methodCache)[i + MethodCacheClass]; + m = GIV(methodCache)[i + MethodCacheMethod]; + p = GIV(methodCache)[i + MethodCachePrimFunction]; + if (((thing == -1) + || ((s == thing) + || ((c == thing) + || ((p == thing) + || ((m == thing) + || ((addressCouldBeObj(m)) + && ((((m & (tagMask())) == 0) + && ((((((usqInt) (longAt(m))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((m + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) + && ((((sqInt)(cogMethodOf(m)))) == thing)))))))) + && (((s & (tagMask())) + || (addressCouldBeObj(s))) + && ((c != 0) + && ((addressCouldBeClassObj(c)) + || (addressCouldBeClassObj(classAtIndex(c))))))) { + n += 1; + printNum(i); + /* begin space */ + putchar(' '); + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) i)); + /* begin cr */ + printf("\n"); + /* begin tab */ + putchar(' '); + if (((((usqInt) (longAt(s))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())) { + printf("%" PRIxSQPTR " %.*s\n", s, (int)(numBytesOf(s)), (char *)firstIndexableField(s)); + } + else { + shortPrintOop(s); + } + /* begin tab */ + putchar(' '); + if (addressCouldBeClassObj(c)) { + shortPrintOop(c); + } + else { + printNum(c); + /* begin space */ + putchar(' '); + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) c)); + /* begin space */ + putchar(' '); + shortPrintOop(classAtIndex(c)); + } + /* begin tab */ + putchar(' '); + shortPrintOop(m); + /* begin tab */ + putchar(' '); + if (p > 1024) { + /* begin printHexnp: */ + printf("0x%lx", ((unsigned long) p)); + } + else { + printNum(p); + } + /* begin cr */ + printf("\n"); + } + } + if (n > 1) { + printNum(n); + /* begin cr */ + printf("\n"); + } +} + + /* CoInterpreter>>#printPrimLogEntryAt: */ +static sqInt NoDbgRegParms +printPrimLogEntryAt(sqInt i) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt intOrSelector; + sqInt referent; + sqInt target; + + intOrSelector = GIV(primTraceLog)[i]; + if (intOrSelector & (tagMask())) { + if (intOrSelector == TraceIncrementalGC) { + print("**IncrementalGC**"); + return null; + } + if (intOrSelector == TraceFullGC) { + print("**FullGC**"); + return null; + } + if (intOrSelector == TraceCodeCompaction) { + print("**CompactCode**"); + return null; + } + if (intOrSelector == TraceStackOverflow) { + print("**StackOverflow**"); + return null; + } + if (intOrSelector == TracePrimitiveFailure) { + print("**PrimitiveFailure**"); + return null; + } + if (intOrSelector == TracePrimitiveRetry) { + print("**PrimitiveRetry**"); + return null; + } + print("???"); + } + else { + if (intOrSelector == 0) { + printNum(i); + print("!!!"); + } + else { + /* begin safePrintStringOf: */ + if (((intOrSelector & (tagMask())) == 0) + && (((longAt(intOrSelector)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(intOrSelector)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((intOrSelector + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + target = referent; + } + else { + target = intOrSelector; + } + printStringOf(target); + /* return self */ + } + } + return 0; +} + + /* CoInterpreter>>#quickPrimitiveConstantFor: */ +sqInt +quickPrimitiveConstantFor(sqInt aQuickPrimitiveIndex) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + + switch (aQuickPrimitiveIndex) { + case 257: + return GIV(trueObj); + + case 258: + return GIV(falseObj); + + case 259: + return GIV(nilObj); + + case 260: + return ConstMinusOne; + + case 261: + return ConstZero; + + case 262: + return ConstOne; + + case 263: + return ConstTwo; + + default: + error("Case not found and no otherwise clause"); + return -1; + } +} + + /* CoInterpreter>>#quickPrimitiveGeneratorFor: */ +sqInt (*quickPrimitiveGeneratorFor(sqInt aQuickPrimitiveIndex))(void) + +{ + + switch (aQuickPrimitiveIndex) { + case 256: + return genQuickReturnSelf; + + case 257: + case 258: + case 259: + case 260: + case 261: + case 262: + case 263: + return genQuickReturnConst; + + default: + return genQuickReturnInstVar; + + } +} + + /* CoInterpreter>>#quickPrimitiveInstVarIndexFor: */ +sqInt +quickPrimitiveInstVarIndexFor(sqInt primIndex) +{ + return primIndex - 264; +} + + /* CoInterpreter>>#rawHeaderOf: */ +sqInt +rawHeaderOf(sqInt methodPointer) +{ + return longAt((methodPointer + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); +} + + +/* Since methods may be updated while forwarding during become, make the + assert accomodate this. + */ + + /* CoInterpreter>>#rawHeaderOf:put: */ +void +rawHeaderOfput(sqInt methodOop, sqInt cogMethodOrMethodHeader) +{ + assert(isCompiledMethodHeader(headerWhileForwardingOf(methodOop))); + assert(!(isOopForwarded(methodOop))); + longAtput((methodOop + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))), cogMethodOrMethodHeader); + +} + + +/* Read an image from the given file stream, allocating an amount of memory + to its object heap. + + V3: desiredHeapSize is the total size of the heap. Fail if the image has + an unknown format or + requires more than the specified amount of memory. + + Spur: desiredHeapSize is ignored; this routine will attempt to provide at + least extraVMMemory's + ammount of free space after the image is loaded, taking any free space in + teh image into account. + extraVMMemory is stored in the image header and is accessible as + vmParameterAt: 23. If + extraVMMemory is 0, the value defaults to the default grow headroom. Fail + if the image has an + unknown format or if sufficient memory cannot be allocated. + + Details: This method detects when the image was stored on a machine with + the opposite byte + ordering from this machine and swaps the bytes automatically. Furthermore, + it allows the header + information to start 512 bytes into the file, since some file transfer + programs for the Macintosh + apparently prepend a Mac-specific header of this size. Note that this same + 512 bytes of prefix + area could also be used to store an exec command on Unix systems, allowing + one to launch + Smalltalk by invoking the image name as a command. */ + + /* CoInterpreter>>#readImageFromFile:HeapSize:StartingAt: */ +size_t +readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt allocationReserve; + sqInt anObject; + sqInt aValue; + sqInt bit; + sqInt bytes; + sqInt bytesRead; + usqInt bytesToShift; + sqInt classArrayClass; + sqInt classArrayObj; + size_t dataSize; + sqInt firstSegSize; + sqInt freeOldSpaceInImage; + sqInt hdrCogCodeSize; + sqInt hdrEdenBytes; + sqInt hdrMaxExtSemTabSize; + sqInt hdrNumStackPages; + sqInt headerFlags; + sqInt headerSize; + squeakFileOffsetType headerStart; + sqInt headroom; + sqInt headroom1; + usqInt heapSize; + usqInt heapSize1; + sqInt i; + sqInt i1; + sqInt iLimiT; + usqInt minimumMemory; + usqInt numSlots; + sqInt objOop; + sqInt oldBaseAddr; + sqInt oop; + sqInt seed; + sqInt swapBytes; + sqInt w; + int w1; + unsigned short w10; + sqInt w11; + sqInt w12; + sqInt w13; + sqInt w2; + sqInt w3; + sqInt w4; + sqInt w5; + int w6; + unsigned short w7; + int w8; + unsigned short w9; + + + /* guess Metaclass instSize */ + GIV(metaclassNumSlots) = 6; + + /* guess (Class instVarIndexFor: 'name' ifAbsent: []) - 1 */ + GIV(classNameIndex) = 6; + swapBytes = checkImageVersionFromstartingAt(f, imageOffset); + + /* record header start position */ + headerStart = (sqImageFilePosition(f)) - 4; + /* begin getWord32FromFile:swap: */ + w1 = 0; + sqImageFileRead((&w1), sizeof(int), 1, f); + headerSize = (swapBytes + ? SQ_SWAP_4_BYTES(w1) + : w1); + /* begin getLongFromFile:swap: */ + w2 = 0; + sqImageFileRead((&w2), sizeof(w2), 1, f); + dataSize = ((sqInt) ((swapBytes + ? (/* begin byteSwapped: */ + SQ_SWAP_4_BYTES(w2)) + : w2))); + /* begin getLongFromFile:swap: */ + w3 = 0; + sqImageFileRead((&w3), sizeof(w3), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + oldBaseAddr = SQ_SWAP_4_BYTES(w3); + } + else { + oldBaseAddr = w3; + } + /* begin specialObjectsOop: */ + w12 = 0; + sqImageFileRead((&w12), sizeof(w12), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + anObject = SQ_SWAP_4_BYTES(w12); + } + else { + anObject = w12; + } + GIV(specialObjectsOop) = anObject; + /* begin lastHash: */ + w13 = 0; + sqImageFileRead((&w13), sizeof(w13), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + seed = SQ_SWAP_4_BYTES(w13); + } + else { + seed = w13; + } + GIV(lastHash) = seed; + /* begin getLongFromFile:swap: */ + w4 = 0; + sqImageFileRead((&w4), sizeof(w4), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + GIV(savedWindowSize) = SQ_SWAP_4_BYTES(w4); + } + else { + GIV(savedWindowSize) = w4; + } + /* begin getLongFromFile:swap: */ + w5 = 0; + sqImageFileRead((&w5), sizeof(w5), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + headerFlags = SQ_SWAP_4_BYTES(w5); + } + else { + headerFlags = w5; + } + /* begin setImageHeaderFlagsFrom: */ + + /* so as to preserve unrecognised flags. */ + GIV(imageHeaderFlags) = headerFlags; + GIV(fullScreenFlag) = headerFlags & 1; + GIV(imageFloatsBigEndian) = ((headerFlags & 2) == 0 + ? 1 + : 0); + GIV(flagInterpretedMethods) = (headerFlags & 8) != 0; + GIV(preemptionYields) = (headerFlags & 16) == 0; + GIV(newFinalization) = (headerFlags & 64) != 0; + /* begin getWord32FromFile:swap: */ + w6 = 0; + sqImageFileRead((&w6), sizeof(int), 1, f); + extraVMMemory = (swapBytes + ? SQ_SWAP_4_BYTES(w6) + : w6); + /* begin getShortFromFile:swap: */ + w7 = 0; + sqImageFileRead((&w7), sizeof(unsigned short), 1, f); + hdrNumStackPages = (swapBytes + ? ((((usqInt) w7) >> 8) & 0xFF) | (((int)((usqInt)((w7 & 0xFF)) << 8))) + : w7); + GIV(numStackPages) = (desiredNumStackPages != 0 + ? desiredNumStackPages + : (hdrNumStackPages == 0 + ? defaultNumStackPages() + : hdrNumStackPages)); + + /* This slot holds the size of the native method zone in 1k units. (pad to word boundary). */ + desiredNumStackPages = hdrNumStackPages; + hdrCogCodeSize = (getShortFromFileswap(f, swapBytes)) * 1024; + GIV(cogCodeSize) = (desiredCogCodeSize != 0 + ? desiredCogCodeSize + : (hdrCogCodeSize == 0 + ? defaultCogCodeSize() + : hdrCogCodeSize)); + /* begin getWord32FromFile:swap: */ + w8 = 0; + sqImageFileRead((&w8), sizeof(int), 1, f); + hdrEdenBytes = (swapBytes + ? SQ_SWAP_4_BYTES(w8) + : w8); + /* begin edenBytes: */ + bytes = (desiredEdenBytes != 0 + ? desiredEdenBytes + : (hdrEdenBytes == 0 + ? defaultEdenBytes() + : hdrEdenBytes)); + GIV(edenBytes) = bytes; + desiredEdenBytes = hdrEdenBytes; + /* begin getShortFromFile:swap: */ + w9 = 0; + sqImageFileRead((&w9), sizeof(unsigned short), 1, f); + hdrMaxExtSemTabSize = (swapBytes + ? ((((usqInt) w9) >> 8) & 0xFF) | (((int)((usqInt)((w9 & 0xFF)) << 8))) + : w9); + if (hdrMaxExtSemTabSize != 0) { + /* begin setMaxExtSemSizeTo: */ + GIV(maxExtSemTabSizeSet) = 1; + ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize); + } + /* begin getShortFromFile:swap: */ + w10 = 0; + sqImageFileRead((&w10), sizeof(unsigned short), 1, f); + GIV(the2ndUnknownShort) = (swapBytes + ? ((((usqInt) w10) >> 8) & 0xFF) | (((int)((usqInt)((w10 & 0xFF)) << 8))) + : w10); + /* begin getLongFromFile:swap: */ + w11 = 0; + sqImageFileRead((&w11), sizeof(w11), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + firstSegSize = SQ_SWAP_4_BYTES(w11); + } + else { + firstSegSize = w11; + } + /* begin firstSegmentSize: */ + GIV(firstSegmentSize) = firstSegSize; + allocationReserve = interpreterAllocationReserveBytes(); + + /* no need to include the stackZone; this is alloca'ed */ + minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + allocationReserve; + /* begin getLongFromFile:swap: */ + w = 0; + sqImageFileRead((&w), sizeof(w), 1, f); + if (swapBytes) { + /* begin byteSwapped: */ + freeOldSpaceInImage = SQ_SWAP_4_BYTES(w); + } + else { + freeOldSpaceInImage = w; + } + /* begin initialHeadroom:givenFreeOldSpaceInImage: */ + headroom1 = (extraVMMemory == 0 + ? (!(GIV(growHeadroom)) + ? (16 * 1024) * 1024 + : GIV(growHeadroom)) + : extraVMMemory); + if (freeOldSpaceInImage >= headroom1) { + headroom = 0; + goto l2; + } + if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) { + headroom = headroom1 / 8; + goto l2; + } + if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) { + headroom = headroom1 / 4; + goto l2; + } + if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) { + headroom = (headroom1 * 3) / 8; + goto l2; + } + if (freeOldSpaceInImage >= (headroom1 / 2)) { + headroom = headroom1 / 2; + goto l2; + } + headroom = headroom1; +l2: /* end initialHeadroom:givenFreeOldSpaceInImage: */; + /* begin roundUpHeapSize: */ + heapSize1 = (((GIV(cogCodeSize) + dataSize) + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve + ? 0 + : allocationReserve)); + bit = (((highBit(heapSize1)) - 1) * 3) / 4; + heapSize = (heapSize1 & ((1U << bit) - 1) + ? (((heapSize1 | ((1U << bit) - 1)) - ((1U << bit) - 1))) + (1U << bit) + : heapSize1); + + /* begin memory: */ + aValue = ((usqInt)(pointerForOop(allocateMemoryMinimumImageFileHeaderSize(heapSize, minimumMemory, f, headerSize)))); + GIV(memory) = aValue; + if (!(memory())) { + insufficientMemoryAvailableError(); + } + + /* position file after the header */ + heapBase = setHeapBasememoryLimitendOfMemory((memory()) + GIV(cogCodeSize), (memory()) + heapSize, ((memory()) + GIV(cogCodeSize)) + dataSize); + sqImageFileSeek(f, headerStart + headerSize); + bytesRead = readHeapFromImageFiledataBytes(f, dataSize); + if (bytesRead != dataSize) { + unableToReadImageError(); + } + ensureImageFormatIsUpToDate(swapBytes); + bytesToShift = GIV(oldSpaceStart) - oldBaseAddr; + /* begin initializeInterpreter: */ + interpreterProxy = sqGetInterpreterProxy(); + dummyReferToProxy(); + initializeObjectMemory(bytesToShift); + /* begin checkAssumedCompactClasses */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord())))))) != ((assert(((ClassArrayCompactIndex >= 1) && (ClassArrayCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassArrayCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("Array"); + } + /* begin checkCompactIndex:isClass:named: */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassLargeNegativeInteger) << (shiftForWord())))))) != ((assert(((ClassLargeNegativeIntegerCompactIndex >= 1) && (ClassLargeNegativeIntegerCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassLargeNegativeIntegerCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("LargeNegativeInteger"); + } + /* begin checkCompactIndex:isClass:named: */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassLargePositiveInteger) << (shiftForWord())))))) != ((assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassLargePositiveIntegerCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("LargePositiveInteger"); + } + /* begin checkCompactIndex:isClass:named: */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassFloat) << (shiftForWord())))))) != ((assert(((ClassFloatCompactIndex >= 1) && (ClassFloatCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassFloatCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("Float"); + } + /* begin checkCompactIndex:isClass:named: */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosure) << (shiftForWord())))))) != ((assert(((ClassBlockClosureCompactIndex >= 1) && (ClassBlockClosureCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassBlockClosureCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("BlockClosure"); + } + /* begin checkCompactIndex:isClass:named: */ + if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassMethodContext) << (shiftForWord())))))) != ((assert(((ClassMethodContextCompactIndex >= 1) && (ClassMethodContextCompactIndex <= (classTablePageSize())))), + /* begin fetchPointer:ofObject: */ + longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassMethodContextCompactIndex) << (shiftForWord())))))))) { + invalidCompactClassError("MethodContext"); + } + /* begin compactIndexOfClass: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteArray) << (shiftForWord()))))); + assert((rawHashBitsOf(objOop)) != 0); + GIV(classByteArrayCompactIndex) = (long32At(objOop + 4)) & (identityHashHalfWordMask()); + /* begin initializeExtraClassInstVarIndices */ + classArrayObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))); + classArrayClass = fetchClassOfNonImm(classArrayObj); + /* begin numSlotsOf: */ + assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(classArrayClass + 7); + GIV(metaclassNumSlots) = (numSlots == (numSlotsMask()) + ? longAt(classArrayClass - BaseHeaderSize) + : numSlots); + + /* default */ + GIV(thisClassIndex) = 5; + for (i1 = (InstanceSpecificationIndex + 1), iLimiT = (lengthOfformat(classArrayClass, (((usqInt) (longAt(classArrayClass))) >> (formatShift())) & (formatMask()))); i1 <= iLimiT; i1 += 1) { + if ((longAt((classArrayClass + BaseHeaderSize) + (((sqInt)((usqInt)((i1 - 1)) << (shiftForWord())))))) == classArrayObj) { + GIV(thisClassIndex) = i1 - 1; + } + } + + /* default */ + GIV(classNameIndex) = 6; + for (i1 = (InstanceSpecificationIndex + 1), iLimiT = (lengthOfformat(classArrayObj, (((usqInt) (longAt(classArrayObj))) >> (formatShift())) & (formatMask()))); i1 <= iLimiT; i1 += 1) { + /* begin fetchPointer:ofObject: */ + oop = longAt((classArrayObj + BaseHeaderSize) + (((sqInt)((usqInt)((i1 - 1)) << (shiftForWord()))))); + if ((((oop & (tagMask())) == 0) + && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))) + && (((lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) == 5) + && ((strncmp("Array", firstFixedField(oop), 5)) == 0))) { + GIV(classNameIndex) = i1 - 1; + } + } + GIV(method) = (GIV(newMethod) = GIV(nilObj)); + GIV(methodDictLinearSearchLimit) = 8; + /* begin initialCleanup */ + flushMethodCache(); + /* begin flushExternalPrimitiveTable */ + for (i = 0; i < MaxExternalPrimitiveTableSize; i += 1) { + externalPrimitiveTable[i] = 0; + } + GIV(externalPrimitiveTableFirstFreeIndex) = 0; + setupNativeStack(); + + GIV(profileSemaphore) = (GIV(profileProcess) = (GIV(profileMethod) = GIV(nilObj))); + + /* cmd-. as used for Mac but no other OS */ + GIV(interruptKeycode) = 2094; + while (GIV(globalSessionID) == 0) { + GIV(globalSessionID) = (time(NULL)) + (ioMSecs()); + } + /* begin initializeCodeGenerator */ + initializeCodeZoneFromupTo(memory(), (memory()) + GIV(cogCodeSize)); + return dataSize; +} + + +/* Report the stack page size and minimum unused headroom to stdout. */ + + /* CoInterpreter>>#reportMinimumUnusedHeadroom */ +void +reportMinimumUnusedHeadroom(void) +{ + printf("stack page bytes %lld available headroom %lld minimum unused headroom %lld\n", ((unsigned long long)(stackPageByteSize())), ((unsigned long long)(((stackPageByteSize()) - ((((stackPageFrameBytes()) < (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))) ? (stackPageFrameBytes()) : (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))))) - ((IFrameSlots + 64) * BytesPerWord))), ((unsigned long long)(minimumUnusedHeadroom()))); +} + + +/* Make aProcess runnable and if its priority is higher than that of the + current process, preempt the current process. Answer if the current + process was preempted. If the current process was preempted then if + yieldImplicitly add the current process to the back of its run queue, + causing an implicit yeild to other processes on the run queue, otherwise + add the current process to the front of its run queue, hence not yielding. + Blue book behaviour is to yield implicitly but is arguably incorrect. + Override to add tracing info. */ + + /* CoInterpreter>>#resume:preemptedYieldingIf:from: */ +static sqInt NoDbgRegParms +resumepreemptedYieldingIffrom(sqInt aProcess, sqInt yieldImplicitly, sqInt sourceCode) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activePriority; + sqInt activeProc; + sqInt newPriority; + sqInt objOop; + sqInt objOop1; + sqInt oop; + sqInt oop1; + + /* begin fetchPointer:ofObject: */ + objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + activeProc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((activeProc + BaseHeaderSize) + (((int)((usqInt)(PriorityIndex) << (shiftForWord()))))); + assert((oop & 1)); + activePriority = (oop >> 1); + /* begin quickFetchInteger:ofObject: */ + oop1 = longAt((aProcess + BaseHeaderSize) + (((int)((usqInt)(PriorityIndex) << (shiftForWord()))))); + assert((oop1 & 1)); + newPriority = (oop1 >> 1); + if (newPriority <= activePriority) { + putToSleepyieldingIf(aProcess, 1); + return 0; + } + putToSleepyieldingIf(activeProc, yieldImplicitly); + transferTofrom(aProcess, sourceCode); + return 1; +} + + +/* Return to the current frame, either by entering machine code, or + longjmp-ing back to the + interpreter or simply returning, depending on where we are. To know + whether to return or + enter machine code we have to know from whence we came. We could have come + from the interpreter, either directly or via a machine code primitive. We + could have come from + machine code. The instructionPointer tells us where from. If it is above + startOfMemory we're + in the interpreter. If it is below, then we are in machine-code unless it + is ceReturnToInterpreterPC, + in which case we're in a machine-code primitive called from the + interpreter. */ + + /* CoInterpreter>>#returnToExecutive:postContextSwitch: */ +static sqInt NoDbgRegParms +returnToExecutivepostContextSwitch(sqInt inInterpreter, sqInt switchedContext) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aMethodObj; + CogBlockMethod *cogMethod; + sqInt fullyInInterpreter; + sqInt retValue; + char *sp; + char *sp1; + sqInt top; + + assertCStackWellAligned(); + if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) { + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + if (switchedContext) { + /* begin mframeCogMethod: */ + cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask)); + assert((GIV(instructionPointer) > (minCogMethodAddress())) + && (GIV(instructionPointer) < (maxCogMethodAddress()))); + if ((GIV(instructionPointer) != ((((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset)))) + && (isSendReturnPC(GIV(instructionPointer)))) { + assert(addressCouldBeOop(stackTop())); + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + retValue = top; + } + else { + /* begin mframeReceiver: */ + retValue = longAt(GIV(framePointer) + FoxMFReceiver); + } + } + else { + /* begin mframeReceiver: */ + retValue = longAt(GIV(framePointer) + FoxMFReceiver); + } + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), retValue); + GIV(stackPointer) = sp1; + ceEnterCogCodePopReceiverReg(); + } + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + fullyInInterpreter = inInterpreter; + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = ((usqInt)(longAt(GIV(framePointer) + FoxIFSavedIP))); + fullyInInterpreter = 0; + } + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__); + if (!fullyInInterpreter) { + siglongjmp(reenterInterpreter, ReturnToInterpreter); + } + return null; +} + + +/* We have made a context switch, either when interpreting or from machine + code. Effectively return to the current frame, either by entering machine + code, or + longjmp-ing back to the interpreter or simply returning, depending on + where we are. */ + + /* CoInterpreter>>#return:toExecutive: */ +static sqInt NoDbgRegParms +returntoExecutive(sqInt returnValue, sqInt inInterpreter) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aMethodObj; + char *sp; + char *sp1; + char *sp2; + + assertCStackWellAligned(); + if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) { + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__); + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp1; + ceEnterCogCodePopReceiverReg(); + } + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), returnValue); + GIV(stackPointer) = sp2; + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__); + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + /* begin iframeSavedIP: */ + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + if (inInterpreter) { + return null; + } + siglongjmp(reenterInterpreter, ReturnToInterpreter); + return null; +} + + +/* Rewrite an existing entry in the method cache with a new primitive + function address. + Used by primitiveExternalCall to make direct calls to found external + prims, or quickly + fail not found external prims. + Override to do the same to the machine code call. If methodObj has a + cogged dual + rewrite the primitive call in it to call localPrimAddress. Used to update + calls through + primitiveExternalCall to directly call the target function or to revert to + calling primitiveExternalCall after a flush. */ + + /* CoInterpreter>>#rewriteMethodCacheEntryForExternalPrimitiveToFunction: */ +static void NoDbgRegParms +rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void)) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (methodHasCogMethod(GIV(newMethod))) { + rewritePrimInvocationInto(cogMethodOf(GIV(newMethod)), (localPrimAddress == 0 + ? ((void (*)(void)) primitiveFail) + : localPrimAddress)); + } + if ((GIV(methodCache)[GIV(lastMethodCacheProbeWrite) + MethodCacheMethod]) == GIV(newMethod)) { + GIV(methodCache)[GIV(lastMethodCacheProbeWrite) + MethodCachePrimFunction] = (((sqIntptr_t) localPrimAddress)); + } +} + + +/* Answer if there is room to push n arguments onto the current stack. We + assume this is called by primitives that check there is enough room in any + new context, and + won't actually push the arguments in the current context if the primitive + fails. With + this assumption it is safe to answer based on the maximum argument count, + /not/ the ammount of space in the current frame were it converted to a + context.. */ + + /* CoInterpreter>>#roomToPushNArgs: */ +static sqInt NoDbgRegParms +roomToPushNArgs(sqInt n) +{ + + /* simpler code that simply insists args are <= max arg count */ + return n <= (LargeContextSlots - CtxtTempFrameStart); + +} + + /* CoInterpreter>>#saneFunctionPointerForFailureOfPrimIndex: */ +static sqInt NoDbgRegParms +saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (GIV(instructionPointer) >= (((usqInt)GIV(nilObj))), + primitiveFunctionPointer == (functionPointerForinClass(primIndex, GIV(nilObj)))); +} + + +/* Send the calllback message to Alien class with the supplied arg(s). Use + either the + 1 arg invokeCallbackContext: or the 4 arg + invokeCallback:stack:registers:jmpbuf: message, depending on what selector + is installed in the specialObjectsArray. + Note that if invoking the legacy invokeCallback:stack:registers:jmpbuf: we + pass the + vmCallbackContext as the jmpbuf argument (see + reestablishContextPriorToCallback:). The arguments are raw C addresses and + are converted to integer objects on the way. */ +/* Override to log and check stack alignment. Since this is an implicit send + we need to + log it explicitly. The return side is done via a primitive so that gets + logged normally. */ + + /* CoInterpreter>>#sendInvokeCallbackContext: */ +EXPORT(sqInt) +sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activateCogMethod; + usqInt aMethodObj; + sqInt aSelectorOrImmediate; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt errorCode; + sqInt i; + usqInt initialIP; + sqInt methodHeader; + sqInt methodHeader1; + sqInt numArgs; + sqInt numTemps; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object2; + sqInt object3; + sqInt object4; + sqInt object5; + sqInt rcvr; + sqInt selector; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp2; + char *sp21; + char *sp3; + char *sp31; + char *sp4; + char *sp41; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt table; + + assertCStackWellAligned(); + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + /* begin fetchClassTagOfNonImm: */ + obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + /* begin classIndexOf: */ + classTag = (longAt(obj)) & (classIndexMask()); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { + if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { + return 0; + } + } + if (primitiveFunctionPointer != 0) { + return 0; + } + /* begin saveCStackStateForCallbackContext: */ + (vmCallbackContext->savedCStackPointer = getCStackPointer()); + (vmCallbackContext->savedCFramePointer = getCFramePointer()); + memcpy(((void *)((vmCallbackContext->savedReenterInterpreter))), reenterInterpreter, sizeof(jmp_buf)); + /* begin push: */ + object3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp3; + if ((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) { + /* begin push: */ + object = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->thunkp)))); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + object1 = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->stackp)))); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp1; + /* begin push: */ + object2 = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->intregargsp)))); + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp2; + } + /* begin push: */ + object4 = positiveMachineIntegerFor(((usqInt)vmCallbackContext)); + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); + GIV(stackPointer) = sp4; + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + /* begin justActivateNewMethod */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (activateCogMethod = (methodHeader & 1) == 0))) { + cogMethod = ((CogMethod *) methodHeader); + methodHeader = (cogMethod->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; + + /* could new rcvr be set at point of send? */ + rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); + assert(!(isOopForwarded(rcvr))); + if (activateCogMethod + && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp7; + /* begin push: */ + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp8; + GIV(framePointer) = GIV(stackPointer); + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + if (activateCogMethod) { + /* begin push: */ + object5 = ((usqInt)cogMethod); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); + GIV(stackPointer) = sp10; + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp11; + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + } + else { + /* begin push: */ + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp21; + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp31; + /* begin push: */ + object11 = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); + longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp41; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp5; + GIV(instructionPointer) = initialIP - 1; + } + /* begin push: */ + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp9; + for (i = (numArgs + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp6; + } + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + initialIP += 3; + if (!activateCogMethod) { + GIV(instructionPointer) = initialIP; + } + if (GIV(primFailCode) != 0) { + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { + maybeFlagMethodAsInterpreted(GIV(newMethod)); + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + /* begin checkForStackOverflow */ + if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { + handleStackOverflow(); + } + /* begin enterSmalltalkExecutiveFromCallback */ + enterSmalltalkExecutive(); + return 1; +} + + +/* Send the 4 argument callback message + invokeCallback:stack:registers:jmpbuf: to Alien class with the supplied + args. The arguments are raw C addresses + and are converted to integer objects on the way. */ +/* Override to log and check stack alignment. Since this is an implicit send + we need to + log it explicitly. The return side is done via a primitive so that gets + logged normally. */ + + /* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */ +EXPORT(sqInt) +sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activateCogMethod; + usqInt aMethodObj; + sqInt aSelectorOrImmediate; + sqInt classTag; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt errorCode; + sqInt i; + usqInt initialIP; + sqInt methodHeader; + sqInt methodHeader1; + sqInt numArgs; + sqInt numTemps; + sqInt obj; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object2; + sqInt object3; + sqInt object4; + sqInt object5; + sqInt rcvr; + sqInt selector; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp2; + char *sp21; + char *sp3; + char *sp31; + char *sp4; + char *sp41; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt table; + + assertCStackWellAligned(); + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate; + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + /* begin fetchClassTagOfNonImm: */ + obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + /* begin classIndexOf: */ + classTag = (longAt(obj)) & (classIndexMask()); + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorInvokeCallback) << (shiftForWord()))))); + GIV(argumentCount) = 4; + if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) { + if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) { + return 0; + } + } + if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) + && (primitiveFunctionPointer == 0))) { + return 0; + } + /* begin push: */ + object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassAlien) << (shiftForWord()))))); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + /* begin push: */ + object1 = positiveMachineIntegerFor(thunkPtr); + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp1; + /* begin push: */ + object2 = positiveMachineIntegerFor(stackPtr); + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp2; + /* begin push: */ + object3 = positiveMachineIntegerFor(regsPtr); + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp3; + /* begin push: */ + object4 = positiveMachineIntegerFor(jmpBufPtr); + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4); + GIV(stackPointer) = sp4; + /* begin ifAppropriateCompileToNativeCode:selector: */ + aMethodObj = GIV(newMethod); + selector = GIV(messageSelector); + /* begin fetchPointer:ofObject: */ + methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader1 & 1)) + || (((((usqInt)methodHeader1)) < (startOfMemory())) + && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))), + (methodHeader1 & 1) == 0)) { + + /* makeBaseFrame: can create cog methods with nil selectors. */ + cogMethod1 = ((CogMethod *) methodHeader1); + if (((cogMethod1->selector)) == GIV(nilObj)) { + setSelectorOfto(cogMethod1, selector); + } + } + else { + if (((assert((methodHeader1 & 1)), + ((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + cogselector(aMethodObj, selector); + } + else { + maybeFlagMethodAsInterpreted(aMethodObj); + } + } + /* begin justActivateNewMethod */ + methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (activateCogMethod = (methodHeader & 1) == 0))) { + cogMethod = ((CogMethod *) methodHeader); + methodHeader = (cogMethod->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15; + + /* could new rcvr be set at point of send? */ + rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord)); + assert(!(isOopForwarded(rcvr))); + if (activateCogMethod + && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + GIV(instructionPointer) = ceReturnToInterpreterPC(); + } + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp7; + /* begin push: */ + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp8; + GIV(framePointer) = GIV(stackPointer); + initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize; + if (activateCogMethod) { + /* begin push: */ + object5 = ((usqInt)cogMethod); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object5); + GIV(stackPointer) = sp10; + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp11; + GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset)); + } + else { + /* begin push: */ + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp21; + /* begin setMethod:methodHeader: */ + GIV(method) = GIV(newMethod); + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp31; + /* begin push: */ + object11 = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0)); + longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp41; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp5; + GIV(instructionPointer) = initialIP - 1; + } + /* begin push: */ + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr); + GIV(stackPointer) = sp9; + for (i = (numArgs + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp6; + } + if ((/* begin alternateHeaderHasPrimitiveFlag: */ + methodHeader & AlternateHeaderHasPrimFlag)) { + + /* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts + with a long store temp. Strictly no need to skip the store because it's effectively a noop. */ + initialIP += 3; + if (!activateCogMethod) { + GIV(instructionPointer) = initialIP; + } + if (GIV(primFailCode) != 0) { + if ((byteAt(initialIP + 1)) == (((((int) methodHeader)) < 0 + ? AltLongStoreBytecode + : LongStoreBytecode))) { + /* begin getErrorObjectFromPrimFailCode */ + if (GIV(primFailCode) > 0) { + /* begin splObj: */ + table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(PrimErrTableIndex) << (shiftForWord()))))); + if (GIV(primFailCode) <= (numSlotsOf(table))) { + /* begin fetchPointer:ofObject: */ + errorCode = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))); + goto l4; + } + } + errorCode = (((usqInt)GIV(primFailCode) << 1) | 1); + l4: /* end getErrorObjectFromPrimFailCode */; + longAtPointerput(GIV(stackPointer), errorCode); + } + GIV(primFailCode) = 0; + } + } + if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { + maybeFlagMethodAsInterpreted(GIV(newMethod)); + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + /* begin checkForStackOverflow */ + if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) { + handleStackOverflow(); + } + /* begin enterSmalltalkExecutiveFromCallback */ + enterSmalltalkExecutive(); + return 1; +} + + /* CoInterpreter>>#shadowCallStackAddress */ +usqInt +shadowCallStackAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(shadowCallStackPointer)))); +} + + +/* See StackInterpreter class>>initializeFrameIndices */ + + /* CoInterpreter>>#shadowCallStackPointerIn: */ +static char* NoDbgRegParms +shadowCallStackPointerIn(char *theFP) +{ + return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? pointerAtPointer((theFP + FoxMFReceiver) - (BytesPerWord * 5)) + : pointerAtPointer((theFP + FoxIFReceiver) - (BytesPerWord * 5))); +} + + /* CoInterpreter>>#shortPrintFrame: */ +static sqInt NoDbgRegParms +shortPrintFrame(char *theFP) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aByte; + sqInt frameNumArgs; + sqInt frameNumArgs1; + sqInt mthd; + sqInt rcvr; + + if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0) + && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) { + print("invalid frame pointer"); + /* begin cr */ + printf("\n"); + return null; + } + rcvr = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? longAt(theFP + FoxMFReceiver) + : longAt(theFP + FoxIFReceiver)); + mthd = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeHomeMethod(theFP))->methodObject) + : longAt(theFP + FoxMethod)); + /* begin printHexPtr: */ + printHex(oopForPointer(theFP)); + /* begin space */ + putchar(' '); + /* begin printChar: */ + aByte = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? 'M' + : 'I'); + putchar(aByte); + /* begin space */ + putchar(' '); + printActivationNameForreceiverisBlockfirstTemporary(mthd, rcvr, ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0), ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? (0 < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs))) + ? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord)) + : longAt(((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord))) + : (/* begin itemporary:in: */ + (0 < ((frameNumArgs1 = byteAt((theFP + FoxIFrameFlags) + 1))) + ? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs1) * BytesPerWord)) + : longAt(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1) * BytesPerWord)))))); + /* begin space */ + putchar(' '); + shortPrintOop(rcvr); + return 0; +} + + +/* Answer a full 32 bit integer object for the given integer value. + N.B. Returning in each arm separately enables Slang inlining. + /Don't/ return the ifTrue:ifFalse: unless Slang inlining of conditionals + is fixed. */ + + /* CoInterpreter>>#signed32BitIntegerFor: */ +sqInt +signed32BitIntegerFor(sqInt integerValue) +{ + if ((((sqInt)((((usqInt)integerValue)) ^ ((((usqInt)integerValue)) << 1)))) >= 0) { + return (((usqInt)integerValue << 1) | 1); + } + return noInlineSigned32BitIntegerGutsFor(integerValue); + +} + + +/* Convert the given object into an integer value. + The object may be either a SmallInteger or a four-byte LargeInteger. */ + + /* CoInterpreter>>#signed32BitValueOf: */ +int +signed32BitValueOf(sqInt oop) +{ + if ((oop & 1)) { + return (oop >> 1); + } + return noInlineSigned32BitValueGutsOf(oop); + +} + + +/* Answer a Large Integer object for the given integer value. N.B. will *not* + cause a GC. */ + + /* CoInterpreter>>#signed64BitIntegerFor: */ +sqInt +signed64BitIntegerFor(sqLong integerValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt highWord; + sqInt largeClass; + usqLong magnitude; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt numSlots; + sqInt objFormat; + sqInt sz; + + if (integerValue < 0) { + if (integerValue >= (MinSmallInteger)) { + return (((usqInt)(((sqInt)integerValue)) << 1) | 1); + } + largeClass = ClassLargeNegativeIntegerCompactIndex; + magnitude = 0 - (((usqLong) integerValue)); + } + else { + if (integerValue <= (MaxSmallInteger)) { + return (((usqInt)(((sqInt)integerValue)) << 1) | 1); + } + largeClass = ClassLargePositiveIntegerCompactIndex; + magnitude = integerValue; + } + if (((highWord = magnitude >> 32)) == 0) { + sz = 4; + } + else { + sz = 5; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + } + } + } + } + + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + numSlots = (sz + 3) / BytesPerOop; + assert((numSlots >= 0) + && (largeClass != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(largeClass)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l1; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; +l1: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ + long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude)); + + return newLargeInteger; +} + + +/* Convert the given object into an integer value. + The object may be either a positive SmallInteger or a eight-byte + LargeInteger. + */ + + /* CoInterpreter>>#signed64BitValueOf: */ +sqLong +signed64BitValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt ccIndex1; + sqInt fmt; + usqLong magnitude; + sqInt negative; + sqInt ok; + usqInt sz; + sqLong value; + + if ((oop & 1)) { + return ((sqLong) ((oop >> 1))); + } + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l4; + +l4: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (ok) { + negative = 0; + } + else { + negative = 1; + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargeNegativeIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7); + if (sz > (sizeof(sqLong))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (sz > 4) { + magnitude = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3)))); + } + else { + + /* ] */ + magnitude = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + } + if ((negative + ? magnitude > 0x8000000000000000ULL + : magnitude >= 0x8000000000000000ULL)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (negative) { + value = 0 - magnitude; + } + else { + value = magnitude; + } + return value; +} + + +/* Invoke a normal (non-quick) primitive. + Called under the assumption that primFunctionPointer has been preloaded. */ +/* Invoke a normal (non-quick) primitive. + Called under the assumption that primFunctionPointer has been preloaded. + Override to log primitive. */ + + /* CoInterpreter>>#slowPrimitiveResponse */ +static sqInt +slowPrimitiveResponse(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt nArgs; + char *savedFramePointer; + char *savedStackPointer; + + nArgs = 0; + savedFramePointer = 0; + savedStackPointer = 0; + if (recordPrimTrace()) { + /* begin fastLogPrim: */ + GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector); + primTraceLogIndex(GIV(primTraceLogIndex) + 1); + } + assert(!(isOopForwarded(stackValue(GIV(argumentCount))))); + assert((remapBufferCount()) == 0); + nArgs = GIV(argumentCount); + savedStackPointer = GIV(stackPointer); + savedFramePointer = GIV(framePointer); + + /* begin initPrimCall */ + GIV(primFailCode) = 0; + dispatchFunctionPointer(primitiveFunctionPointer); + assert(maybeLeakCheckExternalPrimCall(GIV(newMethod))); + /* begin maybeRetryPrimitiveOnFailure */ + if (GIV(primFailCode)) { + retryPrimitiveOnFailure(); + } + /* begin maybeFailForLastObjectOverwrite */ + if (checkAllocFiller) { + if (((freeStart()) < GIV(scavengeThreshold)) + && ((longAt(freeStart())) != (freeStart()))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrWritePastObject; + } + } + if ((!GIV(primFailCode)) + && ((GIV(framePointer) == savedFramePointer) + && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) { + + /* Don't fail if primitive has done something radical, e.g. perform: */ + if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) { + flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context"); + failUnbalancedPrimitive(); + GIV(stackPointer) = savedStackPointer; + } + } + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + return !GIV(primFailCode); +} + + +/* */ + + /* CoInterpreter>>#specialSelectorNumArgs: */ +sqInt +specialSelectorNumArgs(sqInt index) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((fetchPointerofObject((index * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 1); +} + + /* CoInterpreter>>#stackLimitAddress */ +usqInt +stackLimitAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (usqInt)&GIV(stackLimit); +} + + +/* Answer the amount of slots needed to fit a new frame at the point the + stack limit is checked. A frame looks like this at the point the stack + limit is checked: + stacked receiver/closure + arg0 + ... + argN + caller's method ip/base frame's sender context + fp-> saved fp + method + context (uninitialized?) + method header fields (interpreter only) + saved method ip (uninitialized?; interpreter only) + receiver + first temp + ... + sp-> Nth temp + So the amount of headroom is + the maximum number of arguments + 1 (for stacked receiver and arguments) + + the frame size + + the max number of temps. + Since a method's number of temps includes its arguments the actual offset + is: */ + + /* CoInterpreter>>#stackLimitOffset */ +static sqInt +stackLimitOffset(void) +{ + return (IFrameSlots + 64) * BytesPerWord; +} + + +/* Return a minimum amount of headroom for each stack page (in bytes). + In the interpreter we don't actually need any headroom. In a JIT the stack + has to have room for interrupt handlers which will run on the stack. + Defer to the platform for this one. */ + + /* CoInterpreter>>#stackPageHeadroom */ +static sqInt +stackPageHeadroom(void) +{ + return osCogStackPageHeadroom(); +} + + /* CoInterpreter>>#stackPointerAddress */ +usqInt +stackPointerAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return ((usqInt)((&GIV(stackPointer)))); +} + + +/* Zero-relative version of CompiledMethod>>startpc. */ + + /* CoInterpreter>>#startPCOfMethodHeader: */ +sqInt +startPCOfMethodHeader(sqInt aCompiledMethodHeader) +{ + return (((assert((aCompiledMethodHeader & 1)), +/* begin literalCountOfAlternateHeader: */ +((aCompiledMethodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop; +} + + +/* Answer the startPC of lit if it is a (clean) block in aMethodObj, + otherwise answer nil. + */ + + /* CoInterpreter>>#startPCOrNilOfLiteral:in: */ +sqInt +startPCOrNilOfLiteralin(sqInt lit, sqInt aMethodObj) +{ + sqInt oop; + sqInt outerContext; + + if (!(((lit & (tagMask())) == 0) + && ((((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == (indexablePointersFormat())) + && ((numSlotsOf(lit)) >= ClosureFirstCopiedValueIndex)))) { + return null; + } + outerContext = longAt((lit + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (!(((outerContext & (tagMask())) == 0) + && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { + return null; + } + if (aMethodObj != (longAt((outerContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))))) { + return null; + } + /* begin quickFetchInteger:ofObject: */ + oop = longAt((lit + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))); + assert((oop & 1)); + return (oop >> 1); +} + + +/* Signal the given semaphore from within the interpreter. + Answer if the current process was preempted. + Override to add tracing info. */ + + /* CoInterpreter>>#synchronousSignal: */ +static sqInt NoDbgRegParms +synchronousSignal(sqInt aSemaphore) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ctxt; + sqInt excessSignals; + sqInt proc; + sqInt referent; + + if ((assert(!(isForwarded(aSemaphore))), + (longAt((aSemaphore + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) { + + /* no process is waiting on this semaphore */ + excessSignals = fetchIntegerofObject(ExcessSignalsIndex, aSemaphore); + /* begin storeInteger:ofObject:withValue: */ + if ((((sqInt)((((usqInt)(excessSignals + 1))) ^ ((((usqInt)(excessSignals + 1))) << 1)))) >= 0) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(aSemaphore))); + longAtput((aSemaphore + BaseHeaderSize) + (((int)((usqInt)(ExcessSignalsIndex) << (shiftForWord())))), (((usqInt)(excessSignals + 1) << 1) | 1)); + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + return 0; + } + /* begin ensureSemaphoreUnforwardedThroughContext: */ + proc = longAt((aSemaphore + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord()))))); + if (((longAt(proc)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + followForwardedObjectFieldstoDepth(aSemaphore, 1); + proc = longAt((aSemaphore + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord()))))); + } + assert(!((isForwarded(proc)))); + ctxt = longAt((proc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord()))))); + if (((longAt(ctxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(ctxt)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((ctxt + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + ctxt = referent; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(proc))); + if ((assert(isNonImmediate(proc)), + oopisGreaterThanOrEqualTo(proc, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((ctxt & (tagMask())) == 0) + && (oopisLessThan(ctxt, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(proc))) >> (rememberedBitShift())) & 1) != 0)) { + remember(proc); + } + } + } + longAtput((proc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), ctxt); + } + return resumepreemptedYieldingIffrom(removeFirstLinkOfList(aSemaphore), GIV(preemptionYields), CSSignal); +} + + +/* Handle the cannot return response for a base frame return to an invalid + context. Build a new base frame for the context in the cannot resume state + ready for the + send of cannotReturn:. + + Since we have returned from the base frame of the page the context is + effectively widowed. + But its sender needs to be contextToReturnTo, and its pc needs to be the + HasBeenReturnedFromMCPC marker. So bereave it (as a side-effect of + isWidowedContext:), assign contextToReturnTo to + sender, and rebuild its frame, which will have the ceCannotResumePC as its + pc. Finally push + returnValue and set instructionPointer to ceCannotResumePC in preparation + for the send. */ + + /* CoInterpreter>>#tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFrom:to:returnValue: */ +static void NoDbgRegParms +tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(sqInt contextToReturnFrom, sqInt contextToReturnTo, sqInt returnValue) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + StackPage *newPage; + + assert((GIV(stackPage) != 0) + && (isFree(GIV(stackPage)))); + isWidowedContext(contextToReturnFrom); + assert(!(isMarriedOrWidowedContext(contextToReturnFrom))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(contextToReturnFrom))); + if ((assert(isNonImmediate(contextToReturnFrom)), + oopisGreaterThanOrEqualTo(contextToReturnFrom, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((contextToReturnTo & (tagMask())) == 0) + && (oopisLessThan(contextToReturnTo, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(contextToReturnFrom))) >> (rememberedBitShift())) & 1) != 0)) { + remember(contextToReturnFrom); + } + } + } + longAtput((contextToReturnFrom + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), contextToReturnTo); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(contextToReturnFrom))); + if ((assert(isNonImmediate(contextToReturnFrom)), + oopisGreaterThanOrEqualTo(contextToReturnFrom, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((HasBeenReturnedFromMCPCOop & (tagMask())) == 0) + && (oopisLessThan(HasBeenReturnedFromMCPCOop, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(contextToReturnFrom))) >> (rememberedBitShift())) & 1) != 0)) { + remember(contextToReturnFrom); + } + } + } + longAtput((contextToReturnFrom + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), HasBeenReturnedFromMCPCOop); + GIV(instructionPointer) = 0; + newPage = makeBaseFrameFor(contextToReturnFrom); + assert(GIV(stackPage) == newPage); + /* begin setStackPageAndLimit: */ + assert(newPage != 0); + GIV(stackPage) = newPage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(newPage); + GIV(framePointer) = (GIV(stackPage)->headFP); + GIV(stackPointer) = (GIV(stackPage)->headSP); + assert((stackTop()) == (ceCannotResumePC())); + longAtPointerput(GIV(stackPointer), returnValue); + GIV(instructionPointer) = ceCannotResumePC(); +} + + +/* Record a process to be awoken on the next interpreter cycle. + Reimplement to record the source of the switch for debugging, + and to cope with possible code compaction in makeBaseFrameFor:. */ + + /* CoInterpreter>>#transferTo:from: */ +static void NoDbgRegParms +transferTofrom(sqInt newProc, sqInt sourceCode) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + sqInt aMethodObj; + StackPage *lastUsedPage; + StackPage *lruOrFree; + sqInt newContext; + StackPage *newPage; + sqInt objOop; + sqInt oldProc; + sqInt sched; + sqInt senderOop; + char *sp; + char *theFP; + char *theFrame; + StackPage *thePage; + char *theSP; + sqInt top; + sqInt valuePointer; + + GIV(statProcessSwitch) += 1; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + GIV(instructionPointer) = 0; + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + sched = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + oldProc = longAt((sched + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + /* begin recordContextSwitchFrom:in: */ + if (recordEventTrace()) { + /* begin recordTrace:thing:source: */ + GIV(traceLog)[GIV(traceLogIndex)] = TraceContextSwitch; + GIV(traceLog)[GIV(traceLogIndex) + 1] = oldProc; + GIV(traceLog)[GIV(traceLogIndex) + 2] = sourceCode; + GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize; + } + /* begin ensureFrameIsMarried:SP: */ + theFP = GIV(framePointer); + theSP = GIV(stackPointer) + BytesPerWord; + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + activeContext = longAt(theFP + FoxThisContext); + goto l4; + } + activeContext = marryFrameSP(theFP, theSP); +l4: /* end ensureFrameIsMarried:SP: */; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(oldProc))); + if ((assert(isNonImmediate(oldProc)), + oopisGreaterThanOrEqualTo(oldProc, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((activeContext & (tagMask())) == 0) + && (oopisLessThan(activeContext, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(oldProc))) >> (rememberedBitShift())) & 1) != 0)) { + remember(oldProc); + } + } + } + longAtput((oldProc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), activeContext); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(sched))); + if ((assert(isNonImmediate(sched)), + oopisGreaterThanOrEqualTo(sched, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((newProc & (tagMask())) == 0) + && (oopisLessThan(newProc, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(sched))) >> (rememberedBitShift())) & 1) != 0)) { + remember(sched); + } + } + } + longAtput((sched + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord())))), newProc); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(newProc))); + longAtput((newProc + BaseHeaderSize) + (((int)((usqInt)(MyListIndex) << (shiftForWord())))), GIV(nilObj)); + /* begin externalSetStackPageAndPointersForSuspendedContextOfProcess: */ + newContext = longAt((newProc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord()))))); + assert(isContext(newContext)); + if (((longAt((newContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + assert(checkIsStillMarriedContextcurrentFP(newContext, GIV(framePointer))); + } + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(newProc))); + longAtput((newProc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), valuePointer); + if ((((longAt((newContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(newContext)))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((newContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFrame = pointerForOop(senderOop - 1); + + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (theFrame != ((thePage->headFP))) { + + /* explicit assignment of suspendedContext can cause switch to interior frame. */ + /* begin newStackPage */ + lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage); + if (((lruOrFree->baseFP)) == 0) { + newPage = lruOrFree; + goto l11; + } + divorceFramesIn(lruOrFree); + newPage = lruOrFree; + l11: /* end newStackPage */; + moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage); + /* begin markStackPageLeastMostRecentlyUsed: */ + assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage))); + lastUsedPage = (newPage->nextPage); + while (((lastUsedPage->baseFP)) == 0) { + lastUsedPage = (lastUsedPage->nextPage); + } + if (((lastUsedPage->nextPage)) == newPage) { + goto l14; + } + (((newPage->prevPage))->nextPage = (newPage->nextPage)); + (((newPage->nextPage))->prevPage = (newPage->prevPage)); + (((lastUsedPage->prevPage))->nextPage = newPage); + (newPage->prevPage = (lastUsedPage->prevPage)); + (newPage->nextPage = lastUsedPage); + (lastUsedPage->prevPage = newPage); + assert(pageListIsWellFormed()); + l14: /* end markStackPageLeastMostRecentlyUsed: */; + } + assert(((thePage->headFP)) == theFrame); + } + else { + thePage = makeBaseFrameFor(newContext); + theFrame = (thePage->baseFP); + } + /* begin setStackPageAndLimit: */ + assert(thePage != 0); + GIV(stackPage) = thePage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(thePage); + GIV(stackPointer) = (thePage->headSP); + GIV(framePointer) = (thePage->headFP); + if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) { + /* begin setMethod: */ + aMethodObj = longAt(GIV(framePointer) + FoxMethod); + assert((((usqInt)aMethodObj)) >= (startOfMemory())); + GIV(method) = aMethodObj; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); +} + + /* CoInterpreter>>#updateStackZoneReferencesToCompiledCodePreCompaction */ +void +updateStackZoneReferencesToCompiledCodePreCompaction(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *callerFP; + sqInt i; + sqInt theFlags; + char *theFP; + usqInt theIP; + char *theIPPtr; + CogMethod *theMethod; + sqInt theMethodField; + StackPage *thePage; + + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(isFree(thePage))) { + theIPPtr = (thePage->headSP); + theFP = (thePage->headFP); + while (1) { + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + /* begin frameMethodField: */ + theMethodField = longAt(theFP + FoxMethod); + theFlags = theMethodField & MFMethodFlagsMask; + theMethod = ((CogMethod *) (theMethodField - theFlags)); + if (((theMethod->cmType)) == CMBlock) { + theMethod = (((((CogBlockMethod *) (theMethodField - theFlags)))->cpicHasMNUCaseOrCMIsFullBlock) + ? ((CogMethod *) (((CogBlockMethod *) (theMethodField - theFlags)))) + : ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (theMethodField - theFlags))))) - (((((CogBlockMethod *) (theMethodField - theFlags)))->homeOffset))))); + } + theIP = ((usqInt)(longAt(theIPPtr))); + if ((theIP != (ceCannotResumePC())) + && (asserta((theIP >= (((usqInt)theMethod))) + && (theIP < ((((usqInt)theMethod)) + ((theMethod->blockSize))))))) { + longAtput(theIPPtr, theIP + ((theMethod->objectHeader))); + } + longAtput(theFP + FoxMethod, theMethodField + ((theMethod->objectHeader))); + } + if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break; + theIPPtr = theFP + FoxCallerSavedIP; + theFP = callerFP; + } + } + } +} + + +/* Update the frame's spouse context with the frame's current state except + for the + sender and instruction pointer, which are used to mark the context as + married. + */ + + /* CoInterpreter>>#updateStateOfSpouseContextForFrame:WithSP: */ +static void NoDbgRegParms +updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *argsPointer; + sqInt i; + char *pointer; + sqInt tempIndex; + sqInt theContext; + + assert(frameHasContext(theFP)); + theContext = longAt(theFP + FoxThisContext); + assert(isContext(theContext)); + assert((frameReceiver(theFP)) == (noFixupFollowFieldofObject(ReceiverIndex, theContext))); + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + tempIndex = ((mframeCogMethod(theFP))->cmNumArgs); + pointer = (theFP + FoxMFReceiver) - BytesPerWord; + } + else { + /* begin iframeNumArgs: */ + tempIndex = byteAt((theFP + FoxIFrameFlags) + 1); + pointer = (theFP + FoxIFReceiver) - BytesPerWord; + } + argsPointer = theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(tempIndex) << (shiftForWord()))))); + for (i = 1; i <= tempIndex; i += 1) { + argsPointer -= BytesPerWord; + assert(addressCouldBeOop(longAt(argsPointer))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(theContext))); + if ((assert(isNonImmediate(theContext)), + oopisGreaterThanOrEqualTo(theContext, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAt(argsPointer)) & (tagMask())) == 0) + && (oopisLessThan(longAt(argsPointer), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(theContext))) >> (rememberedBitShift())) & 1) != 0)) { + remember(theContext); + } + } + } + longAtput((theContext + BaseHeaderSize) + (((int)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))), longAt(argsPointer)); + } + while (pointer >= theSP) { + assert(addressCouldBeOop(longAt(pointer))); + tempIndex += 1; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(theContext))); + if ((assert(isNonImmediate(theContext)), + oopisGreaterThanOrEqualTo(theContext, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if ((((longAt(pointer)) & (tagMask())) == 0) + && (oopisLessThan(longAt(pointer), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(theContext))) >> (rememberedBitShift())) & 1) != 0)) { + remember(theContext); + } + } + } + longAtput((theContext + BaseHeaderSize) + (((int)((usqInt)((ReceiverIndex + tempIndex)) << (shiftForWord())))), longAt(pointer)); + pointer -= BytesPerWord; + } + assert((ReceiverIndex + tempIndex) < (lengthOf(theContext))); + assert(!(isOopForwarded(theContext))); + longAtput((theContext + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord())))), (((usqInt)tempIndex << 1) | 1)); + +} + + +/* Note that we accept anInstrPointer pointing to a callPrimitiveBytecode + at the start of a method that contains a primitive. This because methods + like Context(Part)>>reset have to be updated to skip the callPrimtiive + bytecode otherwise. */ +/* -1 for pre-increment in fetchNextBytecode */ + + /* CoInterpreter>>#validInstructionPointer:inMethod:framePointer: */ +sqInt +validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp) +{ + CogMethod *cogMethod; + sqInt header; + usqInt theInstrPointer; + + if (instrPointer == (ceCannotResumePC())) { + return (((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory()); + } + if (instrPointer == (ceReturnToInterpreterPC())) { + if ((((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory())) { + return 0; + } + /* begin iframeSavedIP: */ + theInstrPointer = longAt(fp + FoxIFSavedIP); + } + else { + theInstrPointer = instrPointer; + header = longAt((aMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if (((assert(((header & 1)) + || (((((usqInt)header)) < (startOfMemory())) + && ((((usqInt)header)) >= (minCogMethodAddress())))), + (header & 1) == 0)) + && (theInstrPointer < (startOfMemory()))) { + cogMethod = ((CogMethod *) header); + return (theInstrPointer >= (header + (sizeof(CogMethod)))) + && (theInstrPointer < (header + ((cogMethod->blockSize)))); + } + + } + return (theInstrPointer >= (((aMethod + (lastPointerOf(aMethod))) + BytesPerOop) - 1)) + && (theInstrPointer < (((aMethod + (numBytesOfBytes(aMethod))) + BaseHeaderSize) - 1)); +} + + +/* Check that the base frame in the stack page has a valid sender and saved + context. + */ + + /* CoInterpreter>>#validStackPageBaseFrame: */ +static sqInt NoDbgRegParms +validStackPageBaseFrame(StackPage *aPage) +{ + sqInt savedThisContext; + sqInt senderContextOrNil; + + senderContextOrNil = longAt((aPage->baseAddress)); + savedThisContext = longAt(((aPage->baseAddress)) - BytesPerWord); + if (!(asserta(((((aPage->baseFP)) + (frameStackedReceiverOffset((aPage->baseFP)))) + (2 * BytesPerWord)) == ((aPage->baseAddress))))) { + return 0; + } + if (!(asserta(addressCouldBeObj(senderContextOrNil)))) { + return 0; + } + if (!(asserta(addressCouldBeObj(savedThisContext)))) { + return 0; + } + if (!(asserta((senderContextOrNil == (nilObject())) + || (isContext(senderContextOrNil))))) { + return 0; + } + if (!(asserta(isContext(savedThisContext)))) { + return 0; + } + if (!(asserta((frameCallerContext((aPage->baseFP))) == senderContextOrNil))) { + return 0; + } + if (!(asserta((frameContext((aPage->baseFP))) == savedThisContext))) { + return 0; + } + return 1; +} + + /* CoInterpreter>>#varBaseAddress */ +usqInt +varBaseAddress(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((usqInt)((&GIV(stackPointer))))) - 64; +} + + +/* Make sure that all VM state that affects the heap contents is voided so + that the heap is + ready to be snapshotted. If flushExtPrims is true, flush references to + external primitives in methods. Answer the activeContext that should be + stored in the snapshot. */ +/* Make sure that all VM state that affects the heap contents is voided so + that the heap is + ready to be snapshotted. If flushExtPrims is true, flush references to + external primitives in methods. Answer the activeContext that should be + stored in the snapshot. */ + + /* CoInterpreter>>#voidVMStateForSnapshotFlushingExternalPrimitivesIf: */ +static sqInt NoDbgRegParms +voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + sqInt activeContext1; + sqInt address; + sqInt address1; + sqInt fmt; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt obj; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + + /* in case of code compactions. */ + GIV(instructionPointer) = 0; + activeContext1 = divorceAllFrames(); + /* begin bereaveAllMarriedContextsForSnapshotFlushingExternalPrimitivesIf: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); + if ((fmt == (indexablePointersFormat())) + && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + makeContextSnapshotSafe(objOop1); + } + if (flushExtPrims + && (fmt >= (firstCompiledMethodFormat()))) { + flushExternalPrimitiveOf(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()); + if ((fmt == (indexablePointersFormat())) + && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + makeContextSnapshotSafe(objOop1); + } + if (flushExtPrims + && (fmt >= (firstCompiledMethodFormat()))) { + flushExternalPrimitiveOf(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()); + if ((fmt == (indexablePointersFormat())) + && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + makeContextSnapshotSafe(objOop11); + } + if (flushExtPrims + && (fmt >= (firstCompiledMethodFormat()))) { + flushExternalPrimitiveOf(objOop11); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + activeContext = activeContext1; + voidCogCompiledCode(); + return activeContext; +} + + /* CoInterpreter>>#whereIs: */ +char * +whereIs(sqInt anOop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *somewhere; + char *where; + + somewhere = whereIsMaybeCodeThing(anOop); + if (!(somewhere == null)) { + return somewhere; + } + /* begin whereIsMaybeHeapThing: */ + if ((oopisLessThan(anOop, GIV(newSpaceLimit))) + && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) { + if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) { + where = " is in eden"; + goto l1; + } + if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) { + where = " is in future space"; + goto l1; + } + if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) { + where = " is in past space"; + goto l1; + } + where = " is in new space"; + goto l1; + } + if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) { + if (!((segmentContainingObj(anOop)) == null)) { + where = " is in old space"; + goto l1; + } + where = " is between old space segments"; + goto l1; + } + where = null; +l1: /* end whereIsMaybeHeapThing: */; + if (!(where == null)) { + return where; + } + /* begin whereIsMaybeStackThing: */ + if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackBasePlus1) - 1, GIV(pages))) { + where = " is in the stack zone"; + goto l2; + } + where = null; +l2: /* end whereIsMaybeStackThing: */; + if (!(where == null)) { + return where; + } + return " is no where obvious"; +} + + +/* Either widow the context or map its pc to a bytecode one. + Used to implement primitiveVoidVMStateForMethod. */ +/* for debugging & saving space */ + + /* CoInterpreter>>#widowOrForceToBytecodePC: */ +static void NoDbgRegParms NeverInline +widowOrForceToBytecodePC(sqInt ctxt) +{ + sqInt pc; + + if (((longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + + /* Since any machine-code frame activations of the method have been divorced + there should only be interpreted activations of marriecd contexts. */ + if (!(isWidowedContext(ctxt))) { + assert(!((isMachineCodeFrame(frameOfMarriedContext(ctxt))))); + } + } + else { + /* begin ensureContextHasBytecodePC: */ + assert(!(isMarriedOrWidowedContext(ctxt))); + pc = longAt((ctxt + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + if (((pc & 1)) + && (((pc = (pc >> 1))) < 0)) { + pc = mustMapMachineCodePCcontext(pc, ctxt); + assert(!(isOopForwarded(ctxt))); + longAtput((ctxt + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), pc); + + } + } +} + + /* CoInterpreterPrimitives>>#frameIsMarked: */ +static sqInt NoDbgRegParms +frameIsMarked(sqInt theFPInt) +{ + sqInt methodField; + + methodField = longAt(theFPInt + FoxMethod); + return ((((usqInt)methodField)) < (startOfMemory()) + ? (methodField & 4) != 0 + : ((longAt(theFPInt + FoxIFrameFlags)) & 2) != 0); +} + + +/* This is optional old obsolete stuff tedious to implement in Cog because of + the need to map from machine code pc to bytecode pc. So for now just fail. */ + + /* CoInterpreterPrimitives>>#primitiveClosureCopyWithCopiedValues */ +static void +primitiveClosureCopyWithCopiedValues(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } +} + + +/* Answer the contents of the code zone as an array of pair-wise element, + address in ascending address order. + Answer a string for a runtime routine or abstract label (beginning, end, + etc), a CompiledMethod for a CMMethod, + or a selector (presumably a Symbol) for a PIC. */ + + /* CoInterpreterPrimitives>>#primitiveCollectCogCodeConstituents */ +static void +primitiveCollectCogCodeConstituents(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt constituents; + char *sp; + + constituents = cogCodeConstituents(); + if (!(constituents)) { + (GIV(primFailCode) = PrimErrNoMemory); + return; + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), constituents); + GIV(stackPointer) = sp; +} + + +/* Lift the veil from a context and answer an integer describing its interior + state. Used for e.g. VM tests so they can verify they're testing what they + think they're testing. + 0 implies a vanilla heap context. + Bit 0 = is or was married to a frame + Bit 1 = is still married to a frame + Bit 2 = frame is executing machine code + Bit 3 = has machine code pc (as opposed to nil or a bytecode pc) + Bit 4 = method is currently compiled to machine code */ + + /* CoInterpreterPrimitives>>#primitiveContextXray */ +static void +primitiveContextXray(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt context; + sqInt flags; + sqInt pc; + sqInt senderOop; + char *sp; + char *theFP; + sqInt theMethod; + + context = longAt(GIV(stackPointer)); + pc = longAt((context + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))); + if (((longAt((context + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + if (checkIsStillMarriedContextcurrentFP(context, GIV(framePointer))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((context + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFP = pointerForOop(senderOop - 1); + + if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { + flags = 7; + } + else { + flags = 3; + } + } + else { + flags = 1; + } + } + else { + flags = 0; + } + if (((pc & 1)) + && (((pc >> 1)) < 0)) { + flags = flags | 8; + } + theMethod = longAt((context + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + if (((theMethod & (tagMask())) == 0) + && ((((((usqInt) (longAt(theMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) { + flags = flags | 16; + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)flags << 1) | 1)); + GIV(stackPointer) = sp; +} + + +/* Attempt to enter a CriticalSection/Mutex. If not owned, set the owner to + the current + process and answer false. If owned by the current process answer true. + Otherwise suspend the process. Answer if the receiver is owned by the + current process. */ + + /* CoInterpreterPrimitives>>#primitiveEnterCriticalSection */ +static void +primitiveEnterCriticalSection(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeProc; + sqInt criticalSection; + int inInterpreter; + sqInt objOop; + sqInt objOop1; + sqInt owningProcess; + sqInt owningProcessIndex; + char *sp; + char *sp1; + char *sp2; + + if (GIV(argumentCount) > 0) { + + /* rcvr */ + criticalSection = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + activeProc = longAt(GIV(stackPointer)); + } + else { + + /* rcvr */ + criticalSection = longAt(GIV(stackPointer)); + /* begin fetchPointer:ofObject: */ + objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + activeProc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + } + + /* CriticalSections are laid out like Semaphores */ + owningProcessIndex = ExcessSignalsIndex; + owningProcess = longAt((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord()))))); + if (owningProcess == GIV(nilObj)) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(criticalSection))); + if ((assert(isNonImmediate(criticalSection)), + oopisGreaterThanOrEqualTo(criticalSection, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((activeProc & (tagMask())) == 0) + && (oopisLessThan(activeProc, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(criticalSection))) >> (rememberedBitShift())) & 1) != 0)) { + remember(criticalSection); + } + } + } + longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), activeProc); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(falseObj)); + GIV(stackPointer) = sp; + return; + } + if (owningProcess == activeProc) { + /* begin pop:thenPush: */ + longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(trueObj)); + GIV(stackPointer) = sp1; + return; + } + /* begin pop:thenPush: */ + longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(falseObj)); + GIV(stackPointer) = sp2; + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + addLastLinktoList(activeProc, criticalSection); + transferTofrom(wakeHighestPriority(), CSEnterCriticalSection); + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); +} + + +/* Exit the critical section. + This may change the active process as a result. */ + + /* CoInterpreterPrimitives>>#primitiveExitCriticalSection */ +static void +primitiveExitCriticalSection(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt criticalSection; + int inInterpreter; + sqInt owningProcess; + sqInt owningProcessIndex; + + + /* rcvr */ + criticalSection = longAt(GIV(stackPointer)); + + /* CriticalSections are laid out like Semaphores */ + owningProcessIndex = ExcessSignalsIndex; + if ((assert(!(isForwarded(criticalSection))), + (longAt((criticalSection + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(criticalSection))); + longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), GIV(nilObj)); + } + else { + + /* We're going to switch process, either to an interpreted frame or a machine + code frame. To know whether to return or enter machine code we have to + know from whence we came. We could have come from the interpreter, + either directly or via a machine code primitive. We could have come from + machine code. The instructionPointer tells us where from: */ + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + + /* store check unnecessary because aSemaphore referred to owningProcess + via its FirstLinkIndex slot before owningProcess was removed. */ + owningProcess = removeFirstLinkOfList(criticalSection); + assert(!(isOopForwarded(criticalSection))); + longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), owningProcess); + + if (resumepreemptedYieldingIffrom(owningProcess, GIV(preemptionYields), CSExitCriticalSection)) { + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); + } + } +} + + +/* The receiver is a compiledMethod. Clear all entries in the method lookup + cache that refer to this method, presumably because it has been redefined, + overridden or removed. + */ +/* The receiver is a compiledMethod. Clear all entries in the method lookup + cache that + refer to this method, presumably because it has been redefined, overridden + or removed. + Override to flush appropriate machine code caches also. */ + + /* CoInterpreterPrimitives>>#primitiveFlushCacheByMethod */ +static void +primitiveFlushCacheByMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt oldMethod; + sqInt probe; + + oldMethod = longAt(GIV(stackPointer)); + probe = 0; + for (i = 1; i <= MethodCacheEntries; i += 1) { + if ((GIV(methodCache)[probe + MethodCacheMethod]) == oldMethod) { + GIV(methodCache)[probe + MethodCacheSelector] = 0; + } + probe += MethodCacheEntrySize; + } + flushExternalPrimitiveOf(oldMethod); + unlinkSendsToandFreeIf(longAt(GIV(stackPointer)), 0); +} + + +/* The receiver is a message selector. Clear all entries in the method lookup + cache with this selector, presumably because an associated method has been + redefined. Override to also flush machine code caches. */ + + /* CoInterpreterPrimitives>>#primitiveFlushCacheBySelector */ +static void +primitiveFlushCacheBySelector(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt probe; + sqInt selector; + + selector = longAt(GIV(stackPointer)); + probe = 0; + for (i = 1; i <= MethodCacheEntries; i += 1) { + if ((GIV(methodCache)[probe + MethodCacheSelector]) == selector) { + GIV(methodCache)[probe + MethodCacheSelector] = 0; + } + probe += MethodCacheEntrySize; + } + if ((selector == (fetchPointerofObject(16 * 2, splObj(SpecialSelectors)))) + || (selector == (fetchPointerofObject(17 * 2, splObj(SpecialSelectors))))) { + } + unlinkSendsOfisMNUSelector(selector, selector == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord()))))))); +} + + /* CoInterpreterPrimitives>>#primitiveFunctionPointerAddress */ +usqInt +primitiveFunctionPointerAddress(void) +{ + return ((usqInt)((&primitiveFunctionPointer))); +} + + +/* Primitive. Install the semaphore to be used for collecting long-running + primitives, + or nil if no semaphore should be used. */ + + /* CoInterpreterPrimitives>>#primitiveLongRunningPrimitiveSemaphore */ +EXPORT(sqInt) +primitiveLongRunningPrimitiveSemaphore(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + int flushState; + sqInt sema; + char *sp; + + if (GIV(argumentCount) != 1) { + return (GIV(primFailCode) = PrimErrBadNumArgs); + } + sema = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + if (sema == GIV(nilObj)) { + flushState = GIV(longRunningPrimitiveCheckSemaphore) != null; + GIV(longRunningPrimitiveCheckSemaphore) = null; + } + else { + flushState = GIV(longRunningPrimitiveCheckSemaphore) == null; + if (!(((sema & (tagMask())) == 0) + && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) { + return (GIV(primFailCode) = PrimErrBadArgument); + } + GIV(longRunningPrimitiveCheckSemaphore) = sema; + } + if (flushState) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0); + marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext); + assert((((stackValue(0)) == (nilObject())) + && (GIV(longRunningPrimitiveCheckSemaphore) == null)) + || (((stackValue(0)) == GIV(longRunningPrimitiveCheckSemaphore)) + && (isSemaphoreOop(sema)))); + } + voidLongRunningPrimitive("install"); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + if (flushState) { + siglongjmp(reenterInterpreter, ReturnToInterpreter); + } + return 0; +} + + /* CoInterpreterPrimitives>>#primitiveMethodPCData */ +EXPORT(sqInt) +primitiveMethodPCData(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt cm; + CogMethod *cogMethod; + sqInt data; + sqInt data1; + sqInt methodHeader; + sqInt methodReceiver; + sqInt nEntries; + sqInt nSlots; + char *sp; + + if (GIV(argumentCount) != 0) { + return (GIV(primFailCode) = PrimErrBadNumArgs); + } + methodReceiver = longAt(GIV(stackPointer)); + data = 0; + if (methodHasCogMethod(methodReceiver)) { + /* begin pcDataFor: */ + methodHeader = longAt((methodReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + cm = (cogMethod->methodObject); + nSlots = (((byteSizeOf(cm)) - (((literalCountOf(cm)) + LiteralStart) * BytesPerOop)) * 2) + ((8 * 2) / BytesPerOop); + data1 = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))), nSlots); + if (!(data1)) { + data = -1; + goto l1; + } + nEntries = mapPCDataForinto(cogMethod, data1); + if (nEntries == 0) { + data = 0; + goto l1; + } + if (nEntries < nSlots) { + shortentoIndexableSize(data1, nEntries); + } + data = data1; + l1: /* end pcDataFor: */; + if (data == -1) { + return (GIV(primFailCode) = PrimErrNoMemory); + } + } + if (data == 0) { + data = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))), 0); + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), data); + GIV(stackPointer) = sp; + return 0; +} + + +/* Lift the veil from a method and answer an integer describing the interior + state of its machine code. + Used for e.g. VM tests so they can verify they're testing what they think + they're testing. + 0 implies a vanilla method. + Bit 0 = method might be compiled to machine code + Bit 1 = method is currently compiled to machine code + Bit 2 = is compiled frameless. + Bit 3 = method refers to young object. + Bit 4 = method too big to be jitted (more than 64k of code, or needs more + than 1.5Mb of stack space to compile) + Bit 5 = method contains unknown/unjittable bytecode + Bit 6 = method should not be jitted because it contains a primitive not to + be called from machine code (unused) */ + + /* CoInterpreterPrimitives>>#primitiveMethodXray */ +static void +primitiveMethodXray(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt alreadyCogged; + CogMethod *cogMethod; + sqInt flags; + sqInt methodHeader; + char *sp; + + if (methodWithHeaderShouldBeCogged(methodHeaderOf(longAt(GIV(stackPointer))))) { + /* begin maybeMethodHasCogMethod: */ + alreadyCogged = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))); + flags = 1; + if (!alreadyCogged) { + cogMethod = cogselector(longAt(GIV(stackPointer)), GIV(nilObj)); + if ((cogMethod == null) + && (GIV(cogCompiledCodeCompactionCalledFor))) { + commenceCogCompiledCodeCompaction(); + cogMethod = cogselector(longAt(GIV(stackPointer)), GIV(nilObj)); + } + + switch (((sqInt)cogMethod)) { + case MethodTooBig: + flags = 1 + 16; + break; + case EncounteredUnknownBytecode: + flags = 1 + 32; + break; + case ShouldNotJIT: + flags = 1 + 64; + break; + default: + assert(!(((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= NotFullyInitialized))))); + + } + } + if ((flags == 1) + && ((((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) + && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))))) { + /* begin cogMethodOf: */ + methodHeader = longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + flags = (((cogMethod->stackCheckOffset)) == 0 + ? 7 + : 3); + if ((cogMethod->cmRefersToYoung)) { + flags += 8; + } + if (!alreadyCogged) { + freeMethod(cogMethod); + } + } + } + else { + flags = 0; + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)flags << 1) | 1)); + GIV(stackPointer) = sp; +} + + /* CoInterpreterPrimitives>>#primitiveMinimumUnusedHeadroom */ +EXPORT(void) +primitiveMinimumUnusedHeadroom(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt oop; + char *sp; + + /* begin methodReturnValue: */ + oop = (((usqInt)(minimumUnusedHeadroom()) << 1) | 1); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; +} + + +/* Defined for CompiledMethods only */ + + /* CoInterpreterPrimitives>>#primitiveObjectAt */ +static void +primitiveObjectAt(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt index; + sqInt integerPointer; + sqInt oop; + sqInt rawHeader; + sqInt realHeader; + char *sp; + sqInt thisReceiver; + + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + index = (integerPointer >> 1); + goto l2; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + index = 0; + goto l2; + } +l2: /* end stackIntegerValue: */; + if (GIV(primFailCode)) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + thisReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + rawHeader = longAt((thisReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + realHeader = ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0) + ? ((((CogMethod *) rawHeader))->methodHeader) + : rawHeader); + if (!((index > 0) + && (index <= (((assert((realHeader & 1)), +/* begin literalCountOfAlternateHeader: */ +((realHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart)))) { + (GIV(primFailCode) = PrimErrBadIndex); + return; + } + /* begin pop:thenPush: */ + oop = (index == 1 + ? realHeader + : longAt((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))))); + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; +} + + +/* Store a literal into a CompiledMethod at the given index. Defined for + CompiledMethods only. + */ + + /* CoInterpreterPrimitives>>#primitiveObjectAtPut */ +static void +primitiveObjectAtPut(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt index; + sqInt newValue; + sqInt rawHeader; + sqInt realHeader; + char *sp; + sqInt thisReceiver; + + newValue = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ((index & 1) == 0) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + index = (index >> 1); + thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord)); + if ( +# if IMMUTABILITY + (/* begin isImmutable: */ + ((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0) +# else /* IMMUTABILITY */ + 0 +# endif /* IMMUTABILITY */ + ) { + (GIV(primFailCode) = PrimErrNoModification); + return; + } + rawHeader = longAt((thisReceiver + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + realHeader = ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0) + ? ((((CogMethod *) rawHeader))->methodHeader) + : rawHeader); + if (!((index > 0) + && (index <= (((assert((realHeader & 1)), +/* begin literalCountOfAlternateHeader: */ +((realHeader >> 1)) & AlternateHeaderNumLiteralsMask)) + LiteralStart)))) { + (GIV(primFailCode) = PrimErrBadIndex); + return; + } + if (index == 1) { + if (((newValue & 1) == 0) + || (((assert((newValue & 1)), + /* begin literalCountOfAlternateHeader: */ + ((newValue >> 1)) & AlternateHeaderNumLiteralsMask)) != ((assert((realHeader & 1)), + /* begin literalCountOfAlternateHeader: */ + ((realHeader >> 1)) & AlternateHeaderNumLiteralsMask)))) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + if ((assert(((rawHeader & 1)) + || (((((usqInt)rawHeader)) < (startOfMemory())) + && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))), + (rawHeader & 1) == 0)) { + ((((CogMethod *) rawHeader))->methodHeader = newValue); + } + else { + assert(!(isOopForwarded(thisReceiver))); + longAtput((thisReceiver + BaseHeaderSize) + (0U << (shiftForWord())), newValue); + + } + } + else { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(thisReceiver))); + if ((assert(isNonImmediate(thisReceiver)), + oopisGreaterThanOrEqualTo(thisReceiver, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((newValue & (tagMask())) == 0) + && (oopisLessThan(newValue, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(thisReceiver))) >> (rememberedBitShift())) & 1) != 0)) { + remember(thisReceiver); + } + } + } + longAtput((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue); + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), newValue); + GIV(stackPointer) = sp; +} + + +/* Primitive. Install the semaphore to be used for profiling, + or nil if no semaphore should be used. + See also primitiveProfileStart. */ + + /* CoInterpreterPrimitives>>#primitiveProfileSemaphore */ +EXPORT(sqInt) +primitiveProfileSemaphore(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + int flushState; + sqInt sema; + char *sp; + + if (GIV(argumentCount) != 1) { + return (GIV(primFailCode) = PrimErrBadNumArgs); + } + sema = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + if (sema == GIV(nilObj)) { + flushState = GIV(profileSemaphore) != GIV(nilObj); + } + else { + flushState = GIV(profileSemaphore) == GIV(nilObj); + if (!(((sema & (tagMask())) == 0) + && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) { + return (GIV(primFailCode) = PrimErrBadArgument); + } + } + + /* If we've switched profiling on or off we must void machine code + (and machine code pcs in contexts) since we will start or stop + testing the profile clock in machine code primitive invocations, + and so generate slightly different code from here on in. */ + GIV(profileSemaphore) = sema; + if (flushState) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0); + marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext); + assert((((stackValue(0)) == (nilObject())) + && (GIV(profileSemaphore) == (nilObject()))) + || (((stackValue(0)) == GIV(profileSemaphore)) + && (isSemaphoreOop(sema)))); + } + GIV(profileProcess) = (GIV(profileMethod) = GIV(nilObj)); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + if (flushState) { + siglongjmp(reenterInterpreter, ReturnToInterpreter); + } + return 0; +} + + +/* Put this process on the scheduler's lists thus allowing it to proceed next + time there is + a chance for processes of it's priority level. It must go to the back of + its run queue so + as not to preempt any already running processes at this level. If the + process's priority + is higher than the current process, preempt the current process. */ + + /* CoInterpreterPrimitives>>#primitiveResume */ +static void +primitiveResume(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + int inInterpreter; + sqInt proc; + + + /* rcvr */ + proc = longAt(GIV(stackPointer)); + if (!(isContext(longAt((proc + BaseHeaderSize) + (((int)((usqInt)(SuspendedContextIndex) << (shiftForWord())))))))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + if (resumepreemptedYieldingIffrom(proc, GIV(preemptionYields), CSResume)) { + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); + } +} + + +/* Synchronously signal the semaphore. + This may change the active process as a result. */ +/* We may be about to switch process, either to an interpreted frame or a + machine code frame. To know whether to return or enter machine code + we have to know from whence we came. We could have come from the + interpreter, either directly or via a machine code primitive. We could + have come from machine code. The instructionPointer tells us where from: */ + + /* CoInterpreterPrimitives>>#primitiveSignal */ +static void +primitiveSignal(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + int inInterpreter; + + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + if (synchronousSignal(longAt(GIV(stackPointer)))) { + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); + } +} + + +/* Save a normal snapshot under the same name as it was loaded + unless it has been renamed by the last primitiveImageName. + + Override to jump to the interpreter because the machine code zone is now + void. + */ + + /* CoInterpreterPrimitives>>#primitiveSnapshot */ +static void +primitiveSnapshot(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + snapshot(0); + if ((longAt(GIV(framePointer) + FoxMethod)) == GIV(newMethod)) { + + /* snapshot: has reached the end and built a frame. + In the JIT we need to back-up the pc before reentering the interpreter. */ + GIV(instructionPointer) -= 1; + } + siglongjmp(reenterInterpreter, ReturnToInterpreter); +} + + +/* Save an embedded snapshot. + + Override to jump to the interpreter because the machine code zone is now + void. + */ + + /* CoInterpreterPrimitives>>#primitiveSnapshotEmbedded */ +static void +primitiveSnapshotEmbedded(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + snapshot(1); + if ((longAt(GIV(framePointer) + FoxMethod)) == GIV(newMethod)) { + + /* snapshot: has reached the end and built a frame. + In the JIT we need to back-up the pc before reentering the interpreter. */ + GIV(instructionPointer) -= 1; + } + siglongjmp(reenterInterpreter, ReturnToInterpreter); +} + + +/* Primitive. Suspend the receiver, aProcess such that it can be executed + again by sending #resume. If the given process is not currently running, + take it off + its corresponding list. The primitive returns the list the receiver was + previously on. + */ + + /* CoInterpreterPrimitives>>#primitiveSuspend */ +static void +primitiveSuspend(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt firstLink; + int inInterpreter; + sqInt lastLink; + sqInt myList; + sqInt nextLink; + sqInt process; + sqInt referent; + char *sp; + char *sp1; + sqInt tempLink; + sqInt valuePointer; + + process = longAt(GIV(stackPointer)); + if (process == (fetchPointerofObject(ActiveProcessIndex, schedulerPointer()))) { + + /* We're going to switch process, either to an interpreted frame or a machine + code frame. To know whether to return or enter machine code we have to + know from whence we came. We could have come from the interpreter, + either directly or via a machine code primitive. We could have come from + machine code. The instructionPointer tells us where from: */ + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(nilObj)); + GIV(stackPointer) = sp; + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + transferTofrom(wakeHighestPriority(), CSSuspend); + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); + return; + } + + /* XXXX Fixme. We should really check whether myList is a kind of LinkedList or not + but we can't easily so just do a quick check for nil which is the most common case. */ + myList = longAt((process + BaseHeaderSize) + (((int)((usqInt)(MyListIndex) << (shiftForWord()))))); + if (myList == GIV(nilObj)) { + (GIV(primFailCode) = PrimErrBadReceiver); + return; + } + if (((longAt(myList)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) { + /* begin followForwarded: */ + assert(isUnambiguouslyForwarder(myList)); + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((myList + BaseHeaderSize) + (0U << (shiftForWord()))); + while (((referent & (tagMask())) == 0) + && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + /* begin fetchPointer:ofMaybeForwardedObject: */ + referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord()))); + } + myList = referent; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(process))); + if ((assert(isNonImmediate(process)), + oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((myList & (tagMask())) == 0) + && (oopisLessThan(myList, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) { + remember(process); + } + } + } + longAtput((process + BaseHeaderSize) + (((int)((usqInt)(MyListIndex) << (shiftForWord())))), myList); + } + /* begin removeProcess:fromList: */ + assert(!((isForwarded(process)))); + assert(!((isForwarded(myList)))); + /* begin fetchPointer:ofObject: */ + firstLink = longAt((myList + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord()))))); + /* begin fetchPointer:ofObject: */ + lastLink = longAt((myList + BaseHeaderSize) + (((int)((usqInt)(LastLinkIndex) << (shiftForWord()))))); + assert(!((isForwarded(firstLink)))); + assert(!((isForwarded(lastLink)))); + if (process == firstLink) { + /* begin fetchPointer:ofObject: */ + nextLink = longAt((process + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord()))))); + assert(!((isForwarded(nextLink)))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(myList))); + if ((assert(isNonImmediate(myList)), + oopisGreaterThanOrEqualTo(myList, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((nextLink & (tagMask())) == 0) + && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(myList))) >> (rememberedBitShift())) & 1) != 0)) { + remember(myList); + } + } + } + longAtput((myList + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord())))), nextLink); + if (process == lastLink) { + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(myList))); + longAtput((myList + BaseHeaderSize) + (((int)((usqInt)(LastLinkIndex) << (shiftForWord())))), valuePointer); + } + } + else { + tempLink = firstLink; + while (1) { + assert(!((isForwarded(tempLink)))); + if (tempLink == GIV(nilObj)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l17; + } + /* begin fetchPointer:ofObject: */ + nextLink = longAt((tempLink + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord()))))); + if (nextLink == process) break; + /* begin fetchPointer:ofObject: */ + tempLink = longAt((tempLink + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord()))))); + } + /* begin fetchPointer:ofObject: */ + nextLink = longAt((process + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord()))))); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(tempLink))); + if ((assert(isNonImmediate(tempLink)), + oopisGreaterThanOrEqualTo(tempLink, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((nextLink & (tagMask())) == 0) + && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(tempLink))) >> (rememberedBitShift())) & 1) != 0)) { + remember(tempLink); + } + } + } + longAtput((tempLink + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord())))), nextLink); + if (process == lastLink) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(myList))); + if ((assert(isNonImmediate(myList)), + oopisGreaterThanOrEqualTo(myList, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((tempLink & (tagMask())) == 0) + && (oopisLessThan(tempLink, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(myList))) >> (rememberedBitShift())) & 1) != 0)) { + remember(myList); + } + } + } + longAtput((myList + BaseHeaderSize) + (((int)((usqInt)(LastLinkIndex) << (shiftForWord())))), tempLink); + } + } + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(process))); + if ((assert(isNonImmediate(process)), + oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((GIV(nilObj) & (tagMask())) == 0) + && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) { + remember(process); + } + } + } + longAtput((process + BaseHeaderSize) + (((int)((usqInt)(NextLinkIndex) << (shiftForWord())))), GIV(nilObj)); +l17: /* end removeProcess:fromList: */; + if (!GIV(primFailCode)) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(process))); + if ((assert(isNonImmediate(process)), + oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((GIV(nilObj) & (tagMask())) == 0) + && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) { + remember(process); + } + } + } + longAtput((process + BaseHeaderSize) + (((int)((usqInt)(MyListIndex) << (shiftForWord())))), GIV(nilObj)); + /* begin pop:thenPush: */ + longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), myList); + GIV(stackPointer) = sp1; + } +} + + +/* Primitive. Terminate up the context stack from the receiver up to but not + including the argument, if previousContext is on my Context stack. Make + previousContext my + sender. This prim has to shadow the code in ContextPart>terminateTo: to be + correct. + Override to ensure the caller's saved ip is correct, i.e. if an + interpreter frame it may + have to move to iframeSavedIP. */ + + /* CoInterpreterPrimitives>>#primitiveTerminateTo */ +static void +primitiveTerminateTo(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aContextOrNil; + sqInt callerContextOrNil; + sqInt callerContextOrNil1; + char *callerFP; + char *callerFP1; + char *callerFP2; + char *contextsFP; + usqInt contextsIP; + char *contextsSP; + sqInt currentCtx; + char *fp; + char *fp1; + char *fp2; + char *frameAbove; + char *newFP; + char *newSP; + sqInt nextCntx; + sqInt numArgs; + StackPage *pageToStopOn; + sqInt senderOop; + sqInt senderOop1; + sqInt senderOop2; + sqInt senderOop3; + sqInt senderOop4; + sqInt senderOop5; + char *source; + sqInt stackedReceiverOffset; + char *theFP; + char *theFP1; + StackPage *thePage; + StackPage *thePage1; + StackPage *thePage2; + sqInt thisCtx; + sqInt valuePointer; + sqInt valuePointer1; + + contextsFP = 0; + aContextOrNil = longAt(GIV(stackPointer)); + if (!((aContextOrNil == GIV(nilObj)) + || (((aContextOrNil & (tagMask())) == 0) + && (((longAt(aContextOrNil)) & (classIndexMask())) == ClassMethodContextCompactIndex)))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + thisCtx = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (thisCtx == aContextOrNil) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + if ((aContextOrNil != GIV(nilObj)) + && ((((longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(aContextOrNil))))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + contextsFP = pointerForOop(senderOop - 1); + + /* begin stackPageFor: */ + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + } + else { + pageToStopOn = 0; + } + if ((((longAt((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(thisCtx)))) { + /* begin frameOfMarriedContext: */ + senderOop2 = longAt((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop2 & 1)); + theFP = pointerForOop(senderOop2 - 1); + + if ((theFP == GIV(framePointer)) + && (pageToStopOn == GIV(stackPage))) { + assertValidStackedInstructionPointersInline(GIV(stackPage), __LINE__); + if ((pointerForOop(longAt(theFP + FoxSavedFP))) != contextsFP) { + /* begin frameStackedReceiverOffsetNumArgs: */ + numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((mframeCogMethod(theFP))->cmNumArgs) + : byteAt((theFP + FoxIFrameFlags) + 1)); + stackedReceiverOffset = (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord())))); + /* begin findFrameAbove:inPage: */ + fp = (pageToStopOn->headFP); + if (fp == contextsFP) { + frameAbove = 0; + goto l5; + } + while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) { + if (callerFP == contextsFP) { + frameAbove = fp; + goto l5; + } + fp = callerFP; + } + error("did not find theFP in stack page"); + frameAbove = 0; + l5: /* end findFrameAbove:inPage: */; + contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)))); + assert((((((usqInt)contextsIP)) >= (startOfMemory())) + || (contextsIP == (ceReturnToInterpreterPC()))) == (!(isMachineCodeFrame(contextsFP)))); + assert(!(isBaseFrame(frameAbove))); + newSP = (frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord; + + newFP = (newSP - stackedReceiverOffset) - BytesPerWord; + for (source = (theFP + stackedReceiverOffset); source >= GIV(stackPointer); source += (-BytesPerWord)) { + newSP -= BytesPerWord; + longAtput(newSP, longAt(source)); + } + longAtput(newFP + FoxSavedFP, contextsFP); + if (((((usqInt)(longAt(newFP + FoxMethod)))) < (startOfMemory())) + && (contextsIP >= (startOfMemory()))) { + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(contextsFP))); + longAtput(contextsFP + FoxIFSavedIP, contextsIP); + contextsIP = ceReturnToInterpreterPC(); + } + longAtput(newFP + FoxCallerSavedIP, contextsIP); + assert(isContext(thisCtx)); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(thisCtx))); + longAtput((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer(newFP)) & (BytesPerWord - 1)) == 0), + (oopForPointer(newFP)) + (smallIntegerTag()))); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(thisCtx))); + longAtput((thisCtx + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(contextsFP)) & (BytesPerWord - 1)) == 0), + (oopForPointer(contextsFP)) + (smallIntegerTag()))); + GIV(framePointer) = newFP; + GIV(stackPointer) = newSP; + } + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + assertValidStackedInstructionPointersInline(GIV(stackPage), __LINE__); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + return; + } + assertValidStackedInstructionPointers(__LINE__); + + /* May cause a GC!! */ + theFP = externalEnsureIsBaseFrame(theFP); + /* begin frameCallerContext: */ + assert(isBaseFrame(theFP)); + /* begin stackPageFor: */ + thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil = longAt((thePage1->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil)); + assert((callerContextOrNil == (nilObject())) + || (isContext(callerContextOrNil))); + currentCtx = callerContextOrNil; + if ((aContextOrNil != GIV(nilObj)) + && ((((longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(aContextOrNil))))) { + /* begin frameOfMarriedContext: */ + senderOop1 = longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop1 & 1)); + contextsFP = pointerForOop(senderOop1 - 1); + + /* begin stackPageFor: */ + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + } + else { + pageToStopOn = 0; + } + } + else { + currentCtx = longAt((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + } + assertValidStackedInstructionPointers(__LINE__); + if (contexthasSender(thisCtx, aContextOrNil)) { + + /* Need to walk the stack freeing stack pages and nilling contexts. */ + while (!((currentCtx == aContextOrNil) + || (currentCtx == GIV(nilObj)))) { + assert(isContext(currentCtx)); + if (((longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + /* begin frameOfMarriedContext: */ + senderOop4 = longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop4 & 1)); + theFP = pointerForOop(senderOop4 - 1); + + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + if (thePage == GIV(stackPage)) { + /* begin findFrameAbove:inPage: */ + fp1 = (thePage->headFP); + if (fp1 == theFP) { + frameAbove = 0; + goto l19; + } + while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) { + if (callerFP1 == theFP) { + frameAbove = fp1; + goto l19; + } + fp1 = callerFP1; + } + error("did not find theFP in stack page"); + frameAbove = 0; + l19: /* end findFrameAbove:inPage: */; + assert(frameAbove != 0); + + /* May cause a GC!! May also reclaim aContextOrNil's page, hence... */ + frameAbove = externalEnsureIsBaseFrame(frameAbove); + if ((aContextOrNil != GIV(nilObj)) + && ((((longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(aContextOrNil))))) { + /* begin frameOfMarriedContext: */ + senderOop3 = longAt((aContextOrNil + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop3 & 1)); + contextsFP = pointerForOop(senderOop3 - 1); + + /* begin stackPageFor: */ + pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + } + else { + pageToStopOn = 0; + } + } + else { + if (thePage == pageToStopOn) { + + /* We're here. Cut back the stack to aContextOrNil's frame, + push its instructionPointer if it's not already a head frame, + and we're done. */ + /* begin findFrameAbove:inPage: */ + fp2 = (thePage->headFP); + if (fp2 == contextsFP) { + frameAbove = 0; + goto l20; + } + while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) { + if (callerFP2 == contextsFP) { + frameAbove = fp2; + goto l20; + } + fp2 = callerFP2; + } + error("did not find theFP in stack page"); + frameAbove = 0; + l20: /* end findFrameAbove:inPage: */; + if (frameAbove != 0) { + contextsSP = ((assert(!(isBaseFrame(frameAbove))), +(frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord)) - BytesPerWord; + longAtput(contextsSP, pointerForOop(longAt(frameAbove + FoxCallerSavedIP))); + /* begin setHeadFP:andSP:inPage: */ + assert(contextsSP < contextsFP); + assert((contextsSP < ((thePage->baseAddress))) + && (contextsSP > (((thePage->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((contextsFP < ((thePage->baseAddress))) + && (contextsFP > (((thePage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (thePage->headFP = contextsFP); + (thePage->headSP = contextsSP); + } + currentCtx = aContextOrNil; + } + else { + + /* We can free the entire page without further ado. */ + /* begin frameCallerContext: */ + theFP1 = (thePage->baseFP); + assert(isBaseFrame(theFP1)); + /* begin stackPageFor: */ + thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + callerContextOrNil1 = longAt((thePage2->baseAddress)); + assert(addressCouldBeObj(callerContextOrNil1)); + assert((callerContextOrNil1 == (nilObject())) + || (isContext(callerContextOrNil1))); + currentCtx = callerContextOrNil1; + freeStackPageNoAssert(thePage); + } + } + } + else { + nextCntx = longAt((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + /* begin markContextAsDead: */ + assert(isContext(currentCtx)); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer); + /* begin storePointerUnchecked:ofObject:withValue: */ + valuePointer1 = GIV(nilObj); + assert(!(isOopForwarded(currentCtx))); + longAtput((currentCtx + BaseHeaderSize) + (((int)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1); + currentCtx = nextCntx; + } + } + } + assert(pageListIsWellFormed()); + if (((longAt((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) { + assert(checkIsStillMarriedContextcurrentFP(thisCtx, GIV(framePointer))); + assert(isBaseFrame(frameOfMarriedContext(thisCtx))); + /* begin frameOfMarriedContext: */ + senderOop5 = longAt((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop5 & 1)); + theFP = pointerForOop(senderOop5 - 1); + + frameCallerContextput(theFP, aContextOrNil); + } + else { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(thisCtx))); + if ((assert(isNonImmediate(thisCtx)), + oopisGreaterThanOrEqualTo(thisCtx, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((aContextOrNil & (tagMask())) == 0) + && (oopisLessThan(aContextOrNil, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(thisCtx))) >> (rememberedBitShift())) & 1) != 0)) { + remember(thisCtx); + } + } + } + longAtput((thisCtx + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))), aContextOrNil); + } + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + assertValidStackedInstructionPointers(__LINE__); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); +} + + +/* Void all internal VM state in the stack and machine code zones + + Override to jump to the interpreter because the machine code zone is now + void. + */ + + /* CoInterpreterPrimitives>>#primitiveVoidVMState */ +static void +primitiveVoidVMState(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + char *sp; + + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp; + activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0); + marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext); + siglongjmp(reenterInterpreter, ReturnToInterpreter); +} + + +/* The receiver is a compiledMethod. Clear all entries in the method lookup + cache that refer to this method, presumably because it has been redefined, + overridden or removed. + */ +/* The receiver is a compiledMethod. Clear all VM state associated with the + method, including any machine code, or machine code pcs in context + objects. */ + + /* CoInterpreterPrimitives>>#primitiveVoidVMStateForMethod */ +static void +primitiveVoidVMStateForMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeContext; + sqInt address; + sqInt address1; + StackPage *aPage; + CogMethod *cogMethod; + sqInt divorcedSome; + sqInt divorcedSome1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt hasCogMethod; + sqInt i; + sqInt i1; + usqInt limit; + sqInt methodHeader; + sqInt methodObj; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt object; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oldMethod; + sqInt oop; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + sqInt probe; + sqInt senderOop; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + char *sp; + char *sp1; + char *theFP; + char *theFrame; + StackPage *thePage; + char *theSP; + sqInt top; + sqInt top1; + + oldMethod = longAt(GIV(stackPointer)); + probe = 0; + for (i = 1; i <= MethodCacheEntries; i += 1) { + if ((GIV(methodCache)[probe + MethodCacheMethod]) == oldMethod) { + GIV(methodCache)[probe + MethodCacheSelector] = 0; + } + probe += MethodCacheEntrySize; + } + flushExternalPrimitiveOf(oldMethod); + methodObj = longAt(GIV(stackPointer)); + /* begin ensureFrameIsMarried:SP: */ + theFP = GIV(framePointer); + theSP = GIV(stackPointer); + if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) + ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 + : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { + assert(isContext(frameContext(theFP))); + activeContext = longAt(theFP + FoxThisContext); + goto l6; + } + activeContext = marryFrameSP(theFP, theSP); +l6: /* end ensureFrameIsMarried:SP: */; + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object = ceReturnToInterpreterPC(); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + } + /* begin externalWriteBackHeadFramePointers */ + assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)); + assert(GIV(stackPage) == (mostRecentlyUsedPage())); + /* begin setHeadFP:andSP:inPage: */ + assert(GIV(stackPointer) < GIV(framePointer)); + assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))); + assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress))) + && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))); + (GIV(stackPage)->headFP = GIV(framePointer)); + (GIV(stackPage)->headSP = GIV(stackPointer)); + assert(pageListIsWellFormed()); + if ((hasCogMethod = methodHasCogMethod(methodObj))) { + /* begin divorceMachineCodeFramesWithMethod: */ + methodHeader = longAt((methodObj + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader)) + && ((((usqInt)methodHeader)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader); + do { + if (GIV(stackPage) != 0) { + + /* This is needed for the assert in externalDivorceFrame:andContext: */ + markStackPageMostRecentlyUsed(GIV(stackPage)); + } + /* begin divorceSomeMachineCodeFramesWithMethod: */ + divorcedSome1 = 0; + for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) { + /* begin stackPageAt: */ + aPage = stackPageAtpages(i1, GIV(pages)); + if (!(isFree(aPage))) { + + /* this to avoid assert in externalDivorceFrame:andContext: */ + markStackPageMostRecentlyUsed(GIV(stackPage)); + if (divorceAMachineCodeFrameWithCogMethodin(cogMethod, aPage)) { + divorcedSome1 = 1; + } + } + } + divorcedSome = divorcedSome1; + } while(divorcedSome); + } + /* begin ensureAllContextsWithMethodHaveBytecodePCs: */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) { + widowOrForceToBytecodePC(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l16; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l16: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) { + widowOrForceToBytecodePC(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l21; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l21: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if ((((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) + && ((longAt((objOop11 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) { + widowOrForceToBytecodePC(objOop11); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + if (hasCogMethod) { + unlinkSendsToandFreeIf(methodObj, 1); + } + if ((((longAt((activeContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(activeContext)))) { + /* begin frameOfMarriedContext: */ + senderOop = longAt((activeContext + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord()))))); + assert((senderOop & 1)); + theFrame = pointerForOop(senderOop - 1); + + /* begin stackPageFor: */ + thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))), + pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages)); + assert(((thePage->headFP)) == theFrame); + /* begin setStackPageAndLimit: */ + assert(thePage != 0); + GIV(stackPage) = thePage; + if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) { + GIV(stackLimit) = (GIV(stackPage)->stackLimit); + } + markStackPageMostRecentlyUsed(thePage); + GIV(stackPointer) = (thePage->headSP); + GIV(framePointer) = (thePage->headFP); + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + GIV(instructionPointer) = top; + assert(methodObj == (stackTop())); + } + else { + /* begin zeroStackPage */ + assert((GIV(stackPage) == 0) + || ((((GIV(stackPage)->headFP)) == GIV(framePointer)) + && (((GIV(stackPage)->headSP)) == GIV(stackPointer)))); + GIV(stackPage) = 0; + marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext); + /* begin popStack */ + top1 = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + assert(methodObj == (stackTop())); + siglongjmp(reenterInterpreter, ReturnToInterpreter); + } +} + + /* CoInterpreterPrimitives>>#primitiveWait */ +static void +primitiveWait(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeProc; + sqInt excessSignals; + int inInterpreter; + sqInt objOop; + sqInt objOop1; + sqInt sema; + + + /* rcvr */ + sema = longAt(GIV(stackPointer)); + excessSignals = fetchIntegerofObject(ExcessSignalsIndex, sema); + if (excessSignals > 0) { + /* begin storeInteger:ofObject:withValue: */ + if ((((sqInt)((((usqInt)(excessSignals - 1))) ^ ((((usqInt)(excessSignals - 1))) << 1)))) >= 0) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(sema))); + longAtput((sema + BaseHeaderSize) + (((int)((usqInt)(ExcessSignalsIndex) << (shiftForWord())))), (((usqInt)(excessSignals - 1) << 1) | 1)); + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + else { + + /* We're going to switch process, either to an interpreted frame or a machine + code frame. To know whether to return or enter machine code we have to + know from whence we came. We could have come from the interpreter, + either directly or via a machine code primitive. We could have come from + machine code. The instructionPointer tells us where from: */ + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + /* begin fetchPointer:ofObject: */ + objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + objOop = longAt((objOop1 + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + activeProc = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + addLastLinktoList(activeProc, sema); + transferTofrom(wakeHighestPriority(), CSWait); + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); + } +} + + +/* primitively do the equivalent of Process>yield */ + + /* CoInterpreterPrimitives>>#primitiveYield */ +static void +primitiveYield(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt activeProc; + int inInterpreter; + sqInt objOop; + sqInt oop; + sqInt priority; + sqInt processList; + sqInt processLists; + sqInt scheduler; + + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + scheduler = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + activeProc = longAt((scheduler + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((activeProc + BaseHeaderSize) + (((int)((usqInt)(PriorityIndex) << (shiftForWord()))))); + assert((oop & 1)); + priority = (oop >> 1); + processLists = longAt((scheduler + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + processList = longAt((processLists + BaseHeaderSize) + (((sqInt)((usqInt)((priority - 1)) << (shiftForWord()))))); + if ((assert(!(isForwarded(processList))), + (longAt((processList + BaseHeaderSize) + (((int)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) { + return; + } + inInterpreter = GIV(instructionPointer) >= (startOfMemory()); + addLastLinktoList(activeProc, processList); + transferTofrom(wakeHighestPriority(), CSYield); + /* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */ + if (GIV(nextProfileTick) > 0) { + checkProfileTick(GIV(newMethod)); + } + returnToExecutivepostContextSwitch(inInterpreter, 1); +} + + /* CoInterpreterPrimitives>>#unmarkAllFrames */ +static void +unmarkAllFrames(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt flags; + sqInt i; + sqInt methodField; + char *theFP; + StackPage *thePage; + + for (i = 0; i < GIV(numStackPages); i += 1) { + /* begin stackPageAt: */ + thePage = stackPageAtpages(i, GIV(pages)); + if (!(isFree(thePage))) { + theFP = (thePage->headFP); + do { + methodField = longAt(theFP + FoxMethod); + if ((((usqInt)methodField)) < (startOfMemory())) { + if ((methodField & 4) != 0) { + longAtput(theFP + FoxMethod, methodField - 4); + } + } + else { + flags = longAt(theFP + FoxIFrameFlags); + if ((flags & 2) != 0) { + longAtput(theFP + FoxIFrameFlags, flags - 2); + } + } + } while(((theFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0); + } + } +} + + +/* Initialize the stack pages. In the C VM theStackPages will be alloca'ed + memory to hold the + stack pages on the C stack. In the simulator they are housed in the memory + between the + cogMethodZone and the heap. */ + + /* CoInterpreterStackPages>>#initializeStack:numSlots:pageSize: */ +static void NoDbgRegParms +initializeStacknumSlotspageSize(char *theStackPages, sqInt stackSlots, sqInt slotsPerPage) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt count; + sqInt index; + sqInt numPages; + StackPage *page; + char *pageStructBase; + void *pointer; + usqIntptr_t structStackPageSize; + sqInt theIndex; + + structStackPageSize = sizeof(CogStackPage); + GIV(bytesPerPage) = slotsPerPage * BytesPerWord; + + /* Because stack pages grow down baseAddress is at the top of a stack page and so to avoid + subtracting BytesPerWord from baseAddress and lastAddress in the init loop below we simply + push the stackPage array up one word to avoid the overlap. This word is extraStackBytes. */ + numPages = GIV(numStackPages); + pageStructBase = (theStackPages + (numPages * GIV(bytesPerPage))) + BytesPerWord; + + /* make sure there's enough headroom */ + GIV(pages) = ((StackPage *) pageStructBase); + assert((((stackPageByteSize()) - (stackLimitBytes())) - (stackLimitOffset())) >= (stackPageHeadroom())); + for (index = 0; index < numPages; index += 1) { + /* begin stackPageAt: */ + page = stackPageAtpages(index, GIV(pages)); + (page->lastAddress = theStackPages + (index * GIV(bytesPerPage))); + (page->baseAddress = ((page->lastAddress)) + GIV(bytesPerPage)); + (page->stackLimit = ((page->baseAddress)) - ((((stackPageFrameBytes()) < (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))) ? (stackPageFrameBytes()) : (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))))); + (page->realStackLimit = (page->stackLimit)); + (page->baseFP = 0); + (page->nextPage = stackPageAt((index == (numPages - 1) + ? 0 + : index + 1))); + (page->prevPage = stackPageAt((index == 0 + ? numPages - 1 + : index - 1))); + } + GIV(stackBasePlus1) = (((char *) theStackPages)) + 1; + /* begin stackPageAt: */ + page = stackPageAtpages(0, GIV(pages)); + GIV(overflowLimit) = ((((page->baseAddress)) - ((page->realStackLimit))) * 3) / 5; + for (index = 0; index < numPages; index += 1) { + /* begin stackPageAt: */ + page = stackPageAtpages(index, GIV(pages)); + assert((pageIndexFor((page->baseAddress))) == index); + assert((pageIndexFor(((page->baseAddress)) - ((slotsPerPage - 1) * BytesPerWord))) == index); + assert((stackPageFor((page->baseAddress))) == page); + assert((stackPageFor((page->stackLimit))) == page); + /* begin initializePageTraceToInvalid: */ + (page->trace = StackPageTraceInvalid); + } + /* begin stackPageAt: */ + GIV(mostRecentlyUsedPage) = stackPageAtpages(0, GIV(pages)); + page = GIV(mostRecentlyUsedPage); + count = 0; + do { + count += 1; + /* begin pageIndexFor: */ + pointer = (page->baseAddress); + assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); + theIndex = pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); + assert((stackPageAt(theIndex)) == page); + assert((pageIndexFor((page->baseAddress))) == theIndex); + assert((pageIndexFor((page->stackLimit))) == theIndex); + assert((pageIndexFor(((page->lastAddress)) + 1)) == theIndex); + } while(((page = (page->nextPage))) != GIV(mostRecentlyUsedPage)); + assert(count == numPages); + assert(pageListIsWellFormed()); +} + + +/* */ +/* Answer the page index for a pointer into stack memory, i.e. the index + for the page the address is in. N.B. This is a zero-relative index. */ + + /* CoInterpreterStackPages>>#pageIndexFor: */ +static sqInt NoDbgRegParms +pageIndexFor(void *pointer) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))); + return pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage)); +} + + /* InterpreterPrimitives>>#canBeImmutable: */ +#if IMMUTABILITY +static sqInt NoDbgRegParms +canBeImmutable(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt objOop; + sqInt processLists; + sqInt scheduler; + + assert(isNonImmediate(oop)); + if (((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) { + return 0; + } + if ((assert(isNonImmediate(oop)), + isEphemeronFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())))) { + return 0; + } + if (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) { + return 0; + } + if (((longAt(oop)) & (classIndexMask())) == (rawHashBitsOf(splObj(ClassSemaphore)))) { + return 0; + } + /* begin fetchPointer:ofObject: */ + objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SchedulerAssociation) << (shiftForWord()))))); + scheduler = longAt((objOop + BaseHeaderSize) + (((int)((usqInt)(ValueIndex) << (shiftForWord()))))); + processLists = longAt((scheduler + BaseHeaderSize) + (((int)((usqInt)(ProcessListsIndex) << (shiftForWord()))))); + if (oop == scheduler) { + return 0; + } + if (oop == processLists) { + return 0; + } + if ((classIndexOf(longAt((processLists + BaseHeaderSize) + (1U << (shiftForWord()))))) == ((longAt(oop)) & (classIndexMask()))) { + return 0; + } + if ((classIndexOf(longAt((scheduler + BaseHeaderSize) + (((int)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))))) == ((longAt(oop)) & (classIndexMask()))) { + return 0; + } + return 1; +} +#endif /* IMMUTABILITY */ + + +/* Answer either a malloced string with the null-terminated contents of oop + if oop is a string, + or the null pointer if oop is nil, or fail. It is the client's + responsibility to free the string later. */ + + /* InterpreterPrimitives>>#cStringOrNullFor: */ +char * +cStringOrNullFor(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt classOop; + char *cString; + sqInt fmt; + sqInt isString; + sqInt len; + usqInt numSlots; + usqInt numSlots1; + + /* begin is:instanceOf:compactClassIndex: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + if (oop & (tagMask())) { + isString = 0; + goto l2; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + isString = ClassByteStringCompactIndex == ccIndex; + goto l2; + +l2: /* end is:instanceOf:compactClassIndex: */; + if (!isString) { + if (oop != GIV(nilObj)) { + GIV(primFailCode) = PrimErrBadArgument; + } + return 0; + } + /* begin lengthOf:format: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots1 = byteAt(oop + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(oop - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + len = numSlots; + goto l4; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + len = (numSlots << (shiftForWord())) - (fmt & 7); + goto l4; + } + if (fmt >= (firstShortFormat())) { + len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l4; + } + if (fmt >= (firstLongFormat())) { + len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l4; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + len = ((usqInt) numSlots) >> 1; + goto l4; + } + len = 0; +l4: /* end lengthOf:format: */; + if (len == 0) { + return 0; + } + cString = malloc(len + 1); + if (!(cString)) { + GIV(primFailCode) = PrimErrNoCMemory; + return 0; + } + memcpy(cString, firstIndexableField(oop), len); + cString[len] = 0; + return cString; +} + + +/* In C, non-zero is true, so avoid computation by simply answering + primFailCode in the C version. + */ + + /* InterpreterPrimitives>>#failed */ +sqInt +failed(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return GIV(primFailCode); +} + + +/* Answer true if integer object is negative. + Fail if object pointed by oop i not an integer. */ + + /* InterpreterPrimitives>>#isNegativeIntegerValueOf: */ +static sqInt NoDbgRegParms +isNegativeIntegerValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt ccIndex1; + sqInt ok; + sqInt smallInt; + + if ((oop & 1)) { + smallInt = (oop >> 1); + return smallInt < 0; + } + if ((oop & (tagMask())) == 0) { + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (ok) { + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop)) & (classIndexMask()); + ok = ClassLargeNegativeIntegerCompactIndex == ccIndex1; + goto l4; + + l4: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (ok) { + return 1; + } + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; +} + + +/* Return a Large Integer object for the given integer magnitude and sign */ + + /* InterpreterPrimitives>>#magnitude64BitIntegerFor:neg: */ +static sqInt NoDbgRegParms +magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt highWord; + int isSmall; + sqInt largeClass; + sqInt newLargeInteger; + sqInt smallVal; + sqInt sz; + + isSmall = (isNegative + ? magnitude <= ((MaxSmallInteger) + 1) + : magnitude <= (MaxSmallInteger)); + if (isSmall) { + smallVal = ((sqInt) magnitude); + if (isNegative) { + smallVal = 0 - smallVal; + } + return (((usqInt)smallVal << 1) | 1); + } + if (isNegative) { + assert(((ClassLargeNegativeIntegerCompactIndex >= 1) && (ClassLargeNegativeIntegerCompactIndex <= (classTablePageSize())))); + /* begin fetchPointer:ofObject: */ + largeClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassLargeNegativeIntegerCompactIndex) << (shiftForWord()))))); + + } + else { + assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))); + /* begin fetchPointer:ofObject: */ + largeClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((int)((usqInt)(ClassLargePositiveIntegerCompactIndex) << (shiftForWord()))))); + + } + if (((highWord = magnitude >> 32)) == 0) { + sz = 4; + } + else { + sz = 5; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) { + sz += 1; + } + } + } + } + + newLargeInteger = instantiateClassindexableSize(largeClass, sz); + + /* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */ + long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude)); + + return newLargeInteger; +} + + +/* Convert the given object into an integer value. + The object may be either a positive SmallInteger or an eight-byte + LargeInteger. + */ + + /* InterpreterPrimitives>>#magnitude64BitValueOf: */ +static usqLong NoDbgRegParms +magnitude64BitValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt ccIndex1; + sqInt fmt; + sqInt ok; + sqInt smallIntValue; + usqInt sz; + usqLong value; + + if ((oop & 1)) { + smallIntValue = (oop >> 1); + if (smallIntValue < 0) { + smallIntValue = 0 - smallIntValue; + } + return ((usqLong) smallIntValue); + } + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l4; + +l4: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargeNegativeIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7); + if (sz > (sizeof(sqLong))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (sz > 4) { + value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3)))); + } + else { + + /* ] */ + value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + } + return value; +} + + +/* Convert the given object into an integer value. + The object may be a four-byte LargeInteger. */ + + /* InterpreterPrimitives>>#noInlineSigned32BitValueGutsOf: */ +static int NoDbgRegParms +noInlineSigned32BitValueGutsOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ccIndex; + sqInt ccIndex1; + unsigned int magnitude; + sqInt negative; + sqInt ok; + int value; + + assert(!((hasSixtyFourBitImmediates()))); + assert(!(((oop & 1)))); + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l4; + +l4: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (ok) { + negative = 0; + } + else { + negative = 1; + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargeNegativeIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + } + if ((numBytesOfBytes(oop)) > 4) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + magnitude = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + if ((negative + ? magnitude > 0x80000000U + : magnitude >= 0x80000000U)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (negative) { + value = 0 - magnitude; + } + else { + value = magnitude; + } + return value; +} + + +/* Answer a value of an integer in address range, i.e up to the size of a + machine word. + The object may be either a positive SmallInteger or a LargePositiveInteger + of size <= word size. + */ +/* only two callers & one is primitiveNewWithArg */ + + /* InterpreterPrimitives>>#positiveMachineIntegerValueOf: */ +usqIntptr_t +positiveMachineIntegerValueOf(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt bs; + sqInt ccIndex; + sqInt fmt; + sqInt ok; + sqInt value; + + if ((oop & 1)) { + value = (oop >> 1); + if (value < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + return value; + } + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + +l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + bs = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7); + if (bs > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs > 4)) { + return SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3)))); + } + else { + return ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2)))))); + } +} + + /* InterpreterPrimitives>>#primitiveAdd */ +static void +primitiveAdd(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerResult; + char *sp; + + /* begin pop2AndPushIntegerIfOK: */ + integerResult = (stackIntegerValue(1)) + (stackIntegerValue(0)); + if (!GIV(primFailCode)) { + if ((((sqInt)((((usqInt)integerResult)) ^ ((((usqInt)integerResult)) << 1)))) >= 0) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerResult << 1) | 1)); + GIV(stackPointer) = sp; + } + else { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + } +} + + +/* Primitive arithmetic operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveAddLargeIntegers */ +EXPORT(void) +primitiveAddLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong a; + sqInt aIsNegative; + usqLong b; + sqInt bIsNegative; + sqInt oopArg; + sqInt oopRcvr; + sqInt oopResult; + usqLong result; + sqInt resultIsNegative; + char *sp; + + oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + aIsNegative = isNegativeIntegerValueOf(oopRcvr); + bIsNegative = isNegativeIntegerValueOf(oopArg); + a = magnitude64BitValueOf(oopRcvr); + b = magnitude64BitValueOf(oopArg); + if (GIV(primFailCode)) { + return; + } + if (aIsNegative == bIsNegative) { + + /* Protect against overflow */ + if (a > (0xFFFFFFFFFFFFFFFFULL - b)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + result = a + b; + resultIsNegative = aIsNegative; + } + else { + if (a >= b) { + result = a - b; + resultIsNegative = aIsNegative; + } + else { + result = b - a; + resultIsNegative = bIsNegative; + } + } + oopResult = magnitude64BitIntegerForneg(result, resultIsNegative); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + +/* Primitive. Change the class of the argument to make it an instance of the + receiver given that the format of the receiver matches the format of the + argument's class. + Fail if receiver or argument are SmallIntegers, or the receiver is an + instance of a + compact class and the argument isn't, or when the argument's class is + compact and + the receiver isn't, or when the format of the receiver is different from + the format of + the argument's class, or when the arguments class is fixed and the + receiver's size + differs from the size that an instance of the argument's class should + have. + */ + + /* InterpreterPrimitives>>#primitiveAdoptInstance */ +static void +primitiveAdoptInstance(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqInt err; + sqInt rcvr; + + arg = longAt(GIV(stackPointer)); + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ((arg & (tagMask())) + || ((GIV(argumentCount) > 1) + && ((rcvr & (tagMask())) + || (!(objCouldBeClassObj(rcvr)))))) { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + err = changeClassOfto(arg, rcvr); + if (err == 0) { + + /* Flush at cache because rcvr's class has changed. */ + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; + } + else { + GIV(primFailCode) = err; + } + return; +} + + +/* Answer an array of all instances of the receiver that exist + when the primitive is called, excluding any that may be + garbage collected as a side effect of allocating the result array. */ + + /* InterpreterPrimitives>>#primitiveAllInstances */ +EXPORT(void) +primitiveAllInstances(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt delta; + sqInt result; + char *sp; + + result = allInstancesOf(longAt(GIV(stackPointer))); + if ((result & 1)) { + /* begin growToAccomodateContainerWithNumSlots: */ + delta = (BaseHeaderSize * 2) + (((result >> 1)) * BytesPerOop); + growOldSpaceByAtLeast(((GIV(growHeadroom) < delta) ? delta : GIV(growHeadroom))); + result = allInstancesOf(longAt(GIV(stackPointer))); + if ((result & 1)) { + GIV(primFailCode) = PrimErrNoMemory; + return; + } + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp; +} + + +/* Answer an array of all objects that exist when the primitive + is called, excluding those that may be garbage collected as + a side effect of allocating the result array. */ + + /* InterpreterPrimitives>>#primitiveAllObjects */ +EXPORT(void) +primitiveAllObjects(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt delta; + sqInt result; + char *sp; + + result = allObjects(); + if ((result & 1)) { + /* begin growToAccomodateContainerWithNumSlots: */ + delta = (BaseHeaderSize * 2) + (((result >> 1)) * BytesPerOop); + growOldSpaceByAtLeast(((GIV(growHeadroom) < delta) ? delta : GIV(growHeadroom))); + result = allObjects(); + if ((result & 1)) { + GIV(primFailCode) = PrimErrNoMemory; + return; + } + } + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp; +} + + /* InterpreterPrimitives>>#primitiveArctan */ +static void +primitiveArctan(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double f; + sqInt isFloat; + sqInt object; + sqInt oop; + double rcvr; + double result; + char *sp; + sqInt top; + + /* begin popFloat */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + oop = top; + isFloat = ((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(oop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end popFloat */; + if (!GIV(primFailCode)) { + /* begin pushFloat: */ + f = atan(rcvr); + /* begin push: */ + object = floatObjectOf(f); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + } + else { + /* begin unPop: */ + GIV(stackPointer) -= 1 * BytesPerWord; + } +} + + +/* We must flush the method cache here, to eliminate stale references + to mutated classes and/or selectors. */ + + /* InterpreterPrimitives>>#primitiveArrayBecome */ +static void +primitiveArrayBecome(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqInt ec; + sqInt rcvr; + + arg = longAt(GIV(stackPointer)); + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + ec = becomewithtwoWaycopyHash(rcvr, arg, 1, 0); + if (ec == PrimNoErr) { + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + else { + GIV(primFailCode) = ec; + } +} + + +/* We must flush the method cache here, to eliminate stale references + to mutated classes and/or selectors. */ + + /* InterpreterPrimitives>>#primitiveArrayBecomeOneWay */ +static void +primitiveArrayBecomeOneWay(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqInt ec; + sqInt rcvr; + + arg = longAt(GIV(stackPointer)); + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + ec = becomewithtwoWaycopyHash(rcvr, arg, 0, 1); + if (ec == PrimNoErr) { + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + else { + GIV(primFailCode) = ec; + } +} + + +/* Similar to primitiveArrayBecomeOneWay but accepts a third argument + deciding whether to + copy the receiver's element's identity hash over the argument's elementy's + identity hash. + */ + + /* InterpreterPrimitives>>#primitiveArrayBecomeOneWayCopyHash */ +static void +primitiveArrayBecomeOneWayCopyHash(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt copyHashFlag; + sqInt ec; + + copyHashFlag = 0; + if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { + copyHashFlag = 1; + } + else { + if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { + copyHashFlag = 0; + } + else { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + } + ec = becomewithtwoWaycopyHash(longAt(GIV(stackPointer) + (2 * BytesPerWord)), longAt(GIV(stackPointer) + (1 * BytesPerWord)), 0, copyHashFlag); + if (ec == PrimNoErr) { + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; + } + else { + GIV(primFailCode) = ec; + } +} + + /* InterpreterPrimitives>>#primitiveAsCharacter */ +static void +primitiveAsCharacter(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt characterCode; + sqInt characterObject; + sqInt reasonCode; + char *sp; + + characterCode = longAt(GIV(stackPointer)); + if (!(((characterCode & 1)) + && (((characterCode = (characterCode >> 1)), + ((characterCode >= 0) && (characterCode <= ((1U << 30) - 1))))))) { + /* begin primitiveFailFor: */ + reasonCode = (GIV(argumentCount) == 0 + ? PrimErrBadReceiver + : PrimErrBadArgument); + GIV(primFailCode) = reasonCode; + return; + } + /* begin characterObjectOf: */ + characterObject = (((sqInt)((usqInt)(characterCode) << (numTagBits())))) + (characterTag()); + + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), characterObject); + GIV(stackPointer) = sp; +} + + +/* N.B. This will answer inexact results for integers with > 53 bits of + magnitude. + */ + + /* InterpreterPrimitives>>#primitiveAsFloat */ +static void +primitiveAsFloat(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + char *sp; + + rcvr = longAt(GIV(stackPointer)); + assert((rcvr & 1)); + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), floatObjectOf(((double) ((rcvr >> 1)) ))); + GIV(stackPointer) = sp; +} + + /* InterpreterPrimitives>>#primitiveAt */ +static void +primitiveAt(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt class; + sqInt classFormat; + sqInt fixedFields; + usqLong fmt; + sqLong hdr; + sqInt index; + unsigned int integerValue; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + usqInt numSlots; + usqInt numSlots1; + sqInt objFormat; + sqInt rcvr; + sqInt reasonCode; + sqInt result; + char *sp; + sqInt sp1; + sqInt sp2; + sqInt stSize; + sqInt totalLength; + sqInt valueWord; + + /* begin commonAt: */ + GIV(primFailCode) = 0; + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + index = longAt(GIV(stackPointer)); + if (rcvr & (tagMask())) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrInappropriate; + goto l14; + } + if (((index & 1) == 0) + || ((GIV(argumentCount) > 1) + && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + goto l14; + } + index = (index >> 1); + /* begin stObject:at: */ + hdr = long64At(rcvr); + fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()); + /* begin lengthOf:format: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + totalLength = numSlots; + goto l6; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + totalLength = (numSlots << (shiftForWord())) - (fmt & 7); + goto l6; + } + if (fmt >= (firstShortFormat())) { + totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l6; + } + if (fmt >= (firstLongFormat())) { + totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l6; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + totalLength = ((usqInt) numSlots) >> 1; + goto l6; + } + totalLength = 0; +l6: /* end lengthOf:format: */; + /* begin fixedFieldsOf:format:length: */ + if ((fmt >= (sixtyFourBitIndexableFormat())) + || (fmt == 2)) { + fixedFields = 0; + goto l7; + } + if (fmt < 2) { + fixedFields = totalLength; + goto l7; + } + class = fetchClassOfNonImm(rcvr); + /* begin fixedFieldsOfClassFormat: */ + classFormat = ((longAt((class + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); +l7: /* end fixedFieldsOf:format:length: */; + if ((fmt == (indexablePointersFormat())) + && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) { + /* begin stackPointerForMaybeMarriedContext: */ + if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(rcvr)))) { + sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); + assert((ReceiverIndex + ((sp2 >> 1))) < (lengthOf(rcvr))); + stSize = sp2; + goto l4; + } + /* begin fetchStackPointerOf: */ + sp1 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp1 & 1))) { + stSize = 0; + goto l4; + } + assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr))); + stSize = (sp1 >> 1); + l4: /* end stackPointerForMaybeMarriedContext: */; + if ((oopisGreaterThanOrEqualTo(index, 1)) + && ((oopisLessThanOrEqualTo(index, stSize)) + && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(rcvr)))))) { + result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr)); + goto l13; + } + } + else { + stSize = totalLength - fixedFields; + } + if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat()) + ? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1 + : 1))) + && (oopisLessThanOrEqualTo(index, stSize))) { + /* begin subscript:with:format: */ + if (fmt <= 5) { + /* begin fetchPointer:ofObject: */ + result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord()))))); + goto l13; + } + if (fmt >= (firstByteFormat())) { + result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 1) | 1); + goto l13; + } + if (fmt >= (firstShortFormat())) { + result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 1) | 1); + goto l13; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))))); + goto l13; + } + + /* begin positive32BitIntegerFor: */ + integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2)))); + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { + result = ((integerValue << 1) | 1); + goto l13; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l10; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; + l10: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(integerValue); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + result = newLargeInteger; + goto l13; + + } + /* begin primitiveFailFor: */ + reasonCode = (fmt <= 1 + ? PrimErrBadReceiver + : PrimErrBadIndex); + GIV(primFailCode) = reasonCode; + result = 0; +l13: /* end stObject:at: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp; + } +l14: /* end commonAt: */; +} + + /* InterpreterPrimitives>>#primitiveAtPut */ +static void +primitiveAtPut(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt class1; + sqInt classFormat1; + sqInt fixedFields1; + usqLong fmt1; + sqLong hdr1; + sqInt index; + usqInt numSlots11; + usqInt numSlots2; + sqInt rcvr; + sqInt reasonCode1; + sqInt signedValueToStore1; + char *sp; + sqInt sp11; + sqInt sp3; + sqInt stSize1; + sqInt totalLength1; + usqLong unsigned64BitValueToStore1; + unsigned int unsignedValueToStore1; + sqInt value; + + /* begin commonAtPut: */ + GIV(primFailCode) = 0; + rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); + index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + value = longAt(GIV(stackPointer)); + if (rcvr & (tagMask())) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrInappropriate; + goto l30; + } + if (((index & 1) == 0) + || ((GIV(argumentCount) > 2) + && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + goto l30; + } + if ( +# if IMMUTABILITY + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) +# else /* IMMUTABILITY */ + 0 +# endif /* IMMUTABILITY */ + ) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrNoModification; + goto l30; + } + index = (index >> 1); + /* begin stObject:at:put: */ + hdr1 = long64At(rcvr); + fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask()); + /* begin lengthOf:format: */ + numSlots11 = byteAt(rcvr + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots11); + if (fmt1 <= 5) { + totalLength1 = numSlots2; + goto l21; + } + if (fmt1 >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7); + goto l21; + } + if (fmt1 >= (firstShortFormat())) { + totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3); + goto l21; + } + if (fmt1 >= (firstLongFormat())) { + totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1); + goto l21; + } + if (fmt1 == (sixtyFourBitIndexableFormat())) { + totalLength1 = ((usqInt) numSlots2) >> 1; + goto l21; + } + totalLength1 = 0; +l21: /* end lengthOf:format: */; + /* begin fixedFieldsOf:format:length: */ + if ((fmt1 >= (sixtyFourBitIndexableFormat())) + || (fmt1 == 2)) { + fixedFields1 = 0; + goto l16; + } + if (fmt1 < 2) { + fixedFields1 = totalLength1; + goto l16; + } + class1 = fetchClassOfNonImm(rcvr); + /* begin fixedFieldsOfClassFormat: */ + classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); +l16: /* end fixedFieldsOf:format:length: */; + if ((fmt1 == (indexablePointersFormat())) + && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) { + /* begin stackPointerForMaybeMarriedContext: */ + if ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(rcvr)))) { + sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr)); + assert((ReceiverIndex + ((sp3 >> 1))) < (lengthOf(rcvr))); + stSize1 = sp3; + goto l17; + } + /* begin fetchStackPointerOf: */ + sp11 = longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(StackPointerIndex) << (shiftForWord()))))); + if (!((sp11 & 1))) { + stSize1 = 0; + goto l17; + } + assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr))); + stSize1 = (sp11 >> 1); + l17: /* end stackPointerForMaybeMarriedContext: */; + if ((oopisGreaterThanOrEqualTo(index, 1)) + && ((oopisLessThanOrEqualTo(index, stSize1)) + && ((((longAt((rcvr + BaseHeaderSize) + (((int)((usqInt)(SenderIndex) << (shiftForWord())))))) & 1)) + && (!(isWidowedContext(rcvr)))))) { + noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value); + goto l29; + } + } + else { + stSize1 = totalLength1 - fixedFields1; + } + if ((oopisGreaterThanOrEqualTo(index, (fmt1 >= (firstCompiledMethodFormat()) + ? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1 + : 1))) + && (oopisLessThanOrEqualTo(index, stSize1))) { + /* begin subscript:with:storing:format: */ + if (fmt1 <= 5) { + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(rcvr))); + if ((assert(isNonImmediate(rcvr)), + oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) { + remember(rcvr); + } + } + } + longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value); + goto l28; + } + if (fmt1 >= (firstByteFormat())) { + if (!((value & 1))) { + GIV(primFailCode) = PrimErrBadArgument; + goto l28; + } + signedValueToStore1 = (value >> 1); + if (!((signedValueToStore1 >= 0) + && (signedValueToStore1 <= 0xFF))) { + GIV(primFailCode) = PrimErrBadArgument; + goto l28; + } + /* begin storeByte:ofObject:withValue: */ + byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1); + goto l28; + } + if (fmt1 >= (firstShortFormat())) { + if (!((value & 1))) { + GIV(primFailCode) = PrimErrBadArgument; + goto l28; + } + signedValueToStore1 = (value >> 1); + if (!((signedValueToStore1 >= 0) + && (signedValueToStore1 <= 0xFFFF))) { + GIV(primFailCode) = PrimErrBadArgument; + goto l28; + } + /* begin storeShort16:ofObject:withValue: */ + shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1); + goto l28; + } + if (fmt1 == (sixtyFourBitIndexableFormat())) { + unsigned64BitValueToStore1 = positive64BitValueOf(value); + if (!GIV(primFailCode)) { + /* begin storeLong64:ofObject:withValue: */ + long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1); + } + goto l28; + } + + unsignedValueToStore1 = positive32BitValueOf(value); + if (!GIV(primFailCode)) { + /* begin storeLong32:ofObject:withValue: */ + long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1); + } + l28: /* end subscript:with:storing:format: */; + } + else { + /* begin primitiveFailFor: */ + reasonCode1 = (fmt1 <= 1 + ? PrimErrBadReceiver + : PrimErrBadIndex); + GIV(primFailCode) = reasonCode1; + } +l29: /* end stObject:at:put: */; + + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value); + GIV(stackPointer) = sp; + } +l30: /* end commonAtPut: */; +} + + +/* Set the cursor to the given shape. The Mac only supports 16x16 pixel + cursors. Cursor offsets are handled by Smalltalk. + */ + + /* InterpreterPrimitives>>#primitiveBeCursor */ +static void +primitiveBeCursor(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt bitsObj; + sqInt cursorBitsIndex; + sqInt cursorObj; + sqInt depth; + sqInt extentX; + sqInt extentY; + sqInt maskBitsIndex; + sqInt maskObj; + sqInt offsetObj; + sqInt offsetX; + sqInt offsetY; + sqInt ourCursor; + sqInt successBoolean; + sqInt successBoolean1; + sqInt successBoolean10; + sqInt successBoolean11; + sqInt successBoolean12; + sqInt successBoolean2; + sqInt successBoolean3; + sqInt successBoolean4; + sqInt successBoolean5; + sqInt successBoolean6; + sqInt successBoolean7; + sqInt successBoolean8; + sqInt successBoolean9; + + bitsObj = 0; + cursorBitsIndex = 0; + cursorObj = 0; + depth = 0; + extentX = 0; + extentY = 0; + maskBitsIndex = 0; + maskObj = 0; + offsetObj = 0; + ourCursor = 0; + if (GIV(argumentCount) == 0) { + cursorObj = longAt(GIV(stackPointer)); + maskBitsIndex = null; + } + if (GIV(argumentCount) == 1) { + cursorObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + maskObj = longAt(GIV(stackPointer)); + } + /* begin success: */ + if (!(GIV(argumentCount) < 2)) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin success: */ + successBoolean = (((cursorObj & (tagMask())) == 0) + && (((((usqInt) (longAt(cursorObj))) >> (formatShift())) & (formatMask())) <= 5)) + && ((lengthOfformat(cursorObj, (((usqInt) (longAt(cursorObj))) >> (formatShift())) & (formatMask()))) >= 5); + if (!successBoolean) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + if (!GIV(primFailCode)) { + bitsObj = longAt((cursorObj + BaseHeaderSize) + (0U << (shiftForWord()))); + extentX = fetchIntegerofObject(1, cursorObj); + extentY = fetchIntegerofObject(2, cursorObj); + depth = fetchIntegerofObject(3, cursorObj); + offsetObj = longAt((cursorObj + BaseHeaderSize) + (4U << (shiftForWord()))); + /* begin success: */ + successBoolean1 = (((offsetObj & (tagMask())) == 0) + && (((((usqInt) (longAt(offsetObj))) >> (formatShift())) & (formatMask())) <= 5)) + && ((lengthOfformat(offsetObj, (((usqInt) (longAt(offsetObj))) >> (formatShift())) & (formatMask()))) >= 2); + if (!successBoolean1) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + if (!GIV(primFailCode)) { + offsetX = fetchIntegerofObject(0, offsetObj); + offsetY = fetchIntegerofObject(1, offsetObj); + if ((GIV(argumentCount) == 0) + && (depth == 32)) { + + /* Support arbitrary-sized 32 bit ARGB forms --bf 3/1/2007 23:51 */ + /* begin success: */ + successBoolean2 = (extentX > 0) + && (extentY > 0); + if (!successBoolean2) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean3 = (offsetX >= (extentX * -1)) + && (offsetX <= 0); + if (!successBoolean3) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean4 = (offsetY >= (extentY * -1)) + && (offsetY <= 0); + if (!successBoolean4) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean5 = (((bitsObj & (tagMask())) == 0) + && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) == (firstLongFormat()))) + && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == (extentX * extentY)); + if (!successBoolean5) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + cursorBitsIndex = bitsObj + BaseHeaderSize; + } + else { + /* begin success: */ + successBoolean6 = (extentX == 16) + && ((extentY == 16) + && (depth == 1)); + if (!successBoolean6) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean7 = (offsetX >= -16) + && (offsetX <= 0); + if (!successBoolean7) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean8 = (offsetY >= -16) + && (offsetY <= 0); + if (!successBoolean8) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean9 = (((bitsObj & (tagMask())) == 0) + && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) == (firstLongFormat()))) + && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == 16); + if (!successBoolean9) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + cursorBitsIndex = bitsObj + BaseHeaderSize; + } + } + if (GIV(argumentCount) == 1) { + /* begin success: */ + successBoolean12 = (((maskObj & (tagMask())) == 0) + && (((((usqInt) (longAt(maskObj))) >> (formatShift())) & (formatMask())) <= 5)) + && ((lengthOfformat(maskObj, (((usqInt) (longAt(maskObj))) >> (formatShift())) & (formatMask()))) >= 5); + if (!successBoolean12) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + bitsObj = longAt((maskObj + BaseHeaderSize) + (0U << (shiftForWord()))); + extentX = fetchIntegerofObject(1, maskObj); + extentY = fetchIntegerofObject(2, maskObj); + depth = fetchIntegerofObject(3, maskObj); + } + if (!GIV(primFailCode)) { + /* begin success: */ + successBoolean10 = (extentX == 16) + && ((extentY == 16) + && (depth == 1)); + if (!successBoolean10) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + /* begin success: */ + successBoolean11 = (((bitsObj & (tagMask())) == 0) + && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) == (firstLongFormat()))) + && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == 16); + if (!successBoolean11) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + maskBitsIndex = bitsObj + BaseHeaderSize; + } + } + if (!GIV(primFailCode)) { + if (GIV(argumentCount) == 0) { + if (depth == 32) { + if (!(ioSetCursorARGB(cursorBitsIndex, extentX, extentY, offsetX, offsetY))) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + return; + } + } + else { + ioSetCursor(cursorBitsIndex, offsetX, offsetY); + } + } + else { + ioSetCursorWithMask(cursorBitsIndex, maskBitsIndex, offsetX, offsetY); + } + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; + } +} + + +/* Record the system Display object in the specialObjectsTable. */ + + /* InterpreterPrimitives>>#primitiveBeDisplay */ +static void +primitiveBeDisplay(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + sqInt successBoolean; + + rcvr = longAt(GIV(stackPointer)); + /* begin success: */ + successBoolean = (((rcvr & (tagMask())) == 0) + && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) + && ((lengthOfformat(rcvr, (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= 4); + if (!successBoolean) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin splObj:put: */ + assert(!(isForwarded(GIV(specialObjectsOop)))); + if ((assert(isNonImmediate(GIV(specialObjectsOop))), + oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((rcvr & (tagMask())) == 0) + && (oopisLessThan(rcvr, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) { + remember(GIV(specialObjectsOop)); + } + } + } + longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheDisplay) << (shiftForWord())))), rcvr); + } +} + + +/* make the basic beep noise */ + + /* InterpreterPrimitives>>#primitiveBeep */ +static void +primitiveBeep(void) +{ + ioBeep(); +} + + /* InterpreterPrimitives>>#primitiveBehaviorHash */ +static void +primitiveBehaviorHash(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt err; + sqInt hash; + sqInt hashOrError; + char *sp; + + assert((isNonImmediate(stackTop())) + && (addressCouldBeClassObj(stackTop()))); + assert(addressCouldBeClassObj(longAt(GIV(stackPointer)))); + hashOrError = (((hash = (long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(longAt(GIV(stackPointer))) + ? (((err = enterIntoClassTable(longAt(GIV(stackPointer))))) != 0 + ? -err + : (long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + + if (hashOrError >= 0) { + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)hashOrError << 1) | 1)); + GIV(stackPointer) = sp; + } + else { + GIV(primFailCode) = -hashOrError; + } +} + + +/* Note no short-cut for SmallIntegers. Either the inline interpreter + bytecode or the JIT primitive will handle this case. */ + + /* InterpreterPrimitives>>#primitiveBitAnd */ +static void +primitiveBitAnd(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt bs; + usqInt bs1; + sqInt ccIndex; + sqInt ccIndex1; + sqInt fmt; + sqInt fmt1; + usqInt integerArgumentValue; + usqInt integerReceiverValue; + sqInt ok; + sqInt ok1; + sqInt oop; + sqInt oop1; + sqInt oop2; + char *sp; + sqInt value; + sqInt value1; + + /* begin positiveMachineIntegerValueOf: */ + oop1 = longAt(GIV(stackPointer)); + if ((oop1 & 1)) { + value = (oop1 >> 1); + if (value < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) null); + goto l4; + } + integerArgumentValue = ((usqIntptr_t) value); + goto l4; + } + if (oop1 & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop1))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop1)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + +l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + bs = ((numSlotsOf(oop1)) << (shiftForWord())) - (fmt & 7); + if (bs > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs > 4)) { + integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); + goto l4; + } + else { + integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); + goto l4; + } +l4: /* end positiveMachineIntegerValueOf: */; + /* begin positiveMachineIntegerValueOf: */ + oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ((oop2 & 1)) { + value1 = (oop2 >> 1); + if (value1 < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) null); + goto l8; + } + integerReceiverValue = ((usqIntptr_t) value1); + goto l8; + } + if (oop2 & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop2))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop2)) & (classIndexMask()); + ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l7; + +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok1) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin numBytesOfBytes: */ + fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); + assert(fmt1 >= (firstByteFormat())); + bs1 = ((numSlotsOf(oop2)) << (shiftForWord())) - (fmt1 & 7); + if (bs1 > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs1 > 4)) { + integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); + goto l8; + } + else { + integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); + goto l8; + } +l8: /* end positiveMachineIntegerValueOf: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue); + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + } +} + + +/* Primitive logical operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveBitAndLargeIntegers */ +EXPORT(void) +primitiveBitAndLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong integerArg; + usqLong integerRcvr; + sqInt oopResult; + char *sp; + + integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (GIV(primFailCode)) { + return; + } + oopResult = positive64BitIntegerFor(integerRcvr & integerArg); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + +/* Note no short-cut for SmallIntegers. Either the inline interpreter + bytecode or the JIT primitive will handle this case. */ + + /* InterpreterPrimitives>>#primitiveBitOr */ +static void +primitiveBitOr(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt bs; + usqInt bs1; + sqInt ccIndex; + sqInt ccIndex1; + sqInt fmt; + sqInt fmt1; + usqInt integerArgumentValue; + usqInt integerReceiverValue; + sqInt ok; + sqInt ok1; + sqInt oop; + sqInt oop1; + sqInt oop2; + char *sp; + sqInt value; + sqInt value1; + + /* begin positiveMachineIntegerValueOf: */ + oop1 = longAt(GIV(stackPointer)); + if ((oop1 & 1)) { + value = (oop1 >> 1); + if (value < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) null); + goto l4; + } + integerArgumentValue = ((usqIntptr_t) value); + goto l4; + } + if (oop1 & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop1))); + /* begin classIndexOf: */ + ccIndex = (longAt(oop1)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + +l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + bs = ((numSlotsOf(oop1)) << (shiftForWord())) - (fmt & 7); + if (bs > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs > 4)) { + integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3)))))); + goto l4; + } + else { + integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2)))))))); + goto l4; + } +l4: /* end positiveMachineIntegerValueOf: */; + /* begin positiveMachineIntegerValueOf: */ + oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ((oop2 & 1)) { + value1 = (oop2 >> 1); + if (value1 < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) null); + goto l8; + } + integerReceiverValue = ((usqIntptr_t) value1); + goto l8; + } + if (oop2 & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(oop2))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(oop2)) & (classIndexMask()); + ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l7; + +l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok1) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin numBytesOfBytes: */ + fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask()); + assert(fmt1 >= (firstByteFormat())); + bs1 = ((numSlotsOf(oop2)) << (shiftForWord())) - (fmt1 & 7); + if (bs1 > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs1 > 4)) { + integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3)))))); + goto l8; + } + else { + integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2)))))))); + goto l8; + } +l8: /* end positiveMachineIntegerValueOf: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue); + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + } +} + + +/* Primitive logical operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveBitOrLargeIntegers */ +EXPORT(void) +primitiveBitOrLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong integerArg; + usqLong integerRcvr; + sqInt oopResult; + char *sp; + + integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (GIV(primFailCode)) { + return; + } + oopResult = positive64BitIntegerFor(integerRcvr | integerArg); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + +/* Perform a bitShift. In 32-bits deal only with non-negative 32-bit + integers. In 64-bits deal with signed 64-bit quantities (max (2^63)-1). */ + + /* InterpreterPrimitives>>#primitiveBitShift */ +static void +primitiveBitShift(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerArgument; + sqInt integerReceiver; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt shifted; + char *sp; + sqInt valueWord; + + integerArgument = longAt(GIV(stackPointer)); + if (!((integerArgument & 1))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + integerReceiver = positive32BitValueOf(integerReceiver); + + if (!GIV(primFailCode)) { + if (((integerArgument = (integerArgument >> 1))) >= 0) { + + /* Left shift -- must fail bits would be lost */ + if (!(integerArgument <= 0x1F)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument)); + if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + } + else { + + /* Right shift -- OK to lose bits */ + if (!(integerArgument >= (-0x1F))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + shifted = ((usqInt) integerReceiver) >> (0 - integerArgument); + } + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) shifted)) <= (MaxSmallInteger)) { + shifted = (((usqInt)shifted << 1) | 1); + goto l5; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(shifted); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + shifted = newLargeInteger; + goto l5; + + l5: /* end positive32BitIntegerFor: */; + + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted); + GIV(stackPointer) = sp; + } +} + + +/* Primitive arithmetic operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveBitShiftLargeIntegers */ +EXPORT(void) +primitiveBitShiftLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong a; + sqInt aIsNegative; + sqInt integerPointer; + sqInt oopRcvr; + sqInt oopResult; + usqLong result; + sqInt shift; + char *sp; + + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + shift = (integerPointer >> 1); + goto l1; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + shift = 0; + goto l1; + } +l1: /* end stackIntegerValue: */; + oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + aIsNegative = isNegativeIntegerValueOf(oopRcvr); + a = magnitude64BitValueOf(oopRcvr); + if (GIV(primFailCode)) { + return; + } + if (shift >= 0) { + + /* Protect against overflow */ + + /* This is to avoid undue (usqInt) cast */ + result = 0xFFFFFFFFFFFFFFFFULL; + if ((shift >= 64) + || (a > (result >> shift))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + result = a << shift; + } + else { + shift = 0 - shift; + if (shift >= 64) { + result = 0; + } + else { + result = a >> shift; + } + if (aIsNegative + && ((result << shift) != a)) { + result += 1; + } + } + oopResult = magnitude64BitIntegerForneg(result, aIsNegative); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveBitXor */ +static void +primitiveBitXor(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt bs; + usqInt bs1; + sqInt ccIndex; + sqInt ccIndex1; + sqInt fmt; + sqInt fmt1; + sqInt integerArgument; + usqInt integerArgumentValue; + sqInt integerReceiver; + usqInt integerReceiverValue; + sqInt ok; + sqInt ok1; + sqInt oop; + sqInt oop1; + char *sp; + char *sp1; + sqInt value; + sqInt value1; + + integerArgument = longAt(GIV(stackPointer)); + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (((integerArgument & 1)) + && ((integerReceiver & 1))) { + + /* xoring will leave the tag bits zero, whether the tag is 1 or zero, so add it back in. */ + /* begin pop:thenPush: */ + oop = (integerArgument ^ integerReceiver) + (smallIntegerTag()); + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + } + else { + /* begin positiveMachineIntegerValueOf: */ + if ((integerArgument & 1)) { + value = (integerArgument >> 1); + if (value < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) null); + goto l4; + } + integerArgumentValue = ((usqIntptr_t) value); + goto l4; + } + if (integerArgument & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(integerArgument))); + /* begin classIndexOf: */ + ccIndex = (longAt(integerArgument)) & (classIndexMask()); + ok = ClassLargePositiveIntegerCompactIndex == ccIndex; + goto l2; + + l2: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + bs = ((numSlotsOf(integerArgument)) << (shiftForWord())) - (fmt & 7); + if (bs > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgumentValue = ((usqIntptr_t) 0); + goto l4; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs > 4)) { + integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3)))))); + goto l4; + } + else { + integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2)))))))); + goto l4; + } + l4: /* end positiveMachineIntegerValueOf: */; + /* begin positiveMachineIntegerValueOf: */ + if ((integerReceiver & 1)) { + value1 = (integerReceiver >> 1); + if (value1 < 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) null); + goto l8; + } + integerReceiverValue = ((usqIntptr_t) value1); + goto l8; + } + if (integerReceiver & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin isClassOfNonImm:equalTo:compactClassIndex: */ + assert(!(isImmediate(integerReceiver))); + /* begin classIndexOf: */ + ccIndex1 = (longAt(integerReceiver)) & (classIndexMask()); + ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1; + goto l7; + + l7: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + if (!ok1) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + /* begin numBytesOfBytes: */ + fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask()); + assert(fmt1 >= (firstByteFormat())); + bs1 = ((numSlotsOf(integerReceiver)) << (shiftForWord())) - (fmt1 & 7); + if (bs1 > (sizeof(usqIntptr_t))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiverValue = ((usqIntptr_t) 0); + goto l8; + } + if (((sizeof(usqIntptr_t)) == 8) + && (bs1 > 4)) { + integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3)))))); + goto l8; + } + else { + integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2)))))))); + goto l8; + } + l8: /* end positiveMachineIntegerValueOf: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue); + longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop1); + GIV(stackPointer) = sp1; + } + } +} + + +/* Primitive logical operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveBitXorLargeIntegers */ +EXPORT(void) +primitiveBitXorLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong integerArg; + usqLong integerRcvr; + sqInt oopResult; + char *sp; + + integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (GIV(primFailCode)) { + return; + } + oopResult = positive64BitIntegerFor(integerRcvr ^ integerArg); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + +/* Reports bytes available at this moment. For more meaningful + results, calls to this primitive should be precedeed by a full + or incremental garbage collection. */ + + /* InterpreterPrimitives>>#primitiveBytesLeft */ +static void +primitiveBytesLeft(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + sqInt integerVal; + char *sp; + char *sp1; + + if (GIV(argumentCount) == 0) { + + /* old behavior - just return the size of free memory */ + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((GIV(totalFreeOldSpace) << 1) | 1)); + GIV(stackPointer) = sp; + return; + } + if (GIV(argumentCount) == 1) { + + /* new behaviour -including or excluding swap space depending on aBool */ + /* begin booleanValueOf: */ + if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { + aBool = 1; + goto l1; + } + if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { + aBool = 0; + goto l1; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + aBool = null; + l1: /* end booleanValueOf: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushInteger: */ + integerVal = (((GIV(totalFreeOldSpace) + ((((eden()).limit)) - GIV(freeStart))) + ((((pastSpace()).limit)) - GIV(pastSpaceStart))) + ((((futureSpace()).limit)) - (((futureSpace()).limit)))) - (interpreterAllocationReserveBytes()); + longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerVal << 1) | 1)); + GIV(stackPointer) = sp1; + return; + } + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; +} + + +/* Perform a function call to a foreign function. + Only invoked from method containing explicit external call spec. + Due to this we use the pluggable prim mechanism explicitly here + (the first literal of any FFI spec'ed method is an ExternalFunction + and not an array as used in the pluggable primitive mechanism). */ + + /* InterpreterPrimitives>>#primitiveCalloutToFFI */ +static void +primitiveCalloutToFFI(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + static void *function = (void *)-1; + void (*primitiveCallout)(void); + + /* begin functionForPrimitiveCallout */ + if ((((sqInt)function)) == -1) { + function = ioLoadFunctionFrom("primitiveCallout", "SqueakFFIPrims"); + } + primitiveCallout = ((void (*)(void)) function); + if (primitiveCallout == null) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + else { + primitiveCallout(); + } +} + + +/* Primitive. Change the class of the receiver into the class of the argument + given that + the format of the receiver matches the format of the argument's class. + Fail if the + receiver or argument are SmallIntegers, or the receiver is an instance of + a compact + class and the argument isn't, or when the argument's class is compact and + the receiver + isn't, or when the format of the receiver is different from the format of + the argument's + class, or when the arguments class is fixed and the receiver's size + differs from the size + that an instance of the argument's class should have. */ + + /* InterpreterPrimitives>>#primitiveChangeClass */ +static void +primitiveChangeClass(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqInt argClass; + sqInt err; + sqInt oop; + sqInt oop1; + sqInt rcvr; + + /* begin stackObjectValue: */ + oop = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + if (oop & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = null; + goto l2; + } + arg = oop; +l2: /* end stackObjectValue: */; + /* begin stackObjectValue: */ + oop1 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (oop1 & (tagMask())) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = null; + goto l3; + } + rcvr = oop1; +l3: /* end stackObjectValue: */; + if (GIV(primFailCode)) { + return; + } + argClass = fetchClassOfNonImm(arg); + err = changeClassOfto(rcvr, argClass); + if (err == 0) { + + /* Flush at cache because rcvr's class has changed. */ + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; + } + else { + GIV(primFailCode) = err; + } + return; +} + + /* InterpreterPrimitives>>#primitiveClass */ +static void +primitiveClass(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt instance; + sqInt oop; + char *sp; + sqInt tagBits; + + instance = longAt(GIV(stackPointer)); + if ((GIV(argumentCount) > 0) + && (((instance & (tagMask())) == 0) + && (((longAt(instance)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + else { + /* begin pop:thenPush: */ + if (((tagBits = instance & (tagMask()))) != 0) { + /* begin fetchPointer:ofObject: */ + oop = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))); + } + else { + oop = fetchClassOfNonImm(instance); + } + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + } +} + + +/* Primitive. Void the VM profile histograms. */ + + /* InterpreterPrimitives>>#primitiveClearVMProfile */ +static void +primitiveClearVMProfile(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + ioClearProfile(); + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; +} + + +/* When called with a single string argument, post the string to + the clipboard. When called with zero arguments, return a + string containing the current clipboard contents. */ + + /* InterpreterPrimitives>>#primitiveClipboardText */ +static void +primitiveClipboardText(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt fmt; + sqInt formatField; + usqInt newObj; + usqInt numBytes1; + sqInt numSlots; + sqInt s; + char *sp; + usqInt sz; + + if (GIV(argumentCount) == 1) { + s = longAt(GIV(stackPointer)); + if (!(((s & (tagMask())) == 0) + && (((((usqInt) (longAt(s))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + if (!GIV(primFailCode)) { + /* begin numBytesOfBytes: */ + fmt = (((usqInt) (longAt(s))) >> (formatShift())) & (formatMask()); + assert(fmt >= (firstByteFormat())); + sz = ((numSlotsOf(s)) << (shiftForWord())) - (fmt & 7); + clipboardWriteFromAt(sz, s + BaseHeaderSize, 0); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + } + else { + sz = clipboardSize(); + /* begin allocateBytes:classIndex: */ + assert(addressCouldBeClassObj(classAtIndex(ClassByteStringCompactIndex))); + assert((instSpecOfClass(classAtIndex(ClassByteStringCompactIndex))) == (firstByteFormat())); + /* begin allocateSlots:format:classIndex: */ + numSlots = ((sz + BytesPerOop) - 1) / BytesPerOop; + formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1)); + if (numSlots >= (numSlotsMask())) { + newObj = GIV(freeStart) + BaseHeaderSize; + numBytes1 = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj = GIV(freeStart); + numBytes1 = BaseHeaderSize + ((numSlots <= 1 + ? (/* begin allocationUnit */ + 8) + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex); + goto l4; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, ClassByteStringCompactIndex)); + } + else { + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex); + } + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + GIV(freeStart) += numBytes1; + s = newObj; + l4: /* end allocateBytes:classIndex: */; + if (!(s)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + + clipboardReadIntoAt(sz, s + BaseHeaderSize, 0); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), s); + GIV(stackPointer) = sp; + } +} + + +/* Take a boolean which if true turns or keeps clock logging on. Answer an + array supplying + the size of the clock logs, the address of the usecs log, the index in it, + the address of the + msecs log, and the index into it. */ + + /* InterpreterPrimitives>>#primitiveClockLogAddresses */ +EXPORT(sqInt) +primitiveClockLogAddresses(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt midx; + void *msecs; + sqInt newLargeInteger; + sqInt newLargeInteger1; + usqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numBytes1; + sqInt objFormat; + sqInt objFormat1; + sqInt objOop; + sqInt objOop1; + sqInt objOop2; + sqInt objOop3; + sqInt objOop4; + sqInt oop; + sqInt oop1; + sqInt oop2; + sqInt result; + sqInt runInNOut; + char *sp; + sqInt uidx; + void *usecs; + sqInt v1; + sqInt v2; + sqInt valueWord; + sqInt valueWord2; + + + /* bypass type inference which would deduce int */ + midx = 0; + msecs = 0; + uidx = 0; + usecs = 0; + if (GIV(argumentCount) != 1) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + runInNOut = (longAt(GIV(stackPointer) + (0 * BytesPerWord))) == GIV(trueObj); + ioGetClockLogSizeUsecsIdxMsecsIdx((&runInNOut), (&usecs), (&uidx), (&msecs), (&midx)); + result = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassArray) << (shiftForWord()))))), 5); + if (result == 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + /* begin pushRemappableOop: */ + assert(addressCouldBeOop(result)); + GIV(remapBuffer)[(GIV(remapBufferCount) += 1)] = result; + if (!(GIV(remapBufferCount) <= RemapBufferSize)) { + error("remapBuffer overflow"); + } + /* begin storePointerUnchecked:ofObject:withValue: */ + objOop = GIV(remapBuffer)[GIV(remapBufferCount)]; + assert(!(isOopForwarded(objOop))); + longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)runInNOut << 1) | 1)); + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) (((usqInt)usecs)))) <= (MaxSmallInteger)) { + v1 = (((((usqInt)usecs)) << 1) | 1); + goto l9; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l7; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; +l7: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN((((usqInt)usecs))); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + v1 = newLargeInteger; + goto l9; + +l9: /* end positive32BitIntegerFor: */; + /* begin positive32BitIntegerFor: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) (((usqInt)msecs)))) <= (MaxSmallInteger)) { + v2 = (((((usqInt)msecs)) << 1) | 1); + goto l14; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj1 = GIV(freeStart); + numBytes1 = BaseHeaderSize + (8); + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger1 = 0; + goto l12; + } + } + long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes1; + newLargeInteger1 = newObj1; +l12: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord2 = SQ_SWAP_4_BYTES_IF_BIGENDIAN((((usqInt)msecs))); + long32Atput((newLargeInteger1 + BaseHeaderSize) + (0U << 2), valueWord2); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); + + v2 = newLargeInteger1; + goto l14; + +l14: /* end positive32BitIntegerFor: */; + if (GIV(primFailCode)) { + /* begin popRemappableOop */ + oop = GIV(remapBuffer)[GIV(remapBufferCount)]; + GIV(remapBufferCount) -= 1; + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return null; + } + /* begin storePointer:ofObject:withValue: */ + objOop3 = GIV(remapBuffer)[GIV(remapBufferCount)]; + assert(!(isForwarded(objOop3))); + if ((assert(isNonImmediate(objOop3)), + oopisGreaterThanOrEqualTo(objOop3, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((v1 & (tagMask())) == 0) + && (oopisLessThan(v1, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop3))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop3); + } + } + } + longAtput((objOop3 + BaseHeaderSize) + (1U << (shiftForWord())), v1); + /* begin storePointerUnchecked:ofObject:withValue: */ + objOop1 = GIV(remapBuffer)[GIV(remapBufferCount)]; + assert(!(isOopForwarded(objOop1))); + longAtput((objOop1 + BaseHeaderSize) + (2U << (shiftForWord())), (((usqInt)uidx << 1) | 1)); + /* begin storePointer:ofObject:withValue: */ + objOop4 = GIV(remapBuffer)[GIV(remapBufferCount)]; + assert(!(isForwarded(objOop4))); + if ((assert(isNonImmediate(objOop4)), + oopisGreaterThanOrEqualTo(objOop4, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((v2 & (tagMask())) == 0) + && (oopisLessThan(v2, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(objOop4))) >> (rememberedBitShift())) & 1) != 0)) { + remember(objOop4); + } + } + } + longAtput((objOop4 + BaseHeaderSize) + (3U << (shiftForWord())), v2); + /* begin storePointerUnchecked:ofObject:withValue: */ + objOop2 = GIV(remapBuffer)[GIV(remapBufferCount)]; + assert(!(isOopForwarded(objOop2))); + longAtput((objOop2 + BaseHeaderSize) + (4U << (shiftForWord())), (((usqInt)midx << 1) | 1)); + /* begin pop:thenPush: */ + oop2 = GIV(remapBuffer)[GIV(remapBufferCount)]; + GIV(remapBufferCount) -= 1; + oop1 = oop2; + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop1); + GIV(stackPointer) = sp; + return 0; +} + + /* InterpreterPrimitives>>#primitiveClosureValue */ +static void +primitiveClosureValue(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt blockClosure; + sqInt closureIP; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt i; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + sqInt oop1; + sqInt outerContext; + sqInt outerContext1; + char *sp; + char *sp1; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(GIV(argumentCount) == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + outerContext = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (!(((outerContext & (tagMask())) == 0) + && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + + /* Check if the closure's method is actually a CompiledMethod. */ + closureMethod = longAt((outerContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin activateNewClosureMethod:numArgs:mayContextSwitch: */ + outerContext1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + assert(isContext(outerContext1)); + assert(outerContext1 != blockClosure); + numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex; + theMethod = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp8; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + ((cogMethod->blockEntryOffset)); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l8; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogselector(theMethod, GIV(nilObj)); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + ((cogMethod1->blockEntryOffset)); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l8; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp2; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp4; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp5; + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp6; + /* begin push: */ + objOop = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(ReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext1, objOop); + } + object1 = objOop; + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp7; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin quickFetchInteger:ofObject: */ + oop1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))); + assert((oop1 & 1)); + closureIP = (oop1 >> 1); + GIV(instructionPointer) = ((theMethod + closureIP) + BaseHeaderSize) - 2; + /* begin setMethod:methodHeader: */ + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(1); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +} + + +/* An exact clone of primitiveClosureValue except that this version will not + check for interrupts on stack overflow. It may invoke the garbage + collector but will not switch processes. See + checkForInterruptsMayContextSwitch: */ + + /* InterpreterPrimitives>>#primitiveClosureValueNoContextSwitch */ +void +primitiveClosureValueNoContextSwitch(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt blockClosure; + sqInt closureIP; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt i; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + sqInt oop1; + sqInt outerContext; + sqInt outerContext1; + char *sp; + char *sp1; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(GIV(argumentCount) == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + outerContext = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (!(((outerContext & (tagMask())) == 0) + && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + + /* Check if the closure's method is actually a CompiledMethod. */ + closureMethod = longAt((outerContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin activateNewClosureMethod:numArgs:mayContextSwitch: */ + outerContext1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + assert(isContext(outerContext1)); + assert(outerContext1 != blockClosure); + numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex; + theMethod = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp8; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + (((cogMethod->blockEntryOffset)) - (noContextSwitchBlockEntryOffset())); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l8; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogselector(theMethod, GIV(nilObj)); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + (((cogMethod1->blockEntryOffset)) - (noContextSwitchBlockEntryOffset())); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l8; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp2; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp4; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp5; + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp6; + /* begin push: */ + objOop = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(ReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext1, objOop); + } + object1 = objOop; + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp7; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin quickFetchInteger:ofObject: */ + oop1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))); + assert((oop1 & 1)); + closureIP = (oop1 >> 1); + GIV(instructionPointer) = ((theMethod + closureIP) + BaseHeaderSize) - 2; + /* begin setMethod:methodHeader: */ + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(0); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l8: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +} + + /* InterpreterPrimitives>>#primitiveClosureValueWithArgs */ +static void +primitiveClosureValueWithArgs(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt argumentArray; + usqInt arraySize; + sqInt blockClosure; + sqInt closureIP; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt i; + sqInt index; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + usqInt numSlots; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + sqInt oop1; + sqInt outerContext; + sqInt outerContext1; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + sqInt top; + + argumentArray = longAt(GIV(stackPointer)); + if (!(((argumentArray & (tagMask())) == 0) + && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin numSlotsOf: */ + assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); + if (!(roomToPushNArgs(arraySize))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(arraySize == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + outerContext = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + if (!(((outerContext & (tagMask())) == 0) + && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + + /* Check if the closure's method is actually a CompiledMethod. */ + closureMethod = longAt((outerContext + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + index = 1; + while (index <= numArgs) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + index += 1; + } + /* begin activateNewClosureMethod:numArgs:mayContextSwitch: */ + outerContext1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))); + assert(isContext(outerContext1)); + assert(outerContext1 != blockClosure); + numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex; + theMethod = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(MethodIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp8; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + ((cogMethod->blockEntryOffset)); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l10; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogselector(theMethod, GIV(nilObj)); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + ((cogMethod1->blockEntryOffset)); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l10; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp2; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp3; + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp4; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp5; + /* begin push: */ + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp6; + /* begin push: */ + objOop = longAt((outerContext1 + BaseHeaderSize) + (((int)((usqInt)(ReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext1, objOop); + } + object1 = objOop; + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp7; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp10; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin quickFetchInteger:ofObject: */ + oop1 = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))); + assert((oop1 & 1)); + closureIP = (oop1 >> 1); + GIV(instructionPointer) = ((theMethod + closureIP) + BaseHeaderSize) - 2; + /* begin setMethod:methodHeader: */ + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + assert((methodHeaderOf(GIV(method))) == methodHeader); + GIV(bytecodeSetSelector) = ((((int) methodHeader)) < 0 + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(1); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l10: /* end activateNewClosureMethod:numArgs:mayContextSwitch: */; +} + + +/* Primitive. Compare two byte-indexed objects for equality */ + + /* InterpreterPrimitives>>#primitiveCompareBytes */ +EXPORT(void) +primitiveCompareBytes(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg1; + sqInt arg2; + sqInt fmt; + sqInt fmt1; + sqInt i; + sqInt len1; + sqInt len2; + usqInt numBytes; + usqInt numBytes1; + usqInt numSlots; + usqInt numSlots1; + char *sp; + char *sp1; + char *sp2; + char *sp3; + + if (!(GIV(argumentCount) == 1)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + arg1 = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + arg2 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + if (!((((arg1 & (tagMask())) == 0) + && (((((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))) + && (((arg2 & (tagMask())) == 0) + && (((((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + if (arg1 == arg2) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj)); + GIV(stackPointer) = sp; + return; + } + /* begin byteSizeOf: */ + if (arg1 & (tagMask())) { + len1 = 0; + goto l2; + } + /* begin numBytesOf: */ + fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(arg1 + 7); + numBytes = (numSlots == (numSlotsMask()) + ? longAt(arg1 - BaseHeaderSize) + : numSlots); + numBytes = numBytes << (shiftForWord()); + if (fmt >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + len1 = numBytes - (fmt & 7); + goto l2; + } + if (fmt <= (sixtyFourBitIndexableFormat())) { + len1 = numBytes; + goto l2; + } + if (fmt >= (firstShortFormat())) { + len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); + goto l2; + } + len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); +l2: /* end byteSizeOf: */; + /* begin byteSizeOf: */ + if (arg2 & (tagMask())) { + len2 = 0; + goto l4; + } + /* begin numBytesOf: */ + fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun())); + numSlots1 = byteAt(arg2 + 7); + numBytes1 = (numSlots1 == (numSlotsMask()) + ? longAt(arg2 - BaseHeaderSize) + : numSlots1); + numBytes1 = numBytes1 << (shiftForWord()); + if (fmt1 >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + len2 = numBytes1 - (fmt1 & 7); + goto l4; + } + if (fmt1 <= (sixtyFourBitIndexableFormat())) { + len2 = numBytes1; + goto l4; + } + if (fmt1 >= (firstShortFormat())) { + len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1))); + goto l4; + } + len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2))); +l4: /* end byteSizeOf: */; + if (!(len1 == len2)) { + /* begin pop:thenPush: */ + longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); + GIV(stackPointer) = sp1; + return; + } + for (i = 0; i < len1; i += 1) { + if (!((byteAt((arg1 + BaseHeaderSize) + i)) == (byteAt((arg2 + BaseHeaderSize) + i)))) { + /* begin pop:thenPush: */ + longAtput((sp2 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj)); + GIV(stackPointer) = sp2; + return; + } + } + /* begin pop:thenPush: */ + longAtput((sp3 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj)); + GIV(stackPointer) = sp3; +} + + +/* Fill the receiver, which must be an indexable non-pointer + object, with the given integer value. */ + + /* InterpreterPrimitives>>#primitiveConstantFill */ +static void +primitiveConstantFill(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqInt end; + usqLong fillValue; + sqInt format; + usqInt i; + usqInt numSlots; + usqInt numSlots1; + sqInt oddBytes; + sqInt rcvr; + usqInt slotBytes; + + /* begin primitiveConstantFillSpur */ + fillValue = positive64BitValueOf(longAt(GIV(stackPointer))); + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (!((!GIV(primFailCode)) + && (((rcvr & (tagMask())) == 0) + && (((format = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= (sixtyFourBitIndexableFormat()))))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l5; + } + if (format >= (firstShortFormat())) { + if (format >= (firstByteFormat())) { + if ((fillValue > 0xFF) + || (format >= (firstCompiledMethodFormat()))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l5; + } + fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24); + oddBytes = format & 7; + } + else { + if (fillValue > 0xFFFF) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l5; + } + fillValue += fillValue << 16; + oddBytes = ((sqInt)((usqInt)((format & 3)) << 1)); + } + fillValue += fillValue << 32; + } + else { + if (format == (sixtyFourBitIndexableFormat())) { + oddBytes = 0; + } + else { + if (fillValue > 0xFFFFFFFFU) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + goto l5; + } + fillValue += fillValue << 32; + oddBytes = ((sqInt)((usqInt)((format & 1)) << 2)); + } + } + /* begin addressAfter: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + end = (rcvr + BaseHeaderSize) + slotBytes; + i = rcvr + BaseHeaderSize; + while (i < end) { + long64Atput(i, fillValue); + i += 8; + } + if (oddBytes > 0) { + flag("endianness"); + fillValue = fillValue >> (8 * oddBytes); + long64Atput(i - 8, fillValue); + } + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; +l5: /* end primitiveConstantFillSpur */; + +} + + +/* Primitive. Start or stop the VM profiler. The first argument is a boolean + to switch profiling on or off. The second argument is an integer or nil. + If an integer it determines the maximum number of samples in the VM's + sample buffer. Answer the current number of samples in the buffer. */ + + /* InterpreterPrimitives>>#primitiveControlVMProfiling */ +static void +primitiveControlVMProfiling(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt bufferSize; + sqInt numSamples; + sqInt onOffBar; + char *sp; + + if (GIV(argumentCount) != 2) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + if (((onOffBar = longAt(GIV(stackPointer) + (1 * BytesPerWord)))) == GIV(trueObj)) { + onOffBar = 1; + } + else { + if (onOffBar == GIV(falseObj)) { + onOffBar = 0; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + } + if (((bufferSize = longAt(GIV(stackPointer)))) == GIV(nilObj)) { + bufferSize = 0; + } + else { + if (!(((bufferSize & 1)) + && (((bufferSize = (bufferSize >> 1))) > 0))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + } + numSamples = ioControlNewProfile(onOffBar,bufferSize); + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), (((usqInt)numSamples << 1) | 1)); + GIV(stackPointer) = sp; +} + + +/* Primitive. Copy the state of the receiver from the argument. + Fail if receiver and argument are of a different class. + Fail if the receiver or argument are contexts (because of context-to-stack + mapping). Fail if receiver and argument have different lengths (for + indexable objects). + Fail if the objects are not in a fit state to be copied (e.g. married + contexts and Cogged methods) */ + + /* InterpreterPrimitives>>#primitiveCopyObject */ +static void +primitiveCopyObject(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqInt fmt; + sqInt i; + usqInt length; + usqInt numBytes; + usqInt numSlots; + usqInt numSlots1; + sqInt rcvr; + sqInt valuePointer; + + if (!(GIV(argumentCount) >= 1)) { + GIV(primFailCode) = PrimErrBadNumArgs; + return; + } + arg = longAt(GIV(stackPointer)); + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (rcvr & (tagMask())) { + GIV(primFailCode) = PrimErrBadReceiver; + return; + } + if (arg & (tagMask())) { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + if (((longAt(rcvr)) & (classIndexMask())) != ((longAt(arg)) & (classIndexMask()))) { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + if (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) { + /* begin numBytesOf: */ + fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); + numSlots1 = byteAt(rcvr + 7); + numBytes = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + numBytes = numBytes << (shiftForWord()); + if (fmt >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + length = numBytes - (fmt & 7); + goto l4; + } + if (fmt <= (sixtyFourBitIndexableFormat())) { + length = numBytes; + goto l4; + } + if (fmt >= (firstShortFormat())) { + length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); + goto l4; + } + length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); + l4: /* end numBytesOf: */; + if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask()))) + && (length == (numBytesOf(arg))))) { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + memcpy(((void *)(rcvr + BaseHeaderSize)), ((void *)(arg + BaseHeaderSize)), length); + } + else { + if (!(isAppropriateForCopyObject(rcvr))) { + GIV(primFailCode) = PrimErrBadReceiver; + return; + } + /* begin numSlotsOf: */ + assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(rcvr + 7); + length = (numSlots == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots); + if (!((isAppropriateForCopyObject(arg)) + && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) { + GIV(primFailCode) = PrimErrBadArgument; + return; + } + for (i = 0; i < length; i += 1) { + /* begin storePointer:ofObject:withValue: */ + valuePointer = longAt((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))); + assert(!(isForwarded(rcvr))); + if ((assert(isNonImmediate(rcvr)), + oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((valuePointer & (tagMask())) == 0) + && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) { + remember(rcvr); + } + } + } + longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + } + /* begin pop: */ + GIV(stackPointer) += GIV(argumentCount) * BytesPerWord; +} + + +/* Crash the VM by indirecting through a null pointer. If the sole argument + is true crash in this thread, and if it is false crash in a new thread. If + the argument is an integer use the method that implies. + bit 0 = thread to crash in; 1 => this thread + bit 1 = crash method; 0 => indirect through null pointer; 1 => call exit */ + + /* InterpreterPrimitives>>#primitiveCrashVM */ +EXPORT(sqInt) +primitiveCrashVM(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt crashInThisThread; + + if (((longAt(GIV(stackPointer))) & 1)) { + crashInThisThread = ((longAt(GIV(stackPointer))) >> 1); + } + else { + /* begin booleanValueOf: */ + if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { + crashInThisThread = 1; + goto l1; + } + if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { + crashInThisThread = 0; + goto l1; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + crashInThisThread = null; + l1: /* end booleanValueOf: */; + } + if (GIV(primFailCode) + || (GIV(argumentCount) != 1)) { + return (GIV(primFailCode) = PrimErrBadNumArgs); + } + crashInThisOrAnotherThread(crashInThisThread); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + return 0; +} + + +/* Pass in a non-negative value to disable the architectures powermanager if + any, zero to enable. This is a named (not numbered) primitive in the null + module (ie the VM) + */ + + /* InterpreterPrimitives>>#primitiveDisablePowerManager */ +EXPORT(sqInt) +primitiveDisablePowerManager(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integer; + sqInt integerPointer; + + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + integer = (integerPointer >> 1); + goto l2; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integer = 0; + goto l2; + } +l2: /* end stackIntegerValue: */; + if (!GIV(primFailCode)) { + ioDisablePowerManager(integer); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + return 0; +} + + /* InterpreterPrimitives>>#primitiveDiv */ +static void +primitiveDiv(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt quotient; + char *sp; + + quotient = doPrimitiveDivby(longAt(GIV(stackPointer) + (1 * BytesPerWord)), longAt(GIV(stackPointer))); + /* begin pop2AndPushIntegerIfOK: */ + if (!GIV(primFailCode)) { + if ((((sqInt)((((usqInt)quotient)) ^ ((((usqInt)quotient)) << 1)))) >= 0) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)quotient << 1) | 1)); + GIV(stackPointer) = sp; + } + else { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + } +} + + /* InterpreterPrimitives>>#primitiveDivide */ +static void +primitiveDivide(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerArgument; + sqInt integerPointer; + sqInt integerPointer1; + sqInt integerReceiver; + char *sp; + + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + integerReceiver = (integerPointer >> 1); + goto l1; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerReceiver = 0; + goto l1; + } +l1: /* end stackIntegerValue: */; + /* begin stackIntegerValue: */ + integerPointer1 = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer1 & 1)) { + integerArgument = (integerPointer1 >> 1); + goto l2; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + integerArgument = 0; + goto l2; + } +l2: /* end stackIntegerValue: */; + if ((integerArgument != 0) + && ((integerReceiver % integerArgument) == 0)) { + /* begin pop2AndPushIntegerIfOK: */ + if (!GIV(primFailCode)) { + if ((((sqInt)((((usqInt)(integerReceiver / integerArgument))) ^ ((((usqInt)(integerReceiver / integerArgument))) << 1)))) >= 0) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)(integerReceiver / integerArgument) << 1) | 1)); + GIV(stackPointer) = sp; + } + else { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + } + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } +} + + +/* Primitive arithmetic operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveDivideLargeIntegers */ +EXPORT(void) +primitiveDivideLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong a; + sqInt aIsNegative; + usqLong b; + sqInt bIsNegative; + sqInt oopArg; + sqInt oopRcvr; + sqInt oopResult; + usqLong result; + char *sp; + + oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + aIsNegative = isNegativeIntegerValueOf(oopRcvr); + bIsNegative = isNegativeIntegerValueOf(oopArg); + a = magnitude64BitValueOf(oopRcvr); + b = magnitude64BitValueOf(oopArg); + if (GIV(primFailCode)) { + return; + } + if (!((b != 0) + && ((a % b) == 0))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + result = a / b; + oopResult = magnitude64BitIntegerForneg(result, aIsNegative != bIsNegative); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + +/* Primitive arithmetic operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveDivLargeIntegers */ +EXPORT(void) +primitiveDivLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + usqLong a; + sqInt aIsNegative; + usqLong b; + sqInt bIsNegative; + sqInt oopArg; + sqInt oopRcvr; + sqInt oopResult; + usqLong rem; + usqLong result; + char *sp; + + oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + aIsNegative = isNegativeIntegerValueOf(oopRcvr); + bIsNegative = isNegativeIntegerValueOf(oopArg); + a = magnitude64BitValueOf(oopRcvr); + b = magnitude64BitValueOf(oopArg); + if (b == 0) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (GIV(primFailCode)) { + return; + } + result = a / b; + if (!(a == 0)) { + if (!(bIsNegative == aIsNegative)) { + + /* Round toward negative infinity */ + rem = a % b; + if (!(rem == 0)) { + + /* This can not overflow, because b > 1, otherwise rem = 0 */ + result += 1; + } + } + } + oopResult = magnitude64BitIntegerForneg(result, bIsNegative != aIsNegative); + if (!GIV(primFailCode)) { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveEqual */ +static void +primitiveEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerArgument; + sqInt integerReceiver; + int result; + char *sp; + char *sp1; + + integerArgument = longAt(GIV(stackPointer)); + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (((integerReceiver & integerArgument) & 1) != 0) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver == integerArgument + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } + else { + result = (positiveMachineIntegerValueOf(integerReceiver)) == (positiveMachineIntegerValueOf(integerArgument)); + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (result + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp1; + } + } +} + + +/* Primitive comparison operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveEqualLargeIntegers */ +EXPORT(void) +primitiveEqualLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqLong integerArg; + sqLong integerRcvr; + char *sp; + + integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr == integerArg + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveExitToDebugger */ +static void +primitiveExitToDebugger(void) +{ + error("Exit to debugger at user request"); +} + + +/* Computes E raised to the receiver power. */ + + /* InterpreterPrimitives>>#primitiveExp */ +static void +primitiveExp(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double f; + sqInt isFloat; + sqInt object; + sqInt oop; + double rcvr; + double result; + char *sp; + sqInt top; + + /* begin popFloat */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + oop = top; + isFloat = ((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(oop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end popFloat */; + if (!GIV(primFailCode)) { + /* begin pushFloat: */ + f = exp(rcvr); + /* begin push: */ + object = floatObjectOf(f); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + } + else { + /* begin unPop: */ + GIV(stackPointer) -= 1 * BytesPerWord; + } +} + + +/* Exponent part of this float. */ + + /* InterpreterPrimitives>>#primitiveExponent */ +static void +primitiveExponent(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double frac; + sqInt isFloat; + sqInt oop; + int pwr; + double rcvr; + double result; + char *sp; + sqInt top; + + /* begin popFloat */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + oop = top; + isFloat = ((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(oop + BaseHeaderSize, result); + rcvr = result; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l2: /* end popFloat */; + if (!GIV(primFailCode)) { + + /* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */ + frac = frexp(rcvr, &pwr); + /* begin pushInteger: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), (((usqInt)(pwr - 1) << 1) | 1)); + GIV(stackPointer) = sp; + } + else { + /* begin unPop: */ + GIV(stackPointer) -= 1 * BytesPerWord; + } +} + + +/* Set general (unspecified) primitive failure. Don't overwrite an error code + that has already been set. */ +/* Use returnTypeC: #sqInt because that's the way it is defined in sq.h. + Use no explicit return so that Slang doesn't fail an inlining type-check + when a primitive with return type void uses ^self primitiveFail to exit. */ + + /* InterpreterPrimitives>>#primitiveFail */ +sqInt +primitiveFail(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return 0; +} + + +/* Set specific primitive failure. + N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode. */ + + /* InterpreterPrimitives>>#primitiveFailFor: */ +sqInt +primitiveFailFor(sqInt reasonCode) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (GIV(primFailCode) = reasonCode); +} + + /* InterpreterPrimitives>>#primitiveFailureCode */ +sqInt +primitiveFailureCode(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return GIV(primFailCode); +} + + /* InterpreterPrimitives>>#primitiveFetchNextMourner */ +static void +primitiveFetchNextMourner(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt mourner; + char *sp; + + mourner = (GIV(mournQueue) != GIV(nilObj) + ? popObjStack(GIV(mournQueue)) + : 0); + if (mourner == null) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrNotFound; + } + else { + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), mourner); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatAdd */ +static void +primitiveFloatAdd(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double arg; + sqInt argOop; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + sqInt rcvrOop; + double result; + double result1; + char *sp; + + /* begin primitiveFloatAdd:toArg: */ + rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + argOop = longAt(GIV(stackPointer)); + /* begin loadFloatOrIntFrom: */ + if ((rcvrOop & 1)) { + rcvr = ((double) ((rcvrOop >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = ((rcvrOop & (tagMask())) == 0) + && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((argOop & 1)) { + arg = ((double) ((argOop >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = ((argOop & (tagMask())) == 0) + && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(argOop + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr + arg)); + GIV(stackPointer) = sp; + } + return; +} + + +/* Provide platform-independent access to 32-bit words comprising + a Float. Map index 1 onto the most significant word and index 2 + onto the least significant word. */ + + /* InterpreterPrimitives>>#primitiveFloatAt */ +static void +primitiveFloatAt(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt index; + unsigned int integerValue; + unsigned int integerValue1; + sqInt newLargeInteger; + sqInt newLargeInteger1; + usqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numBytes1; + sqInt objFormat; + sqInt objFormat1; + sqInt rcvr; + sqInt reasonCode; + usqInt result; + char *sp; + char *sp1; + sqInt valueWord; + sqInt valueWord2; + + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + index = longAt(GIV(stackPointer)); + if (index == ConstOne) { + /* begin positive32BitIntegerFor: */ + fieldIndex = (VMBIGENDIAN + ? 0 + : 1); + integerValue = ((sqInt) (long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2)))))); + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { + result = ((integerValue << 1) | 1); + goto l6; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; + l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(integerValue); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + result = newLargeInteger; + goto l6; + + l6: /* end positive32BitIntegerFor: */; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp; + return; + } + if (index == ConstTwo) { + /* begin positive32BitIntegerFor: */ + fieldIndex1 = (VMBIGENDIAN + ? 1 + : 0); + integerValue1 = ((sqInt) (long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << 2)))))); + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) integerValue1)) <= (MaxSmallInteger)) { + result = ((integerValue1 << 1) | 1); + goto l11; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat1 = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat1 < (firstByteFormat()) + ? objFormat1 + : objFormat1 & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj1 = GIV(freeStart); + numBytes1 = BaseHeaderSize + (8); + assert((numBytes1 % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger1 = 0; + goto l9; + } + } + long64Atput(newObj1, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat1) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes1; + newLargeInteger1 = newObj1; + l9: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord2 = SQ_SWAP_4_BYTES_IF_BIGENDIAN(integerValue1); + long32Atput((newLargeInteger1 + BaseHeaderSize) + (0U << 2), valueWord2); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger1 + BaseHeaderSize) + (1U << 2), 0); + + result = newLargeInteger1; + goto l11; + + l11: /* end positive32BitIntegerFor: */; + /* begin pop:thenPush: */ + longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp1; + return; + } + /* begin primitiveFailFor: */ + reasonCode = ((index & 1) + ? PrimErrBadIndex + : PrimErrBadArgument); + GIV(primFailCode) = reasonCode; +} + + +/* Provide platform-independent access to 32-bit words comprising + a Float. Map index 1 onto the most significant word and index 2 + onto the least significant word. */ + + /* InterpreterPrimitives>>#primitiveFloatAtPut */ +static void +primitiveFloatAtPut(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt fieldIndex; + sqInt fieldIndex1; + sqInt index; + sqInt oopToStore; + sqInt rcvr; + sqInt reasonCode; + char *sp; + char *sp1; + usqInt valueToStore; + + oopToStore = longAt(GIV(stackPointer)); + valueToStore = positive32BitValueOf(oopToStore); + if (GIV(primFailCode)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + return; + } + rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); + index = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if ( +# if IMMUTABILITY + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) +# else /* IMMUTABILITY */ + 0 +# endif /* IMMUTABILITY */ + ) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrNoModification; + return; + } + if (index == ConstOne) { + /* begin storeLong32:ofObject:withValue: */ + fieldIndex = (VMBIGENDIAN + ? 0 + : 1); + long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueToStore); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), oopToStore); + GIV(stackPointer) = sp; + return; + } + if (index == ConstTwo) { + /* begin storeLong32:ofObject:withValue: */ + fieldIndex1 = (VMBIGENDIAN + ? 1 + : 0); + long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << 2))), valueToStore); + /* begin pop:thenPush: */ + longAtput((sp1 = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), oopToStore); + GIV(stackPointer) = sp1; + return; + } + /* begin primitiveFailFor: */ + reasonCode = ((index & 1) + ? PrimErrBadIndex + : PrimErrBadArgument); + GIV(primFailCode) = reasonCode; +} + + /* InterpreterPrimitives>>#primitiveFloatDivide */ +static void +primitiveFloatDivide(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double arg; + sqInt argOop; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + sqInt rcvrOop; + double result; + double result1; + char *sp; + + /* begin primitiveFloatDivide:byArg: */ + rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + argOop = longAt(GIV(stackPointer)); + /* begin loadFloatOrIntFrom: */ + if ((rcvrOop & 1)) { + rcvr = ((double) ((rcvrOop >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = ((rcvrOop & (tagMask())) == 0) + && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((argOop & 1)) { + arg = ((double) ((argOop >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = ((argOop & (tagMask())) == 0) + && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(argOop + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + /* begin success: */ + if (!(arg != 0.0)) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr / arg)); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatEqual */ +static void +primitiveFloatEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatEqual:toArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr == arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatGreaterOrEqual */ +static void +primitiveFloatGreaterOrEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatGreaterOrEqual:toArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr >= arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatGreaterThan */ +static void +primitiveFloatGreaterThan(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatGreater:thanArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr > arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatLessOrEqual */ +static void +primitiveFloatLessOrEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatLessOrEqual:toArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr <= arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatLessThan */ +static void +primitiveFloatLessThan(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatLess:thanArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr < arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatMultiply */ +static void +primitiveFloatMultiply(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double arg; + sqInt argOop; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + sqInt rcvrOop; + double result; + double result1; + char *sp; + + /* begin primitiveFloatMultiply:byArg: */ + rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + argOop = longAt(GIV(stackPointer)); + /* begin loadFloatOrIntFrom: */ + if ((rcvrOop & 1)) { + rcvr = ((double) ((rcvrOop >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = ((rcvrOop & (tagMask())) == 0) + && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((argOop & 1)) { + arg = ((double) ((argOop >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = ((argOop & (tagMask())) == 0) + && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(argOop + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr * arg)); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatNotEqual */ +static void +primitiveFloatNotEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt aBool; + double arg; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + double result; + double result1; + char *sp; + + /* begin primitiveFloatEqual:toArg: */ + if (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & 1)) { + rcvr = ((double) (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = (((longAt(GIV(stackPointer) + (1 * BytesPerWord))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer) + (1 * BytesPerWord)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if (((longAt(GIV(stackPointer))) & 1)) { + arg = ((double) (((longAt(GIV(stackPointer))) >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = (((longAt(GIV(stackPointer))) & (tagMask())) == 0) + && (((longAt(longAt(GIV(stackPointer)))) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto((longAt(GIV(stackPointer))) + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + aBool = rcvr == arg; + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (!aBool + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveFloatSubtract */ +static void +primitiveFloatSubtract(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double arg; + sqInt argOop; + sqInt isFloat; + sqInt isFloat1; + double rcvr; + sqInt rcvrOop; + double result; + double result1; + char *sp; + + /* begin primitiveFloatSubtract:fromArg: */ + rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + argOop = longAt(GIV(stackPointer)); + /* begin loadFloatOrIntFrom: */ + if ((rcvrOop & 1)) { + rcvr = ((double) ((rcvrOop >> 1)) ); + goto l1; + } + /* begin floatValueOf: */ + isFloat = ((rcvrOop & (tagMask())) == 0) + && (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(rcvrOop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end loadFloatOrIntFrom: */; + /* begin loadFloatOrIntFrom: */ + if ((argOop & 1)) { + arg = ((double) ((argOop >> 1)) ); + goto l2; + } + /* begin floatValueOf: */ + isFloat1 = ((argOop & (tagMask())) == 0) + && (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(argOop + BaseHeaderSize, result1); + arg = result1; + goto l2; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + arg = 0.0; +l2: /* end loadFloatOrIntFrom: */; + if (!GIV(primFailCode)) { + /* begin pop:thenPushFloat: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr - arg)); + GIV(stackPointer) = sp; + } + return; +} + + +/* Clear the method lookup cache. This must be done after every programming + change. + */ + + /* InterpreterPrimitives>>#primitiveFlushCache */ +static void +primitiveFlushCache(void) +{ + flushMethodCache(); +} + + +/* Primitive. Flush all the existing external primitives in the image thus + forcing a reload on next invokation. + */ + + /* InterpreterPrimitives>>#primitiveFlushExternalPrimitives */ +static void +primitiveFlushExternalPrimitives(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt address; + sqInt address1; + sqInt followingWord; + sqInt followingWord1; + sqInt followingWord2; + usqInt followingWordAddress; + usqInt followingWordAddress1; + usqInt followingWordAddress2; + sqInt i; + usqInt limit; + usqInt numSlots; + usqInt numSlots1; + usqInt numSlots11; + usqInt numSlots12; + usqInt numSlots2; + usqInt numSlots3; + usqInt numSlots4; + usqInt numSlots5; + sqInt objOop; + sqInt objOop1; + sqInt objOop11; + sqInt objOop2; + sqInt oop; + sqInt prevObj; + sqInt prevObj1; + sqInt prevPrevObj; + sqInt prevPrevObj1; + usqInt slotBytes; + usqInt slotBytes1; + usqInt slotBytes2; + + /* begin flushExternalPrimitives */ + + /* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are + in pastSpace. Objects are allocated in eden. So enumerate only pastSpace and eden. */ + prevPrevObj = (prevObj = null); + assert((((pastSpace()).start)) < (((eden()).start))); + /* begin objectStartingAt: */ + address = ((pastSpace()).start); + numSlots3 = byteAt(address + 7); + objOop1 = (numSlots3 == (numSlotsMask()) + ? address + BaseHeaderSize + : address); + limit = GIV(pastSpaceStart); + while (oopisLessThan(objOop1, limit)) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { + + /* This is a compiled method */ + flushExternalPrimitiveOf(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots1 = byteAt(objOop1 + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots1); + if (numSlots == 0) { + /* begin allocationUnit */ + slotBytes = ((sqInt) 8); + } + else { + slotBytes = (numSlots + (numSlots & 1)) << (shiftForWord()); + } + followingWordAddress = (objOop1 + BaseHeaderSize) + slotBytes; + if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) { + objOop1 = limit; + goto l4; + } + flag("endianness"); + followingWord = longAt(followingWordAddress + 4); + objOop1 = ((((usqInt) followingWord) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress + BaseHeaderSize + : followingWordAddress); + l4: /* end objectAfter:limit: */; + } + /* begin objectStartingAt: */ + address1 = ((eden()).start); + numSlots4 = byteAt(address1 + 7); + objOop1 = (numSlots4 == (numSlotsMask()) + ? address1 + BaseHeaderSize + : address1); + while (oopisLessThan(objOop1, GIV(freeStart))) { + assert(isEnumerableObjectNoAssert(objOop1)); + if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { + + /* This is a compiled method */ + flushExternalPrimitiveOf(objOop1); + } + + + prevPrevObj = prevObj; + prevObj = objOop1; + /* begin objectAfter:limit: */ + numSlots11 = byteAt(objOop1 + 7); + numSlots2 = (numSlots11 == (numSlotsMask()) + ? longAt(objOop1 - BaseHeaderSize) + : numSlots11); + if (numSlots2 == 0) { + /* begin allocationUnit */ + slotBytes1 = ((sqInt) 8); + } + else { + slotBytes1 = (numSlots2 + (numSlots2 & 1)) << (shiftForWord()); + } + followingWordAddress1 = (objOop1 + BaseHeaderSize) + slotBytes1; + if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) { + objOop1 = GIV(freeStart); + goto l8; + } + flag("endianness"); + followingWord1 = longAt(followingWordAddress1 + 4); + objOop1 = ((((usqInt) followingWord1) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress1 + BaseHeaderSize + : followingWordAddress1); + l8: /* end objectAfter:limit: */; + } + /* begin allOldSpaceObjectsDo: */ + assert(isOldObject(GIV(nilObj))); + prevPrevObj1 = (prevObj1 = null); + objOop11 = GIV(nilObj); + while (1) { + assert((objOop11 % (allocationUnit())) == 0); + if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break; + assert((long64At(objOop11)) != 0); + if (isEnumerableObject(objOop11)) { + if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) { + + /* This is a compiled method */ + flushExternalPrimitiveOf(objOop11); + } + + } + + prevPrevObj1 = prevObj1; + prevObj1 = objOop11; + /* begin objectAfter:limit: */ + numSlots12 = byteAt(objOop11 + 7); + numSlots5 = (numSlots12 == (numSlotsMask()) + ? longAt(objOop11 - BaseHeaderSize) + : numSlots12); + if (numSlots5 == 0) { + /* begin allocationUnit */ + slotBytes2 = ((sqInt) 8); + } + else { + slotBytes2 = (numSlots5 + (numSlots5 & 1)) << (shiftForWord()); + } + followingWordAddress2 = (objOop11 + BaseHeaderSize) + slotBytes2; + if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) { + objOop11 = GIV(endOfMemory); + goto l13; + } + flag("endianness"); + followingWord2 = longAt(followingWordAddress2 + 4); + objOop11 = ((((usqInt) followingWord2) >> (numSlotsHalfShift())) == (numSlotsMask()) + ? followingWordAddress2 + BaseHeaderSize + : followingWordAddress2); + l13: /* end objectAfter:limit: */; + } + flushMethodCache(); + /* begin flushExternalPrimitiveTable */ + for (i = 0; i < MaxExternalPrimitiveTableSize; i += 1) { + externalPrimitiveTable[i] = 0; + } + GIV(externalPrimitiveTableFirstFreeIndex) = 0; +} + + +/* On some platforms, this primitive forces enqueued display updates to be + processed immediately. On others, it does nothing. + */ + + /* InterpreterPrimitives>>#primitiveForceDisplayUpdate */ +static void +primitiveForceDisplayUpdate(void) +{ + ioForceDisplayUpdate(); +} + + +/* On platforms that support it, this primitive prints the receiver, assumed + to be a Form, to the default printer. + */ + + /* InterpreterPrimitives>>#primitiveFormPrint */ +static void +primitiveFormPrint(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt bitsArray; + usqInt bitsArraySize; + sqInt depth; + sqInt fmt; + sqInt h; + double hScale; + sqInt isFloat; + sqInt isFloat1; + sqInt landscapeFlag; + usqInt numBytes; + usqInt numSlots; + sqInt ok; + sqInt oop; + sqInt oop1; + int pixelsPerWord; + sqInt rcvr; + double result; + double result1; + double vScale; + sqInt w; + sqInt wordsPerLine; + + /* begin booleanValueOf: */ + if ((longAt(GIV(stackPointer))) == GIV(trueObj)) { + landscapeFlag = 1; + goto l2; + } + if ((longAt(GIV(stackPointer))) == GIV(falseObj)) { + landscapeFlag = 0; + goto l2; + } + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + landscapeFlag = null; +l2: /* end booleanValueOf: */; + /* begin floatValueOf: */ + oop = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + isFloat = ((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(oop + BaseHeaderSize, result); + vScale = result; + goto l5; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + vScale = 0.0; +l5: /* end floatValueOf: */; + /* begin floatValueOf: */ + oop1 = longAt(GIV(stackPointer) + (2 * BytesPerWord)); + isFloat1 = ((oop1 & (tagMask())) == 0) + && (((longAt(oop1)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat1) { + fetchFloatAtinto(oop1 + BaseHeaderSize, result1); + hScale = result1; + goto l6; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + hScale = 0.0; +l6: /* end floatValueOf: */; + rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord)); + if (!((((rcvr & (tagMask())) == 0) + && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5)) + && ((lengthOfformat(rcvr, (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= 4))) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + if (!GIV(primFailCode)) { + bitsArray = longAt((rcvr + BaseHeaderSize) + (0U << (shiftForWord()))); + w = fetchIntegerofObject(1, rcvr); + h = fetchIntegerofObject(2, rcvr); + depth = fetchIntegerofObject(3, rcvr); + if (!((w > 0) + && (h > 0))) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + pixelsPerWord = 32 / depth; + wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord; + if (((bitsArray & (tagMask())) == 0) + && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) { + /* begin numBytesOf: */ + fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOf: */ + assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(bitsArray + 7); + numBytes = (numSlots == (numSlotsMask()) + ? longAt(bitsArray - BaseHeaderSize) + : numSlots); + numBytes = numBytes << (shiftForWord()); + if (fmt >= (firstByteFormat())) { + + /* bytes (the common case), including CompiledMethod */ + bitsArraySize = numBytes - (fmt & 7); + goto l4; + } + if (fmt <= (sixtyFourBitIndexableFormat())) { + bitsArraySize = numBytes; + goto l4; + } + if (fmt >= (firstShortFormat())) { + bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1))); + goto l4; + } + bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2))); + l4: /* end numBytesOf: */; + /* begin success: */ + if (!(bitsArraySize == ((wordsPerLine * h) * 4))) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + else { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + } + } + if (!GIV(primFailCode)) { + ok = ioFormPrint(bitsArray + BaseHeaderSize, w, h, depth, hScale, vScale, landscapeFlag); + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + if (!GIV(primFailCode)) { + /* begin pop: */ + GIV(stackPointer) += 3 * BytesPerWord; + } +} + + /* InterpreterPrimitives>>#primitiveFractionalPart */ +static void +primitiveFractionalPart(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + double frac; + sqInt isFloat; + sqInt object; + sqInt oop; + double rcvr; + double result; + char *sp; + sqInt top; + double trunc; + + /* begin popFloat */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + oop = top; + isFloat = ((oop & (tagMask())) == 0) + && (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex); + if (isFloat) { + fetchFloatAtinto(oop + BaseHeaderSize, result); + rcvr = result; + goto l1; + } + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + rcvr = 0.0; +l1: /* end popFloat */; + if (!GIV(primFailCode)) { + frac = modf(rcvr, (&trunc)); + /* begin pushFloat: */ + object = floatObjectOf(frac); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + } + else { + /* begin unPop: */ + GIV(stackPointer) -= 1 * BytesPerWord; + } +} + + /* InterpreterPrimitives>>#primitiveFullClosureValue */ +static void +primitiveFullClosureValue(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt blockClosure; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt header; + sqInt i; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + sqInt numTemps; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(GIV(argumentCount) == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + closureMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin activateNewFullClosureMethod:numArgs:mayContextSwitch: */ + numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex; + theMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + (fullBlockEntryOffset()); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l7; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogFullBlockMethodnumCopied(theMethod, numCopied); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp10; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + (fullBlockEntryOffset()); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l7; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp3; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp4; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp5; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp6; + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp7; + /* begin push: */ + objOop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop); + } + object1 = objOop; + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp8; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin methodHeaderOf: */ + assert(isCompiledMethod(theMethod)); + header = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp1; + } + GIV(instructionPointer) = ((theMethod + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + /* begin setMethod: */ + assert((((usqInt)theMethod)) >= (startOfMemory())); + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(1); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l7: /* end activateNewFullClosureMethod:numArgs:mayContextSwitch: */; +} + + +/* An exact clone of primitiveFullClosureValue except that this version will + not check for interrupts on stack overflow. It may invoke the garbage + collector but will not switch processes. See + checkForInterruptsMayContextSwitch: */ + + /* InterpreterPrimitives>>#primitiveFullClosureValueNoContextSwitch */ +void +primitiveFullClosureValueNoContextSwitch(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt blockClosure; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt header; + sqInt i; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + sqInt numTemps; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp12; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(GIV(argumentCount) == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + closureMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin activateNewFullClosureMethod:numArgs:mayContextSwitch: */ + numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex; + theMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + (fullBlockNoContextSwitchEntryOffset()); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l7; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogFullBlockMethodnumCopied(theMethod, numCopied); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp10; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + (fullBlockNoContextSwitchEntryOffset()); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l7; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp3; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp4; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp5; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp6; + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp7; + /* begin push: */ + objOop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop); + } + object1 = objOop; + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp8; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin methodHeaderOf: */ + assert(isCompiledMethod(theMethod)); + header = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp1; + } + GIV(instructionPointer) = ((theMethod + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + /* begin setMethod: */ + assert((((usqInt)theMethod)) >= (startOfMemory())); + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(0); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l7: /* end activateNewFullClosureMethod:numArgs:mayContextSwitch: */; +} + + /* InterpreterPrimitives>>#primitiveFullClosureValueWithArgs */ +static void +primitiveFullClosureValueWithArgs(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt argumentArray; + usqInt arraySize; + sqInt blockClosure; + sqInt closureMethod; + CogMethod *cogMethod; + CogMethod *cogMethod1; + sqInt header; + sqInt i; + sqInt index; + int inInterpreter; + sqInt methodHeader; + sqInt methodHeader1; + sqInt methodHeader2; + sqInt numArgs; + usqInt numCopied; + usqInt numSlots; + sqInt numTemps; + sqInt object; + sqInt object1; + sqInt object11; + sqInt object12; + sqInt object2; + sqInt object3; + sqInt objOop; + sqInt oop; + char *sp; + char *sp1; + char *sp10; + char *sp11; + char *sp12; + char *sp13; + char *sp2; + char *sp21; + char *sp22; + char *sp3; + char *sp31; + char *sp32; + char *sp4; + char *sp5; + char *sp6; + char *sp7; + char *sp8; + char *sp9; + sqInt switched; + sqInt theMethod; + sqInt top; + + argumentArray = longAt(GIV(stackPointer)); + if (!(((argumentArray & (tagMask())) == 0) + && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin numSlotsOf: */ + assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun())); + numSlots = byteAt(argumentArray + 7); + arraySize = (numSlots == (numSlotsMask()) + ? longAt(argumentArray - BaseHeaderSize) + : numSlots); + if (!(roomToPushNArgs(arraySize))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord)); + /* begin quickFetchInteger:ofObject: */ + oop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(ClosureNumArgsIndex) << (shiftForWord()))))); + assert((oop & 1)); + numArgs = (oop >> 1); + if (!(arraySize == numArgs)) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + closureMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + if (!(((closureMethod & (tagMask())) == 0) + && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + index = 1; + while (index <= numArgs) { + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))))); + GIV(stackPointer) = sp; + index += 1; + } + /* begin activateNewFullClosureMethod:numArgs:mayContextSwitch: */ + numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex; + theMethod = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord()))))); + assert(isOopCompiledMethod(theMethod)); + /* begin fetchPointer:ofObject: */ + methodHeader = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((assert(((methodHeader & 1)) + || (((((usqInt)methodHeader)) < (startOfMemory())) + && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))), + (methodHeader & 1) == 0)) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader1 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader1)) + && ((((usqInt)methodHeader1)) < (startOfMemory()))); + cogMethod = ((CogMethod *) methodHeader1); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object2 = ceReturnToInterpreterPC(); + longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2); + GIV(stackPointer) = sp9; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp11; + } + /* begin push: */ + object11 = (((sqInt)cogMethod)) + (fullBlockEntryOffset()); + longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11); + GIV(stackPointer) = sp21; + /* begin push: */ + longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp31; + ceCallCogCodePopReceiverReg(); + goto l9; + } + if (((assert((methodHeader & 1)), + ((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) { + if ((GIV(instructionPointer) < (startOfMemory())) + || (theMethod == GIV(lastCoggableInterpretedBlockMethod))) { + + /* If from interpreter and repeat block, attempt jitting */ + if (theMethod != GIV(lastUncoggableInterpretedBlockMethod)) { + cogFullBlockMethodnumCopied(theMethod, numCopied); + if ((assert(isNonImmediate(theMethod)), + isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord())))))))) { + /* begin executeFullCogBlock:closure:mayContextSwitch: */ + methodHeader2 = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + assert((isNonImmediate(methodHeader2)) + && ((((usqInt)methodHeader2)) < (startOfMemory()))); + cogMethod1 = ((CogMethod *) methodHeader2); + assertCStackWellAligned(); + /* begin assertValidExecutionPointe:r:s: */ + assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__); + /* begin ensurePushedInstructionPointer */ + if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) { + + /* invoked directly from the interpreter */ + /* begin iframeSavedIP:put: */ + assert(!(isMachineCodeFrame(GIV(framePointer)))); + longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer)); + /* begin push: */ + object3 = ceReturnToInterpreterPC(); + longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3); + GIV(stackPointer) = sp10; + } + else { + + /* instructionPointer == cogit ceReturnToInterpreterPC + ifTrue: [invoked from the interpreter via a machine code primitive] + ifFalse: [invoked from machine code]. + If in the first case the bytecode instructionPointer has already been + saved in iframeSavedIP so all we need to do is push the instructionPointer. */ + /* begin push: */ + longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp12; + } + /* begin push: */ + object12 = (((sqInt)cogMethod1)) + (fullBlockEntryOffset()); + longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12); + GIV(stackPointer) = sp22; + /* begin push: */ + longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure); + GIV(stackPointer) = sp32; + ceCallCogCodePopReceiverReg(); + goto l9; + } + if (!GIV(cogCompiledCodeCompactionCalledFor)) { + GIV(lastUncoggableInterpretedBlockMethod) = theMethod; + } + } + } + else { + GIV(lastCoggableInterpretedBlockMethod) = theMethod; + } + } + else { + maybeFlagMethodAsInterpreted(theMethod); + } + assert(!(methodHasCogMethod(theMethod))); + if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) { + if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) { + GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP); + } + } + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer)); + GIV(stackPointer) = sp3; + GIV(framePointer) = GIV(stackPointer); + /* begin push: */ + longAtput((sp4 = GIV(stackPointer) - BytesPerWord), theMethod); + GIV(stackPointer) = sp4; + /* begin push: */ + longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp5; + /* begin push: */ + object = (VMBIGENDIAN + ? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1U << ((BytesPerWord * 8) - 24)) + : ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24)); + longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp6; + /* begin push: */ + longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0); + GIV(stackPointer) = sp7; + /* begin push: */ + objOop = longAt((blockClosure + BaseHeaderSize) + (((int)((usqInt)(FullClosureReceiverIndex) << (shiftForWord()))))); + if (((objOop & (tagMask())) == 0) + && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) { + objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop); + } + object1 = objOop; + longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1); + GIV(stackPointer) = sp8; + for (i = 0; i < numCopied; i += 1) { + /* begin push: */ + longAtput((sp13 = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord())))))); + GIV(stackPointer) = sp13; + } + assert(frameIsBlockActivation(GIV(framePointer))); + assert(!(frameHasContext(GIV(framePointer)))); + /* begin methodHeaderOf: */ + assert(isCompiledMethod(theMethod)); + header = longAt((theMethod + BaseHeaderSize) + (((int)((usqInt)(HeaderIndex) << (shiftForWord()))))); + if ((header & 1)) { + methodHeader = header; + } + else { + assert((((usqInt)header)) < GIV(newSpaceStart)); + assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())); + methodHeader = ((((CogMethod *) header))->methodHeader); + } + numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F; + for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) { + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj)); + GIV(stackPointer) = sp1; + } + GIV(instructionPointer) = ((theMethod + ((LiteralStart + ((assert((methodHeader & 1)), +((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1; + /* begin setMethod: */ + assert((((usqInt)theMethod)) >= (startOfMemory())); + GIV(method) = theMethod; + assert(isOopCompiledMethod(GIV(method))); + GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method))) + ? 256 + : 0); + + switched = 0; + if (GIV(stackPointer) < GIV(stackLimit)) { + switched = handleStackOverflowOrEventAllowContextSwitch(1); + } + returnToExecutivepostContextSwitch(inInterpreter, switched); +l9: /* end activateNewFullClosureMethod:numArgs:mayContextSwitch: */; +} + + +/* Fetch the system attribute with the given integer ID. The + result is a string, which will be empty if the attribute is not + defined. */ + + /* InterpreterPrimitives>>#primitiveGetAttribute */ +static void +primitiveGetAttribute(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt attr; + sqInt integerPointer; + sqInt s; + char *sp; + sqInt sz; + + sz = 0; + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + attr = (integerPointer >> 1); + goto l1; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + attr = 0; + goto l1; + } +l1: /* end stackIntegerValue: */; + if (!GIV(primFailCode)) { + sz = attributeSize(attr); + } + if (!GIV(primFailCode)) { + s = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))), sz); + getAttributeIntoLength(attr, s + BaseHeaderSize, sz); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), s); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveGetImmutability */ +#if IMMUTABILITY +static void +primitiveGetImmutability(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt rcvr; + char *sp; + sqInt trueOrFalse; + + rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin pop:thenPushBool: */ + trueOrFalse = (rcvr & (tagMask())) + || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0); + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; +} +#endif /* IMMUTABILITY */ + + +/* Primitive. Answer the VM's current log directory */ + + /* InterpreterPrimitives>>#primitiveGetLogDirectory */ +EXPORT(sqInt) +primitiveGetLogDirectory(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + char*ptr; + char *sp; + sqInt stringOop; + sqInt sz; + + ptr = ioGetLogDirectory(); + if (ptr == null) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + return null; + } + sz = strlen(ptr); + stringOop = instantiateClassindexableSize(splObj(ClassByteString), sz); + for (i = 0; i < sz; i += 1) { + byteAtput((stringOop + BaseHeaderSize) + i, ptr[i]); + } + /* begin pop: */ + GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), stringOop); + GIV(stackPointer) = sp; + return 0; +} + + +/* Primitive. Return the next input event from the VM event queue. */ + + /* InterpreterPrimitives>>#primitiveGetNextEvent */ +static void +primitiveGetNextEvent(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + sqIntptr_t eventTypeIs; + sqIntptr_t evtBuf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + sqInt i; + sqIntptr_t value; + + arg = longAt(GIV(stackPointer)); + if (!((((arg & (tagMask())) == 0) + && (((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())) == 2)) + && ((slotSizeOf(arg)) == 8))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + return; + } + ioGetNextEvent(((sqInputEvent*) evtBuf)); + if (GIV(primFailCode)) { + return; + } + eventTypeIs = evtBuf[0]; + /* begin storeInteger:ofObject:withValue: */ + if ((((sqInt)((((usqInt)(evtBuf[0]))) ^ ((((usqInt)(evtBuf[0]))) << 1)))) >= 0) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(arg))); + longAtput((arg + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)(evtBuf[0]) << 1) | 1)); + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (GIV(primFailCode)) { + return; + } + if (eventTypeIs == 6) { + + /* Event is Complex, assume evtBuf is populated correctly and return */ + for (i = 1; i <= 7; i += 1) { + value = evtBuf[i]; + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(arg))); + if ((assert(isNonImmediate(arg)), + oopisGreaterThanOrEqualTo(arg, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(arg))) >> (rememberedBitShift())) & 1) != 0)) { + remember(arg); + } + } + } + longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), value); + } + } + else { + + /* Event time stamp */ + /* begin storeInteger:ofObject:withValue: */ + if ((((sqInt)((((usqInt)((evtBuf[1]) & MillisecondClockMask))) ^ ((((usqInt)((evtBuf[1]) & MillisecondClockMask))) << 1)))) >= 0) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(arg))); + longAtput((arg + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)((evtBuf[1]) & MillisecondClockMask) << 1) | 1)); + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (GIV(primFailCode)) { + return; + } + for (i = 2; i <= 7; i += 1) { + value = evtBuf[i]; + if ((((sqInt)((((usqInt)value)) ^ ((((usqInt)value)) << 1)))) >= 0) { + /* begin storeInteger:ofObject:withValue: */ + if ((((sqInt)((((usqInt)value)) ^ ((((usqInt)value)) << 1)))) >= 0) { + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(arg))); + longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), (((usqInt)value << 1) | 1)); + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + } + else { + value = positiveMachineIntegerFor(value); + /* begin storePointer:ofObject:withValue: */ + assert(!(isForwarded(arg))); + if ((assert(isNonImmediate(arg)), + oopisGreaterThanOrEqualTo(arg, GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((value & (tagMask())) == 0) + && (oopisLessThan(value, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(arg))) >> (rememberedBitShift())) & 1) != 0)) { + remember(arg); + } + } + } + longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), value); + } + } + } + if (!GIV(primFailCode)) { + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } +} + + +/* Primitive. Answer the OS window's label */ + + /* InterpreterPrimitives>>#primitiveGetWindowLabel */ +EXPORT(sqInt) +primitiveGetWindowLabel(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt labelOop; + char*ptr; + char *sp; + sqInt sz; + + ptr = ioGetWindowLabel(); + if (ptr == null) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + return null; + } + sz = strlen(ptr); + labelOop = instantiateClassindexableSize(splObj(ClassByteString), sz); + for (i = 0; i < sz; i += 1) { + byteAtput((labelOop + BaseHeaderSize) + i, ptr[i]); + } + /* begin pop: */ + GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), labelOop); + GIV(stackPointer) = sp; + return 0; +} + + +/* Primitive. Answer the OS window's size (extent) */ + + /* InterpreterPrimitives>>#primitiveGetWindowSize */ +EXPORT(sqInt) +primitiveGetWindowSize(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classObj; + sqInt h; + sqInt knownClassIndex; + usqInt newObj; + usqInt numBytes; + sqInt numSlots; + sqInt object; + sqInt objFormat; + sqInt pointResult; + char *sp; + sqInt w; + + w = ioGetWindowWidth(); + h = ioGetWindowHeight(); + /* begin pop: */ + GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord; + /* begin push: */ + classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassPoint) << (shiftForWord()))))); + numSlots = YIndex + 1; + assert((rawHashBitsOf(classObj)) != 0); + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + /* begin instSpecOfClassFormat: */ + objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1))) >> (fixedFieldsFieldWidth())) & (formatMask()); + assert((numSlots >= 0) + && (knownClassIndex != 0)); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(numSlots < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + pointResult = 0; + goto l3; + } + } + long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex); + GIV(freeStart) += numBytes; + pointResult = newObj; +l3: /* end eeInstantiateSmallClass:numSlots: */; + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(pointResult))); + longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 1) | 1)); + /* begin storePointerUnchecked:ofObject:withValue: */ + assert(!(isOopForwarded(pointResult))); + longAtput((pointResult + BaseHeaderSize) + (((int)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)h << 1) | 1)); + object = pointResult; + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + return 0; +} + + /* InterpreterPrimitives>>#primitiveGreaterOrEqual */ +static void +primitiveGreaterOrEqual(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerArgument; + sqInt integerReceiver; + char *sp; + + integerArgument = longAt(GIV(stackPointer)); + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (((integerReceiver & integerArgument) & 1) != 0) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver >= integerArgument + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } +} + + +/* Primitive comparison operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveGreaterOrEqualLargeIntegers */ +EXPORT(void) +primitiveGreaterOrEqualLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqLong integerArg; + sqLong integerRcvr; + char *sp; + + integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr >= integerArg + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveGreaterThan */ +static void +primitiveGreaterThan(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt integerArgument; + sqInt integerReceiver; + char *sp; + + integerArgument = longAt(GIV(stackPointer)); + integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (((integerReceiver & integerArgument) & 1) != 0) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver > integerArgument + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } +} + + +/* Primitive comparison operations for large integers in 64 bit range */ + + /* InterpreterPrimitives>>#primitiveGreaterThanLargeIntegers */ +EXPORT(void) +primitiveGreaterThanLargeIntegers(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqLong integerArg; + sqLong integerRcvr; + char *sp; + + integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord))); + integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord))); + if (!GIV(primFailCode)) { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr > integerArg + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveGrowMemoryByAtLeast */ +static void +primitiveGrowMemoryByAtLeast(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt ammount; + sqInt segSize; + char *sp; + + ammount = longAt(GIV(stackPointer)); + if (!((ammount & 1))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + return; + } + segSize = growOldSpaceByAtLeast((ammount >> 1)); + if (segSize == null) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrNoMemory; + } + else { + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)segSize << 1) | 1)); + GIV(stackPointer) = sp; + } +} + + +/* Answer the heartbeat frequency in beats per second. If the argument is + true, reset the frequency measure. */ + + /* InterpreterPrimitives>>#primitiveHeartbeatFrequency */ +EXPORT(sqInt) +primitiveHeartbeatFrequency(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + unsigned int integerValue; + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt oop; + sqInt reset; + char *sp; + sqInt valueWord; + + reset = (GIV(argumentCount) == 1) + && ((longAt(GIV(stackPointer))) == GIV(trueObj)); + /* begin pop:thenPush: */ + integerValue = ioHeartbeatFrequency(reset); + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) integerValue)) <= (MaxSmallInteger)) { + oop = ((integerValue << 1) | 1); + goto l5; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(integerValue); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + oop = newLargeInteger; + goto l5; + +l5: /* end positive32BitIntegerFor: */; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + return 0; +} + + +/* Return the value of the high resolution clock if this system has any. The + exact frequency of the high res clock is undefined specifically so that we + can use processor dependent instructions (like RDTSC). The only use for + the high res clock is for profiling where we can allocate time based on + sub-msec resolution of the high res clock. If no high-resolution counter + is available, the platform should return zero. + */ + + /* InterpreterPrimitives>>#primitiveHighResClock */ +EXPORT(sqInt) +primitiveHighResClock(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + char *sp; + + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + /* begin push: */ + object = positive64BitIntegerFor(ioHighResClock()); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + return 0; +} + + +/* is the receiver/first argument the same object as the (last) argument?. + pop argumentCount because this can be used as a mirror primitive. */ + + /* InterpreterPrimitives>>#primitiveIdentical */ +static void +primitiveIdentical(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt otherObject; + char *sp; + sqInt thisObject; + + otherObject = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + thisObject = longAt(GIV(stackPointer)); + if ((((otherObject & (tagMask())) == 0) + && (((longAt(otherObject)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) + || ((GIV(argumentCount) > 1) + && (((thisObject & (tagMask())) == 0) + && (((longAt(thisObject)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + } + else { + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (thisObject == otherObject + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + } +} + + /* InterpreterPrimitives>>#primitiveIdentityHash */ +static void +primitiveIdentityHash(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt hash; + sqInt integerVal; + char *sp; + sqInt thisReceiver; + + thisReceiver = longAt(GIV(stackPointer)); + if ((thisReceiver & (tagMask())) + || ((GIV(argumentCount) > 0) + && (((longAt(thisReceiver)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + else { + /* begin pop:thenPushInteger: */ + hash = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask()); + if (hash == 0) { + + /* would like to assert + self assert: (coInterpreter addressCouldBeClassObj: objOop) not + but instance-specific behaviors that are instances of themselves may + fail this test. */ + hash = (newObjectHash()) & (identityHashHalfWordMask()); + /* begin setHashBitsOf:to: */ + assert(((hash >= 0) && (hash <= (identityHashHalfWordMask())))); + long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash); + } + integerVal = hash; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)integerVal << 1) | 1)); + GIV(stackPointer) = sp; + } +} + + +/* Answer an integer identifying the type of image. The image version number + may identify the format of the image (e.g. 32 or 64-bit word size) or + specific requirements + of the image (e.g. block closure support required). + + This is a named (not numbered) primitive in the null module (ie the VM) + */ + + /* InterpreterPrimitives>>#primitiveImageFormatVersion */ +EXPORT(sqInt) +primitiveImageFormatVersion(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt newLargeInteger; + usqInt newObj; + usqInt numBytes; + sqInt objFormat; + sqInt oop; + char *sp; + sqInt valueWord; + + /* begin pop:thenPush: */ + /* begin maybeInlinePositive32BitIntegerFor: */ + assert(!((hasSixtyFourBitImmediates()))); + if ((((unsigned int) 6521)) <= (MaxSmallInteger)) { + oop = (((usqInt)6521 << 1) | 1); + goto l5; + } + /* begin eeInstantiateSmallClassIndex:format:numSlots: */ + objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1)); + assert(ClassLargePositiveIntegerCompactIndex != 0); + assert(((objFormat < (firstByteFormat()) + ? objFormat + : objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))); + /* begin allocateSmallNewSpaceSlots:format:classIndex: */ + assert(1 < (numSlotsMask())); + newObj = GIV(freeStart); + numBytes = BaseHeaderSize + (8); + assert((numBytes % (allocationUnit())) == 0); + assert((newObj % (allocationUnit())) == 0); + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + if ((GIV(freeStart) + numBytes) > (((eden()).limit))) { + error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"); + newLargeInteger = 0; + goto l4; + } + } + long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex); + GIV(freeStart) += numBytes; + newLargeInteger = newObj; +l4: /* end eeInstantiateSmallClassIndex:format:numSlots: */; + + /* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */ + /* eem 4/28/2016 questionable; they should never be read */ + /* begin storeLong32:ofObject:withValue: */ + valueWord = SQ_SWAP_4_BYTES_IF_BIGENDIAN(6521); + long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), valueWord); + /* begin storeLong32:ofObject:withValue: */ + long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0); + + oop = newLargeInteger; + goto l5; + +l5: /* end positive32BitIntegerFor: */; + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + return 0; +} + + +/* When called with a single string argument, record the string as the + current image file name. When called with zero arguments, return a string + containing the current image file name. + */ + + /* InterpreterPrimitives>>#primitiveImageName */ +static void +primitiveImageName(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classOop; + sqInt ok; + sqInt okToRename; + sqInt s; + void *sCRIfn; + char *sp; + sqInt sz; + + if (GIV(argumentCount) == 1) { + + /* If the security plugin can be loaded, use it to check for rename permission. + If not, assume it's ok */ + sCRIfn = ioLoadFunctionFrom("secCanRenameImage", "SecurityPlugin"); + if (sCRIfn != 0) { + okToRename = ((sqInt (*)(void))sCRIfn)(); + if (!okToRename) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + } + s = longAt(GIV(stackPointer)); + /* begin assertClassOf:is: */ + classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))); + /* begin isNonImmediate: */ + ok = (s & (tagMask())) == 0; + if (ok) { + /* begin isClassOfNonImm:equalTo: */ + assert(isNonImmediate(s)); + ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask())); + } + /* begin success: */ + if (!ok) { + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + } + if (!GIV(primFailCode)) { + sz = stSizeOf(s); + imageNamePutLength(s + BaseHeaderSize, sz); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + } + else { + sz = imageNameSize(); + s = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassByteString) << (shiftForWord()))))), sz); + imageNameGetLength(s + BaseHeaderSize, sz); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), s); + GIV(stackPointer) = sp; + } +} + + +/* For a Smalllnteger, answer itself. + For a Character, answer its code as an unsigned integer. + For a SmallFloat, answer the signed, but unadjusted bit pattern (so as to + keep the result a SmallInteger). + This is a good value for an immediate's hash. */ + + /* InterpreterPrimitives>>#primitiveImmediateAsInteger */ +static void +primitiveImmediateAsInteger(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt oop; + char *sp; + sqInt value; + + value = 0; + oop = longAt(GIV(stackPointer)); + if ((oop & 1)) { + value = (oop >> 1); + } + else { + if ((oop & (tagMask())) == (characterTag())) { + value = ((usqInt) (((usqInt)oop))) >> (numTagBits()); + } + else { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return; + + } + } + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)value << 1) | 1)); + GIV(stackPointer) = sp; +} + + +/* Register the input semaphore. If the argument is not a + Semaphore, unregister the current input semaphore. */ + + /* InterpreterPrimitives>>#primitiveInputSemaphore */ +static void +primitiveInputSemaphore(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + + arg = longAt(GIV(stackPointer)); + if ((arg & 1)) { + + /* If arg is integer, then use it as an index + into the external objects array and install it + as the new event semaphore */ + ioSetInputSemaphore((arg >> 1)); + if (!GIV(primFailCode)) { + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + return; + } + if (TheInputSemaphore == null) { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + return; + } + if ((arg == GIV(nilObj)) + || (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) { + /* begin splObj:put: */ + assert(!(isForwarded(GIV(specialObjectsOop)))); + if ((assert(isNonImmediate(GIV(specialObjectsOop))), + oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((arg & (tagMask())) == 0) + && (oopisLessThan(arg, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) { + remember(GIV(specialObjectsOop)); + } + } + } + longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheInputSemaphore) << (shiftForWord())))), arg); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + else { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + } +} + + +/* Return an integer indicating the reason for the most recent input + interrupt. + */ + + /* InterpreterPrimitives>>#primitiveInputWord */ +static void +primitiveInputWord(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + + /* begin pop:thenPushInteger: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)0 << 1) | 1)); + GIV(stackPointer) = sp; +} + + +/* Return the 32bit signed integer contents of a words receiver */ + + /* InterpreterPrimitives>>#primitiveIntegerAt */ +static void +primitiveIntegerAt(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt addr; + sqInt fmt; + sqInt index; + int intValue; + usqInt numSlots; + usqInt numSlots1; + sqInt rcvr; + sqInt result; + char *sp; + sqInt sz; + + index = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + if (!((index & 1))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + return; + } + rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + if (!(((rcvr & (tagMask())) == 0) + && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == (firstLongFormat())))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrInappropriate; + return; + } + index = (index >> 1); + /* begin lengthOf:format: */ + fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + sz = numSlots; + goto l6; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots << (shiftForWord())) - (fmt & 7); + goto l6; + } + if (fmt >= (firstShortFormat())) { + sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l6; + } + if (fmt >= (firstLongFormat())) { + sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l6; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots) >> 1; + goto l6; + } + sz = 0; +l6: /* end lengthOf:format: */; + if (!((index >= 1) + && (index <= sz))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadIndex; + return; + } + + /* for zero indexing */ + addr = (rcvr + BaseHeaderSize) + ((index - 1) * 4); + intValue = intAt(addr); + /* begin signed32BitIntegerFor: */ + if ((((sqInt)((((usqInt)intValue)) ^ ((((usqInt)intValue)) << 1)))) >= 0) { + result = (((usqInt)intValue << 1) | 1); + goto l4; + } + result = noInlineSigned32BitIntegerGutsFor(intValue); + goto l4; + +l4: /* end signed32BitIntegerFor: */; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result); + GIV(stackPointer) = sp; +} + + +/* Return the 32bit signed integer contents of a words receiver */ + + /* InterpreterPrimitives>>#primitiveIntegerAtPut */ +static void +primitiveIntegerAtPut(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt addr; + sqInt fmt; + sqInt index; + sqInt integerPointer; + usqInt numSlots; + usqInt numSlots1; + sqInt rcvr; + char *sp; + sqInt sz; + int value; + sqInt valueOop; + + valueOop = longAt(GIV(stackPointer) + (0 * BytesPerWord)); + /* begin stackIntegerValue: */ + integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + /* begin checkedIntegerValueOf: */ + if ((integerPointer & 1)) { + index = (integerPointer >> 1); + goto l6; + } + else { + /* begin primitiveFail */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + index = 0; + goto l6; + } +l6: /* end stackIntegerValue: */; + value = signed32BitValueOf(valueOop); + if (GIV(primFailCode)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + return; + } + rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord)); + if (!(((rcvr & (tagMask())) == 0) + && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == (firstLongFormat())))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrInappropriate; + return; + } + if ( +# if IMMUTABILITY + (/* begin isImmutable: */ + ((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) +# else /* IMMUTABILITY */ + 0 +# endif /* IMMUTABILITY */ + ) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrNoModification; + return; + } + /* begin lengthOf:format: */ + fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()); + /* begin numSlotsOfAny: */ + numSlots1 = byteAt(rcvr + 7); + numSlots = (numSlots1 == (numSlotsMask()) + ? longAt(rcvr - BaseHeaderSize) + : numSlots1); + if (fmt <= 5) { + sz = numSlots; + goto l8; + } + if (fmt >= (firstByteFormat())) { + + /* bytes, including CompiledMethod */ + sz = (numSlots << (shiftForWord())) - (fmt & 7); + goto l8; + } + if (fmt >= (firstShortFormat())) { + sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3); + goto l8; + } + if (fmt >= (firstLongFormat())) { + sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1); + goto l8; + } + if (fmt == (sixtyFourBitIndexableFormat())) { + sz = ((usqInt) numSlots) >> 1; + goto l8; + } + sz = 0; +l8: /* end lengthOf:format: */; + if (!((index >= 1) + && (index <= sz))) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadIndex; + return; + } + + /* for zero indexing */ + addr = (rcvr + BaseHeaderSize) + ((index - 1) * 4); + value = intAtput(addr, value); + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), valueOop); + GIV(stackPointer) = sp; +} + + +/* Primitive. Answer the number of interrupt checks per milliseconds that we + execute on this machine. This can be used to adjust the sub-msecs profiler + to check (roughly) + n times per millisecond. + */ + + /* InterpreterPrimitives>>#primitiveInterruptChecksPerMSec */ +EXPORT(sqInt) +primitiveInterruptChecksPerMSec(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt oop; + char *sp; + + if (!(GIV(argumentCount) == 0)) { + /* begin success: */ + + /* Don't overwrite an error code that has already been set. */ + if (!GIV(primFailCode)) { + GIV(primFailCode) = 1; + } + + return null; + } + /* begin pop:thenPush: */ + oop = (((usqInt)(ioHeartbeatMilliseconds()) << 1) | 1); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop); + GIV(stackPointer) = sp; + return 0; +} + + +/* Register the user interrupt semaphore. If the argument is + not a Semaphore, unregister the current interrupt + semaphore. */ + + /* InterpreterPrimitives>>#primitiveInterruptSemaphore */ +static void +primitiveInterruptSemaphore(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt arg; + + arg = longAt(GIV(stackPointer)); + if ((arg == GIV(nilObj)) + || (((arg & (tagMask())) == 0) + && (((longAt(arg)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) { + /* begin splObj:put: */ + assert(!(isForwarded(GIV(specialObjectsOop)))); + if ((assert(isNonImmediate(GIV(specialObjectsOop))), + oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) { + + /* most stores into young objects */ + if (((arg & (tagMask())) == 0) + && (oopisLessThan(arg, GIV(newSpaceLimit)))) { + /* begin possibleRootStoreInto: */ + if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) { + remember(GIV(specialObjectsOop)); + } + } + } + longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheInterruptSemaphore) << (shiftForWord())))), arg); + /* begin pop: */ + GIV(stackPointer) += 1 * BytesPerWord; + } + else { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadArgument; + } +} + + +/* Primitive. 'Invoke' an object like a function, sending the special message + run: originalSelector with: arguments in: aReceiver. + */ + + /* InterpreterPrimitives>>#primitiveInvokeObjectAsMethod */ +static void +primitiveInvokeObjectAsMethod(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt i; + sqInt lookupClassTag; + sqInt runArgs; + sqInt runReceiver; + char *sp; + char *sp1; + char *sp2; + char *sp3; + sqInt tagBits; + sqInt top; + sqInt top1; + sqInt valuePointer; + + /* begin eeInstantiateClassIndex:format:numSlots: */ + assert((GIV(argumentCount) >= 0) + && (ClassArrayCompactIndex != 0)); + assert((2) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex)))); + runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2, ClassArrayCompactIndex); + + for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) { + /* begin storePointerUnchecked:ofObject:withValue: */ + top1 = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + valuePointer = top1; + assert(!(isOopForwarded(runArgs))); + longAtput((runArgs + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer); + } + /* begin popStack */ + top = longAt(GIV(stackPointer)); + GIV(stackPointer) += BytesPerWord; + runReceiver = top; + /* begin push: */ + longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod)); + GIV(stackPointer) = sp; + /* begin push: */ + longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(messageSelector)); + GIV(stackPointer) = sp1; + /* begin push: */ + longAtput((sp2 = GIV(stackPointer) - BytesPerWord), runArgs); + GIV(stackPointer) = sp2; + /* begin push: */ + longAtput((sp3 = GIV(stackPointer) - BytesPerWord), runReceiver); + GIV(stackPointer) = sp3; + /* begin fetchPointer:ofObject: */ + GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(SelectorRunWithIn) << (shiftForWord()))))); + GIV(argumentCount) = 3; + if (((tagBits = GIV(newMethod) & (tagMask()))) != 0) { + lookupClassTag = ((tagBits & 1) != 0 + ? 1 + : tagBits); + } + else { + /* begin classIndexOf: */ + lookupClassTag = (longAt(GIV(newMethod))) & (classIndexMask()); + } + findNewMethodInClassTag(lookupClassTag); + executeNewMethod(); + /* begin initPrimCall */ + GIV(primFailCode) = 0; +} + + +/* Answer if running on a big endian machine. */ + + /* InterpreterPrimitives>>#primitiveIsBigEnder */ +EXPORT(sqInt) +primitiveIsBigEnder(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + char *sp; + + /* begin pop:thenPushBool: */ + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (VMBIGENDIAN + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; + return 0; +} + + +/* Answer if the receiver is pinned, i.e. immobile. */ + + /* InterpreterPrimitives>>#primitiveIsPinned */ +static void +primitiveIsPinned(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt obj; + char *sp; + sqInt trueOrFalse; + + obj = longAt(GIV(stackPointer)); + if ((obj & (tagMask())) + || (((longAt(obj)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return; + } + /* begin pop:thenPushBool: */ + trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0; + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse + ? GIV(trueObj) + : GIV(falseObj))); + GIV(stackPointer) = sp; +} + + +/* Primitive. Answer whether the OS window is currently partially or fully + obscured. + */ + + /* InterpreterPrimitives>>#primitiveIsWindowObscured */ +EXPORT(sqInt) +primitiveIsWindowObscured(void) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt object; + char *sp; + sqInt trueOrFalse; + + /* begin pop: */ + GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord; + /* begin pushBool: */ + trueOrFalse = ioIsWindowObscured(); + /* begin push: */ + object = (trueOrFalse + ? GIV(trueObj) + : GIV(falseObj)); + longAtput((sp = GIV(stackPointer) - BytesPerWord), object); + GIV(stackPointer) = sp; + return 0; +} + + +/* Obsolete on virtually all platforms; old style input polling code. + Return the next keycode and remove it from the input buffer. The low byte + is the 8-bit ISO character. The next four bits are the Smalltalk modifier + bits